Backing Up and Restoring Cisco IOS Device Configurations
Learn how Cisco IOS stores configurations and how to save, verify, back up, transfer, restore, and troubleshoot router and switch configuration files.
A Cisco IOS device uses more than one place to hold configuration information. The running configuration is active in RAM, while the startup configuration is saved for the next boot. Understanding this distinction prevents accidental loss of changes and makes recovery procedures safer.
This lesson covers local saves, flash and USB copies, TFTP transfers, authenticated transfer alternatives, verification, restoration, and operational backup practices. Basic IOS command modes, IPv4 addressing, interface configuration, and ping knowledge are assumed. For related fundamentals, see the computer networking and OSI reference model lessons.
How Cisco IOS Stores Configuration
The running-config is the active configuration currently held in volatile RAM. IOS uses it immediately to operate interfaces, routing protocols, access rules, management services, and other features.
The startup-config is the saved configuration normally stored in nonvolatile NVRAM. IOS reads it during boot and uses it to build the running configuration. If you change the running configuration but do not save it, the changes are normally lost after a reload or power failure.
Flash is persistent storage commonly used for IOS images and other local files. It can also hold an emergency configuration copy, although a file in flash is not automatically the startup configuration. Some platforms provide USB storage such as usbflash0:. Remote files may be stored on TFTP, FTP, or SCP servers.
| Location | Typical contents | Persistence | Common command usage | Operational notes |
|---|---|---|---|---|
running-config | Active device configuration | RAM; volatile | show running-config, copy running-config ... | Changes take effect immediately, but unsaved changes disappear after reload or power loss. |
startup-config | Boot configuration | NVRAM; nonvolatile | show startup-config, copy ... startup-config | Loaded during boot; does not necessarily match the current running configuration. |
flash: | IOS images and local files | Persistent flash storage | dir flash:, copy startup-config flash:backup.cfg | Useful for local copies, but available capacity and filenames vary by platform. |
nvram: | Startup configuration on platforms that expose NVRAM as a filesystem | Nonvolatile | dir nvram: | Filesystem visibility differs among IOS releases and hardware. |
usbflash0: | Files on a supported USB device | Removable persistent storage | dir usbflash0:, copy startup-config usbflash0:backup.cfg | Requires compatible hardware, filesystem, and IOS support. |
| Remote server location | Exported configuration backups | Depends on server storage | copy startup-config tftp: or supported FTP/SCP syntax | Requires network reachability, service availability, permissions, and suitable security controls. |
View and Verify the Current Configuration
Before making a backup, determine which configuration contains the intended state. Use these commands from privileged EXEC mode:
show running-config
show startup-config
show running-config displays the active configuration in RAM. show startup-config displays the saved boot configuration. Compare them when you need to find unsaved changes. On platforms that support it, show configuration or a platform-specific equivalent may expose configuration information in a different form; use show ? to inspect available commands.
Verify more than the text of the configuration. Confirm the device identity, management address, interface state, routing, and enabled services:
show running-config | section hostname
show ip interface brief
show interfaces <interface-id>
show ip route
show running-config | section interface
ping <server-address>
For a switch, also check the management VLAN interface and default gateway. A Layer 2 switch commonly uses an SVI for management:
interface vlan <management-vlan>
ip address <switch-management-ip> <subnet-mask>
no shutdown
exit
ip default-gateway <gateway-address>
The exact configuration depends on the platform. A routed switch may use a routed management interface and a routing table instead of ip default-gateway.
Save the Active Configuration Locally
After approved changes, save the active configuration so it will be available after the next reload:
copy running-config startup-config
IOS may ask for a destination filename. Press Enter to accept the displayed default, unless your platform or procedure requires another name. A successful operation normally displays a message indicating that the configuration was written or copied successfully.
The shortcut is:
write memory
write memory is widely recognized, but copy running-config startup-config is clearer for beginners because it explicitly shows the source and destination. After saving, verify the result:
show startup-config
Confirm that important recent changes, such as interface addresses, routing statements, VLAN settings, and management services, appear in the saved configuration.
Back Up to a TFTP Server
TFTP, or Trivial File Transfer Protocol, is a simple UDP-based file transfer service commonly used in labs and some legacy environments. TFTP typically uses UDP port 69 for the initial request. It provides little security, so do not treat it as a protected backup system.
Prerequisites
- The IOS device must be able to reach the TFTP server at Layer 3.
- You need the correct server address and a working route, or a correct default gateway.
- The TFTP service must be running and UDP port 69 and related return traffic must be permitted.
- The server must permit uploads and the destination directory must exist or be writable according to server policy.
- The server must have sufficient storage.
- The device management interface must have a valid IP address, subnet mask, and operational status.
Test reachability before starting the copy:
show ip interface brief
show ip route
ping <server-address>
On a switch, check the SVI, VLAN membership, and default gateway. On a router, check the relevant routed interface and route toward the server.
Interactive TFTP Copy
To back up the active configuration, enter:
copy running-config tftp:
To back up the saved boot configuration, enter:
copy startup-config tftp:
IOS usually prompts for the remote server address and destination filename. A typical workflow is:
Router# copy startup-config tftp:
Address or name of remote host []? <server-address>
Destination filename [router-confg]? branch-rtr-2026-08-16-startup-v1.cfg
Writing ... !!
[OK]
Use a descriptive, unique filename that identifies the device, date, site, and configuration version. For example, branch-rtr-2026-08-16-startup-v1.cfg is more useful than backup.cfg.
Noninteractive Syntax
Where supported by the IOS release, specify the server and filename in the source or destination URL:
copy running-config tftp://<server-address>/<backup-filename>
copy startup-config tftp://<server-address>/<backup-filename>
Syntax and prompts can differ by platform. Use copy ? when in doubt. Verify the transfer in two places: inspect the IOS completion message and confirm that the expected file exists in the TFTP server's configured directory. If your TFTP application provides transfer logs, check those as well.
Restore a Configuration from TFTP
Restoration is potentially disruptive. First obtain and inspect the source file. Pay particular attention to:
- Enable, console, local-user, and SSH credentials.
- Management interface addresses, VLANs, and default gateways.
- Physical interface addresses and shutdown states.
- Static routes and routing protocol settings.
- VLAN definitions and trunk or access settings.
- Access control lists, NAT, VPN material, and management restrictions.
Restore to the running configuration with:
copy tftp: running-config
Or, where supported:
copy tftp://<server-address>/<backup-filename> running-config
This applies the received commands immediately. It generally merges commands with the existing running configuration. It does not automatically erase every command that is absent from the source file. Therefore, an incorrect ACL, route, interface command, or service can remain unless the source contains an explicit negating command or you remove it separately.
Restore to the startup configuration with:
copy tftp: startup-config
Or:
copy tftp://<server-address>/<backup-filename> startup-config
This changes the configuration saved for boot. It does not normally change the current running configuration immediately. The restored startup configuration takes effect after a reload, unless you separately copy it into running-config or use a planned recovery procedure.
| Source | Destination | Result | When changes take effect | Key cautions |
|---|---|---|---|---|
running-config | startup-config | Saves active settings for boot | Already active; saved settings apply on the next boot | Ensure the current state is correct before saving. |
running-config | tftp:, flash:, or USB | Creates a backup copy | No device behavior change | Protect the resulting file and verify its location. |
startup-config | tftp:, flash:, or USB | Creates a backup of the boot configuration | No device behavior change | It may not contain recent unsaved changes. |
tftp: | running-config | Applies source commands to the active configuration | Immediately; configuration is merged | May change management access and may leave unwanted commands behind. |
tftp: | startup-config | Replaces the saved startup file on supported platforms | After reload, unless separately applied to RAM | Inspect the file and confirm boot behavior before reloading. |
Safe Restore Sequence
- Preserve the current known-good configuration by copying it to a uniquely named local or remote file.
- Inspect the candidate backup and confirm device model, IOS version, interfaces, addressing, routing, VLANs, credentials, and access rules are appropriate.
- Use console access or an out-of-band management path for a high-risk restoration. Out-of-band access is independent of the production network.
- Copy the file to the intended destination, understanding whether the operation merges into running-config or changes startup-config.
- Check the running configuration, interface status, routes, management reachability, and required services.
- Save only after validation. If a reload is required, schedule it with a recovery plan and a tested backup.
A restore can disconnect a remote session if it changes the management IP, management VLAN, route, ACL, SSH settings, or credentials. A configuration from another model or IOS release may also contain unsupported commands, different interface names, or feature syntax that requires adjustment.
Other Supported Copy Methods
IOS uses the copy command family to move configuration and image files among supported locations. Discover available filesystems and protocols with dir ? and copy ?.
copy startup-config flash:<backup-filename>
copy running-config flash:<backup-filename>
dir flash:
more flash:<backup-filename>
copy startup-config usbflash0:<backup-filename>
dir usbflash0:
Flash is convenient for an on-device emergency copy. USB is useful when the platform supports the device and filesystem. Both require physical or administrative protection because configuration files may contain sensitive information.
FTP supports authenticated file transfer on supported IOS platforms. SCP, or Secure Copy Protocol, uses SSH and encrypts the transfer in transit. Generic forms may include copy ... ftp: and copy ... scp:, but exact prompts, prerequisites, and URL syntax vary by IOS release and device platform. SCP commonly requires a functioning SSH configuration and suitable user authorization. Prefer authenticated and encrypted methods when permitted by the environment.
| Method | Authentication and encryption | Typical use case | Advantages | Limitations | IOS support considerations |
|---|---|---|---|---|---|
| TFTP | Minimal authentication; not encrypted | Labs and legacy workflows | Simple and widely understood | Weak security; UDP reachability and server permissions matter | Syntax and supported URL forms vary. |
| FTP | Username and password; encryption depends on implementation | Authenticated file transfer where supported | More access control than basic TFTP | Credentials and data may not be encrypted in transit | Check feature support and server configuration. |
| SCP | SSH authentication and encrypted transfer | More secure operational backups | Protects credentials and contents in transit | Requires SSH, compatible IOS features, and an SCP server | Platform, IOS release, and authorization requirements differ. |
| Flash | Local device access controls | Emergency local backup | Works without a network server | Lost with device damage or storage failure; limited capacity | Use dir flash: and check free space. |
| USB | Physical access controls; encryption depends on process | Portable offline copy | Useful when network access is unavailable | Removable media can be lost, unsupported, or corrupted | Check for usbflash0: and platform compatibility. |
Operational Backup Practices
- Back up before disruptive or high-risk changes.
- Back up after approved changes and confirm that the saved version is the intended one.
- Use a recurring schedule appropriate to the device's change frequency and business impact.
- Use consistent names containing device identity, site, date, and configuration version.
- Record the device model, IOS version, backup source type, and time of collection.
- Restrict repository access and apply retention policies and version tracking.
- Protect backups because they may contain credentials, SNMP community strings, VPN material, ACLs, topology details, and internal addresses.
- Use encryption at rest and encryption in transit where possible. Avoid exposing configuration files through an unrestricted TFTP service.
- Periodically test that backups can be read and restored in a controlled environment.
A configuration backup is sensitive operational data, not merely a text file. Store it in a controlled repository with auditability and an established retention and deletion process.
Verification and Troubleshooting
After a backup, confirm the correct source was copied and that the destination contains the expected file. After a restore, inspect the active or saved destination—not just the transfer message.
show running-config
show startup-config
show ip interface brief
show interfaces <interface-id>
show ip route
ping <server-address>
| Symptom or message | Likely cause | Verification command or check | Corrective action |
|---|---|---|---|
| TFTP transfer times out | No route, incorrect server address, down management interface, missing gateway, filtering, or stopped service | show ip interface brief, show ip route, ping <server-address>; check firewall and service | Correct addressing or routing, enable the interface, fix the gateway, permit required traffic, and start the TFTP service. |
| Unreachable host | Layer 3 connectivity or gateway problem | show ip route and ping | Correct the route, SVI, routed interface, subnet mask, or default gateway. |
| Backup cannot be created on the server | Uploads disabled, restrictive directory permissions, filename policy, or full storage | Review server logs, write permissions, destination directory, filename, and free space | Permit uploads to an approved directory, choose an allowed unique filename, or free storage. |
| File not found | Wrong filename, directory, server address, or case-sensitive path | List the server directory and compare the requested name | Use the exact server-side filename and permitted path. |
| Insufficient storage | Flash, USB, or server storage is full | dir flash:, dir usbflash0:, or server storage check | Remove obsolete files according to policy or use another destination. |
| Restored file does not remove incorrect settings | Copying into running-config merged commands; absent commands were not negated | Compare show running-config with the source file | Remove obsolete commands explicitly or use a planned replacement and validation procedure. |
| Remote connection drops | Restore changed management addressing, VLAN, route, ACL, SSH, or credentials | Use console or out-of-band access; inspect management configuration | Restore through a maintenance plan with an independent recovery path. |
| Copy destination or protocol is unavailable | Unsupported IOS feature, platform, filesystem, USB device, or missing FTP/SCP prerequisite | copy ?, dir ?, platform and IOS capability checks | Use a supported method such as flash or TFTP, or enable required secure-transfer prerequisites. |
| Device boots with an older configuration | Running changes were not saved, or startup-config was restored without reloading | Compare show running-config and show startup-config | Save the intended state and review boot-related behavior if the expected file is not loaded. |
Use TFTP debugging only in a controlled lab or maintenance window:
debug tftp
undebug all
Debug output can consume device resources and obscure other events. Disable debugging immediately after collecting useful evidence.
Practical Workflows
Save Changes Before a Reboot
show running-config
copy running-config startup-config
show startup-config
Check that the interface and routing changes appear in both the active and saved configurations before rebooting.
Create a Pre-Change TFTP Backup
show ip interface brief
show ip route
ping <server-address>
copy startup-config tftp://<server-address>/branch-rtr-2026-08-16-prechange-v1.cfg
If the active configuration contains unsaved changes that must also be preserved, export running-config instead. Confirm the file on the server before beginning the change.
Create a Local Emergency Copy
copy startup-config flash:branch-rtr-known-good.cfg
dir flash:
more flash:branch-rtr-known-good.cfg
This file is a separate flash backup. It does not replace startup-config unless you deliberately copy it to that destination.
Recover from an Incorrect ACL or Route
- Secure console or out-of-band access before changing a remote device.
- Preserve the current state in a uniquely named backup.
- Inspect the known-good source file for addressing, routing, VLAN, credentials, and access rules.
- Copy it into
running-configonly when the merge behavior is acceptable, or use a planned replacement procedure when a clean state is required. - Check interfaces, routes, access rules, services, and management access.
- Copy the validated result to
startup-config.
Key Takeaways
running-configis active in RAM;startup-configis the boot-time configuration normally stored in NVRAM.- Unsaved running changes are lost after reload or power loss.
- Use
copy running-config startup-configto save the intended active state. - Use TFTP only after validating reachability, UDP service availability, permissions, and destination storage.
- Copying a remote file into
running-configapplies an immediate merge and may not remove old commands. - Copying a remote file into
startup-configchanges the next-boot configuration but does not normally change the current running state. - Use flash or USB for local copies and FTP or SCP when supported and appropriate; prefer secure, controlled repositories.
- Always preserve a known-good backup and an independent management path before a high-risk restore.
For password-related configuration details, review configuring passwords in IOS. Configuration backup is also closely connected to change management, secure SSH administration, and routing configuration verification such as OSPF configuration.