Hey there, wrangling those configuration files on Cisco routers and switches is key to keeping your network as steady as a trusty steed! This guide's got the lowdown on the essential steps and best practices for handling these files. It'll help you make sure your network configurations are always backed up and ready to be restored quicker than a lasso twirl!
Understanding Running and Startup Configurations
When you configure a Cisco router or switch, the changes you make are initially stored in the device’s RAM. This in-memory configuration is known as the running configuration (running-config). However, this configuration is volatile, meaning it will be lost if the device is powered off or restarted.
To ensure that your configuration changes persist after a reboot, you must save them to non-volatile RAM (NVRAM). The saved configuration in NVRAM is referred to as the startup configuration (startup-config).
Saving the Running Configuration
After making changes to your router or switch, it is essential to save the running configuration to the startup configuration to avoid losing those changes.
Copy Running Config to Startup Config:
Router# copy running-config startup-config
This command copies the current running configuration to the startup configuration, ensuring that your changes are saved and will persist after a reboot.
Using Shortened Command:
Router# copy run start
Cisco IOS allows you to use abbreviations as long as they are unambiguous. The command above is a shortened version that achieves the same result. You can use the
Tab
key for auto-completion.
Verifying Configurations
View Running Configuration:
Router# show running-config
This command displays the current configuration running on the device.
View Startup Configuration:
Router# show startup-config
This command shows the configuration that will be used when the device next starts up.
Backing Up Configuration Files
Backup Running Config to TFTP Server:
Router# copy running-config tftp
- You will be prompted for:
- IP address of the TFTP server:
Address or name of remote host []? 172.16.100.16
- Destination filename:
Destination filename [Router1-confg]?
- Successful copy is indicated by exclamation points:
!!!!!!!!!!!!!!!!! 2012 bytes copied in 0.123 secs (16.35 Kbytes/sec)
- You will be prompted for:
Backup Startup Config to TFTP Server:
Router# copy startup-config tftp
- Similar prompts and process as above.
Verifying Backup on TFTP Server
- Check the File on TFTP Server:
- Open the TFTP server application (e.g., SolarWinds TFTP Server) on your external server.
- Verify that the file (e.g.,
Router1-confg
) exists and contains the correct configuration.
Restoring Configuration from TFTP Server
If you need to restore a configuration from a TFTP server, you can copy the configuration file from the TFTP server to your router’s startup configuration.
- Restore Startup Config from TFTP Server:
Router# copy tftp startup-config
- You will be prompted for:
- IP address of the TFTP server:
Address or name of remote host []? 172.16.100.16
- Source filename:
Source filename []? Router1-confg
- Destination filename:
Destination filename [startup-config]?