Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a simple ping-like command to test whether a DHCP service is running on a network? ...on Linux

share|improve this question

6 Answers 6

up vote 2 down vote accepted

Even if you don't use a Nagios monitoring server, you can grep the check_dhcp binary or compile it from source and use the check to test a DHCP-Server. E.g.

./check_dhcp -v -s <dhcp_server_address> -r <expected_ip_address> -m <mac_address_touse>
share|improve this answer

There is a program called dhcpping

share|improve this answer

why not just make a dhcp request ?

dhclient

share|improve this answer
    
Probably because that will make your system use the IP assigned by the DHCP server which is not what one wants when e.g. trying to find out if there are rogue DHCP servers in his network. –  ThiefMaster Jun 9 '12 at 18:54
    
-n option helps here? –  akostadinov Jan 24 '13 at 22:20

On Debian-Ubuntu systems:

dhcpd -f

gives good feedback and tests the configuration.

On RH systems try:

/etc/rc.d/init.d/dhcpd configtest
share|improve this answer

if you use nagios you could monitor it with check_dhcp

share|improve this answer

or you can try dhcpcd in test mode:

dhcpcd -T eth0

share|improve this answer

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.