Saving & Managing Cisco Configurations

Every change you make on a Cisco router or switch takes effect immediately in the running configuration — but it lives only in RAM. The moment the device loses power or is reloaded, every unsaved change is gone. Understanding where configurations are stored, how to save them, how to back them up off-device, and how to recover after a factory reset are essential operational skills for any network engineer — and tested knowledge on the CCNA 200-301 exam.

This lab builds on Hostname, Password, and Banner Configuration and SSH Configuration. All the work done in those labs is at risk until properly saved and backed up.

1. Cisco Device Memory — Where Everything Lives

Cisco IOS devices use four distinct types of memory. Understanding what is stored in each is the foundation of configuration management:

Memory Type Contents Volatile? Cleared by reload?
RAM Running configuration, routing tables, ARP cache, active processes ✅ Yes ✅ Yes — all RAM contents are lost on reload or power loss
NVRAM Startup configuration (startup-config) ❌ No ❌ No — survives reload and power loss
Flash IOS operating system image, vlan.dat ❌ No ❌ No — survives reload and power loss
ROM Bootstrap program, ROMMON (recovery mode), POST ❌ No ❌ No — permanent read-only firmware
The golden rule: RAM holds what the device is currently doing. NVRAM holds what it will load next time it boots. If these two are not synchronized (by saving), a reload will revert every unsaved change.

2. running-config vs startup-config

These are the two most important configuration files on any Cisco IOS device:

Feature running-config startup-config
Location RAM NVRAM
When active Always — this is what the device uses right now Only at boot — loaded into RAM when the device starts
Effect of changes Immediate — every command takes effect instantly No effect until next reload
Survives reload? ❌ No — lost unless saved to startup-config ✅ Yes — persists across reboots
View command show running-config show startup-config
Erase command no [command] to remove individual lines erase startup-config or write erase

Viewing Both Configurations

NetsTuts_R1#show running-config
Building configuration...

Current configuration : 1482 bytes
!
version 15.4
!
hostname NetsTuts_R1
!
enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
!
username admin privilege 15 secret 5 $1$mERr$9kB2zPXvMqAw1yJhL3eRd.
!
ip domain-name netstuts.com
ip ssh version 2
!
interface GigabitEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 no shutdown
!
line vty 0 4
 login local
 transport input ssh
!
end
  
show running-config displays the active configuration from RAM. Every line shown is currently in effect.
NetsTuts_R1#show startup-config
Using 1482 bytes
!
version 15.4
!
hostname NetsTuts_R1
...
  
show startup-config displays what is saved in NVRAM. If this does not match show running-config, there are unsaved changes.
Quick check — are they in sync? Run both commands and compare. If show startup-config shows "startup-config is not present" or is missing recent changes visible in show running-config, you have unsaved work.

3. Saving the Configuration

Saving copies the running-config from RAM into NVRAM as the startup-config. There are two equivalent commands — both do exactly the same thing:

Method 1: copy running-config startup-config

NetsTuts_R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
NetsTuts_R1#
  
Press Enter to accept the default destination filename. "[OK]" confirms the save was successful.

Method 2: write memory (shorthand)

NetsTuts_R1#write memory
Building configuration...
[OK]
NetsTuts_R1#
  
write memory (or just wr) is the shorthand equivalent. Both methods produce the same result — the running-config is written to NVRAM.
Command Shorthand Result
copy running-config startup-config copy run start Saves RAM → NVRAM
write memory wr Saves RAM → NVRAM (identical result)
When to save: Save after every configuration change — not just at the end of a long session. An unexpected power cut between changes and a save loses everything since the last save.

4. Backing Up Configuration to a TFTP Server

Saving to NVRAM protects against reloads, but the device itself could fail — hardware fault, theft, or accidental factory reset. Backing up to an external TFTP server provides an off-device copy that can be restored to any replacement device. This is standard practice in enterprise environments.

Lab Topology for TFTP Backup

  [NetsTuts_R1] ──────────────── [TFTP Server]
  Gi0/0: 192.168.1.1/24          IP: 192.168.1.100
  

Step 1: Verify Connectivity to the TFTP Server

NetsTuts_R1#ping 192.168.1.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
  
Always ping the TFTP server before attempting a backup. A failed transfer is most commonly caused by a connectivity issue, not a configuration error.

Step 2: Copy Running-Config to TFTP

NetsTuts_R1#copy running-config tftp:
Address or name of remote host []? 192.168.1.100
Destination filename [NetsTuts_R1-confg]? NetsTuts_R1-backup-2025.cfg
!!
1482 bytes copied in 0.456 secs (3250 bytes/sec)
NetsTuts_R1#
  
IOS prompts for the TFTP server IP and the destination filename. Press Enter to accept the default filename or type a custom name. The exclamation marks confirm successful block transfers.

Step 3: Verify the Backup File on the TFTP Server

On the TFTP server (e.g., SolarWinds TFTP, Tftpd64, or a Linux server), confirm the file NetsTuts_R1-backup-2025.cfg exists in the TFTP root directory and its size matches the bytes reported by IOS.

Also Back Up the Startup-Config

NetsTuts_R1#copy startup-config tftp:
Address or name of remote host []? 192.168.1.100
Destination filename [NetsTuts_R1-confg]? NetsTuts_R1-startup-2025.cfg
!!
1482 bytes copied in 0.421 secs (3518 bytes/sec)
NetsTuts_R1#
  
Best practice is to back up both running-config and startup-config separately — especially after confirming they are in sync with a save.

Backup Command Reference

Source Destination Command
Running-config (RAM) TFTP server copy running-config tftp:
Startup-config (NVRAM) TFTP server copy startup-config tftp:
Running-config (RAM) USB drive copy running-config usbflash0:
IOS image (Flash) TFTP server copy flash: tftp: — see IOS Upgrade via TFTP

5. Restoring Configuration from TFTP

To restore a backed-up configuration — whether to the same device after a reset or to a replacement device — copy the file from TFTP back to the device.

Restore to Running-Config (Merge)

NetsTuts_R1#copy tftp: running-config
Address or name of remote host []? 192.168.1.100
Source filename []? NetsTuts_R1-backup-2025.cfg
Destination filename [running-config]?
Accessing tftp://192.168.1.100/NetsTuts_R1-backup-2025.cfg...
Loading NetsTuts_R1-backup-2025.cfg from 192.168.1.100 (via GigabitEthernet0/0):
!!
[OK - 1482 bytes]

1482 bytes copied in 0.512 secs (2895 bytes/sec)
NetsTuts_R1#
  
Copying to running-config merges the file with the existing configuration — it does not replace it. Commands in the file are applied on top of whatever is currently in RAM.

Restore to Startup-Config (Full Replace on Next Boot)

NetsTuts_R1#copy tftp: startup-config
Address or name of remote host []? 192.168.1.100
Source filename []? NetsTuts_R1-backup-2025.cfg
Destination filename [startup-config]?
!!
[OK - 1482 bytes]
NetsTuts_R1#reload
  
Copying to startup-config replaces NVRAM with the backup file. After reload, the device boots with the restored configuration. This is the clean method for a full restoration.
Merge vs Replace: Copying to running-config merges — existing lines not in the backup file remain active. Copying to startup-config and reloading is a full replacement — the preferred method for a clean restore.

6. Factory Reset — Erasing All Configuration

A factory reset wipes the device back to its out-of-box state. This is done when decommissioning a device, repurposing it, or recovering from a severe misconfiguration. There are two components to reset completely: the startup-config in NVRAM and (on switches) the VLAN database in flash.

Step 1: Erase Startup-Config

NetsTuts_R1#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
NetsTuts_R1#
  
Press Enter to confirm. This wipes NVRAM completely — the startup-config no longer exists. The running-config in RAM is unaffected until the device reloads.

Step 2: Delete vlan.dat (Switches Only)

On Cisco switches, VLAN data is stored separately in vlan.dat in flash memory. erase startup-config does NOT remove it — it must be deleted separately:

NetsTuts_SW1#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:/vlan.dat? [confirm]
NetsTuts_SW1#
  

Step 3: Reload

NetsTuts_R1#reload
System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm]

System Bootstrap, Version 15.4...
...
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]: no
NetsTuts_R1>
  
Answer no to "Save?" — saving before reload would recreate the startup-config from RAM, defeating the erase. After reload the device boots with no configuration and prompts for the initial setup dialog — answer no to enter the clean CLI.

Complete Factory Reset Checklist

Step Command What It Clears Routers Switches
1 erase startup-config NVRAM (startup-config)
2 delete flash:vlan.dat VLAN database N/A
3 reload → answer no to save RAM (running-config cleared on boot)

7. The copy Command — Full Reference

The copy command follows the format: copy [source] [destination]. The source and destination can be any of the following locations:

Location Keyword What It Refers To
running-config Active configuration in RAM
startup-config Saved configuration in NVRAM
tftp: TFTP server on the network
flash: Internal flash memory (IOS image, vlan.dat)
usbflash0: USB drive inserted in the device
ftp: FTP server (requires credentials)

Common copy Scenarios

Task Command
Save running-config to NVRAM copy running-config startup-config
Load startup-config into running-config copy startup-config running-config
Back up running-config to TFTP copy running-config tftp:
Restore config from TFTP to startup-config copy tftp: startup-config
Back up IOS image to TFTP copy flash: tftp:
Upgrade IOS from TFTP to flash copy tftp: flash:

8. Verification Commands

Command What It Shows When to Use
show running-config Full active configuration from RAM After every change — confirm the command took effect
show startup-config Saved configuration from NVRAM After saving — confirm the save was successful
show flash: Files stored in flash — IOS image, vlan.dat Verify flash contents and available space
show version IOS version, uptime, and config register value Identify IOS version and check if config register is set correctly after recovery
dir nvram: Files in NVRAM including startup-config Confirm startup-config exists or has been erased
dir flash: Flash directory listing with file sizes Verify backup files were written, confirm IOS image is present

Confirming a Successful Save

NetsTuts_R1#show startup-config
Using 1482 bytes
!
version 15.4
!
hostname NetsTuts_R1
!
enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
...
  
If show startup-config returns "startup-config is not present", the device has never been saved or was erased. Run wr immediately.

Confirming Erase was Successful

NetsTuts_R1#show startup-config
startup-config is not present
  
This message confirms erase startup-config completed successfully. NVRAM is empty — the device will boot with no configuration on next reload.

9. Troubleshooting Common Issues

Problem Cause Fix
Changes lost after reload Running-config was never saved to startup-config Always run wr after changes. Make it a habit: configure → verify → save.
TFTP transfer fails — "Error opening tftp://" TFTP server not reachable, firewall blocking UDP 69, or TFTP service not running Ping the TFTP server first. Verify TFTP service is running and the root directory is writable.
Restored config not fully applied Copied to running-config (merge) instead of startup-config + reload For a clean restore: copy to startup-config, then reload
VLANs reappear after factory reset erase startup-config does not delete vlan.dat from flash Also run delete flash:vlan.dat before reload on switches. See VLAN Creation Lab.
Device boots into setup dialog after reset No startup-config — IOS enters initial configuration dialog automatically Answer no to enter the normal CLI. Then restore from TFTP or reconfigure manually.
startup-config is not present after reload Device was reloaded without saving, or erase startup-config was run Reconfigure the device or restore from TFTP backup — this is why off-device backups are essential

Key Points & Exam Tips

  • The running-config lives in RAM and is lost on reload. The startup-config lives in NVRAM and survives power loss. Always save between them.
  • copy running-config startup-config and write memory (wr) are identical — both copy RAM → NVRAM.
  • erase startup-config clears NVRAM but does not affect the running-config in RAM — changes remain active until reload.
  • On Cisco switches, erase startup-config does not remove vlan.dat — it must be deleted separately with delete flash:vlan.dat.
  • Answer no to "Save?" during a factory reset reload — answering yes recreates the startup-config from RAM, undoing the erase.
  • Copying from TFTP to running-config merges — existing lines not in the file remain active. Copying to startup-config then reloading is a clean replace.
  • Always ping the TFTP server before initiating a backup or restore — connectivity is the most common cause of TFTP failure.
  • show version shows the configuration register value — after password recovery it is sometimes left at 0x2142 (bypass startup-config). Reset to 0x2102 with config-register 0x2102 after recovery.
  • Back up both running-config and startup-config to TFTP — and do it after every significant change, not just at the end of a project.
  • The four memory types on the exam: RAM (volatile, running-config), NVRAM (non-volatile, startup-config), Flash (non-volatile, IOS + vlan.dat), ROM (read-only, bootstrap/ROMMON).
Next Steps: With configuration management mastered, continue to the Switching section with Trunk Port Configuration (802.1Q). For VLAN-specific configuration storage, revisit VLAN Creation and Management. For a deeper look at what is in the running-config, see Show Running-Config.

TEST WHAT YOU LEARNED

1. An engineer spends two hours configuring VLANs, SSH, and ACLs on a switch. The switch loses power before any save command is run. What happens when power is restored?

Correct answer is B. The running-config lives in RAM — a volatile memory that is completely cleared when power is lost. On reboot, IOS loads the startup-config from NVRAM. Any changes made since the last copy running-config startup-config or wr are permanently lost. Always save after every change.

2. What is the key difference between copying a backup to running-config vs copying it to startup-config followed by a reload?

Correct answer is C. Copying to running-config merges the backup file with what is currently in RAM — lines already in the running-config but not in the backup file remain active. This can cause unexpected behavior. Copying to startup-config and then reloading gives a clean state — the device boots exclusively from the backup file.

3. An engineer runs erase startup-config and reload on a switch, answering "no" to save. After reload, show vlan brief still shows VLANs 10, 20, and 30. Why?

Correct answer is D. On Cisco switches, VLAN data is stored separately in vlan.dat in flash memory. erase startup-config only clears NVRAM. To fully reset a switch, you must also run delete flash:vlan.dat before reloading.

4. During a factory reset, the switch prompts "System configuration has been modified. Save? [yes/no]:". An engineer answers "yes". What is the result?

Correct answer is A. Answering "yes" writes the current running-config (still in RAM) back to NVRAM as startup-config. This recreates everything that was just erased. The device then reboots with that config — defeating the factory reset. Always answer no when performing a factory reset reload.

5. A TFTP backup attempt fails with "Error opening tftp://192.168.1.100/". The engineer can ping the TFTP server successfully. What should be checked next?

Correct answer is B. Since ping succeeds, IP connectivity is confirmed. The next most common cause of TFTP failure is the TFTP service not running, a firewall blocking UDP port 69, or the TFTP root directory not being writable. Verify the TFTP server application is active and the destination folder has write permissions.

6. What does show startup-config returning "startup-config is not present" indicate?

Correct answer is C. "startup-config is not present" means NVRAM is empty — either erase startup-config was run, or the device has never had a configuration saved. If the device reloads in this state, it will boot with no configuration and enter the initial setup dialog. Run wr immediately if you want to preserve the current running-config.

7. Which memory type stores the IOS operating system image and is non-volatile?

Correct answer is D. Flash memory stores the Cisco IOS image file (.bin) and is non-volatile — it survives power loss and reloads. NVRAM stores the startup-config. RAM stores the running-config and is volatile. ROM stores the bootstrap/ROMMON firmware and is read-only.

8. An engineer needs to upgrade the IOS image on a router by loading a new image from a TFTP server into flash. Which command starts this process?

Correct answer is A. copy tftp: flash: copies a file from the TFTP server to the device's flash memory — the correct direction for uploading a new IOS image. copy flash: tftp: is the reverse — backing up the current image to the TFTP server. Always verify flash has enough free space with show flash: before copying.

9. After a password recovery procedure, show version shows the configuration register is set to 0x2142. What problem will this cause on the next reload?

Correct answer is C. The configuration register value 0x2142 tells IOS to ignore the startup-config at boot — it is used during password recovery to bypass the saved configuration. If left at 0x2142, the device will skip startup-config on every subsequent reload. Always reset to 0x2102 using config-register 0x2102 after completing password recovery.

10. An engineer runs copy startup-config running-config. What is the result?

Correct answer is B. Copying startup-config to running-config merges the saved configuration into the active RAM configuration. It does not replace — lines in RAM that are not in the startup-config file remain active. This is different from a reload, which performs a complete replacement by booting fresh from startup-config.