2 Simple Commands That Could Earn You A Get Out Of Jail, Free Card

Working with Cisco’s IOS Archive and Configure Replace Commands

Get Out of Jail..We’ve all been there, it’s the middle of the night and you’re well into a network configuration change and then you get that call from your IT Service Desk “we’re starting to get calls…”. Now you have no choice but to roll back your change! But where to start, did you even remember to make a copy before you started?

Cisco’s IOS software provides two very useful commands for managing configuration files which improve greatly over the more traditional methods, which when used together can prove incredibly useful, especially when making changes within a Production Environment.

The commands in question are the Archive and Configure Replace commands.

To summarize, the Archive command is used to configure an IOS device to create configuration file backups to a location defined by the Network Admin.

Archives can be created ad-hoc when needed, based on a configured scheduled timer or automatically every time the Network Administrator commits any changes to memory. 

The Configure Replace command can later be used to restore an archived configuration file back into the Device’s running-configuration without needing to reload the network device in question.

As you can see if used when making changes within a live environment could be a welcomed “get out of jail card” should you experience any unforeseen issues quickly without too much disruption.

I have made it a practice to incorporate these functions when implementing changes and would encourage other Network Admins to do the same.

So how do we make use of these two commands? Prior to making any configuration change, start by setting up and enabling the archive. Specifying archive file location, the frequency (in minutes) which you might want the device to automatically create new archive files and finally every time you commit any changes to NVRAM.

In the example below we’ll set the local file system as the path with the name Archive to be appended to the files, we’ll tell the router to automatically create a new archive file ever 5 minutes and every time we save any changes (write mem / copy run start):

configure terminal
!
archive
path flash0:Archive

 time-period 5
write-memory
exit
!
exit
!

Now when we check the archive we will see it is enabled and that there is already one file in the archive:

show archive
!
The maximum archive configurations allowed is 10.

There are currently 1 archive configurations saved.
The next archive file will be named flash0:Archive–1
Archive #  Name
1        flash0:Archive-Dec–7-04-35-36.290-0 <- Most Recent
!

And after saving any changes with write memory or copy running-config startup-config check the archive we will  find another file in the archive:

write memory
!
show archive
!
The maximum archive configurations allowed is 10.
There are currently 2 archive configurations saved.
The next archive file will be named flash0:Archive–2
Archive #  Name
1        flash0:Archive-Dec–7-04-35-36.290-0
2        flash0:Archive-Dec–7-04-36-19.354-1 <- Most Recent
!

And even if we forget to save changes the router will automatically add another file to the archive after the time specified when we set it up:

show archive
!
The maximum archive configurations allowed is 10.
There are currently 3 archive configurations saved.
The next archive file will be named flash0:Archive–4
Archive #  Name
1        flash0:Archive-Dec–7-04-35-36.290-0
2        flash0:Archive-Dec–7-04-36-19.354-1
3        flash0:Archive-Dec–7-04-41-45.027-2
!

At this point the Network Administrator can begin making their changes safe in the knowledge that should they run into problems they will have available to them a selection of configuration files to roll back into Production, and here’s the best part; without needing to reload the Device.

Then in the event that you should need to roll back you change, you may want to start by reviewing the files available to you in the Archive, and then pick the one that you think will roll back the problem config:

show archive
!
The maximum archive configurations allowed is 10.
There are currently 10 archive configurations saved.
The next archive file will be named flash0:Archive–13
Archive # Name
1 flash0:Archive-Dec–7-04-40-39.976-3
2 flash0:Archive-Dec–7-04-45-43.396-4
3 flash0:Archive-Dec–7-04-48-25.812-5
4 flash0:Archive-Dec–7-04-50-45.442-6
5 flash0:Archive-Dec–7-04-55-49.029-7
6 flash0:Archive-Dec–7-05-00-51.226-8
7 flash0:Archive-Dec–7-05-04-23.400-9
8 flash0:Archive-Dec–7-05-04-51.397-10
9 flash0:Archive-Dec–7-05-05-54.702-11
10 flash0:Archive-Dec–7-05-08-56.113-12 <- Most Recent
!

In this example we could try reinstalling the second from last archive, number 9 using the configure replace command to see if this fixes the problem:

configure replace flash0:Archive-Dec–7-05-05-54.702-11
!
y
!

And if this doesn’t resolve your issue, that’s okay just try an older archive file and keep going until you’re finished  at which point you can disable archiving:

conf t
!
no archive
!

And that’s it..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.