How to find DHCP server or DHCP relay in network

0 minute read

On the same machine, run in one session:

1sudo nmap --script broadcast-dhcp-discover -e <eth-iface>

Another terminal session:

1sudo tcpdump -nelt udp port 68

Explanation

NMAP broadcast-dhcp-discover script is designed to broadcast a DHCP request on the network. Second terminal session show all UDP packets that are using port 68, which is the port typically used by DHCP clients to receive responses from DHCP servers.