Installing and using dhcping

dhcping – a utility for checking DHCP-servers using unicast packages.

In Ubuntu, you can install dhcping with the command:

sudo apt-get install dhcping

First let’s see what IP-addresses are received and from which gateway:

netstat -rn | grep default

Also you can see the information received from DHCP in the directory /var/lib/dhcp/.

In my case, IP is received from the DHCP server
Here’s an example of running dhcping:

dhcping -s

If the DHCP server responds, the following information will be displayed:

Got answer from:

If there is no answer:

no answer

I’ll describe the dhcping startup keys:
-v (detailed mode)
-V (very detailed mode)
-i (use DHCPINFORM packets)
-r (use DHCPREQUEST packets (standard))
-q (quiet mode)
-t maxwait (response timeout, standard 3 seconds)
-c IP (request the specified IP)
-s IP (send request to specified IP)
-h MAC (use the specified MAC address in the request)
-g IP (use the specified IP gateway in the packet)

Leave a Reply