IOS-XE Configuration Archive

Cisco IOS-XE devices have a configuration archive functionality to store and manage configuration files, with a rollback capability. Configurations can be automatically backed up locally or to a remote server (i.e, TFP, TFTP, SCP etc). The archived configuration can be compared to the running configuration and if required reverted to the archived configuration.

With archiving enabled, you can set a revert timer before making configuration changes. If the timer expires and the changes have not been confirmed, the configuration will automatically revert to the save configured. This is invaluable depending on the changes being made and could potentially stop the administrator being locked out of the device.

Configuration

SWITCH(config)#archive
SWITCH(config-archive)#?
Archive configuration commands:
  default       Set a command to its defaults
  exit          Exit from archive configuration mode
  log           Logging commands
  maximum       maximum number of backup copies
  no            Negate a command or set its defaults
  path          path for backups
  rollback      Rollback parameters
  time-period   Period of time in minutes to automatically archive the running-config
  write-memory  Enable automatic backup generation during write memory

Apply the basic archive configuration to archive the configuration to flash, automatically every day (1440 minutes).

archive
 path flash:/switcharchive
 time-period 1440

To manually archive the configuration using the command archive config instead of waiting 1440 minutes.

SWITCH#archive config
SWITCH#show archive
The maximum archive configurations allowed is 10.
There are currently 2 archive configurations saved.
The next archive file will be named flash:/switcharchive-<timestamp>-2
 Archive #  Name
   1        flash:/switcharchive-Jun--6-10-38-00.741-0

Make any configuration change for demonstration purposes.

SWITCH(config)#interface loopback0
SWITCH(config-if)#ip add
SWITCH(config-if)#ip address 1.1.1.1 255.255.255.255
SWITCH(config-if)#ip ospf 1 area 0
SWITCH(config-if)#shut

Compare the difference between the running configuration and an archived configuration using the command show archive config differences <path:filename>

The output below displays the loopback configuration applied, which does not exist in the archived version.

SWITCH#show archive config differences flash:switcharchive-Jun--6-10-38-00.741-0
!Contextual Config Diffs:
-interface Loopback0
 -ip address 1.1.1.1 255.255.255.255
 -ip ospf 1 area 0
 -shutdown
-router ospf 1

To revert the running configuration to the archived version, use the command configure replace <path:filename>.

SWITCH#configure replace flash:switcharchive-Jun--6-10-38-00.741-0
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: 1
Rollback Done

Run the show archive config differences <path:filename> command again, to compare the running configuration with the archived version, confirms the configuration has been reverted – thus the loopback interface has been removed.

SWITCH#show archive config differences flash:switcharchive-Jun--6-10-38-00.741-0
!Contextual Config Diffs:
!No changes were found

For complex changes you can automatically revert the configuration if you do not save the configuration before the timer expires, using the command configure terminal revert timer <time>. Executing that command will save the current configuration and start the timer.

SWITCH#configure terminal revert timer 1

Rollback Confirmed Change: Backing up current running config to flash:/switcharchive-Jun--6-10-55-33.039-3

Enter configuration commands, one per line.  End with CNTL/Z.
SWITCH(config)#int loopback 1
SWITCH(config-if)#ip address 1.1.1.1 255.255.255.255
SWITCH(config-if)#do show ip int br | i Loopback
Loopback1              1.1.1.1         YES manual up                    up

To save the configuration use the command configure confirm before the timer expires, else the configuration will revert to the saved version.

Use the command show archive config rollback timer to display the rollback timer

SWITCH#show archive config rollback time
Time configured(or reconfigured): 12:11:54 gmt Fri Jun 6 2025
Timer type: absolute timer
Timer value: 20 min
User: admin

 Use the command configure revert timer <time> to increase, decrease the timer.

SWITCH#configure revert timer 40
SWITCH#show archive config rollback time
Time configured(or reconfigured): 12:12:27 gmt Fri Jun 6 2025
Timer type: absolute timer
Timer value: 40 min
User: admin

To manually rollback the configuration to the previous version, without waiting for the timer to expire use the command configure revert now.

SWITCH(config)#hostname TEST
TEST#configure revert now
Rollback Confirmed Change: rolling to:flash:/switcharchive-Jun--6-11-11-52.801-5

Total number of passes: 1
Rollback Done

 

Leave a Reply