Tuesday, January 31, 2017

Cisco: Auto Backup Configuration Using “Configuration Archive”

Cisco: Auto Backup Configuration Using “Configuration Archive”

There are certain question you should ask before reading any further:
  • Do you have a change management system in place?
  • How often do make changes in router/switch configuration?
  • What if you router/switch blown up today?
  • Will you be able to recover the previous configuration?
  • Oh..you forgot to backup?
  • Can you figure out exactly what you did and try to put it back the way it was?
One of the quite old Cisco IOS feature can help you solve this very problem or at least make it easier for you to recover from the loss.
Cisco IOS 12.3 introduced the Cisco IOS archive and archive config commands. A very detailed and comprehensive information is available at this Cisco link “Archiving Configurations and Managing them using Archive Management
  • Cisco IOS archive command can help you automatically save configuration after every change.
  • This command can also show you the difference between any two configurations saved.
  • These archives can also be created manually as per requirement.
  • This command can also be used to automatically log all commands entered by any user.
  • This command was introduced with IOS 12.3(4)T. Later it was integrated into IOS Release 12.2(25)S.
Archiving : Cisco IOS Command
Router(config)# archive
Router(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
  • time-period – Period of time in minutes to automatically archive the running- config
  • write-memory – Enable automatic backup generation during write memory
In case you want to archive configuration on an ftp server than following configuration will be used. This will backup config on every “write mem” and periodically after every 15 days.
  • ip ftp username ftp-username
  • ip ftp password ftp-password
  • archive
  • path ftp://202.163.x.x/routerconfig/$h
  • write-memory
  • time-period 21600

Router #show archive
The next archive file will be named ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-14
Archive #  Name
0
1       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-1
2       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-2
3       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-3
4       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-4
5       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-5
6       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-6
7       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-7
8       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-8
9       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-9
10       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-10
11       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-11
12       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-12
13       ftp://202.163.x.x/routerconfig/asw01-cc-syb-8flr-13 <- Most Recent

I can also compare the differences between two archived configurations or the running config and an archived config, using the show archive config differences or incremental-diffs, like this:
Router# show archive config ?
differences              Display the differences between two config files
incremental-diffs        Display lines in config file which will be added to running-config
As these archived configurations are just text files in the flash memory (if stored locally, but in our example we have given ftp path to store the backup), you can copy them back to the startup or running config anytime you want. Besides viewing them with the show archive command, you can view them with the dir flash command if stored locally and use the files in following commands otherwise have to give path to ftp:
show archive config differencees [file1 [file2]]
or
show archive config incremental-diffs [file]

The archive command is a powerful tool that I recommend to Cisco admins to be implemented on all routers. You can do both local backups of configurations as well as remote backups.

1 comment:

  1. I am bold enough among many others to state that there is now a potent cure to this sickness but many are unaware of it. I discovered that I was infected with the virus 3 months ago, after a medical check-up. My doctor told me and I was shocked, confused and felt like my world has crumbled. I was dying slowly due to the announcement of my medical practitioner but he assured me that I could leave a normal life if I took my medications (as there was no medically known cure to Herpes). I went from churches to churches but soon found that my case needed urgent attention as I was growing lean due to fear of dying anytime soon. In a bid to look for a lasting solution to my predicament, I sought for solutions from the herbal world. I went online and searched for every powerful trado-medical practitioner that I could severe, cos I heard that the African Herbs had a cure to the Herpes syndrome. It was after a little time searching the web that I came across one Dr Itua(A powerful African Herbal Doctor), who offered to help me at a monetary fee. I had to comply as this was my final bus-stop to receiving a perfect healing. My last resolve was to take my life by myself, should this plan fail. At last it worked out well. He gave me some steps to follow and I meticulously carried out all his instructions. Last month, to be precise, I went back to the hospital to conduct another test and to my amazement, the results showed that negative,Dr Itua Can As Well Cure The Following Desease…Cancer,Hiv,Herpes, Hepatitis B,Liver Inflammatory,Diabetis,Fribroid,Get Your Ex Back, You can free yourself of this Herpes virus by consulting this great African Herbal Doctor via this e-mail: drituaherbalcenter@gmail.com or call and whatsapp him on +2348149277967 He will help you and his herb medication is sure. he has the cure on all disease .You can talk to me on INSTAGRAM..tashamoore219....

    ReplyDelete