Configuration Archive and Rollback
Configuration Archive and Rollback
Lesson Contents
Configuration
Verification
Cisco IOS routers and switches are able to create ‘snapshots’ of their configuration
using the archive feature. Cisco calls these snapshots ‘configuration archives’ and
they are very useful as it allows you to store multiple versions of your configuration.
The configuration archive can be created every time you save your running
configuration or you can create one based on a time schedule, for example, every 24
hours or so.
When you have multiple snapshots you can use a show command to see the
difference between the configurations and easily restore (rollback) to a previous
version.
Configuration
First, we need to configure where we want to store our configuration archives. When
you use the path command, you can see what options we have:
Router(config)#archive
Router(config-archive)#path ?
Normally an external location would be a good idea, but to keep things simple, I will
use the flash memory of my router:
Router(config-archive)#path flash:router-backup
Each configuration archive file will start with “router-backup” in the filename. Besides
the destination, we also have to choose when we want to create a configuration
archive. For example, whenever the running-config is saved as the startup-config
might be a good idea to create a backup:
Router(config-archive)#write-memory
I will also configure a schedule, for example, to create a configuration archive every
24 hours:
Router(config-archive)#time-period 1440
1440 minutes means we’ll create a snapshot every 24 hours. Everything is now in
place. Let’s see if it is working.
Verification
We can use the show archive command to see how many snapshots we have. At the
moment, no snapshots were made, so the list is empty:
Router#show archive
Archive # Name
0
1
10
11
12
13
14
Now we will save the running-config, and thanks to the write-memory command, it
will also create a configuration archive:
Building configuration...
[OK]
When we look again at the show archive command we’ll see our first configuration
archive:
Router#show archive
Archive # Name
10
11
12
13
14
As configured, you can see that it has been stored on the flash of the router:
Router#show flash:
System CompactFlash directory:
1 840 router-backup-1
Having extra backups feels great! Before we are going to recover one, I’ll show you
how you can compare different archives. I’ll make some changes to the running-
config so that we’ll end up with two different configuration archives:
Router(config)#interface loopback0
We’ll save the running-config to the startup-config so that another archive is created:
Building configuration...
[OK]
Router#show archive
Archive # Name
0
1 flash:router-backup-1
10
11
12
13
14
So we now have two configuration archives but don’t know their differences. IOS
tells us that the second one is the latest version, but this doesn’t always mean that
it’s the best configuration that we have. Luckily there’s a command that tells us
exactly the difference between the two files:
+interface Loopback0
Now we can replace our running configuration and select one of our snapshots like
this:
Router#
The router tells us which commands it has executed in order to roll back to the
configuration that we selected. In my example, it has removed the loopback 0
interface.
That’s all I wanted to show you for now, I hope this has been a useful lesson for you!
If you have any questions feel free to leave a comment.