Octet

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

Cisco IOS
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-bindings

The 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).

Traps

  • Forgetting that excluded addresses are your job. The server does not know about static devices.
How did you do?Book 3.3 Internet (IP)