Tags
Ok, we have seen the basic COMMIT option – but what other options do we have for configuration mode? Well, we have a few to choose from.
First, what if I am making changes and decide I don’t want them? You have a few options. First you could just exit all the way out.
RP/0/7/CPU0:R1(config)#exit
Uncommitted changes found, commit them before exiting(yes/no/cancel)? [cancel]: no
And once you exit out, all your changes are lost.
Ok, that is one option. Another is clear. To demonstrate, lets create loopback 666
RP/0/7/CPU0:R1#conf t
Sun Apr 1 22:18:52.956 UTC
RP/0/7/CPU0:R1(config)#int loop 666
RP/0/7/CPU0:R1(config-if)#ip add 6.6.6.6/32
Ok, let’s check the candidate configuration:
RP/0/7/CPU0:R1(config-if)#show config
Sun Apr 1 22:19:03.438 UTC
Building configuration…
!! IOS XR Configuration 4.1.1
interface Loopback666
ipv4 address 6.6.6.6 255.255.255.255
!
end
RP/0/7/CPU0:R1(config-if)#
OK, we have it in the candidate configuration now. We changed our mind about that – so lets clear it.
RP/0/7/CPU0:R1(config-if)#clear
Now check the candidate configuration again.
RP/0/7/CPU0:R1(config)#show config
Sun Apr 1 22:19:34.733 UTC
Building configuration…
!! IOS XR Configuration 4.1.1
end
RP/0/7/CPU0:R1(config)#
There, all gone!
Now, what if we want to make a change but we want to be sure we don’t lose connection to the router? Well, we can do a commit confirm, this way if we do lose connection our change will be rolled back!
RP/0/7/CPU0:R1#conf t
Sun Apr 1 22:23:01.154 UTC
RP/0/7/CPU0:R1(config)#int loop 666
RP/0/7/CPU0:R1(config-if)#ip add 6.6.6.6/32
Now, lets look at our commit confirmed options:
RP/0/7/CPU0:R1(config-if)#commit confirmed ?
<30-65535> Seconds until rollback unless there is a confirming commit
minutes Specify the rollback timer in the minutes
<cr> Commit the configuration changes to running
See, we can have a few seconds or a few minutes. Pretty cool!
RP/0/7/CPU0:R1(config-if)#commit confirmed 30
Sun Apr 1 22:23:19.344 UTC
Now, lets see if we have loop666:
RP/0/7/CPU0:R1(config-if)#do show int loop666
Sun Apr 1 22:23:34.353 UTC
Loopback666 is up, line protocol is up
Interface state transitions: 1
Hardware is Loopback interface(s)
Internet address is 6.6.6.6/32
MTU 1500 bytes, BW 0 Kbit
reliability Unknown, txload Unknown, rxload Unknown
Encapsulation Loopback, loopback not set,
Last input Unknown, output Unknown
Last clearing of “show interface” counters Unknown
RP/0/7/CPU0:R1(config-if)#
Yup, its there. Now we can wait a few seconds (30 or so) and do the show interface command again.
RP/0/7/CPU0:R1(config-if)#do show int loop666
Sun Apr 1 22:25:09.361 UTC
Interface not found (Loopback666)
RP/0/7/CPU0:R1(config-if)#
All gone!
Ok, now lets commit it this time.
RP/0/7/CPU0:R1#conf t
Sun Apr 1 22:26:20.749 UTC
RP/0/7/CPU0:R1(config)#int loop 666
RP/0/7/CPU0:R1(config-if)#ip add 6.6.6.6/32
RP/0/7/CPU0:R1(config-if)#commit confirmed 30
Sun Apr 1 22:26:32.913 UTC
RP/0/7/CPU0:R1(config-if)#
Lets see if the interface is there:
RP/0/7/CPU0:R1(config-if)#do show int loop666
Sun Apr 1 22:26:38.421 UTC
Loopback666 is up, line protocol is up
Interface state transitions: 1
Hardware is Loopback interface(s)
Internet address is 6.6.6.6/32
MTU 1500 bytes, BW 0 Kbit
reliability Unknown, txload Unknown, rxload Unknown
Encapsulation Loopback, loopback not set,
Last input Unknown, output Unknown
Last clearing of “show interface” counters Unknown
Yup, now we can commit it again to make it stay.
RP/0/7/CPU0:R1(config-if)#commit
Sun Apr 1 22:26:40.299 UTC
% Confirming commit for trial session.
RP/0/7/CPU0:R1(config-if)#
And lets make sure it is still there.
RP/0/7/CPU0:R1#sh int loop 666
Sun Apr 1 22:27:09.232 UTC
Loopback666 is up, line protocol is up
Interface state transitions: 1
Hardware is Loopback interface(s)
Internet address is 6.6.6.6/32
MTU 1500 bytes, BW 0 Kbit
reliability Unknown, txload Unknown, rxload Unknown
Encapsulation Loopback, loopback not set,
Last input Unknown, output Unknown
Last clearing of “show interface” counters Unknown
RP/0/7/CPU0:R1#
Look at that, IOS XR has a commit confirmed – just like someone else does as well.
Few other things that are nice to know.
You can configure the system in exclusive mode, this way only you can be making changes and nobody else. To do this, just enter configure exclusive
RP/0/7/CPU0:R1#configure exclusive
You can add comments and notations to your commit that will show up in the rollback.
RP/0/7/CPU0:R1#conf t
Sun Apr 1 22:32:23.941 UTC
RP/0/7/CPU0:R1(config)#int loop 667
RP/0/7/CPU0:R1(config-if)#ip add 6.6.6.7/32
RP/0/7/CPU0:R1(config-if)#exit
RP/0/7/CPU0:R1(config)#commit comment Created Loopback 667 For Testing
Sun Apr 1 22:33:34.589 UTC
RP/0/7/CPU0:R1(config)#
Now, if a comment has been added, you can see it via the show configuration history last x detail command
RP/0/7/CPU0:R1#sh configuration history last 1 detail
Sun Apr 1 22:36:04.053 UTC
1) Event: commit Time: Sun Apr 1 22:33:36 2012
Commit ID: 1000000230 Label:
User: user Line: con0_7_CPU0
Client: CLI Comment: Created Loopback 667 For Testing
RP/0/7/CPU0:R1#