Routelearn.net
Course menu

Course 1: Cisco IOSLesson 1.3 (3 of 5 in this course)3 of 91 in the CCNA series

Saving and managing configurations

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

Beginner · 8 min read

Running-config and startup-config are the two configurations of a Cisco IOS device. The running-config is the active configuration held in RAM and changes as soon as a command is entered; the startup-config is the saved copy in NVRAM that the device loads when it boots.

In simple terms: What you type takes effect right away but lives only in memory that is lost when the power goes off. Saving copies it to storage the device reads again the next time it starts.

A real-life situation

You spend an hour setting up R1. Everything works. That night a power cut reboots the router, and in the morning it is back to Router> with no addresses and no passwords. Nothing was broken: the configuration was simply never saved. Knowing where IOS keeps its configuration, and when it reads it, prevents this mistake.

What running-config and startup-config are

A Cisco device has two configurations at any time:

  • running-config: the active configuration, held in RAM (the device's working memory). Every command you type in configuration mode changes it immediately.
  • startup-config: the saved configuration, held in NVRAM (non-volatile RAM, memory that keeps its contents without power). The device reads it once, at boot.

The IOS software itself is a file in flash memory. Backups can live in flash too, or better, on a server somewhere else.

RAM
running-config
What the device is doing now. Lost at power-off or reload.
NVRAM
startup-config
Loaded into RAM at boot. Survives power-off.
Flash
IOS image, backup files
The operating system and any files you save. Survives power-off.
TFTP / FTP / SCP server
off-box backups
Survives even if the device is replaced.
RAM→NVRAMcopy running-config startup-configSave your changes (same as write memory).
NVRAM→RAMreloadAt boot, startup-config is copied into RAM.
RAM→TFTPcopy running-config tftp:Back up the live configuration off the device.
TFTP→RAMcopy tftp: running-configMerge a saved file into the live configuration.
RAM→Flashcopy running-config flash:backup.cfgKeep a local copy before a risky change.
A dashed border means the contents are lost at power-off. The copy command always reads: copy <from> <to>.

Why it works that way

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.

How it works step by step: the boot sequence

POST
Power-on self-test checks the hardware
Bootstrap
A small program in ROM finds and loads IOS
Load IOS
Usually from flash, into RAM
Load startup-config
From NVRAM, copied into RAM as running-config
No startup-config?
IOS offers the initial configuration dialog (setup mode)
What a router or switch does from power-on to prompt.

If NVRAM is empty, IOS asks: Would you like to enter the initial configuration dialog? [yes/no]:. Answer no and configure the device yourself. The 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 works.

How to manage it on Cisco IOS

⚠️ Based on Cisco IOS / IOS XE documentation, not run on a lab device.

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.

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.

Gi0/1Gi1/0/24Gi1/0/10R1Gi0/1 192.168.10.1SW1Vlan1 192.168.10.2TFTP server192.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).

How to verify it

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
Normal boot: IOS will load the startup configuration.

What goes wrong and how to troubleshoot it

  • Configuration gone after a reload. It was never saved, or the configuration register is 0x2142 (left over from password recovery). Check with show version; set it back with config-register 0x2102.
  • 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.

Common mistakes

  • Reversing the copy order, for example copy startup-config running-config when you meant to save. That merges the old saved config into the live one.
  • Answering yes to "Save?" after erase startup-config, which writes everything straight back.
  • Thinking erase startup-config changes the running device. It doesn't, until the next reload.
  • Keeping the only backup in the device's own flash. If the device dies, so does the backup.

💡 Exam tip: know which memory holds what: RAM = running-config, NVRAM = startup-config, flash = IOS image, ROM = bootstrap and POST. Know that copy is always source then destination, that copying into running-config merges, and that erase startup-config plus reload returns a router to defaults (a switch also needs vlan.dat deleted).

Key takeaways

  • Changes go live in running-config (RAM) instantly; only startup-config (NVRAM) survives a reload.
  • copy running-config startup-config saves; write memory is the same.
  • erase startup-config + reload resets a device; delete vlan.dat on a switch.
  • Back up off the device with TFTP, FTP or SCP; copying into running-config merges rather than replaces.

Check yourself

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

A router keeps booting into the initial configuration dialog even though show startup-config shows a valid saved config. What should you check?

FAQ

What is the difference between running-config and startup-config?
running-config is the configuration the device is using right now, held in RAM. Every command you type changes it at once. startup-config is the saved copy in NVRAM that is loaded at boot. If you don't copy running-config to startup-config, your changes are lost at the next reload or power cut.
Is write memory the same as copy running-config startup-config?
Yes, both save the running configuration to NVRAM. write memory (often shortened to wr) is the older command and still works on IOS and IOS XE. copy running-config startup-config is the form Cisco documents and the exam uses.
Does copying a file into running-config replace the configuration?
No, it merges. Each line in the file is applied as if you typed it, on top of what is already there. Commands that are in the running configuration but not in the file stay. To replace the whole configuration, copy the file to startup-config and reload, or use configure replace.
How do I wipe a switch back to factory settings?
Erase the startup configuration (erase startup-config or write erase), delete the VLAN database file (delete flash:vlan.dat), then reload and answer no when asked to save. On a switch, VLANs are kept in vlan.dat, not in the startup configuration, so erasing only the startup-config leaves them behind.