copy running-config startup-config
Saves the current running configuration to the startup configuration file in NVRAM, ensuring changes persist after a router reload.
Definition: copy running-config startup-config is a Cisco IOS privileged exec command. Saves the current running configuration to the startup configuration file in NVRAM, ensuring changes persist after a router reload.
Overview
The `copy running-config startup-config` command is one of the most fundamental and frequently used commands in Cisco IOS. Its primary purpose is to save the current running configuration (the active configuration in RAM) to the startup configuration file stored in NVRAM (non-volatile RAM). This ensures that after a router or switch reloads (reboots), the configuration changes you made during the current session are preserved and automatically applied.
Without this command, any changes made to the running configuration are lost upon reload, reverting to the last saved startup configuration. This command is critical for network engineers because it bridges the gap between temporary, in-memory changes and persistent, non-volatile storage. The underlying concept is the separation of running and startup configurations in Cisco IOS.
The running configuration is the live configuration that the device is currently using, while the startup configuration is the configuration that is loaded during boot. This separation allows engineers to test changes without permanently committing them; if a change causes issues, the device can be reloaded to revert to the previous stable startup configuration. You would reach for this command after making any configuration change that you intend to keep, such as adding VLANs, configuring routing protocols, setting passwords, or modifying interfaces.
Alternatives include `write memory` (a legacy alias that does the same thing) and `copy system:running-config nvram:startup-config` (the full syntax). In modern IOS, `write memory` is still accepted but `copy running-config startup-config` is the preferred, more explicit form. This command fits into the broader configuration workflow as the final step after making changes: you enter configuration mode, apply changes, verify them with `show` commands, and then save with `copy running-config startup-config`.
Important IOS behaviors: the command is available only in privileged EXEC mode (enable mode). It does not require any configuration mode. The output is buffered; the command executes and returns a confirmation message like `[OK]` or `Destination filename [startup-config]?` if you use the full syntax.
If the startup configuration file does not exist, it creates one. The command has no impact on the running configuration itself; it only copies it to NVRAM. Privilege level 15 is required (default enable password).
In some IOS versions, the command may prompt for confirmation if the destination file already exists. It is good practice to verify the save with `show startup-config` afterward. This command is also used in scripts and automation to ensure configurations are saved before reloads or maintenance windows.
Understanding this command is essential for CCNA and CCNP candidates because it is tested in both written and lab exams, and it is a daily task for network engineers. Failure to save configurations is a common cause of network outages after reboots. The command is simple but its implications are profound: it is the difference between a temporary test and a permanent network change.
copy running-config startup-configWhen to Use This Command
- After making configuration changes to a router, save them so they survive a reboot.
- Before performing a critical upgrade or maintenance, back up the current configuration.
- When deploying a new router, save the initial configuration to make it permanent.
- After troubleshooting and applying a fix, save the working configuration to avoid losing the fix.
Command Examples
Basic save of running config to startup config
copy running-config startup-configDestination filename [startup-config]? Building configuration... [OK]
The router prompts for confirmation of the destination filename (default is startup-config). Press Enter to accept. 'Building configuration...' indicates the config is being written to NVRAM. '[OK]' confirms success.
Saving with explicit destination filename
copy running-config nvram:startup-configDestination filename [startup-config]? Building configuration... [OK]
Specifying 'nvram:startup-config' explicitly does the same as the default. The output is identical. This variant is useful in scripts or when you want to be explicit.
Understanding the Output
The output of 'copy running-config startup-config' is minimal. The router first prompts 'Destination filename [startup-config]?' — simply press Enter to accept the default. Then it displays 'Building configuration...' while it compresses and writes the configuration to NVRAM.
Finally, '[OK]' indicates success. If the command fails (e.g., NVRAM full), you'll see an error like '%Error copying running-config to startup-config (insufficient space)'. Always verify with 'show startup-config' after saving to ensure the configuration is correct.
Configuration Scenarios
Saving configuration after adding a new VLAN on a switch
A network administrator has added a new VLAN (VLAN 100) to a Cisco switch for a new department. The change is currently in the running configuration but needs to be saved to survive a reload.
Topology
Switch1 (VLAN 100 configured)Steps
- 1.Step 1: Enter privileged EXEC mode: Switch> enable
- 2.Step 2: Verify the running configuration includes the new VLAN: Switch# show running-config | include vlan 100
- 3.Step 3: Save the running configuration to startup configuration: Switch# copy running-config startup-config
- 4.Step 4: Confirm the save: Switch# show startup-config | include vlan 100
! No configuration mode needed; command is executed in privileged EXEC Switch# copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]
Verify: Switch# show startup-config | include vlan 100 vlan 100 name Engineering
Watch out: If the switch has multiple configuration files (e.g., in a stack), the command saves to the startup config of the active switch. Ensure you are on the correct switch.
Saving configuration after modifying OSPF on a router
A network engineer has changed the OSPF router ID and added a network statement on a router. The changes must be saved to ensure they persist after a planned power outage.
Topology
R1 (Gi0/0) --- 10.1.1.0/30 --- (Gi0/0) R2Steps
- 1.Step 1: Enter privileged EXEC mode: Router> enable
- 2.Step 2: Verify the OSPF changes: Router# show running-config | section router ospf
- 3.Step 3: Save the configuration: Router# copy running-config startup-config
- 4.Step 4: Verify the saved configuration: Router# show startup-config | section router ospf
Router# copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]
Verify: Router# show startup-config | section router ospf router ospf 1 router-id 1.1.1.1 network 10.1.1.0 0.0.0.3 area 0
Watch out: If the router has a large configuration, the save may take a few seconds. Do not reload the router during the save process, as it can corrupt the startup configuration.
Troubleshooting with This Command
The `copy running-config startup-config` command is not typically used for troubleshooting network issues directly, but it plays a crucial role in the troubleshooting workflow. A healthy execution of this command results in a confirmation message like `[OK]` and no errors. If the command fails, common indicators include error messages such as `%Error opening nvram:/startup-config (Permission denied)` or `%Error copying running-config to startup-config (Not enough space)`.
The first error suggests a file system issue or insufficient privileges; ensure you are in privileged EXEC mode with level 15 access. The second error indicates that NVRAM is full; you may need to delete old files or upgrade hardware. Another problem is when the command appears to succeed but the startup configuration is not updated; this can happen if the device is in a stack or virtual chassis and the command only saves to the active member.
Verify with `show startup-config` to ensure the changes are present. This command helps diagnose configuration persistence issues: if after a reload the device loses changes, the root cause is often that the running configuration was not saved. To troubleshoot, check the timestamp of the startup configuration with `dir nvram:` or `show file information nvram:startup-config`.
If the timestamp is older than the changes, the save was not performed. Another common symptom is that the device boots with a blank configuration or factory defaults; this indicates that the startup configuration is missing or corrupted. In such cases, you can try to recover from a backup or use `copy tftp: startup-config` to restore.
The step-by-step diagnostic flow: 1) After making changes, run `copy running-config startup-config`. 2) Immediately verify with `show startup-config` to confirm the changes are saved. 3) If the save fails, check NVRAM space with `show file systems` and look for `nvram:` size and free space. 4) If NVRAM is full, delete unnecessary files with `delete nvram:filename`. 5) If permission errors occur, check if the device is in ROMMON or if the configuration register is set to ignore startup config (0x2142). 6) After a reload, if changes are lost, check the configuration register with `show version`; if it is 0x2102, the device should load startup config. If it is 0x2142, it bypasses startup config. Correlate this command with `show running-config` and `show startup-config` to compare configurations.
Use `diff` tools or manually compare sections. Also, use `debug` commands like `debug file nvram:` to trace file operations, but this is rarely needed. In summary, while not a direct troubleshooting tool, this command is essential for ensuring that troubleshooting fixes are permanent.
CCNA Exam Tips
CCNA exam tip 1: The 'copy running-config startup-config' command is often abbreviated as 'wr' (write memory) on older IOS, but the full command is tested.
CCNA exam tip 2: Remember that 'copy running-config startup-config' overwrites the entire startup config; there is no merge.
CCNA exam tip 3: The exam may ask which command ensures configuration persists after reload — this is the correct answer.
CCNA exam tip 4: In the exam, you might need to identify the correct mode (Privileged EXEC) to execute this command.
Common Mistakes
Mistake 1: Typing 'copy startup-config running-config' instead — this loads startup config into running config, overwriting current changes.
Mistake 2: Forgetting to save after making changes — the router will lose all changes on reload.
Mistake 3: Using 'copy running-config startup-config' from User EXEC mode (>) instead of Privileged EXEC (#) — the command will be rejected.
copy running-config startup-config vs copy startup-config running-config
The commands 'copy running-config startup-config' and 'copy startup-config running-config' are commonly confused because they both transfer configuration between the same two files but in opposite directions. Understanding the direction is critical: one saves the active config to NVRAM, the other loads the saved config into memory.
| Aspect | copy running-config startup-config | copy startup-config running-config |
|---|---|---|
| Source → Destination | running-config → startup-config | startup-config → running-config |
| Persistence after reload | Changes are persistent | Changes are not persistent (unless saved) |
| Impact on active configuration | No immediate effect; activates after reload | Immediately overwrites running config |
| Typical use | Save ongoing changes | Restore previous saved state or undo changes |
| Precedence after reload | Sets the startup config to be used | Does not affect startup config |
Use copy running-config startup-config when you have made changes to the running configuration and want them to survive a reload.
Use copy startup-config running-config when you want to revert the active configuration to the last saved state without rebooting the device.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches, ISR 4000 routers), the `copy running-config startup-config` command works identically to classic IOS. However, IOS-XE often uses a unified file system, and the startup configuration may be stored in a different location (e.g., `nvram:startup-config` or `bootflash:startup-config`). The command syntax remains the same.
In NX-OS (Cisco Nexus switches), the equivalent command is `copy running-config startup-config` as well, but NX-OS also supports `copy run start` as a shorthand. Additionally, NX-OS has a `copy running-config startup-config vdc` variant for virtual device contexts. On Cisco ASA firewalls, the command is `write memory` or `copy running-config startup-config`; both are accepted.
ASA stores the startup configuration in disk0: or flash: as `startup-config`. In IOS-XR (Cisco ASR 9000, CRS), the command is different: the running configuration is saved with `commit` in configuration mode, and the startup configuration is managed with `copy running-config nvram:startup-config` or `save` commands. IOS-XR does not use the same `copy running-config startup-config` syntax; instead, you use `commit` to save changes to the candidate configuration and then `copy running-config nvram:startup-config` to persist.
For IOS versions, the command has been consistent from 12.x through 15.x and 16.x. In very old IOS (11.x), `write memory` was the primary command, but `copy running-config startup-config` was also available. In IOS 15.x and later, the command may prompt for the destination filename if not specified; you can press Enter to accept the default.
In IOS-XE 16.x, the behavior is the same. There are no significant syntax differences between versions, but the output messages may vary slightly (e.g., `Building configuration...` vs `[OK]`). Always verify with `show startup-config` after saving.
Related Commands
copy startup-config running-config
Copies the saved startup configuration (startup-config) into the active running configuration (running-config), effectively restoring the device to the state saved in NVRAM without a reboot.
show running-config
Displays the current active configuration in DRAM, showing all non-default settings.
show startup-config
Displays the saved configuration stored in NVRAM that loads on next device boot.
write memory
Saves the current running configuration to the startup configuration in NVRAM, ensuring changes persist after a reload.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions