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 |
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.
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#
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) |
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
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#
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#
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#
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
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.
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#
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>
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 ...
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
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-configandwrite memory(wr) are identical — both copy RAM → NVRAM.erase startup-configclears NVRAM but does not affect the running-config in RAM — changes remain active until reload.- On Cisco switches,
erase startup-configdoes not removevlan.dat— it must be deleted separately withdelete 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-configmerges — existing lines not in the file remain active. Copying tostartup-configthen 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 versionshows the configuration register value — after password recovery it is sometimes left at0x2142(bypass startup-config). Reset to0x2102withconfig-register 0x2102after 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).