Managing Configuration Files

IOS on a router uses a configuration file for the initial configuration at router startup and the active, running configuration file. The startup configuration file is in NVRAM; the other file, which is in RAM, is the one that the router uses during operation. When the router first comes up, the router copies the stored configuration file from NVRAM into RAM, so the running and startup configuration files are identical at that point. Also, exterior to the router, configuration files can be stored as ASCII text files anywhere using TFTP or FTP.

Example 7-4 demonstrates the basic interaction between the two files. In this example, the show running-config and show startup-config commands are used. These commands display the currently used, active, running configuration and the stored, startup configuration used when the router boots, respectively. The full command output is not shown; instead, you can see only a brief excerpt including the host command, which will be changed several times. (Notes are included inside the example that would not appear if you were doing these commands on a real router.)

Example 7-4 Configuration Process Example

hannah#show running-config

I™ (lines omitted)

hostname hannah

I™ (rest of lines omitted)

hannah#show startup-config

I™ (lines omitted)

hostname hannah

I™ (rest of lines omitted)

hannah#configure terminal

hannah(config)#hostname jessie

jessie(config)#exit

jessie#show running-config

I™ (lines omitted)

hostname jessie

I™ (rest of lines omitted - notice that

the running

configuration reflects the

I changed hostname)

jessie# show startup-config

I™ (lines omitted)

hostname hannah

I™ (rest of lines omitted - notice that

the changed

configuration is not

I shown in the startup config)

If you reload the router now, the host name would revert back to hannah. However, if you want to keep the changed host name of jessie, you would use the command copy running-config startup-config, which overwrites the current startup-config file with what is currently in the running configuration file.

The copy command can be used to copy files in a router, most typically a configuration file or a new version of the IOS Software. The most basic method for moving configuration files in and out of a router is to use the copy command to copy files between RAM or NVRAM on a router and a TFTP server. The files can be copied between any pair, as Figure 7-5 illustrates.

Figure 7-5 Locations for Copying and Results from Copy Operations

0 0

Post a comment