Date created: Friday, June 9, 2023 9:36:02 AM. Last modified: Friday, June 9, 2023 10:07:27 AM

JunOS - Committing and Rolling-back

One can apply a configuration using a rollback timer as per the below example, which commits with an automatic rollback timer of 1 minute unless the second "commit" statement is entered:

$ ssh r1
user@r1> monitor start messages
user@r1> configure
user@r1# load set test-config
user@r1# show | compare
user@r1# commit check
user@r1# commit confirmed 1 comment "commit with 1 minute rollback timer"
user@r1# commit
user@r1# exit
user@r1> monitor stop messages
user@r1> exit

The pending config can be rolled back sooner if needed by using "rollback 1":

user@r1# commit check
user@r1# commit confirmed 1 comment "commit with 1 minute rollback timer"
user@r1# rollback 1
user@r1# commit

One can view rollbacks using "show system rollback":

# This shows what was added 2 commits ago, when compared to the current running config:
user@r1> show system rollback 0 compare 2
[edit groups LAB-CONFIG system login]
+ user labuser {
+ uid 10;
+ }

# This shows what would be removed from the running config, by rolling back 2 commits:
user@r1> show system rollback 2 compare 0
[edit groups LAB-CONFIG system login]
- user labuser {
- uid 10;
- }

# This produces the same output as:
user@r1> configure Entering configuration mode {master}[edit] user@r1# rollback 2 load complete {master}[edit] user@r1# show | compare [edit groups LAB-CONFIG system login] - user labuser { - uid 10; - }

{master}[edit]
user@r1# rollback 0
load complete

{master}[edit]
user@br1# exit
Exiting configuration mode

 


Previous page: Fusion
Next page: MX Series Forwarding Hardware