When an engineer begins to use Cisco equipment, there are a number of different concepts that must be clearly understood; this includes how Cisco organizes their configurations, how interfaces and lines are organized, how secure access is configured, among many other things. This article takes a look at how Cisco organizes their configurations within a device, how these different configurations relate to each other, and how they can be managed to ensure that the desired result is achieved. It also covers the procedure that can be used should the passwords to access the device be lost or forgotten.
Startup vs. Running Configurations
One concept that is often confusing to those just getting into Cisco equipment is the concept of startup and running configurations. These are the two different ways that Cisco maintains the configuration within a device depending on the current state of the device. The startup configuration is used by the Cisco device upon startup (seems obvious from the name), this configuration is maintained throughout shutdowns, power offs (intentional or otherwise), and reloads. The running configuration is slightly different; it contains the configuration that is currently being used by the Cisco device. Any changes that are made to the running configuration will be lost during power offs and reloads unless they are copied over to the startup configuration, this will be covered in the next section. It is important to note that the Cisco device will automatically prompt the user to save this configuration if a reload is being attempted without saving this configuration over to the startup configuration; make sure to pay attention to any of these types of warnings on Cisco equipment, they have been put there to ensure that something has not been overlooked before continuing.
Startup/Running Configuration Management
The concepts and commands used for configuration management on a Cisco device are very simple once the concepts discussed above are understood. Anytime that a Cisco device needs to be shutdown or reloaded it is important to ensure that any changes that are intended to be kept are committed to the startup configuration. The command that is used to perform this operation is copy running-config startup-config. (or copy ru st for short); this is shown in Figure 1.
Figure 1 copy running-config startup-config
An often overlooked ability is for a Cisco device to backup its configuration to an external server; this server is typically a TFTP server. It is also possible to load configurations from an external server into the startup configuration of a Cisco device to restore functionality. Figure 2 shows the use of the copy startup-config tftp command to backup a device’s startup configuration to an external TFTP server.
Figure 2 copy running-config tftp
To take a configuration from a TFTP server and load it into the startup configuration simply requires that the command be reversed; this is shown in Figure 3.
Figure 3 copy tftp startup-config
A common thing that can happen to those just starting to play around with Cisco devices (and occasionally to those with a lot of experience) is the device lockout; this occurs when a password is set and forgotten (or miss-entered as Cisco devices do not verify passwords). There are a number of different Cisco device but for the purposes of this article the most common type of password recovery technique will be used.
The configuration register is used to change the devices console and booting behavior; specifically, the following are affected:
- How the device boots
- Boot options
- Console speed
Typically, on Cisco routers the configuration register is set to 0x2102 or 0x102. The 0x2102 setting tells the device to ignore break (operating), Boot into ROM if initial boot fails, and to default to 9600 baud (on most platforms); the 0x102 setting tells the device to ignore break and to default to 9600 baud. To check the current setting for the configuration register on a device, use the show version command and look at the bottom of the output; this is shown for a 7206VXR in Figure 4.
Figure 4 show version
To recover the password for a device, follow these steps:
- Power down the device.
- Connect cable to console.
- If using a device that uses a compact flash device, remove it.
- Power up the device.
- For devices without a compact flash device, send a break during the first 60 seconds of bootup (the key used for break depends on the terminal program being used).
- The device will boot into Rom Monitor mode (rommon); if the device has a compact flash device, insert it now.
- Configure the device to ignore the startup configuration; this is done with the confreg 0x2142 command.
- Reset the device with the reset command.
- The device will boot into the router as if no configuration existed; just say no to any setup prompts.
- Go into enable mode with the enable command.
- Enter the copy startup-config running-config command (DO NOT use the copy running-config startup-config command, as this will erase the configuration).
- Verify that all interfaces to reach the device over the network are enabled with the show ip interface brief command.
- Go into global configuration mode with the configuration terminal (or conf t for short) command.
- Reset the enable secret password with the enable secret password command.
- Enable any interfaces that are required for network reachability.
- Reset the configuration register to its normal value with the config-register command (i.e. config-register 0x2102) and exit configuration mode.
- Save the running configuration to the startup configuration with the copy running-config startup-config command.
- Restart the device.
There is so much material to learn when starting out in the Cisco world, it is important to have a clear understanding of the basics before moving forward as it makes learning the more advanced techniques much easier. Hopefully, the content in this article will help any beginning engineer understand these concepts and be able to help in advancing further in their studies.