The process of managing configuration files is straightforward; however, it is increasingly difficult because of the different versions of Cisco software and the wide variety of architectures used in Cisco hardware. This section will bring light to these subjects; present an overview of the different types of configuration files and the commands used to move, display, and copy these files; and, finally, highlight some of the areas that can cause confusion when managing configuration files. Types of Configuration FilesCisco IOS software uses and requires a configuration file to determine how a router is to function. Typically, network administrators enter the commands necessary for their environment into a router configuration file. Only two types of configuration files exist for the context of the CCNA exam:
The router will always use the running configuration file to execute. However, any time a router is restarted (cycling power or reloading the software), the running configuration file is erased and the startup configuration file is the only remaining configuration file. During the boot sequence of a router, the router copies the startup configuration file to the running configuration file (NVRAM to RAM). Therefore, it is paramount that any time a change is made to a running configuration, the change is also copied to the startup configuration. The many ways of preventing the loss of changes made are discussed in this chapter. Displaying the Running and Startup Configuration FilesThe purpose of displaying a running or startup configuration file is to determine the configuration commands being executed on a router. Use the show running-config and show startup-config commands to show the running configuration and startup configuration files, respectively. Displaying the running configuration file shows the commands being executed at the time that the show command is executed, as shown here: Router#show running-config Building configuration... Current configuration: Last configuration change at 03:25:38 UTC Sat Jan 1 2000 version 11.2 no service password-encryption no service udp-small-servers no service tcp-small-servers hostname Router enable secret 5 uUPI.L0xxD3wnX.7WDMHzb60 enable password cisco no ip domain-lookup interface Serial0 ip address 138.144.2.2 255.255.255.0 encapsulation frame-relay bandwidth 2000 frame-relay lmi-type cisco interface Serial1 no ip address shutdown ! interface TokenRing0 ip address 138.144.3.1 255.255.255.0 ring-speed 16 ! interface TokenRing1 ip address 138.144.4.1 255.255.255.0 ring-speed 16 ! router igrp 1 network 138.144.0.0 ! no ip classless ! snmp-server community public RO ! line con 0 line aux 0 line vty 0 4 password cisco login ! end
Configuring the Running and Startup Configuration FilesThe running configuration file often requires changes while the router is functioning. Cisco IOS is designed to accept changes to a running or startup configuration file without restarting (reloading) or cycling the power of the router. The following commands are used to manipulate the configuration files:
Backing Up and Restoring Configuration FilesConfiguration files are copied and moved constantly in most networks. One common method of copying files is with the use of a Trivial File Transfer Protocol (TFTP) server. Most Unix machines have built-in TFTP support. Also, TFTP server programs are available for Windows-based PCs. Cisco makes a TFTP server program that is available to registered users on its Web site at the following Web address: www.cisco.com/pcgi-bin/tablebuild.pl/tftp. Cisco routers use a TFTP server to load IOS and to copy software and configuration files. To copy a file using TFTP, one device needs to be executing TFTP server software and the other device needs to be executing the client software. Cisco routers are equipped with both functions. Network administrators often need to back up a running or startup configuration file on a central server. The following command sequence accomplishes this goal: Router# copy running-config TFTP Remote host []? 172.15.10.2 (IP Address of TFTP Server) Name of configuration file to write [router-confg]? <Return> Write file Router-confg on host 172.15.10.2? [confirm] < Return > Building configuration... Writing Router-confg !!!!!!!!!!!!!!!!![OK]
The reverse process occurs when a configuration file is copied from a central server to an executing router. This process is most often used when a router has gone dead or someone has accidentally deleted the configuration file on the router. If the running configuration was backed up on a TFTP server, it is really simple to restore the configuration file. The first step for restoring the configuration file on a router is to determine Internet Protocol (IP) connectivity from the central server to the router. This might require the use of a ping test and/or the configuration of an IP address on the router. The following command sequence is used for restoring a running configuration file: Router# copy TFTP running-config Host or network configuration file [host]? < Return > Address of remote host [255.255.255.255]? 172.15.10.2 (TFTP Server) Name of configuration file [Router-confg]?Router-confg - (File name) Configure using Router-confg from 172.15.10.2? [confirm] < Return > Loading Router-confg from 172.15.10.2 (via serial 1): !!!!! [OK - 875/32723] Router#
Another method of backing up a running configuration is to save it to NVRAM. You should complete this process after every change to the running configuration file, unless a good reason exists to keep the startup configuration different. By copying the running configuration to NVRAM, you are ensuring that if the router is reloaded or the power is cycled, it will boot with the same configuration you are currently executing. The following command sequence is required for this process: Router#copy running-config startup-config Building configuration... [OK] The startup configuration file can also be copied into RAM, thereby overwriting the running configuration file, by performing the following command: Router# Copy startup-config running-config
Finally, the startup configuration file can be completely erased. When this occurs, the router boots into setup mode the next time it is reloaded: Router#erase startup-config |