Back up that config!

      No Comments on Back up that config!

My apologies again for being gone for so long.  Studying for the BSCI took most of my time up until a week or so ago, and ever since its been crazy.  At any rate, I received my Cisco TSHOOT book last week and I’ve been trying to read a few chapters in my free time.  One topic that came up was backing up your configurations.  I wanted to take some time to review a couple of options for backing up your router configurations.  So let’s get right into it!

Backing up your router configurations is one of the most crucial functions of a network engineer.  I don’t make any changes to a router without backing up its config first.  That being said, there are a couple of automated ways of performing this function for you.  The two options are kron jobs and the archive functionality.

Kron Jobs
Kron jobs consist of two pieces: a policy set and occurrence configuration.  For instance, we would configure a policy set to backup the config, and then an occurrence to schedule the actions of the policy set.  It’s pretty straightforward so let’s just see an example configuration.

Notes
-Insert your relevant information between <>
-Console prompts are show in green
-Text in blue are variable names I made up, feel free to change them

Define the Kron policy
Cisco2801(config)#
kron policy-list Backup
Cisco2801(config-kron-policy)# cli show run | redirect tftp://<TFTP Server IP>/2801/config 

Define the Kron Occurrence
Cisco2801(config)# Kron occurrence Backup at 17:00 Wed recurring
Cisco2801(config-kron-occurrence)# policy-list Backup

Pretty straightforward right?  This particular kron job copies the running config to the TFTP server every Wednesday at 5pm.  A couple of items to look out for: 
-Check to make sure the time and date on the router is correct (show clock)
-Not everyone writes the config when they are done, I have seen some people setup a kron to copy the running config and separate kron to copy the startup config.
-‘show kron schedule’ and ‘debug kron all’ are helpful when troubleshooting a kron job that isn’t running correctly or at the right date/time

Archive
Kron jobs are cool and have their purpose but they do have some limitations.  The archive feature on the other hand is designed specifically for backup up and archiving configs.  Let’s take a quick look at configuring archiving and then discuss its function.

Cisco2801(config)# archive
Cisco2801(config-archive)# log config
Cisco2801(config-archive-log-cfg)# logging enable
Cisco2801(config-archive-log-cfg)# logging size 100
Cisco2801(config-archive-log-cfg)# path tftp://<TFTP Server IP>/2801/config
Cisco2801(config-archive)# write-memory
Cisco2801(config-archive)# time
Cisco2801(config-archive)# time-period 1440
Cisco2801(config-archive)# exit
Cisco2801(config)# exit
Cisco2801#

This is actually really, really cool.  What we have done is told the router to backup its config once a day and any time that a user writes the running config to the startup config.  After I issue the above commands I did a ‘write mem’ four times.  Below I show the output from TFTP server.

image

As you can see, each time I wrote the config to memory, the router dumped a copy of it to the TFTP server incrementing the file number by one.  Pretty slick eh?!  This is on top of it backing up the config once a day (or every 1440 minutes).  Here are some other cool commands you can use once its setup.

Manually Create an archive and send it to the designated TFTP server
Cisco2801# archive config

Show all the commands entered up to the buffer limit you defined with the ‘logging size’ command
Cisco2801# show archive log config all

Show all the configs that were sent to TFTP for archive
Cisco2801# show archive

Restore a config from TFTP to the running config.  CAUTION!!  This dumps the archived config back to the running config.  You’ll get a warning telling you something along the same lines when you issue the command.
Cisco2801# configure replace tftp://<TFTP Server IP>/2801/config-1

Conclusion
So I really just scratched the surface with both of these.  There are tons of great examples out there if you do a little “googling”.  If you have a TFTP server on line all the time why not configure archiving?  You might not always need it, but when you do, it’s a life saver!

Leave a Reply

Your email address will not be published. Required fields are marked *