How can I know the DHCP settings offered by a server?

1

I want to debug a router that is giving strange DHCP settings, but I don't know how to check it without having to make my system take all the configurations. Isn't there a utility that returns all DHCP settings (like NTP, WINS, DNS, IP, router) whenever a client connects?

Preferably that is platform independent, and that won't require changing the client's configuration to trigger the DHCP.

Braiam

Posted 2013-09-20T13:45:41.460

Reputation: 4 526

Does DHCP even allow you to get a list of all possible configurations from a server? Would any server even give them to you? I would think not; it might be a security flaw or something. – Blacklight Shining – 2013-09-20T13:49:56.223

Why don't you just log into the configuration page for the router? Any debug tool would require to connect to the device. What exactly is "strange" settings? – Ramhound – 2013-09-20T13:50:57.340

Answers

4

Ok, this is what happens when I don't read the manual. man dhclient

-d : Force dhclient to run as a foreground process. Normally the DHCP client will run in the foreground until is has configured an interface at which time it will revert to running in the background. This option is useful when running the client undera debugger, or when running it out of inittab on System V systems. This implies -v.

-v : Enable verbose log messages.

-n : Do not configure any interfaces. This is most likely to be useful in combination with the -w flag.

Once I ran dhclient -d -v -n, discovered what configurations were buggy, and why. Another DHCP was running in the network.


If you want to really get several information, but then some system will need to mess up the DHCP configuration to work, is using WireShark:

enter image description here

Braiam

Posted 2013-09-20T13:45:41.460

Reputation: 4 526

This would be a *nix specific answer. – deed02392 – 2013-09-20T14:32:35.173

1@deed02392 It's often hard to give answers that include *nix and Windows, seeing how Windows does everything differently. 9.9 Besides, he said preferably platform-independent. – Blacklight Shining – 2013-09-20T14:33:13.753

I'd suggest that: either the question is rephrased and tagged appropriately to indicate the answer only applies to *nix platforms, or the answer is updated to describe a suitable method for Windows as well. The latter would be preferred. – deed02392 – 2013-09-20T14:52:34.203

1@deed02392 Okay. What major OSes don't have a dhclient, besides Windows? – Blacklight Shining – 2013-09-20T14:54:53.997

@deed02392 there, it won't fit the condition of "not changing the client ip configuration", but is OS independent. – Braiam – 2013-09-20T15:01:12.640

0

I usually use dhcdrop -t -i <interface> <your MAC address>

Example:

# dhcdrop -t -i wlan0 60:67:20:de:14:d8
DHCP SRV: 192.168.99.1 (IP-hdr: 192.168.99.1) SRV ether: 00:23:CD:1D:71:EE, YIP: 192.168.99.127

This means that the DHCP server wants you to use 192.168.99.127.

Note that by default (without -t) it tries to drain all IP addresses from the DHCP server to DoS it.

I can't do similar thing with dhclient unfortunately. With -n it just waits for remote commands, not trying to send any requests.

Vi.

Posted 2013-09-20T13:45:41.460

Reputation: 13 705

Mm.. what package provides dhcdrop? – Braiam – 2014-02-08T01:35:50.483

I built it from source code. – Vi. – 2014-02-09T12:02:02.510