The CCNA syllabus includes backing up and restoring Cisco router/switch configurations using an FTP server. These are also skills every network administrator should master. In this tutorial, you will learn how to back up and recover Cisco switch/router configuration files (startup + running) using an FTP server. These procedures are straightforward and only consist of a few steps.
What is FTP?
FTP stands for File Transfer Protocol, and it is a network protocol designed to share files over a network, whether it is a LAN or a WAN. FTP is based on the client-server model. Generally, FTP servers are used to store files, while FTP clients are used to download/upload files to/from FTP servers.
You can set up an FTP server on a LAN or the Internet. Furthermore, FTP offers user authentication, server connection management, file/directory manipulation commands, file transfer commands, and advanced features such as directory listings with sorting capabilities.
In the following sections, I will use the following network diagram. The network consists of three devices: a Cisco router, a Cisco switch, and an FTP server. You can download and install a free FTP server from this link.
How To Backup Cisco Router/Switch Configurations Using an FTP Server
To back up or recover a Cisco router/switch configuration file, whether it is the startup configuration or the running configuration, using an FTP server, follow these steps:
Step 1. Configure an FTP server. You can find many FTP applications on the Internet.
Step 2. Link the Cisco router/switch directly or through another network equipment to the FTP machine.
Step 3. Configure IP addresses on both the Cisco router/switch and the FTP server.
Switch> enable Switch# conf t Switch(config)# hostname MLS1 MLS1(config)# interface vlan 1 MLS1(config-if)# ip address 133.17.0.2 255.255.255.0 MLS1(config-if)# no shutdown MLS1(config-if)# end MLS1# write
Step 4. Add a username and a password that will be used for FTP transfers.
MLS1(config)# ip ftp username cisco MLS1(config)# ip ftp password cisco
Step 5. Ping the FTP server from the Cisco router/switch to ensure the connection is working between these network devices.
MLS1# ping 133.17.0.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 133.17.0.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
Step 6. Initiate a CLI session with the Cisco router/switch using a console cable, Telnet, or SSH.
Step 7. In privileged EXEC mode, enter the copy startup-config ftp: command or the copy running-config ftp: command to backup the startup configuration file or the running configuration file, respectively. Both commands would request a name under which to store the configuration file on the FTP server, and the IP address of the FTP server.
In this example, we save SW1’s startup configuration using the name “MLS1-startup.config” to the FTP server with IP address 133.17.0.10.
MLS1# copy startup-config ftp: Address or name of remote host []? 133.17.0.10 Destination filename [MLS1-confg]? MLS1-startup.config Writing startup-config... [OK - 1090 bytes] 1090 bytes copied in 0.078 secs (13000 bytes/sec)
Step 8. Open the folder where the FTP software stores files to confirm that the router/switch’s configuration file is there. If you are using Packet Tracer, you see a screen like the following when you open the FTP configuration of the server.
How To Restore a Cisco Router/Switch Configuration File Using an FTP Server
Here are the steps to recover a Cisco router/switch configuration using an FTP server:
Step 1. Install and set up an FTP server.
Step 2. Connect the Cisco router/switch directly or through another network device to the FTP server.
Step 3. Configure IP addresses on the router and the FTP server.
Router> enable Router# conf t Router(config)# hostname R1 R1(config)# interface gigabitEthernet 0/0 R1(config-if)# ip address 133.17.0.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# end R1# write R1#
Step 4. Configure the username and password that will be used to connect to the FTP server.
R1(config)# ip ftp username cisco R1(config)# ip ftp password cisco
Step 5. Ping the FTP server to make sure that both devices can communicate.
R1# ping 133.17.0.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 133.17.0.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
Step 6. Access the Cisco router/switch’s CLI via a console cable, Telnet, or SSH.
Step 7. In enable mode, issue the copy ftp: startup-config command or the copy ftp: running-config command to recover the startup configuration file or the running configuration file, respectively. Both commands would ask you to supply the name of the source file that will be used to replace the content of the chosen configuration file, confirm the name of the configuration file to restore, and enter the IP address of the TFTP server.
R1# copy ftp: running-config Address or name of remote host []? 133.17.0.10 Source filename []? R1-config.txt Destination filename [running-config]? ! press Enter key Accessing ftp://133.17.0.10/R1-config.txt... [OK - 19153 bytes] 19153 bytes copied in 0.088 secs (218000 bytes/sec)
Step 8. Issue the more command, in enable mode, to display the new content of the updated configuration file.
How To Backup and Restore Cisco Switch/Router Configurations Using an FTP Server in Packet Tracer
Here is a Packet tracer lab file that you can download to practice the Cisco IOS commands used to backup and recover Cisco switch/router configuration files using an FTP server.
Click here to download the lab file.
Troubleshooting Backing and Restoring Cisco Router/Switch Configurations using an FTP Server
When you try to backup or recover a Cisco IOS configuration file, whether it is for a switch or router, the process may fail because of one of these reasons:
- The FTP service is not working.
- The FTP server is unreachable because of bad IP addressing on the client or the server side, or due to routing issues in the network.
- Wrong FTP username or password.
- Incorrect or inexistent source/destination file.
- An ACL denies FTP packets between the FTP client and the FTP server.
Related Lessons to How To Backup and Restore Cisco Switch/Router Configuration Files Using FTP
- How To Backup Cisco Switch/Router Images Using TFTP Server
- How To Backup/Restore Cisco Switch/Router Configuration Files Using SCP Server
- How To Backup Cisco Switch/Router Images Using FTP Server
- Memory Types Used in a Cisco Router
- How To Reset a Cisco Switch to Factory Defaults
- How to Reset a Cisco Router to Factory Defaults
- How To Backup and Restore Cisco Switch/Router IOS Images Using SCP Server
- How To Backup and Restore Cisco Switch/Router Configuration Files Using FTP
- How To Backup and Restore Cisco Switch/Router Configuration Files Using TFTP Server
- How To Erase Configuration Files on a Cisco Router or Switch
- Cisco IOS More Command
- How To Upgrade Cisco IOS via FTP/TFTP/USB Drive or Console Cable
Conclusion
I hope this blog post helps you learn something.
Now I’d like to turn it over to you:
What did you like about this tutorial?
Or maybe you have an excellent idea that you think I need to add.
Either way, let me know by leaving a comment below right now.