Networking – looking for a utility to test DHCP settings

dhcpnetworking

Iv'e recently installed DHCP server (isc-dhcp-server) in my workplace.

I'm looking for a utility to test the network DHCP settings from a remote machine (not by using dhclient / iptables /renew).

  • indication of the responding server (sometimes my colleagues install by mistake DHCP services)
  • the ability to provide a MAC address (to test pool reservations)
  • simple display of the response

for example:

$> [utility name] [source mac address | optional] ...

RESPONSE (DHCP Server is 192.168....)
    IP: 192.168.....
    SUBNET: 255.255.....
    DEFAULT GATEWAY: 192.168.....
    ...

Best Answer

You can try out the "dhcping" utility. On CentOS/RHEL, you'll have the option to "yum install it" after you'll gain connectivity to the EPEL repository. Check out the command options. They seem really relevant for your needs.

dhcping(8)                  General Commands Manual                 dhcping(8)

NAME
   dhcping - send a DHCP request to DHCP server to see if it’s up and running

SYNOPSIS
   dhcping [-v] [-q] [-i] [-r] -t maxwait -c client-IP-address -s server-IP-address -h client-hardware-address [-g gateway-
   IP-address]

DESCRIPTION
   This command allows the system administrator to check if a remote DHCP server is still functioning.

   Options are:

   -v   Verbose, print some information.

   -i   Use DHCPINFORM packets.

   -r   Use DHCPREQUEST packets (default behaviour).

   -q   Quiet, print nothing on the screen.

   -t maxwait
        Maximum time to wait for an answer from the server in seconds.  Default is 3 seconds.

   -c client-IP-address
        Request this IP address. Note that this is also the IP address the answer will be sent to.

   -s server-IP-address
        Send the DHCP packet to this IP address.

   -h client-hardware-address
        Use this hardware-address in the DHCP request. It can be up to sixteen octets seperated by colons (i.e. 01:02:03:04)

   -g gateway-IP-address
        Use this IP address for the gateway IP address in the DHCP packet.  This option is currently broken

All the best!

+Daniel.

Related Question