How to Save the Configuration on Cisco IOS XE
On IOS XE, configuration changes such as hostname take effect immediately in the running-config, but the running-config only exists in memory and is lost on reboot.
To keep the configuration after a reboot, you need to copy (save) the running-config to the startup-config.
copy running-config startup-configWhen executed, you’re prompted to confirm the destination filename. Press Enter to save to the default startup-config.
Save Configuration Example
IOS-XE#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
IOS-XE#About the write memory Command
write memory (shortened to wr) can also be used to save to the startup-config. It’s a shorthand command that performs the same action as copy running-config startup-config.
write memoryIOS-XE#write memory
Building configuration...
[OK]
IOS-XE#Checking running-config and startup-config
You can check the configuration before and after saving with show running-config and show startup-config respectively.
show running-config
show startup-configshow running-config shows the currently active configuration in memory, while show startup-config shows the saved boot configuration. Before saving, the two differ, but they match after running copy running-config startup-config (or write memory).
IOS-XE#show running-config | include hostname
hostname IOS-XE
IOS-XE#
IOS-XE#show startup-config | include hostname
hostname Router
IOS-XE#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
IOS-XE#
IOS-XE#show running-config | include hostname
hostname IOS-XE
IOS-XE#show startup-config | include hostname
hostname IOS-XE
IOS-XE#Before saving, the startup-config still has the old hostname (Router), but after saving it’s updated to IOS-XE, matching the running-config.