Redundant DHCP server

If you want to build a truly redundant LAN infrastructure, you should also have redundant DHCP servers. If you decide to do the DHCP address allocation locally (on the router), you should take care that the two routers acting as DHCP servers don't assign overlapping addresses.

If the address space assigned to a LAN is at least twice as large as the number of LAN-attached devices, you can use the ip dhcp excluded-addresses command to exclude half of the address pool on each router, for example:

ip dhcp pool LAN
 network 192.168.1.0 192.168.0.0 255.255.255.0
!
! Exclude router addresses
ip dhcp excluded-addresses 192.168.0.1 192.168.0.10
!
! Exclude half of the pool
ip dhcp excluded-addresses 192.168.0.128 192.168.0.255
Alternatively, you can rely on the ip dhcp ping packets command; the router will ping an IP address to check whether it's live before assigning it (by default, the router sends two pings with 500 millisecond timeout).

Note: You can also inspect the conflicting IP addresses the router found with the show ip dhcp conflict command.

5 comments:

R. Koops said...

Little mistake:
192.168.1.0 has to be 192.168.0.1

Ivan Pepelnjak said...

Actually, it has to be 192.168.0.0 :) ... although your suggestion will work as well. Fixed.

Djerk Geurts said...

To use dhcp conflict logging, doesn't one have to have a storage location configured?

I generally configure "no ip dhcp conflict logging" as the router will broadcast for a tftp server to put the file on if left default. Or at least so I've been told.

"router(config)#ip dhcp database ?
WORD Uniform Resource Locator (URL)"

Anonymous said...

Hi All,

Is there any way to have some kind of redundancy between a windows dhcp server and a Cisco router ?

Thanks

Ivan Pepelnjak said...

You can use the same trick to achieve router/Windows redundancy, just make sure you use two separate address ranges.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.