If you are like me you frequently forget to backup router and switch configurations before making changes. Ok, maybe not so frequently but it happens… There are some ways to prevent this from happening, we can make manual backups or use the automatic archiving feature which is built into IOS.
A manual backup can always be taken using the ‘copy startup-config' command, typing a question mark ‘?’ after that command lists possible backup destinations:
RT#copy startup-config ?
archive: Copy to archive: file system
flash: Copy to flash: file system
ftp: Copy to ftp: file system
http: Copy to http: file system
So to backup a routers current startup-config to a FTP server you would simply type something like this:
RT#copy startup-config ftp://user:[email protected]
The username and password can also be configured so that you don’t need to type them in every time you are performing a backup.
RT(config)#ip ftp username tom
RT(config)#ip ftp password secret
Ok, that’s better but since the backup still has to be started manually chances are that one could forget it…
The archive feature allows for automatic configuration backup that is triggered by a timer and the ‘write memory’ command. The following example configures the archive feature on router RT to create a backup once every 24 hours and additionally every time someone enters the ‘write-memory’ command, that is, every time someone makes a configuration change and decides to save that change:
The time-period keyword simply configures how often a scheduled backup runs, if the write-memory command is configured a configuration backup is performed every time someone saves the config. The ‘show archive’ command displays the 10 latest configuration files:
The maximum archive configurations allowed is 10.
The next archive file will be named ftp://10.10.10.1/History/rt-config--<timestamp>-50
Archive # Name
Obviously other backup destinations such as tftp or flash can be configured. IOS does not take care of the removal of old files, so even though only the 10 latest configuration versions are shown in the ‘show archive’ output, there might be more on the server.
If a configuration change needs to be rolled back the ‘configure replace’ command can be used. So if a configuration change had unintended consequences the ‘configure replace ftp://10.10.10.1/History/rt-config-Jul-10-13-52-57.245-48’ command could be used to restore the current running-config from a backup.
This post has been migrated from our earlier blog based on BlogEngine.NET.