Configuration files on an IOS device
IOS devices store configuration commands in a configuration file. The two main configuration files are:
- the startup config – used to store the initial configuration that will be used when you power-on or reboot the device. The startup configuration file is stored NVRAM (Nonvolatile RAM), so it is retained even after the device loses power. To display the startup configuration of your device, run the show startup-config command (the output has been truncanted):
- the running config – used to store the current configuration. Every configuration command that you enter will be immediately stored in the running configuration file. This file is stored in RAM, so all configured command will be lost if the device is restarted. To display the running (current) configuration of your device, run the show running-config command:
To better understand the difference between these two types of configurations, consider the following example:
In the picture above you can see that we’ve configured an IP address to the router Fa0/0 interface. This configuration is stored in the running configuration file. To verify that the IP address is indeed applied to the interface, we’ve then run the show ip interface brief command. But consider what happens if we reboot the device and run the show ip interface brief command again:
Because the running configuration was lost when the device was restarted, no IP address is configured to the interface. To retain the configuration, we need to run the copy running-config startup-config command to copy the running configuration into the startup configuration:
All configuration changes will be retained, even after the device loses power. So remember to always store your running configuration into the startup configuration before restarting the device.