Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
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 Sep 20 '13 at 13:49
    
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 Sep 20 '13 at 13:50
add comment

2 Answers

up vote 4 down vote accepted

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

share|improve this answer
    
This would be a *nix specific answer. –  deed02392 Sep 20 '13 at 14:32
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 Sep 20 '13 at 14:33
    
Go ahead and accept your own answer. :) –  Blacklight Shining Sep 20 '13 at 14:37
    
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 Sep 20 '13 at 14:52
1  
@deed02392 Okay. What major OSes don't have a dhclient, besides Windows? –  Blacklight Shining Sep 20 '13 at 14:54
show 1 more comment

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.

share|improve this answer
    
Mm.. what package provides dhcdrop? –  Braiam Feb 8 at 1:35
    
I built it from source code. –  Vi. Feb 9 at 12:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.