Archive your Configuration

Hard-DriveIt is important to save your router and switch configuration but what happens if the device fails or if you saved a configuration mistake, without having to manually worry about it? Well if your Cisco router or switch has Cisco IOS 12.3T and higher you would be able to set up an auto archive within the flash memory of the unit or you can send that configuration file to a server that does either FTP, HTTP, SCP. TFTP, etc. Let’s work through on setting up the archive feature on a Cisco Router.

In this example we will look at one way to archive your configuration to the flash memory of the unit. This is good if you want the ability to revert back quickly to an existing configuration that has been saved in flash. Keep in mind this is not the only way to archive your configuration, instead of archiving it to flash memory you could back it up on a server using some common transfer file protocol like FTP, TFTP and other options. Let’s start setting up the archive feature so I’m on the HQ Router and to archive to flash, the first thing we have to do is enter configuration mode followed by typing archive and hit enter.

HQ#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

You will notice we are in the archive configuration mode hit the question to see the available commands.

Archive configuration commands:
  default       Set a command to its defaults
  exit          Exit from archive configuration mode
  log           Logging commands
  maximum       maximum number of backup copies
  no            Negate a command or set its defaults
  path          path for backups
  rollback      Rollback parameters
  time-period   Period of time in minutes to automatically archive the
  write-memory  Enable automatic backup generation during write memory

For this we will put are configuration on the flash file system let’s keep it simple by just calling it HQ-RTR.config here is our example:

HQ(config-archive)#path flash:HQ-RTR.config

This writes the configuration into flash and by default writes up to ten and then rolls them over. This is also where you could point this path to an FTP/TFTP server instead of flash. To archive your configuration while under the config-archive mode you have two choices, both of these options could be used together. The write-memory option will archive you configuration after you issue the copy running-config startup-config command. The time-period command will write the configuration to flash every X amount minutes. Where X is the number of minutes you specify after the command. See an example of both commands below:

HQ(config-archive)#time-period 500000

To see your archives you can issue the command show archive, in this example I have two archives located in flash. This command would also work if you are storing them on a FTP/TFTP server.

HQ#show archive
There are currently 3 archive configurations saved.
The next archive file will be named flash:HQ-RTR.config-3
 Archive #  Name
   1       flash:HQ-RTR.config-1
   2       flash:HQ-RTR.config-2

You can also see these archives in the flash file system by issuing the show flash command.

HQ#show flash:
-#- --length-- -----date/time------ path
1     19939672 Sep 16 2008 15:51:54 +00:00 c1841-spservicesk9-mz.124-6.T7.bin
2         1122 Jan 22 2013 03:49:18 +00:00 HQ-RTR.config-1
3         1142 Jan 22 2013 03:54:28 +00:00 HQ-RTR.config-2

44060672 bytes available (19951616 bytes used)

Let’s roll back from an archive, to do this it is pretty simple just use the configure replace command followed by archive and the archive file you would like to replace the running-config. Let’s look below and see the process as an example.

HQ#configure replace archive:flash:HQ-RTR.config-2
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: Y

That’s it! You can either put these archives on the flash of the device or you can setup a simple FTP, TFTP, SCP, etc. box and have your configurations stored there. Like always I hope this information is helpful and post below if you have questions about this topic.You can also find more information on Cisco’s website about the archiving along with the configure replace and rollback commands. Configuration Replace and Configuration Rollback Enjoy! 🙂