Wednesday, April 13, 2016

Cisco IOS automatic config backups

Backing up configuration files from Cisco switches and routers is an important part of maintaining a network.  Solarwinds has their config management suite, but it can get rather expensive.  There has to be a way to backup Cisco IOS configs in a more automated and cost effective way.  I'm not looking for automated notification when a config changes, just the backup where I can validate configurations as well as have a backup in case of equipment failure.  

I'm pleased to have discovered the Archive function in Cisco IOS.

Here are the simple setup steps.

  1. Run a TFTP Server service (Solarwinds has one) 
  2. Update the IOS config with the following commands
Switch1#conf t
Switch1(config-archive)#path tftp://$h-$t
Switch1#write mem

Note a few things.
  • The IP address of the TFTP server needs to be your IP address
  • The $h variable adds the switch/router host name to the file that is written
  • The $t variable adds a time stamp to the file name that is written
  • Each file that is written appends a hyphen and incremental numeric value.
** To do file comparison, it's fairly easy with the Compare Plugin in Notepad++.  Simply add Compare plugin (Go to the Plugins menu > Plugin Manager , check the Compare checkbox and press install) and compare the two files.

Other Reference Links