Thought you guys would like the title. :D Sorry for the lack of content lately, I’ve been very busy.

Today we’re going to explore the “archive” feature in IOS with a small “archive tutorial”. This was sparked by a recent comment on one of my JUNOS posts. The commenter said that the “archive” command in IOS is the same as “rollback” in JUNOS. They are similar, but “rollback” is there by default where you need to do some tinkering with “archive”. I’ve used it in the past, but never with the intention of mimicking JUNOS’s “rollback”.

Here’s the config:

EDGE(config)#archive
EDGE(config-archive)#?
Archive configuration commands:
  default       Set a command to its defaults
  exit          Exit from archive configuration mode
  log           Logging commands
  maximum       maximum number of backup copies
  no            Negate a command or set its defaults
  path          path for backups
  rollback      Rollback parameters
  time-period   Period of time in minutes to automatically archive the running-config
  write-memory  Enable automatic backup generation during write memory
EDGE(config-archive)#path disk0:config-backup
EDGE(config-archive)#max 14
EDGE(config-archive)#write-memory

To enter the config, we simply type “archive” in global config. There are quite a few options, as we can see. First we’ll need to set our path to store the archived configs, this is a 7200, so I’m using disk0 and a simple naming convention. Next we specify how many configs we want to backup, I’m using the maximum on my device, which is 14. Finally we set the “write-memory” command, which tells the router to archive the config anytime we save.

Here are some of my saved configs:

EDGE#dir
Directory of disk0:/
   12  -rw-       14274  Mar 24 2010 12:59:34 -05:00  config-backup-0
   13  -rw-       14269  Mar 24 2010 13:00:36 -05:00  config-backup-1
   14  -rw-       14269  Mar 24 2010 13:03:08 -05:00  config-backup-2
   15  -rw-       14281  Mar 24 2010 13:03:22 -05:00  config-backup-3
   16  -rw-       14319  Mar 24 2010 13:11:36 -05:00  config-backup-4

So there they are, stored in flash like we specified.

Now we can see what the differences are in the previous configs:

EDGE#show archive config differences disk0:config-backup-1
Contextual Config Diffs:
archive
 -maximum 14

The dash is telling us what isn’t in the old config, but is in the new config.

Now we’ll try a rollback:

EDGE#configure replace disk0:config-backup-1
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: y
Total number of passes: 1
Rollback Done

IOS asks if we’re sure, we say yes. There’s a small pause and then it’s done! We have now rolled back to an older config.

Now this isn’t as easy as JUNOS, but we can tweak it a bit with an alias:

EDGE(config)#alias exec rollback configure replace
EDGE(config)#end
EDGE#rollback disk0:config-backup-6
EDGE#configure replace disk0:config-backup-6
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: y
Total number of passes: 0
Rollback Done

That’s it! Now we have archived configs with the “rollback” feature similar to JUNOS.

As always, I hope this was helpful and let me know what you guys think!

Colby

Colby Glass has been in IT since 2002. He is currently a Systems Engineer (presales) with a Cisco Gold partner and holds the CCNP R/S, CCNP DC, CCDP, CCIP, JNCIA-ER.

More Posts