Backing up your Cisco router or switch configuration is critical for disaster recovery and network management. With the archive command in Cisco IOS, you can automate this process, saving the config to a TFTP server every time you type wr or write memory. This guide walks you through the steps to set up automatic backups, complete with a sample output, so you can protect your network configs effortlessly. Let’s get started!
Why Automate Cisco Config Backups to a TFTP Server?
Manual backups are time-consuming and prone to error, especially in large networks. Automating config backups to a TFTP server ensures your Cisco router or switch settings are preserved after every change, reducing downtime during failures. This method is ideal for network engineers, CCNA/CCNP students, and IT pros looking to streamline Cisco device management.
Step-by-Step: Setting Up Automatic Config Backup
Follow these steps to configure your Cisco device to back up its running-config to a TFTP server whenever write memory is executed:
1. Enter Global Configuration Mode
Start by accessing the configuration terminal.
Router# configure terminal
2. Enable the Archive Feature
Enter archive mode to define backup settings.
Router(config)# archive
3. Specify the TFTP Server Path
Set the TFTP server IP (e.g., 192.168.1.100) and filename base (e.g., router-config). The timestamp will be appended automatically.
Router(config-archive)# path tftp://192.168.1.100/router-config
4. Trigger Backup on Write Memory
Enable automatic backups whenever wr or write memory is run.
Router(config-archive)# write-memory
5. Exit and Test
Exit archive mode and test by saving the config.
Router(config-archive)# exit
Router# write memory
What Happens After Configuration?
- Backup Process: Each write memory saves the running-config to NVRAM and sends a copy to the TFTP server (e.g., router-config-20250403-123456).
- Verification: Check the TFTP server for the file or use show archive on the device.
Sample Output (After show archive)
Router# show archive
The next archive file will be named tftp://192.168.1.100/router-config-<timestamp>
Archive # Name
1 tftp://192.168.1.100/router-config-20250403-123456
Troubleshooting Tips
- TFTP Reachability: Test with ping 192.168.1.100 to ensure the server is accessible.
- Server Status: Confirm the TFTP server is running and has write permissions.
- Error Logs: Use show logging to spot issues like %Error opening tftp://192.168.1.100/router-config.
Conclusion
Automating Cisco config backups to a TFTP server with the archive command is a simple yet powerful way to safeguard your network. By tying it to write memory, you ensure every change is preserved without extra effort. Set it up today, test it in your lab, and rest easy knowing your configs are secure. Have a backup tip? Share it in the comments!