Cisco configuration replace, rollback and commit
Most of the networkers who use JunOS on Juniper Networks equipment state that one of the best features is their configuration and commit system. I have to agree; the Juniper way of configuring things is just easier to work with compared to the Cisco IOS CLI.
I have always been very fond of the fact that on JunOS you are able to make your changes and once you are done, commit them into the running configuration. You can also easily rollback to previous configurations and show differences between them.
This feature has been in JunOS from day 1 and makes is easy for networkers to make changes which might impact router performance or might cause outages. JunOS is able to automatically rollback within a given timeframe unless you explicitly confirm the commit. So if you lock yourself out, the router will automatically revert to the previous configuration.
Recently I found out that Cisco IOS can do exactly the same since 12.3(7)T. All you need to do is enabling the configuration archive. There are some nice options to auto save your config at given intervals.
Below is the basic configuration to enable the feature. I will also configure the feature to automatically save the running-config every 6 hours.
br0.lab4#config t Enter configuration commands, one per line. End with CNTL/Z. br0.lab4(config)#archive br0.lab4(config-archive)#path disk0:archive-config br0.lab4(config-archive)#time-period 360 br0.lab4(config-archive)#end br0.lab4#sh run | sect archive archive path disk0:archive-config time-period 360 br0.lab4#
After enabling the feature you can easily display the archive and show the differences between the archived configurations. This is a very nice feature if multiple people are working on the router and you need to check what changes have been made.
br0.lab4#sh archive There are currently 2 archive configurations saved. The next archive file will be named disk0:archive-config-2 Archive # Name 0 disk0:archive-config-15 1 disk0:archive-config-1 <- Most Recent 2eleted 3
eleted 4
eleted 5
eleted 6
eleted 7 disk0:archive-config-7 8 disk0:archive-config-8 9 disk0:archive-config-9 10 disk0:archive-config-10 11 disk0:archive-config-11 12 disk0:archive-config-12 13 disk0:archive-config-13 14 disk0:archive-config-14 br0.lab4#sh arch conf diff disk0:archive-config-15 disk0:archive-config-16 Contextual Config Diffs: interface GigabitEthernet3/0 +description "ICON # br0.lab4 - cr0.lab4" +ip address 192.168.1.1 255.255.255.252 +mpls ip interface GigabitEthernet3/0 -no ip address br0.lab4#
You can also explicitly save the running config into the archive after you have made some changes and you don’t want to wait for the configured 6-hour interval.
br0.lab4#archive config br0.lab4#
The most practical use of this feature is the configuration replacement and confirmation. Let’s say you have to implement a route-map, or CoPP policy which has not been tested or might have some flaws in it.
Just take the most-current working configuration, and set it to replace the running-config after a specified timeframe, unless you explicitly confirm your changes. The time is expressed in seconds with a maximum of 2 minutes.
In this example I will set the rollback timer to 60 seconds. If I don’t confirm my configuration changes within that timeframe IOS will automatically revert back to disk0:archive-config-1.
br0.lab4#configure replace disk0:archive-config-1 time 60 Timed Rollback: Backing up to disk0:archive-config-5 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 br0.lab4#
At this time you have 60 seconds to apply the new configuration and to confirm the changes. If for some reason you get locked out of the router you don’t need to start panicking. Just wait for the configuration to rollback!
br0.lab4#config t Enter configuration commands, one per line. End with CNTL/Z. br0.lab4(config)# [INSERT YOUR NEW CONFIGURATION] br0.lab4(config)#end br0.lab4#configure confirm br0.lab4#

[...] a follow-up on my post about the Cisco configuration replace, rollback and commit feature; Tom Laermans suggested a Cisco implementation for Juniper’s JunOS its [...]