VMware ESXi and vSphere Cluster Management
Back Up and Restore Cisco IOS Configurations with TFTP
Learn how to prepare a TFTP server and back up or restore Cisco IOS running-config and startup-config files with copy commands.
Configuration backups give you a known-good copy of a router or switch configuration outside the device. Create a backup before making significant changes, upgrading software, troubleshooting, or replacing hardware. If a configuration is accidentally deleted, damaged by an incorrect change, or lost with a failed device, the backup can reduce recovery time.
This lesson uses TFTP, the Trivial File Transfer Protocol, to transfer Cisco IOS configuration files between a Cisco device and a remote server. TFTP is useful in labs and trusted management networks, but it does not provide authentication or encryption.
Why Back Up Cisco IOS Configurations?
A router or switch configuration represents the device's interfaces, VLANs, routing, security, management, and other operational settings. Losing that configuration can interrupt network service and require time-consuming manual reconstruction.
- Back up before planned changes so you can return to a known-good state.
- Back up before an IOS upgrade or hardware replacement.
- Capture the configuration before troubleshooting changes alter the device.
- Use a backup to recover after accidental deletion, incorrect commands, or device failure.
- Keep copies away from the router or switch rather than relying only on local storage.
Use multiple versioned backups instead of overwriting one file repeatedly. A useful filename identifies the device and the configuration state, for example R1-startup-2026-08-18.cfg or SW1-running-before-vlan-change.cfg.
Where Cisco IOS Stores Configurations
Cisco IOS is Cisco's Internetwork Operating System. It manages the device and its configuration files. The two configuration locations used most often are running-config and startup-config.
- running-config: The active configuration currently operating on the device. It is generally held in volatile RAM, so unsaved changes can be lost when the device reloads or loses power.
- startup-config: The saved configuration that IOS loads during boot. It is generally stored in nonvolatile NVRAM, which retains data across a reload.
| Location | Configuration Name | Typical Storage | When It Is Used | Backup Command |
|---|---|---|---|---|
| Active configuration | running-config | RAM | Used immediately | copy running-config tftp: |
| Saved boot configuration | startup-config | NVRAM | Loaded at startup | copy startup-config tftp: |
Saving changes with copy running-config startup-config copies the active configuration into the saved boot configuration. A startup-config backup contains only the most recently saved state. If you changed the running configuration but did not save it, those changes are not included in a startup-config backup.
copy running-config startup-config
A TFTP server is a remote file location. It stores configuration files uploaded by a Cisco device and supplies files when the device downloads a backup.
How the Cisco IOS copy Command Works
The general form of the IOS copy command is:
copy source destination
The source is where the file currently exists. The destination is where IOS sends the file. Reversing these locations changes an upload into a download.
copy startup-config tftp:copies the saved local configuration to a TFTP server.copy running-config tftp:copies the active local configuration to a TFTP server.copy tftp: startup-configdownloads a TFTP file into NVRAM.copy tftp: running-configdownloads a TFTP file into the active configuration.
IOS normally asks interactive questions during a TFTP transfer. These include the remote host address and the destination filename for an upload, or the source filename for a download. Enter the exact server address and filename, then review the transfer result.
TFTP Fundamentals and Security
TFTP means Trivial File Transfer Protocol. It is a lightweight client-server file-transfer protocol that uses UDP. TFTP normally uses UDP port 69 to initiate transfers.
During a configuration transfer, the Cisco router or switch acts as the TFTP client. The host running the TFTP service is the TFTP server. The server must be reachable, its TFTP service must be enabled, and it must have permission and storage to create or retrieve the requested file.
Prepare a TFTP Server
Packet Tracer example
- Place a Server device in the Packet Tracer topology.
- Connect the server to the network with an appropriate cable and switch port.
- Open the server and configure a reachable IPv4 address and subnet mask in its IP configuration settings.
- Configure a default gateway if the server and Cisco device are in different subnets.
- Open the server's services settings and enable the TFTP service.
- Confirm that the TFTP service has sufficient storage and can accept uploaded files.
- From the Cisco device, ping the server before attempting a file transfer.
The server address used in examples must be replaced with the address configured in your topology. In a real network, also confirm that routing, ACLs, firewalls, and host security software allow the transfer.
Verify Connectivity Before a Transfer
The Cisco device needs an operational management path to the server. A router may use an active interface with an IP address. A Layer 2 switch commonly uses a management switched virtual interface, or SVI, with an IP address. The switch also needs a suitable default gateway when the TFTP server is outside its local subnet.
show ip interface brief
ping 192.0.2.10
show ip interface brief helps you check interface addresses and whether interfaces are operational. The documentation address 192.0.2.10 is only an example; use the actual TFTP server address in your lab or network.
| Requirement | Why It Matters | How to Check |
|---|---|---|
| TFTP service enabled | The server must listen for and process TFTP requests. | Check the server's service settings. |
| Correct IP addressing | The device and server need valid addresses and masks. | Review interface and server IP settings. |
| Layer 3 reachability | Different subnets require a route or default gateway. | Use ping and inspect routing or gateway settings. |
| No TFTP-blocking security policy | ACLs, firewalls, or endpoint security can prevent transfers. | Review filtering and host security logs. |
| Correct filename | The server must find the exact requested file. | Inspect the TFTP file list and enter the exact name. |
Back Up the Startup Configuration to TFTP
Use this method to upload the saved boot configuration from NVRAM. First save any intended active changes if they should be part of the startup backup.
copy running-config startup-config
copy startup-config tftp:
A typical interactive session looks like this:
R1# copy startup-config tftp:
Address or name of remote host []? 192.0.2.10
Destination filename [R1-confg]? R1-startup-backup.cfg
Writing R1-startup-backup.cfg ...
!!!!
[OK - 1543 bytes]
Enter the TFTP server's IPv4 address at the remote-host prompt. At the destination-filename prompt, choose a meaningful, device-specific name. IOS reports a successful transfer and usually displays the number of bytes copied.
This file represents the most recently saved configuration. It does not automatically include newer changes that exist only in running-config.
Back Up the Running Configuration to TFTP
To preserve the active configuration, including changes that have not been saved, copy running-config directly to TFTP:
copy running-config tftp:
For example:
R1# copy running-config tftp:
Address or name of remote host []? 192.0.2.10
Destination filename [R1-confg]? R1-running-backup.cfg
Writing R1-running-backup.cfg ...
!!!!
[OK - 1687 bytes]
This is useful before saving recent changes, when preserving the exact active state, or when comparing active and saved configurations. Use a different filename from the startup backup so the two states are not accidentally overwritten.
| Task | IOS Command | Copy Source | Copy Destination | Important Result |
|---|---|---|---|---|
| Back up startup configuration to TFTP | copy startup-config tftp: | startup-config | TFTP server | Uploads the saved boot configuration. |
| Back up running configuration to TFTP | copy running-config tftp: | running-config | TFTP server | Uploads the active configuration, including unsaved changes. |
| Restore a TFTP file to startup configuration | copy tftp: startup-config | TFTP server | startup-config | Stores the downloaded file for a future boot. |
| Load a TFTP file into running configuration | copy tftp: running-config | TFTP server | running-config | Merges downloaded commands into the active configuration. |
Restore a Startup Configuration from TFTP
To download a named backup into NVRAM, use:
copy tftp: startup-config
Provide the TFTP server address and the exact source filename:
R1# copy tftp: startup-config
Address or name of remote host []? 192.0.2.10
Source filename []? R1-startup-backup.cfg
Destination filename [startup-config]?
Reading R1-startup-backup.cfg ...
!!!!
[OK - 1543 bytes]
After the transfer, inspect the saved file:
show startup-config
Copying the file to startup-config does not immediately replace the active running configuration. A reload restarts the device so IOS loads the restored startup configuration. Verify the file and schedule the reload during an appropriate maintenance window.
Restore a Configuration into Running-config
To load a TFTP file into the active configuration, use:
copy tftp: running-config
IOS treats this operation as a merge. Merge means the downloaded commands are added to or applied to the current running configuration rather than replacing it wholesale.
R1# copy tftp: running-config
Address or name of remote host []? 192.0.2.10
Source filename []? R1-running-backup.cfg
Destination filename [running-config]?
Loading R1-running-backup.cfg from 192.0.2.10 ...
!!!!
[OK - 1687 bytes]
Commands already present may remain if the downloaded file does not explicitly remove or change them. Therefore, copying to running-config is not the same as factory-resetting the device and replacing its entire configuration.
- Back up the current configuration first.
- Use a maintenance window when the change can affect production traffic.
- Understand the file's commands and expected impact before applying it.
- Verify interfaces, routing, access controls, and management access afterward.
Verify Transfers and Maintain Backups
After an upload, confirm that the selected filename appears in the TFTP server's file list. After a download, inspect the relevant local configuration.
show running-config
show startup-config
show ip interface brief
ping 192.0.2.10
Use clear filenames that include device identity and a date, version, or change description. Keep several known-good versions so one damaged or incorrect file does not become the only recovery option. Test restoration in a lab, including the difference between restoring to startup-config and merging into running-config.
Troubleshooting TFTP Transfers
The device cannot reach the TFTP server
Check for an incorrect IP address, subnet mask, default gateway, route, disconnected cable, or administratively down interface. On a switch, verify that the management SVI has an address and is operational.
show ip interface brief
ping 192.0.2.10
Correct addressing, interface status, gateway, or routing before retrying the copy command.
The transfer times out even though ping succeeds
Ping proves basic IP reachability, but it does not prove that TFTP is available. Confirm that the TFTP service is enabled, the server accepts uploads when backing up, and sufficient storage is available. Review ACLs, firewalls, endpoint security software, and other policies that may block TFTP.
The requested file cannot be found
Inspect the TFTP server's file list and enter the exact source filename. Check capitalization, file extensions, and the configured TFTP root directory. A file may exist in a different directory from the one being served.
The backup does not contain recent changes
If you backed up startup-config while changes existed only in running-config, the backup correctly reflects the older saved state. Compare both local configurations:
show running-config
show startup-config
Save the active changes before backing up startup-config, or back up running-config directly when the unsaved state is what you need to preserve.
Unexpected settings remain after restoring to running-config
This is normally caused by merge behavior. The downloaded file was applied to the existing active configuration, so commands not removed by the file may remain. Back up the current state, use a planned clean-baseline recovery procedure when a complete replacement is required, and test the process in a lab.
The device still uses old settings after restoring startup-config
Copying a file to startup-config changes the saved boot file, but the current running configuration remains active until a reload or other deliberate application method. Verify the saved file with show startup-config, then reload during an approved maintenance window.
Quick Reference
- Prepare a reachable TFTP server and enable its TFTP service.
- Check device interfaces with
show ip interface brief. - Ping the TFTP server.
- Save running-config to startup-config if the backup should represent current intended changes.
- Use
copy startup-config tftp:for the saved boot configuration. - Use
copy running-config tftp:for the active configuration, including unsaved changes. - Verify the filename on the TFTP server.
- Use
copy tftp: startup-configto prepare a future boot from a backup. - Use
copy tftp: running-configonly when you understand its merge behavior. - Verify the result and keep multiple known-good, device-specific backup versions.
For related study material, see Cisco IOS configuration backup and recovery.