Store DHCP Bindings on the Router

Posted on in Networking

cover image for article

If you're like me, you've probably run into situations where it makes sense to run a DHCP server on your router. You may have noticed that a reboot of the router causes the DHCP bindings to be lost. When this happens, all of your hosts will likely receive new DHCP addresses rather than keeping their old ones.

Cisco routers have the ability to save DHCP bindings in a database via the ip dhcp database configuration command. The intention of this command is to store the bindings on a remote server. My initial idea was to store the bindings in flash, but this resulted in the following error:

DHCPD-3-WRITE_ERROR: DHCP could not write bindings to flash:dhcp-binding.

Thanks to Ivan Pepelnjak, I learned that trying to save the DHCP database to flash can be problematic for the router. According to the show ip dhcp database command, the write was failing because of a protocol error. Instead, I've switched to NVRAM and things are working out much better. For reference, here's the configuration command I used:

ip dhcp database nvram:dhcp-binding

Photo by Barun Patro.

Slaptijack's Koding Kraken