Note: although the article is intended for novice engineers, it may be useful for engineers, who are familiar with iOS XR. As they say, live and learn.
RP/0/0/CPU0:RZN-PE4(config)#interface gigabitEthernet 0/0/0/5 description "link to RZN-CE4-SW5" RP/0/0/CPU0:RZN-PE4(config)#show Sun Dec 11 17:11:11.950 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/5 description "link to RZN-CE4-SW5" ! end
RP/0/0/CPU0:RZN-PE4(config)#do sh run int gi0/0/0/5 description Sun Dec 11 17:12:09.346 UTC % No such configuration item(s)
RP/0/0/CPU0:RZN-PE4(config)#commit comment add desc int ge0/0/0/5 Sun Dec 11 17:12:43.443 UTC
RP/0/0/CPU0:RZN-PE4(config)#do sh run int gi0/0/0/5 description Sun Dec 11 17:12:48.353 UTC interface GigabitEthernet0/0/0/5 description "link to RZN-CE4-SW5" ! end
RP/0/0/CPU0:RZN-PE4#rollback configuration ? last Rollback last <n> commits made to Rollback up to (and including) a specific commit to-exclude Rollback up to (and excluding) a specific commit 1000000037 Commit ID 1000000036 Commit ID 1000000035 Commit ID 1000000034 Commit ID 1000000033 Commit ID 1000000032 Commit ID 1000000031 Commit ID 1000000030 Commit ID 1000000029 Commit ID 1000000028 Commit ID 1000000027 Commit ID 1000000026 Commit ID 1000000025 Commit ID 1000000024 Commit ID 1000000023 Commit ID 1000000022 Commit ID 1000000021 Commit ID 1000000020 Commit ID 1000000019 Commit ID 1000000018 Commit ID
RP/0/0/CPU0:RZN-PE4#rollback configuration last 1
RP/0/0/CPU0:RZN-PE4#sh configuration commit list 10 Sun Dec 11 17:17:39.113 UTC SNo. Label/ID User Line Client Time Stamp ~~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~ ~~~~~~~~~~ 1 1000000037 bormoglot con0_0_CPU0 CLI Sun Dec 11 17:12:43 2016 2 1000000036 bormoglot con0_0_CPU0 CLI Sun Dec 11 16:55:22 2016 3 1000000035 bormoglot con0_0_CPU0 CLI Sun Dec 11 16:55:07 2016 4 1000000034 bormoglot con0_0_CPU0 CLI Sun Dec 11 16:54:56 2016 5 1000000033 bormoglot con0_0_CPU0 Rollback Sun Dec 11 16:34:08 2016 6 1000000032 bormoglot con0_0_CPU0 CLI Sun Dec 11 16:23:18 2016 7 1000000031 bormoglot con0_0_CPU0 Rollback Sun Dec 11 15:48:11 2016 8 1000000030 bormoglot con0_0_CPU0 CLI Sun Dec 11 15:43:43 2016 9 1000000029 bormoglot con0_0_CPU0 CLI Sun Dec 11 15:32:44 2016 10 1000000028 bormoglot con0_0_CPU0 CLI Sun Dec 11 09:26:59 2016
Note: the number 10 means how many commits to display, otherwise Tsisk will dump you all commits, which will be redundant information (you are unlikely to make 40-50 commits at a time, although who knows ...). Unlike JunOS, iOS XR saves the last 100 commits.
RP/0/0/CPU0:RZN-PE4#sh configuration commit list 5 detail Sun Dec 11 17:20:19.682 UTC 1) CommitId: 1000000037 Label: NONE UserId: bormoglotx Line: con0_0_CPU0 Client: CLI Time: Sun Dec 11 17:12:43 2016 Comment: add desc int ge0/0/0/5 2) CommitId: 1000000036 Label: NONE UserId: bormoglotx Line: con0_0_CPU0 Client: CLI Time: Sun Dec 11 16:55:22 2016 Comment: "descr gi0/0/0/4" 3) CommitId: 1000000035 Label: NONE UserId: bormoglotx Line: con0_0_CPU0 Client: CLI Time: Sun Dec 11 16:55:07 2016 Comment: "descr gi0/0/0/3" 4) CommitId: 1000000034 Label: NONE UserId: bormoglotx Line: con0_0_CPU0 Client: CLI Time: Sun Dec 11 16:54:56 2016 Comment: "descr gi0/0/0/2" 5) CommitId: 1000000033 Label: NONE UserId: bormoglotx Line: con0_0_CPU0 Client: Rollback Time: Sun Dec 11 16:34:08 2016 Comment: no evi2
RP/0/0/CPU0:RZN-PE4#show configuration commit changes 1000000037 Sun Dec 11 17:22:05.485 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/5 description "link to RZN-CE4-SW5" ! end
Note: in addition to the commit ID, there is a commit number in the order specified in the detailed output:
1) CommitId: 1000000037 Label: NONE UserId: bormoglotx Line: con0_0_CPU0 Client: CLI Time: Sun Dec 11 17:12:43 2016 Comment: add desc int ge0/0/0/5
1 is the commit number, and 10,000,00037 is its ID. You can also watch configuration changes or roll back by the commit number, for example:
RP/0/0/CPU0:RZN-PE4#show configuration commit changes last 1 Sun Dec 11 17:24:19.616 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/5 description "link to RZN-CE4-SW5" ! end
After last, specify the number of commits to the desired one (the number is equal to the number of the commit). Unlike ID, the commit number is constantly changing (I think it is clear that the commit number is incremented with each commit run)
RP/0/0/CPU0:RZN-PE4# RP/0/0/CPU0:RZN-PE4#show configuration commit changes 1000000036 Sun Dec 11 17:25:21.772 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/4 description "link to RZN-CE4-SW4" ! end
RP/0/0/CPU0:RZN-PE4#show configuration rollback changes 1000000036 Sun Dec 11 17:27:34.912 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/4 no description "link to RZN-CE4-SW4" ! end
RP/0/0/CPU0:RZN-PE4#show configuration rollback changes ? last Changes for rolling back last <n> commits to Changes up to (and including) a specific commit to-exclude Changes up to (and excluding) a specific commit
Note: the to-exclude keyword appeared in the 5th branch of IOS XR, and then not on all versions. In any case, there is no such command on version 5.1.3, and already in 5.3.3.
RP/0/0/CPU0:RZN-PE4#show configuration rollback changes to 1000000035 Sun Dec 11 17:32:21.933 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 no description "link to RZN-CE4-SW3" ! interface GigabitEthernet0/0/0/4 no description "link to RZN-CE4-SW4" ! interface GigabitEthernet0/0/0/5 no description "link to RZN-CE4-SW5" ! end
RP/0/0/CPU0:RZN-PE4#show configuration commit changes 1000000035 Sun Dec 11 17:34:23.184 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 description "link to RZN-CE4-SW3" ! end
RP/0/0/CPU0:RZN-PE4#show configuration rollback changes to-exclude 1000000035 Sun Dec 11 17:37:17.183 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/4 no description "link to RZN-CE4-SW4" ! interface GigabitEthernet0/0/0/5 no description "link to RZN-CE4-SW5" ! end
Note: the show configuration commit changes command can also show all changes that have been made from the current configuration to the specified commit (taking into account all intermediate configuration changes). To do this, use the since keyword and specify the commit ID or the last keyword and specify the serial number of the commit:
RP/0/0/CPU0:RZN-PE4#sh configuration commit changes 1000000035 Sun Dec 11 18:01:33.533 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 description "link to RZN-CE4-SW3" ! end
RP/0/0/CPU0:RZN-PE4#sh configuration commit changes since 1000000035 Sun Dec 11 18:01:38.212 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 description "link to RZN-CE4-SW3" ! interface GigabitEthernet0/0/0/4 description "link to RZN-CE4-SW4" ! interface GigabitEthernet0/0/0/5 description "link to RZN-CE4-SW5" ! end
But again, do not forget that this command shows everything that has been added to the configuration starting from the specified commit and ending with the current one, and you will roll back all these changes with your rollerback!
RP/0/0/CPU0:RZN-PE4#show configuration rollback changes to 1000000025 Sun Dec 11 17:42:44.450 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/1 shutdown ! interface GigabitEthernet0/0/0/1.777 l2transport ! interface GigabitEthernet0/0/0/2 no description "link to RZN-CE4-SW2" ! interface GigabitEthernet0/0/0/3 no description "link to RZN-CE4-SW3" ! interface GigabitEthernet0/0/0/4 no description "link to RZN-CE4-SW4" ! interface GigabitEthernet0/0/0/5 no description "link to RZN-CE4-SW5" ! no interface BVI777 interface BVI777 ipv4 address 10.0.0.254 255.255.255.0 no mac-address 200.0.4777 mac-address 200.0.4777 ! router bgp 6262 vrf VRF_EVPN no address-family ipv4 unicast ! ! evpn ! end
RP/0/0/CPU0:RZN-PE4#show configuration rollback changes to 1000000025 diff Sun Dec 11 17:42:50.580 UTC Building configuration... !! IOS XR Configuration 5.3.3 # interface GigabitEthernet0/0/0/1 + shutdown + ! # interface GigabitEthernet0/0/0/1.777 l2transport # ! - interface GigabitEthernet0/0/0/2 - description "link to RZN-CE4-SW2" - ! - interface GigabitEthernet0/0/0/3 - description "link to RZN-CE4-SW3" - ! - interface GigabitEthernet0/0/0/4 - description "link to RZN-CE4-SW4" - ! - interface GigabitEthernet0/0/0/5 - description "link to RZN-CE4-SW5" - ! - interface BVI777 + interface BVI777 - vrf VRF_EVPN - ipv4 address 10.0.0.254 255.255.255.0 + ipv4 address 10.0.0.254 255.255.255.0 - mac-address 200.0.4777 + mac-address 200.0.4777 + ! # router bgp 6262 # vrf VRF_EVPN - address-family ipv4 unicast - label mode per-vrf - redistribute connected - redistribute static - ! - ! - ! # evpn # ! end
- ipv4 address 10.0.0.254 255.255.255.0 + ipv4 address 10.0.0.254 255.255.255.0 - mac-address 200.0.4777 + mac-address 200.0.4777
RP/0/0/CPU0:RZN-PE4#show configuration rollback changes to 1000000035 Sun Dec 11 17:50:53.187 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 no description "link to RZN-CE4-SW3" ! interface GigabitEthernet0/0/0/4 no description "link to RZN-CE4-SW4" ! interface GigabitEthernet0/0/0/5 no description "link to RZN-CE4-SW5" ! end
RP/0/0/CPU0:RZN-PE4(config)#load rollback changes to 1000000035 Building configuration... Loading. 254 bytes parsed in 1 sec (249)bytes/sec
Note: The output specifies the to keyword, so not only the changes applied to the specified commit are loaded, but also all intermediate commits. If the command were without to: load rollback changes 1000000035 , only the changes that were made with this commit would be loaded, and with the to-exclude keyword all changes would be loaded to commit 1000000035, not including the changes applied in commit 1000000035 itself.
RP/0/0/CPU0:RZN-PE4(config)#do show int description | i 0/0/0/[3-5] Sun Dec 11 17:49:31.632 UTC Gi0/0/0/3 admin-down admin-down "link to RZN-CE4-SW3" Gi0/0/0/4 admin-down admin-down "link to RZN-CE4-SW4" Gi0/0/0/5 admin-down admin-down "link to RZN-CE4-SW5"
RP/0/0/CPU0:RZN-PE4(config)#show Sun Dec 11 17:49:33.962 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 no description ! interface GigabitEthernet0/0/0/4 no description ! interface GigabitEthernet0/0/0/5 no description ! end
RP/0/0/CPU0:RZN-PE4(config)#abort RP/0/0/CPU0:RZN-PE4#
RP/0/0/CPU0:RZN-PE-4(config)#end Uncommitted changes found, commit them before exiting(yes/no/cancel)? [cancel]:n RP/0/0/CPU0:RZN-PE-4#
RP/0/0/CPU0:RZN-PE-4(config)#exit Uncommitted changes found, commit them before exiting(yes/no/cancel)? [cancel]:n RP/0/0/CPU0:RZN-PE-4#
RP/0/0/CPU0:RZN-PE-4#rollback configuration to 1000000003 label bormoglotx RP/0/0/CPU0:RZN-PE-4#show configuration commit list Sun Dec 11 18:42:50.333 UTC SNo. Label/ID User Line Client Time Stamp ~~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~ ~~~~~~~~~~ 1 bormoglotx bormoglot con0_0_CPU0 Rollback Sun Dec 11 18:42:40 2016 2 1000000004 bormoglot con0_0_CPU0 Rollback Sun Dec 11 18:33:34 2016 3 1000000003 bormoglot con0_0_CPU0 CLI Sun Dec 11 18:31:38 2016 4 1000000002 bormoglot con0_0_CPU0 CLI Sun Dec 11 18:31:25 2016 5 1000000001 bormoglot con0_0_CPU0 CLI Sun Dec 11 18:30:57 2016
Note: the ID itself is still assigned and indicated either in the detailed output or when selecting the commit ID:
RP/0/0/CPU0:RZN-PE-4#show configuration rollback changes ? bormoglotx 1000000005 bormoglotx-1 1000000006
RP/0/0/CPU0:RZN-PE-4#rollback configuration to 1000000004 label bormoglotx Sun Dec 11 18:47:24.214 UTC Loading Rollback Changes. Loaded Rollback Changes in 1 sec Committing. Rollback operation failed due to - 'CfgMgr' detected the 'warning' condition 'The specified label already exists in commit database.' Running configuration has not been modified.
RP/0/0/CPU0:RZN-PE-4(config)#commit Sun Dec 11 18:58:40.048 UTC % Failed to commit one or more configuration items during a pseudo-atomic operation. All changes made have been reverted. Please issue 'show configuration failed [inheritance]' from this session to view the errors
RP/0/0/CPU0:RZN-PE-4(config)#commit show-error Sun Dec 11 18:59:44.254 UTC % Failed to commit one or more configuration items during a pseudo-atomic operation. All changes made have been reverted. !! SEMANTIC ERRORS: This configuration was rejected by !! the system due to semantic errors. The individual !! errors with each failed configuration command can be !! found below. interface BVI777 vrf VRF-TEST !!% 'RSI' detected the 'fatal' condition 'The interface's numbered and unnumbered IPv4/IPv6 addresses must be removed prior to changing or deleting the VRF' ! end RP/0/0/CPU0:RZN-PE-4(config)#
RP/0/0/CPU0:RZN-PE-4#clear configuration commits oldest 43 Sun Dec 11 18:26:58.078 UTC Deleting 43 rollback points '1000000001' to '1000000043' 48 KB of disk space will be freed. Continue with deletion?[confirm] RP/0/0/CPU0:RZN-PE-4#show configuration commit list Sun Dec 11 18:27:18.977 UTC The commit database is empty.
RP/0/0/CPU0:RZN-PE-4#show configuration history Sun Dec 11 22:15:04.042 UTC Sno. Event Info Time Stamp ~~~~ ~~~~~ ~~~~ ~~~~~~~~~~ 1 startup configuration applied Sun Dec 11 07:00:27 2016 2 commit id 1000000001 Sun Dec 11 07:01:28 2016 3 commit id 1000000002 Sun Dec 11 07:07:19 2016 4 commit id 1000000003 Sun Dec 11 07:17:26 2016
RP/0/0/CPU0:RZN-PE-4#show configuration history | b ^52 Sun Dec 11 22:16:57.924 UTC 52 commit id 1000000043 Sun Dec 11 18:24:28 2016 53 commit id 1000000001 Sun Dec 11 18:28:53 2016 54 commit id 1000000001 Sun Dec 11 18:30:57 2016
RP/0/0/CPU0:RZN-PE-4(config)#interface gigabitEthernet 0/0/0/3 description 111111 RP/0/0/CPU0:RZN-PE-4(config)#commit comment add 11111 Tue Dec 13 08:21:15.328 UTC RP/0/0/CPU0:RZN-PE-4(config)#
RP/0/0/CPU0:RZN-PE-4(config)#interface gigabitEthernet 0/0/0/4 description 22222 RP/0/0/CPU0:RZN-PE-4(config)#commit comment add 22222 Tue Dec 13 08:21:33.627 UTC RP/0/0/CPU0:RZN-PE-4(config)#
RP/0/0/CPU0:RZN-PE-4(config)#interface gigabitEthernet 0/0/0/5 description 33333 RP/0/0/CPU0:RZN-PE-4(config)#commit comment add 33333 Tue Dec 13 08:21:54.856 UTC RP/0/0/CPU0:RZN-PE-4(config)#
RP/0/0/CPU0:RZN-PE-4#show configuration commit list 5 Tue Dec 13 08:22:04.915 UTC SNo. Label/ID User Line Client Time Stamp ~~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~ ~~~~~~~~~~ 1 1000000022 bormoglot con0_0_CPU0 CLI Tue Dec 13 08:21:54 2016 2 1000000021 bormoglot con0_0_CPU0 CLI Tue Dec 13 08:21:33 2016 3 1000000020 bormoglot con0_0_CPU0 CLI Tue Dec 13 08:21:15 2016 4 1000000019 bormoglot con0_0_CPU0 Rollback Tue Dec 13 08:20:20 2016 5 1000000018 bormoglot con0_0_CPU0 CLI Tue Dec 13 08:16:26 2016
RP/0/0/CPU0:RZN-PE-4#show configuration rollback changes 1000000022 Tue Dec 13 08:22:23.474 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/5 no description 33333 ! end
RP/0/0/CPU0:RZN-PE-4#show configuration rollback changes 1000000021 Tue Dec 13 08:22:27.184 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/4 no description 22222 ! end
RP/0/0/CPU0:RZN-PE-4#show configuration rollback changes 1000000020 Tue Dec 13 08:22:30.373 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 no description 111111 ! end
RP/0/0/CPU0:RZN-PE-4#show configuration rollback changes to 1000000020 Tue Dec 13 08:22:34.553 UTC Building configuration... !! IOS XR Configuration 5.3.3 interface GigabitEthernet0/0/0/3 no description 111111 ! interface GigabitEthernet0/0/0/4 no description 22222 ! interface GigabitEthernet0/0/0/5 no description 33333 ! end
RP/0/0/CPU0:RZN-PE-4#rollback configuration 1000000020 Tue Dec 13 08:22:49.342 UTC Loading Rollback Changes. Loaded Rollback Changes in 1 sec Committing. 2 items committed in 1 sec (1)items/sec Updating. Updated Commit database in 1 sec Configuration successfully rolled back commit '1000000020'.
RP/0/0/CPU0:RZN-PE-4#show running-config Tue Dec 13 08:22:56.432 UTC Building configuration... !! IOS XR Configuration 5.3.3 !! Last configuration change at Tue Dec 13 08:22:50 2016 by bormoglotx ! hostname RZN-PE-4 interface MgmtEth0/0/CPU0/0 shutdown ! interface GigabitEthernet0/0/0/0 description link to core ! interface GigabitEthernet0/0/0/1 description link to SW1 ! interface GigabitEthernet0/0/0/2 shutdown ! interface GigabitEthernet0/0/0/3 shutdown ! interface GigabitEthernet0/0/0/4 description 22222 shutdown ! interface GigabitEthernet0/0/0/5 description 33333 shutdown ! #
Source: https://habr.com/ru/post/317466/
All Articles