Skip to main content
  1. Router and Switch Articles/
  2. IOS-XR/

IOS XR Two-Stage Commit Model

Table of Contents

About the Two-Stage Commit Model

Cisco IOS XR uses a Two-Stage Commit model that separates configuration changes into a “Target Configuration (first stage)” and a “Commit to the Running Configuration (second stage)”.

  • First stage: What the user enters under configure is first applied to their own private Target Configuration. At this point the Running Configuration is not affected, and any syntax errors can be corrected before committing.
  • Second stage (Commit): Running commit applies the contents of the Target Configuration to the Running Configuration all at once.

Whereas a single-stage model that applies each line immediately risks ending up in an inconsistent state if only part of the configuration is applied, Two-Stage Commit lets you validate and apply changes together as a batch.

IOS XR Configuration Example

This example configures ipv4 192.168.10.1/24 on interface GigabitEthernet0/0/0/0.

Cisco IOS XR Configuration Example
RP/0/RP0/CPU0:xr01#configure
RP/0/RP0/CPU0:xr01(config)#show running-config interface GigabitEthernet0/0/0/0

!!!! No IPv4 address configured yet (current Running state)

interface GigabitEthernet0/0/0/0
 description to GigabitEthernet0/0/0/0.XR02
!

RP/0/RP0/CPU0:xr01(config)#interface GigabitEthernet0/0/0/0
RP/0/RP0/CPU0:xr01(config-if)#ipv4 address 192.168.10.1 255.255.255.0
RP/0/RP0/CPU0:xr01(config-if)#exit
RP/0/RP0/CPU0:xr01(config)#show configuration

!!!! show configuration only shows the uncommitted diff

!! Building configuration...
!! IOS XR Configuration 26.1.1
interface GigabitEthernet0/0/0/0
 ipv4 address 192.168.10.1 255.255.255.0
!
end

RP/0/RP0/CPU0:xr01(config)#show configuration merge interface GigabitEthernet0/0/0/0

!!!! show configuration merge shows the merged result of the Target Configuration and Running

interface GigabitEthernet0/0/0/0
 description to GigabitEthernet0/0/0/0.XR02
 ipv4 address 192.168.10.1 255.255.255.0
!

RP/0/RP0/CPU0:xr01(config)#show running-config interface GigabitEthernet0/0/0/0

!!! Not committed yet, so Running is unchanged

interface GigabitEthernet0/0/0/0
 description to GigabitEthernet0/0/0/0.XR02
!

RP/0/RP0/CPU0:xr01(config)#commit
RP/0/RP0/CPU0:xr01(config)#end
RP/0/RP0/CPU0:xr01#show running-config interface gigabitEthernet 0/0/0/0

!!! Committed, so it is now reflected in Running

interface GigabitEthernet0/0/0/0
 description to GigabitEthernet0/0/0/0.XR02
 ipv4 address 192.168.10.1 255.255.255.0
!

RP/0/RP0/CPU0:xr01#

Related Articles

IOS XR Operation Methods