Configuration Archive and Rollback on Cisco IOS

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 each 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.

Let’s take a look at the configuration shall we?

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 ?
  flash:  Write archive on flash: file system
  ftp:    Write archive on ftp: file system
  http:   Write archive on http: file system
  https:  Write archive on https: file system
  pram:   Write archive on pram: file system
  rcp:    Write archive on rcp: file system
  scp:    Write archive on scp: file system
  slot0:  Write archive on slot0: file system
  tftp:   Write archive on tftp: file system

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 each 24 hours:

Router(config-archive)#time-period 1440

1440 minutes means we’ll create a snapshot each 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 
There are currently 1 archive configurations saved.
The next archive file will be named flash:router-backup-1
 Archive #  Name
   0        
   1        
   2        
   3        
   4        
   5        
   6        
   7        
   8        
   9        
   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:

Router#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Verifying checksum...  OK (0xDCF1)

When we look again at the show archive command we’ll see our first configuration archive:

Router#show archive 
There are currently 2 archive configurations saved.
The next archive file will be named flash:router-backup-2
 Archive #  Name
   0        
   1       flash:router-backup-1 <- Most Recent
   2        
   3        
   4        
   5        
   6        
   7        
   8        
   9        
   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:
File  Length   Name/status
  1   840      router-backup-1  
[904 bytes used, 16776308 available, 16777212 total]
16384K bytes of ATA System CompactFlash (Read/Write)

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
Router(config-if)#ip address 1.1.1.1 255.255.255.0

We’ll save the running-config to the startup-config so that another archive is created:

Router#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Verifying checksum...  OK (0xDCF1)

Let’s find out if we have another snapshot:

Router#show archive 
There are currently 3 archive configurations saved.
The next archive file will be named flash:router-backup-3
 Archive #  Name
   0        
   1       flash:router-backup-1 
   2       flash:router-backup-2 <- Most Recent
   3        
   4        
   5        
   6        
   7        
   8        
   9        
   10        
   11        
   12        
   13        
   14  

So we now have two configuration archives but we don’t know the differences between them. 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:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 651 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

555 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Forum Replies

  1. Thanks!!! Great job…

  2. Nice LAB thanks !!

  3. I think the topic for archive is good but you didnt say much about rollback. In this topic are missing such commands as
    configure terminal revert timer and some others

  4. Hi Tatyana,

    I will add these extra commands, sounds like a good idea.

    Rene

Ask a question or join the discussion by visiting our Community Forum