Jul 082010

You want to keep older configurations of your router? Maybe to switch back to the last known good config? Or just for documentation? Or to verify the last changes in your config? Or review changes made by your collegue?

Of course RANCID combined with a graphical CVS-viewer would be a very good solution. But you can achieve this task with less effort directly on your router too. Therefor you need the archive-feature.

With the archive commands you can automatically write your configs to flash: – or some other destinations (ftp:, http:, https:, pram:, rcp:, scp:, tftp:)

You have many features with archive – but today let’s focus only on automatically archiving the current configuration when doing a copy running-config startup-config (or the more or less obsolete write mem)

mkdir flash:/configs
configure terminal
path flash:configs/archive
maximum 14

Command explanation:

  • mkdir flash:/configs creates a new directory on flash:
  • path flash:configs/archive defines the path and filenamesuffix of the files
  • maximum 14 defines the maximum number of configs held on the flash: (currently 1-14)
  • write-memory will save a new version of the running-config into the archive-folder (flash:configs in our example) each time you do a copy running-config startup-config or write mem

with show archive you can review all existing configs in flash:

Router#sh archive
The maximum archive configurations allowed is 14.
There are currently 3 archive configurations saved.
The next archive file will be named flash:configs/archive-3
Archive # Name
1 flash:configs/archive-0
2 flash:configs/archive-1
3 flash:configs/archive-2 <- Most Recent

to view differences between 2 configs use show archive config differences <file1> <file2>
For demonstration I created a new Loopback Interface, added an EIGRP-routing-process and wrote the new configuration to NVRAM (write mem)

show archive config differences flash:configs/archive-2 flash:configs/archive-3

Contextual Config Diffs:
+interface Loopback1
+ip address
+router eigrp 1
+no auto-summary
+eigrp stub connected summary


You also can write a new version of your current configuration into the archive without touching the startup-config with the archive config command.

It is also possible to write a new configuration on a interval-basis. But I don’t recommend this on a flash-device, because if you don’t change your config for a longer time (“long” depends on your backup-interval) you have a maximum of 14 same configurations – and of course lost the configs with real changes.

 Posted by at 14:41