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.

9 comments:

  1. Would it be more wise to put file in flash?

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

    ReplyDelete
  3. Can you elaborate on the use of non-disk-like flash types?

    ReplyDelete
  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.

    ReplyDelete
  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?

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

    ReplyDelete
  7. how can I format a flash in C format?

    ReplyDelete
  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) :))

    ReplyDelete
  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.

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

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.