How does DHCP avoid handing out an address that is already in use?
Show the answer
Say this first
Two checks. The server can ping an address before offering it: Cisco IOS sends 2 pings with a 500 ms timeout by default, and if anything replies it records a conflict and skips that address. Then the client probes the address with ARP before using it and sends DHCPDECLINE if another host answers. Excluding the ranges used by static devices prevents most conflicts in the first place.
Go deeper
On a Cisco IOS server
ip dhcp excluded-address 10.20.0.1 10.20.0.10
ip dhcp ping packets 2
ip dhcp ping timeout 500
ip dhcp database bootflash:dhcp-bindingsThe ping values shown are the defaults. show ip dhcp conflict lists conflicted addresses and how they
were found (ping or gratuitous ARP). They stay out of the pool until you run clear ip dhcp conflict *.
Without ip dhcp database, IOS forgets its bindings on reload and may offer an address a client still
holds. Cisco's advice is to either configure the database agent or turn off conflict logging with
no ip dhcp conflict logging.
On the client
RFC 5227 ARP probes use sender IP 0.0.0.0, so they do not poison anyone's ARP cache. If a reply comes back, the client sends DECLINE and the server marks the address as bad.
Usual causes of conflicts
- Printers or servers configured statically inside the pool range.
- A rogue DHCP server handing out the same subnet.
- The server lost its bindings (reload without a database).
They will ask next
Why might the ping check miss a host that is really there?
Host firewalls often drop ICMP echo; Windows Firewall blocks inbound echo requests by default. The client's ARP probe still catches it, because a host cannot ignore ARP and keep working on the LAN.
How do you stop a rogue DHCP server?
DHCP snooping on the access switches: trust only the uplinks toward real servers, and server messages arriving on any other port are dropped.
Traps
- Forgetting that excluded addresses are your job. The server does not know about static devices.