Course contents

Chapter 1: Cisco IOSLesson 5 of 10

Saving and managing configurations

Running vs. startup config, saving, erasing and restoring, and backing configurations up.

Beginner · 8 min read

Technical definition

Running-config and startup-config hold the active settings in RAM and the saved settings in NVRAM. Configuration changes affect running-config. Copy it to startup-config to keep those changes after a reload.

Where IOS keeps your files

LocationContainsPersistence
RAMrunning-configLost at power-off or reload
NVRAMstartup-configRetained without power
FlashIOS image and local backupsRetained without power
Backup serverOff-device backupsRetained if the network device is replaced

Why live changes and a saved copy are kept apart

Applying changes instantly while keeping a separate saved copy gives you a built-in safety net. If a change goes badly (for example you lock yourself out of a remote router), a reload brings back the last saved configuration. Engineers working on a distant site sometimes schedule a reload with reload in 10 before a risky change, and cancel it with reload cancel once they know the change worked.

The boot sequence, from POST to prompt

IOS boot flow with a saved-configuration decisionPower on, run the power-on self-test and load IOS. If a saved configuration is available and not bypassed, load it and continue to login. Otherwise offer the setup dialog, which can be completed or declined to reach the CLI.12Power onRun POSTLoad IOSUse savedconfiguration?Load startup-configOffer setup dialogContinue to loginContinue setup or CLIPower-on self-testStart the operating systemSaved settings become activeComplete it or answer noYesNo
If the saved configuration is missing or bypassed, IOS offers setup. This simplified lab flow omits platform-specific provisioning.

In the classic IOS lab shown here, if the saved configuration is missing or bypassed, IOS can ask: Would you like to enter the initial configuration dialog? [yes/no]:. Answer no and configure the device yourself. The classic IOS router also checks a setting called the configuration register. The normal value 0x2102 means "load startup-config". The value 0x2142 means "ignore it", which is how password recovery can bypass the saved settings on that platform. These register values are not universal IOS XE switch commands.

Catalyst 9000 uses different boot controls

For a Catalyst 9200 running IOS XE 17.15.x, check the platform's boot settings rather than copying R1's register command. Catalyst 9000 switches use dedicated boot commands and ROMMON variables. A saved configuration can exist while a startup-configuration bypass is enabled; saving the file again does not by itself clear that bypass.

show version show boot show romvar

Read-only privileged EXEC checks on the Catalyst 9000 example: identify model/release, inspect boot settings and look for SWITCH_IGNORE_STARTUP_CFG. show romvar is supported from IOS XE 16.10.1; use the guide for the exact model and release.

If SWITCH_IGNORE_STARTUP_CFG=1 is present, investigate why the switch is bypassing its saved file. Confirm the intended configuration and follow the release-specific recovery procedure before changing boot controls or reloading. Do not erase a valid startup configuration just because it was not loaded.

References: Catalyst 9000 boot-control equivalents and Catalyst 9200 IOS XE 17.15.x recovery guide.

Viewing, saving, erasing and backing up

R1 uses classic IOS 15.9-style examples below; switch VLAN-file examples describe a legacy Catalyst IOS lab. The Catalyst 9200 boot checks above are a separate IOS XE 17.15.x example. These are authored commands and outputs, not device captures.

Look at the configurations

show running-config show startup-config show running-config | section interface show running-config interface GigabitEthernet0/1

Privileged EXEC. The filtered forms save scrolling through hundreds of lines.

Save

copy running-config startup-config

Copies RAM to NVRAM. The order is always copy <from> <to>. write memory does the same.

Will your change survive a restart?

You renamed R1 to R1-Branch. Choose what happens next.

Choose how to restart the router
Working memory, saved memory and the restarted routerRAM contains hostname R1-Branch before restart. NVRAM contains hostname R1-Branch. The restarted router uses hostname R1-Branch.RAMNVRAMrunning-configstartup-configR1-BranchR1-BranchSavedAfter restartR1-Branch

Your new hostname survives

R1-Branch was copied to NVRAM before the restart.

Erase and start again

erase startup-config delete flash:vlan.dat reload

Erase NVRAM (write erase is the same). On a switch, also delete the VLAN database. At the reload prompt, answer no to saving, or you write the old configuration back.

Back up and restore with TFTP

TFTP (Trivial File Transfer Protocol, UDP port 69) is a very simple file transfer protocol with no login and no encryption. It is still common for configuration backups inside a trusted network. FTP and SCP work the same way with ftp: and scp:. See FTP, SFTP and TFTP.

Diagram
Backing up R1's configuration to a TFTP server
Backing up R1's configuration to a TFTP server
Gi0/1Gi1/0/24Gi1/0/10R1Gi0/1 192.168.10.1SW1Vlan1 192.168.10.2TFTP serverIP 192.168.10.50

Device key: R1 (router) · SW1 (switch)

Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • R1: Gi0/1 192.168.10.1
  • SW1: Vlan1 192.168.10.2
  • TFTP server: IP 192.168.10.50
  1. 1. copy running-config tftp: R1 asks to write a file and sends the configuration in numbered blocks (UDP 69 to start the transfer).
  2. 2. Each block is acknowledged. The server confirms every block; IOS prints a ! for progress.
  3. 3. copy tftp: running-config Restoring pulls the file back and merges it into the running configuration.
copy running-config tftp: copy startup-config flash:r1-backup.cfg copy tftp: running-config copy tftp: startup-config

Back up off the box, back up locally, merge a file into the live config, or replace the saved config (it takes effect at the next reload).

A backup taken just before a change window, as well as the scheduled ones, means the file to roll back to is minutes old rather than weeks old.

Choose the restore destination

Diagram
Choose the restore destination before copying the file
Choose the restore destination before copying the file
Choose the restore destination before copying the fileCopying a backup to running-config merges commands into the active configuration. Copying it to startup-config changes the saved startup configuration, not the currently running configuration; a planned reload loads it. Neither copy should be confused with a configuration replace operation.Backup fileApply commands nowcopy tftp: running-configMerges into live settings.Unmentioned settings may remain.Change the saved startup copycopy tftp: startup-configLive settings stay as they are.Loaded at the next planned reload.
IOS / IOS XE conceptual workflow. Keep a backup and console or out-of-band access. Review the file and plan reload impact before restoring a real device.

Restoring into running-config merges settings

In this example, the backup changes R1's hostname. It contains no interface settings, so the existing interface description remains. Copying a file into running-config applies its commands to the current configuration; it does not replace the entire file.

A backup updates the hostname and keeps existing interface settingsThe backup server provides a file containing hostname R1-Branch. Copying it into R1's running configuration updates the hostname. The existing LAN to SW1 description on GigabitEthernet0/1 is retained.backup.cfgR1 · after restorehostnameR1-BranchApply backupR1-BranchBackup serverOnly hostname in this filecopy tftp: running-configWhat changes on R1?hostname R1-BranchUpdated from the backupdescription LAN to SW1Existing setting kept on Gi0/1
The file changes the hostname. It has no interface commands, so the LAN description stays. Illustrative configurations, not device captures.

Confirming the save and the backup worked

Example output · based on Cisco documentation; exact format varies by platform and software version
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Press Enter to accept the default name. [OK] means NVRAM now matches RAM.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show startup-config
Using 1843 out of 262144 bytes
!
version 15.9
service password-encryption
!
hostname R1
!
...
The first line confirms there is a saved configuration and how much NVRAM it uses. If NVRAM is empty you see startup-config is not present instead.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#copy running-config tftp:
Address or name of remote host []? 192.168.10.50
Destination filename [r1-confg]?
!!
1843 bytes copied in 0.204 secs (9034 bytes/sec)
IOS suggests a file name made from the hostname plus -confg. Each ! is a successful block. A row of dots and an error mean the server is unreachable or not running.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#reload
System configuration has been modified. Save? [yes/no]: yes
Building configuration...
[OK]
Proceed with reload? [confirm]
A last chance: IOS warns you when running-config differs from startup-config. Answer no if you are deliberately going back to the saved configuration.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show version | include register
Configuration register is 0x2102
R1's classic IOS example: this register permits loading the saved configuration during normal boot. This line is not a universal Catalyst 9000 boot check.

Lost configs, half-restored files and failed transfers

  • Configuration gone after a reload. It was never saved, or startup loading was bypassed. On the classic IOS R1 example, check for 0x2142 with show version; the normal register in this lab is 0x2102. On Catalyst 9000, inspectshow boot and show romvar instead. Identify the platform and preserve the valid saved file before choosing a recovery procedure.
  • A restored file left old settings behind. Copying to running-config merges. Old lines that aren't in the file remain. Copy to startup-config and reload for a clean replace.
  • Restored interfaces are shut down. When you merge into running-config, interfaces that are currently shut stay shut unless the file contains no shutdown, which saved files don't show by default. Bring them up by hand.
  • TFTP copy fails with timeouts. Ping the server, check that the TFTP service is running and that a firewall allows UDP 69 (and the high ports the transfer then uses).
  • A wiped switch still has its VLANs. The VLAN database (vlan.dat in flash) wasn't deleted.

Test yourself on saving and restoring

Predict · scenario 1

You configure a new static route on R1 and test it successfully. The router then loses power. Is the route there after it boots?

Predict · scenario 2

Which command saves the active configuration so it survives a reload?

Predict · scenario 3

You run 'copy tftp: running-config' with a file that has no 'ip domain name' line. The router already has one. What happens to it?

Predict · scenario 4

After 'erase startup-config' and 'reload' a switch boots with no hostname, but all its old VLANs are still there. Why?

Predict · scenario 5

The classic IOS R1 lab keeps booting into the initial configuration dialog even though show startup-config shows a valid saved config. What should you check?

Predict · scenario 6

A Catalyst 9200 running IOS XE 17.15.x has a valid startup-config but bypasses it. What is the next diagnostic step?