Monday, August 2, 2010

Quickly debugging dhcpd under linux

If you encounter any problem delivering IP addresses to clients, start by restarting the dhcp daemon on the Linux box:

service dhcpd restart

The following step is making sure that the dhcp daemon is running. Issuing a ps aux command and grepping it for dhcp is the easiest way to do this. If the dhcp service is running, an output like the following one should be returned:

root 16971 0.0 0.0 2632 880 ? Ss 09:35 0:00 /usr/sbin/dhcpd

Also, remember to check the DHCP log file, which can be useful diagnosing whether leases have been handed out and for how long:

/var/lib/dhcpd/dhcpd.leases

Tcpdump can be run on server side on port 67 and 68:

tcpdump -vv -n port 67 or port 68

Ports 67 and 68 are specifically for DHCP traffic - 67 for requests and 68 for responses.

If no traffic occurs, then the request isn't going through the server, which means something may be wrong with the network in between... so go and double check with your network administrator and, remember, DHCP broadcast is not routable, so, meybe, an ip-helper might be useful in some occasions.

For instance, the ip helper-address interface subcommand tells the CISCO router to forward UDP broadcasts, including BootP, received on this interface

Back to the Linux box, if the dhcp daemon gives you a red [FAILED] message, then check your /var/log/messages logfile for syntax error in your dhcp.donf configuration file:

cat /var/log/messages

HTH!

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...