Persistent DHCP bindings stored in NVRAM

If you'd like to implement persistent DHCP bindings on Cisco IOS, but cannot store them on an external server, you could always use the on-board NVRAM. Simply configure ip dhcp database nvram:dhcp.txt. Later on, you can examine the contents of the dhcp.txt file with more nvram:dhcp.txt command.

This post was written in 2007, when a lot of low-end Cisco routers still shipped with flash formatted in the “old” Cisco format and the flash was not really usable to store ever-changing files. For more details on storing DHCP bindings in onboard flash, read the Flash-based DHCP Database blog post.

9 comments:

  1. Would it be more wise to put file in flash?
  2. You might have a problem with flash file if you don't have disk-like flash memory (the show file systems should display your flash: as a disk filesystem).
  3. Can you elaborate on the use of non-disk-like flash types?
  4. If you have a “traditional” flash file system, the files never disappear, they are just marked as deleted (and you have to squeeze it manually). As you have to store the DHCP bindings in a file whenever something changes (after a short delay, of course), you could have a lot of old versions left in the flash after a while … not something I would want to have in a production network.
  5. Makes sense. On that note if you're running DHCP on an ISR you shouldn't have that issue since the flash is formatted Class C, correct?
  6. Well, new ISR routers come with class-C formatted flash, older ones are still formatted as class-B (but can be reformatted into class-C).
  7. how can I format a flash in C format?
  8. It's described here. I knew I've been writing about it already, so I've entered "format flash" into the "Search blog" input field (top left) :))
  9. I noticed today that writing the DHCP binding to nvram has one drawback (at least on the 2801): writing to NVRAM seems to be a very CPU intensive operation, for whatever reason, so, using the default values and some DHCP activity your CPU usage will spike to 100% every 5 minutes.

    Writing to flash seems to be much better in this regard.
Add comment
Sidebar