Router Configuration Files

In order to get a sense for what is really happening when you configure a router, you will need to understand the difference between a router’s running configuration and its startup configuration. In Chapter 6 we looked at the contents of RAM and NVRAM. A router’s running configuration is stored in RAM. When you make changes to the configuration of a router, this is almost always what you are changing. However, remember that the contents of RAM are lost when a router is powered down. As such, if you want to save any changes that you’ve made, you will need to copy them to NVRAM, where the startup configuration is stored. The startup configuration that is saved in NVRAM is the one that will be applied to the router if it is rebooted.

Before getting into the details of how to save a router’s configuration, we should first know how to view both the startup and running configurations. Both can be accessed from privileged EXEC mode using the show command. A variety of different configuration elements can be viewed using the show command, many of which we’ll look at as the chapter progresses.

To view the current running configuration of a router, use the show running-config command. To view the startup configuration, use the show startup-config command.

toronto-1#show running-config
Building configuration...

Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
service tcp-small-servers
!
hostname toronto-1
!
enable secret 5 $1$RATF$Rr5XuMrPDNBHSqnvJLVwI/
enable password cisco2
!
ip subnet-zero
!
!
process-max-time 200
!
interface Ethernet0
ip address 192.168.1.46 255.255.255.0
toronto-1#show startup-config
Using 739 out of 32762 bytes
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
service tcp-small-servers
!
hostname toronto-1
!
enable secret 5 $1$RATF$Rr5XuMrPDNBHSqnvJLVwI/
enable password cisco2
!
ip subnet-zero
!
!
process-max-time 200
!
interface Ethernet0
ip address 192.168.1.46 255.255.255.0

Since we haven’t really configured any major settings yet, I cut the output of both commands to save space. You may have noticed that the output from both commands looks fairly similar. That’s because we haven’t made any configuration changes yet. If we had, the running configuration would include settings not yet saved to the startup configuration.

In order to save the running configuration to the startup configuration, use the copy running-config startup-config command.

toronto-1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...

toronto-1#

Notice the format of the command – it is telling the router to copy the settings found in the running configuration to the startup configuration. In other words, the format of the copy command is:

copy from to

But why is this important to remember? Because if you issue the command in the reverse order – copy startup-config running-config – you are actually telling the router to overwrite the current running configuration with the settings found in the startup configuration! Take time to think before issuing these commands, and be sure to remember that you are always specifying the source first, followed by the destination. We’ll look at the configuration files in much more detail later in the chapter. For now, just remember that in order to save configuration changes, you’ll need to copy them to the startup configuration stored in NVRAM.

Author: Dan DiNicolo

Dan DiNicolo is a freelance author, consultant, trainer, and the managing editor of 2000Trainers.com. He is the author of the CCNA Study Guide found on this site, as well as many books including the PC Magazine titles Windows XP Security Solutions and Windows Vista Security Solutions. Click here to contact Dan.