04-13-2014 01:45 PM - edited 03-07-2019 07:04 PM
Hello, say I make a change to the config of a router or switch, such as the addition of new lines.
If I then decide I want to revert to the original config, I understand that I can just paste the original config back in via the terminal.
However doing this does not get rid of the additional lines I had added in.
Apart from manually deleting those new lines ,is there another way to revert back to the original config apart from reloading ?
Thanks kindly.
04-13-2014 02:05 PM
With Cisco devices that run IOS, IOS, XE, etc.. it works they way you described it. You basically have to delete the lines with a no command or if you have not saved the config yet, a reload would put the switch or the router into the state that was before you add the lines.
If you are using devices that run IOS XR, they have added the commit and rollback command.
So, if you make a change and save the config, you can roll it back to the original state.
Unfortunately, Cisco IOS has always lac this feature. If you are using any Juniper device, you can roll back up to 49 times.
It is really a cool feature to have handy when you need it.
HTH
04-13-2014 04:34 PM
Actually there are a set of tools in Cisco IOS that allow this after a fashion. It's not quite as slick as JunOS's commit and revert functions but have a look at "archive" and "configure replace" toolset. It's been around for a couple of years but I've not seen many engineers use it. Perhaps because it's not covered in the certification guides. :)
There are several nice blog articles on third party sites that discuss it in some detail:
http://packetpushers.net/cisco-configuration-archive-rollback-using-revert-instead-of-reload/
http://packetlife.net/blog/2010/feb/19/soho-configuration-management/
http://www.packetu.com/2013/05/14/understanding-the-cisco-configure-replace-command/
Hope this helps - please rate helpful replies.
04-13-2014 09:33 PM
It would be good if you have a TFTP server (Linux-based would be very nice). Because if you do, then you can do add the following lines:
archive log config logging enable hidekeys path tftp://TFTP IP address/$h- write-memory time-period 10080
The command above means that whenever someone saves the config, a copy is sent straight to the TFTP server. Alternatively, a copy of the latest config is saved into the TFTP server every 7 days (time-period 10080).
Now back to your question, say you got the above config running and you've got the latest config. Now you've done some configuration changes and you "don't like them". The easiest way to revert will be to delete the startup-config in your appliance and copy the latest config (found in your TFTP server) back to your appliance's startup config.
04-13-2014 09:36 PM
There is another tool that you can use and this will be dependent on how old/new your IOS is. The command is "sh archive config difference file_1 file_2
".
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: