Router Products Configuration Guide
Loading System Images, Microcode Images, and Configuration File

Table Of Contents

Loading System Images, Microcode Images, and Configuration Files

System Image, Microcode Image, and Configuration File Load Task List

Retrieve System Images and Configuration Files

Retrieve System Images and Configuration File Task List

Copy System Images from a Network Server to Flash Memory

Copy from a TFTP Server to Flash Memory

Copy from an rcp Server to Flash Memory

Copy from a MOP Server to Flash Memory

Copy Configuration Files from a Network Server to the Router

Copy from a TFTP Server to the Router

Copy from an rcp Server to the Router

Change the Buffer Size for Loading Configuration Files

Compress Configuration Files

Verify the Image in Flash Memory

Display System Image and Configuration Information

Reexecute the Configuration Commands in Startup Configuration

Clear the Configuration Information

Perform General Startup Tasks

General Startup Task List

Enter Configuration Mode and Select a Configuration Source

Configure the Router from the Terminal

Configure the Router from Memory

Configure the Router from the Network

Copy a Configuration File Directly to the Startup Configuration

Modify the Configuration Register Boot Field

How the Router Uses the Boot Field

Setting the Boot Field

Perform the Boot Field Modification Tasks

Specify the Startup System Image

Load from Flash Memory

Load from a Network Server

Load from ROM

Use a Fault-Tolerant Booting Strategy

Specify the Startup Configuration File

Specify the Startup Configuration File Task List

Download the Network Configuration File

Download the Host Configuration File

Download the CONFIG_FILE Environment Variable Configuration on Cisco 7000 Series and Cisco 7500 Series

Schedule a Reload of the System Image

Store System Images and Configuration Files

Store System Images and Configuration Files Task List

Copy System Images from Flash Memory to a Network Server

Copy from Flash Memory to a TFTP Server

Copy from Flash Memory to an rcp Server

Copy Configuration Files from the Router to a Network Server

Copy from the Router to a TFTP Server

Copy from the Router to an rcp Server

Configure a Router as a Server

Configure a Router as a Server Task List

Configure a Router as a TFTP Server

Configure Flash Memory as a TFTP Server

Configure Flash Memory as a TFTP Server Task List

Perform Prerequisite Tasks

Configure the Flash Server

Configure the Client Router

Configure a Router as a RARP Server

Configure for Other Types of Servers

Configure for Other Types of Servers Task List

Specify Asynchronous Interface Extended BOOTP Requests

Specify MOP Server Boot Requests

Perform Cisco 2500 Series, Cisco 3000 Series, Cisco 4000 Series, Cisco 4500 Series, and AccessPro Startup Tasks

Cisco 2500 Series, Cisco 3000 Series, Cisco 4000 Series, Cisco 4500 Series, and AccessPro Startup Task List

Partition Flash Memory Using Dual Flash Bank

Systems that Support Dual Flash Bank

Benefits

Flash Load Helper versus Dual Flash Bank

Understanding Relocatable Images

Dual Flash Bank Configuration Task List

Partition Flash Memory

Copy a File into a Flash Partition

Manually Boot from Flash Memory

Configure the Router to Automatically Boot from Flash Memory

Configure a Flash Partition as a TFTP Server

Use Flash Load Helper to Upgrade Software on Run-from-Flash Systems (Cisco 2500 Series and Cisco 3000 Series Only)

Flash Load Helper Configuration Task List

Download a File Using Flash Load Helper

Monitor Flash Load Helper

Understand Additional Cisco 3000 Series and Cisco 4000 Series Features

Copying and Automatic Booting Features

Flash Upgrade Features

Load System Images on Systems with Dual-Bank Flash Memory (Cisco 4500 Series and AccessPro Only)

Copy a Boot Image on a Cisco 4500

Verify a Boot Image's Checksum on a Cisco 4500

Erase Boot Flash Memory on a Cisco 4500

Copy Bootstrap Images from a Network Server to Flash Memory (Cisco 4500 Series Only)

Perform Cisco 7000 Series and Cisco 7500 Series Startup Tasks

Cisco's Implementation of Environment Variables

BOOT Environment Variable

BOOTLDR Environment Variable

CONFIG_FILE Environment Variable

Controlling Environment Variables

Cisco 7000 Series and Cisco 7500 Series Startup Task List

Format Flash Memory

Format Flash Memory Process

Recovering from Locked Blocks

Manage Flash Files

Set the System Default Flash Device

Display the Current Default Flash Device

Show a List of Files on a Flash Device

Delete Files on a Flash Device

Recover Deleted Files on a Flash Device

Permanently Delete Files on a Flash Device

Load and Display Microcode Images

Load Microcode Images Over the Network

Display Microcode Information

Configure for Remote Shell (rsh) and Remote Copy (rcp) Functions

Cisco's Implementation of rsh and rcp

Using rsh

Maintaining rsh Security

Using rcp

Configure for rsh and rcp Task List

Configure a Router to Support Incoming rcp Requests and rsh Commands

Configure a Router to Support Incoming rcp Requests and rsh Commands Task List

Configure the Router to Accept rcp Requests from Remote Users

Configure the Router to Allow Remote Users to Execute Commands Using rsh

Turn Off DNS Lookups for rcp and rsh

Configure the Remote Username for rcp Requests

Remotely Execute Commands Using rsh

Use the AutoInstall Procedure

AutoInstall Requirements

Using a DOS-Based TFTP Server

How AutoInstall Works

Acquiring the New Router's IP Address

Resolving the IP Address to the Host Name

Downloading the New Router's Host Configuration File

Perform the AutoInstall Procedure

Modify the Existing Router's Configuration

Set Up the TFTP Server

Set Up the BOOTP or RARP Server

Connect the New Router to the Network

Stop Booting and Manually Load a System Image from ROM Monitor

Manually Boot from Flash

Manually Boot from a Network File

Manually Boot from ROM

Manually Boot Using MOP

Use the System Image Instead of Reloading


Loading System Images, Microcode Images, and Configuration Files


This chapter describes how to load and maintain system images, microcode images, and configuration files.

System images contain the system software.

Microcode images contain microcode to be downloaded to various hardware devices.

Configuration files contain commands entered to customize the function of the router.

The instructions in this chapter describe copying system images from routers to network servers (and vice versa), displaying and comparing different configuration files, and listing the system software version running on the router.

This chapter also describes the AutoInstall procedure, which you can use to automatically configure and enable a new router upon startup. It also explains how to manually load system images from ROM monitor so that you can successfully boot the router when typical startup processes malfunction.

To benefit most from the instructions and organization of this chapter, your router must contain a minimal configuration that allows you to interact with the system software. You can create a basic configuration file using the setup command facility. See the Router Products Getting Started Guide for more information.

For a complete description of the commands mentioned in this chapter, refer to the "System Image, Configuration File, and Microcode Image Load Commands" chapter in the Router Products Command Reference publication.


Note   One or more of the commands that previously appeared in this chapter have been replaced by new commands. maps the old commands to their replacements. The old commands continue to perform their normal functions in the current release, but support for these commands will cease in a future release. See the Router Products Command Reference publication for detailed command information.


Table 3-1 Mapping Old Commands to New Commands

Old Command
New Command

configure network

copy rcp running-config (for an rcp server)

copy tftp running-config (for a TFTP server)

configure overwrite-network

copy rcp startup-config (for an rcp server)

copy tftp startup-config (for a TFTP server)

copy erase flash

erase flash

copy verify or copy verify flash

verify flash (on all systems except Cisco 7500)

verify (on Cisco 7000 and Cisco 7500)

copy verify bootflash

verify bootflash

show configuration

show startup-config

tftp-server system

tftp-server

write erase

erase startup-config

write memory

copy running-config startup-config

write network

copy running-config rcp (for an rcp server)

copy running-config tftp (for a TFTP server)

write terminal

show running-config


System Image, Microcode Image, and Configuration File Load Task List

To load and maintain system images, microcode images, and configuration files needed for router startup, complete the tasks in the following sections.


Note   The organization of tasks assumes you have a minimal configuration that you want to modify.


The tasks in the first three sections are typical tasks for all routers. Perform the tasks in the remaining sections as needed for your particular router environment.

Retrieve System Images and Configuration Files

Perform General Startup Tasks

Store System Images and Configuration Files

Configure a Router as a Server

Configure for Other Types of Servers

Perform Cisco 2500 Series, Cisco 3000 Series, Cisco 4000 Series, Cisco 4500 Series, and AccessPro Startup Tasks

Perform Cisco 7000 Series and Cisco 7500 Series Startup Tasks

Configure for Remote Shell (rsh) and Remote Copy (rcp) Functions

Use the AutoInstall Procedure

Stop Booting and Manually Load a System Image from ROM Monitor

Retrieve System Images and Configuration Files

If you have a minimal configuration that allows you to interact with the system software, you can retrieve other system images and configuration files from a network server and modify them for use in your particular routing environment. This section describes tasks related to retrieving system images and configuration files for modification.

Retrieve System Images and Configuration File Task List

When retrieving system images and configuration files, perform the following tasks. The first two tasks are required.

Copy System Images from a Network Server to Flash Memory

Copy Configuration Files from a Network Server to the Router

Change the Buffer Size for Loading Configuration Files

Compress Configuration Files

Verify the Image in Flash Memory

Display System Image and Configuration Information

Reexecute the Configuration Commands in Startup Configuration

Clear the Configuration Information

Copy System Images from a Network Server to Flash Memory

You can copy system images from a TFTP, rcp, or MOP server. The following sections describe these tasks:

Copy from a TFTP Server to Flash Memory

Copy from an rcp Server to Flash Memory

Copy from a MOP Server to Flash Memory

Refer to the "Cisco's Implementation of Environment Variables" for an explanation of the Flash memory card that can be used on a Cisco 7000 series and a Cisco 7500 series.


Note   When you are upgrading or changing to a different Cisco IOS release, refer to the appropriate release notes for information on system requirements and limitations.


Copy from a TFTP Server to Flash Memory

To copy a system image from a TFTP server to Flash memory, complete the following tasks:

Task
Command

Step 1 Make a backup copy of the current system software image.

See the instructions in the section "Copy System Images from Flash Memory to a Network Server" later in this chapter.

Step 2 Copy a system image to Flash memory.

copy tftp flash

copy tftp file_id (Cisco 7000 series and Cisco 7500 series only)

Step 3 When prompted, enter the IP address or domain name of the server.

ip-address or name

Step 4 If prompted, enter the filename of the server system image.

filename

Step 5 If prompted, enter the Flash memory device that is to receive the copy of the system image.

device



Note   Be sure there is ample space available before copying a file to Flash memory. Use the show flash command and compare the size of the file you want to copy to the amount of available Flash memory shown. If the space available is less than the space required by the file you want to copy, the copy process will continue, but the entire file will not be copied into Flash memory. The failure message "buffer overflow - xxxx/xxxx" will appear, where xxxx/xxxx is the number of bytes read in relation to the number of bytes available.


The server system image copied to the Flash memories for the AGS+, AGS, MGS, and CGS must be at least Software Version 9.0 or later. For Cisco 3000, Cisco 4000, and Cisco 7000 series, the server system image must be at least Software Version 9.1 or later.

When you issue the copy tftp flash command, the system prompts you for the IP address or domain name of the TFTP server. This server can be another router serving ROM or Flash system software images. The system then prompts you for the filename of the software image to copy.

For the copy tftp flash and copy tftp file_id commands, when there is free space available in Flash memory, you are given the option of erasing the existing Flash memory before writing onto it. If no free Flash memory space is available, or if the Flash memory has never been written to, the erase routine is required before new files can be copied. The system will inform you of these conditions and prompt you for a response. Note that on the AGS+ and Cisco 7000 series, the Flash memory is erased at the factory before shipment.

The file_id argument of the copy tftp file_id command specifies a device and filename as the destination of the copy operation. You can omit the device, entering only copy tftp filename. When you omit the device, the system uses the default device specified by the cd command. On the Cisco 7000 series, you can choose flash: or slot0: as the Flash memory device. On the Cisco 7500 series, you can choose bootflash:, slot0:, or slot1: as the Flash memory device.

If you attempt to copy a file into Flash memory that is already there, a prompt informs you that a file with the same name already exists. This file is "deleted" when you copy the new file into Flash. The first copy of the file still resides within Flash memory, but it is rendered unusable in favor of the newest version, and is listed with the "deleted" tag when you use the show flash command. If you terminate the copy process, the newer file is marked "deleted" because the entire file was not copied and is not valid. In this case, the original file in Flash memory is valid and available to the system.

The following example shows how to use the copy tftp flash command to copy a system image named gs7-k when Flash memory is too full to copy the file. The filename gs7-k can be in either lowercase or uppercase; the system sees GS7-K as gs7-k. If more than one file of the same name is copied to Flash, regardless of case, the last file copied becomes the valid file.

env-chassis# copy tftp flash
IP address or name of remote host [255.255.255.255]? dirt
Translating "DIRT"...domain server (255.255.255.255) [OK]

Name of file to copy ? gs7-k
Copy gs7-k from 131.108.13.111 into flash memory? [confirm]
Flash is filled to capacity.
Erasure is needed before flash may be written.
Erase flash before writing? [confirm]
Erasing flash EPROMs bank 0

Zeroing bank...zzzzzzzzzzzzzzzz
Verify zeroed...vvvvvvvvvvvvvvvv
Erasing bank...eeeeeeeeeeeeeeee

Erasing flash EPROMs bank 1

Zeroing bank...zzzzzzzzzzzzzzzz
Verify zeroed...vvvvvvvvvvvvvvvv
Erasing bank...eeeeeeeeeeeeeeee

Erasing flash EPROMs bank 2

Zeroing bank...zzzzzzzzzzzzzzzz
Verify zeroed...vvvvvvvvvvvvvvvv
Erasing bank...eeeeeeeeeeeeeeee

Erasing flash EPROMs bank 3

Zeroing bank...zzzzzzzzzzzzzzzz
Verify zeroed...vvvvvvvvvvvvvvvv
Erasing bank...eeeeeeeeeeeeeeee

Loading from 131.108.1.111: -
 [OK - 1906676/4194240 bytes]
Verifying via checksum...
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Flash verification successful. Length = 1906676, checksum = 0x12AD

You will see a spinning line during the copy process. A series of Vs indicates that a checksum verification of the image is occurring after the image is written to Flash memory.


Note    If you enter n after the "Erase flash before writing?" prompt, the copy process continues. If you enter y and confirm the erasure, the erase routine begins. Be sure to have ample Flash memory space before entering n at the erasure prompt.


The following example shows how to copy a system image named gs7-k into the current Flash configuration in which a file named gs7-k already exists:

env-chassis# copy tftp flash
IP address or name of remote host [131.108.13.111]?
Name of file to copy ? gs7-k
File gs7-k already exists; it will be invalidated!
Copy gs7-k from 131.108.13.111 into flash memory? [confirm]
2287500 bytes available for writing without erasure.
Erase flash before writing? [confirm]n
Loading from 131.108.1.111: -
[OK - 1906676/2287500 bytes]
Verifying via checksum...
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Flash verification successful. Length = 1902192, checksum = 0x12AD 

You will see a spinning line during the copy process. A series of "V" characters indicates that a checksum verification of the image is occurring after the image is written to Flash memory.

In the following example, the Flash security jumper is not installed, so you cannot write files to Flash memory. On the Cisco 7000 series, you cannot write to internal Flash memory or to a Flash memory card inserted in the Personal Computer Memory Card International Association (PCMCIA) slot. Also, be sure to set the write protect switch on the Flash memory card to unprotected.

Everest# copy tftp flash
Flash: embedded flash security jumper(12V)
       must be strapped to modify flash memory

Note   To terminate this copy process, press Ctrl-^ (the Ctrl, Shift, and 6 keys on a standard keyboard) simultaneously. Although the process will terminate, the partial file copied before the termination will remain until the entire Flash memory is erased. Refer to the Troubleshooting Internetworking Systems publication for procedures on how to resolve Flash memory problems.


On the Cisco 7000 series or the Cisco 7500 series, the following example copies the router-config file from a TFTP server to the Flash memory card inserted in slot 0 of the Route Processor (RP) or Route Switch Processor (RSP) card. The copied file has the name new-config.

Router# copy tftp:router-config slot0:new-config

You can copy normal or compressed images to Flash memory. You can produce a compressed system image on any UNIX platform using the compress command. Refer to your UNIX platform's documentation for the exact usage of the compress command.

The following example shows how to copy a system image named IJ09140Z into the current Flash configuration:

Router# copy tftp flash
IP address or name of remote host [255.255.255.255]? server1
Name of tftp filename to copy into flash []? IJ09140Z
copy IJ09140Z from 131.131.101.101 into flash memory? [confirm] <Return>
xxxxxxxx bytes available for writing without erasure.
erase flash before writing? [confirm] <Return>
Clearing and initializing flash memory (please wait)####...
Loading from 101.2.13.110: -
[OK - 324572/524212 bytes]
Verifying checksum...
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV...
Flash verification successful. Length = 1204637, checksum = 0x95D9

The series of pound signs (#) indicates that each Flash device is being cleared and initialized; one per device. Different router platforms use different ways of indicating that Flash is being cleared. A spinning line indicates that the copy process is taking place. The series of "V" characters indicates that a checksum is calculated. An "O" would have indicated an out-of-order packet. A period (.) would have indicated a timeout. The last line in the sample configuration indicates that the copy is successful.

Copy from an rcp Server to Flash Memory

You can copy a system image from an rcp network server to Flash memory. For the rcp command to execute properly, an account must be defined on the network server for the remote username. You can override the default remote username sent on the rcp copy request by configuring the remote username. For example, if the system image resides in the home directory of a user on the server, you can specify that user's name as the remote username. The rcp protocol implementation copies the system image from the remote server relative to the directory of the remote username if the remote server has a directory structure, as do UNIX systems.

To copy a system image from an rcp server to Flash memory, complete the following tasks:

Tasks
Command

Step 1 Make a backup copy of the current system software image.

See the instructions in the section "Copy System Images from Flash Memory to a Network Server" later in this chapter.

Step 2 Enter configuration mode from the terminal.

This step is required only if you override the default remote username (see Step 3).

configure terminal

Step 3 Specify the remote username. This step is optional, but recommended.

ip rcmd remote-username username

Step 4 Exit configuration mode.

^Z

Step 5 Copy the system image from an rcp server to Flash memory.

copy rcp flash

copy rcp file_id (Cisco 7000 series and Cisco 7500 series only)

Step 6 When prompted, enter the IP address or domain name of the network server.

ip-address or name

Step 7 When prompted, enter the filename of the server system image to be copied.

filename


The copy command automatically displays the Flash memory directory, including the amount of free space. On Cisco 2500, Cisco 3000, and Cisco 4000 systems, if the file being downloaded to Flash memory is an uncompressed system image, the copy command automatically determines the size of the file being downloaded and validates it with the space available in Flash memory.

The server system image copied to the Flash memories must be Cisco Internetwork Operating System (Cisco IOS) Release 10.2 or later.

When you issue the copy rcp flash or copy rcp file_id command, the system prompts you for the IP address or domain name of the server. This server can be another router serving Flash system software images. The system then prompts you for the filename of the software image to copy. With the copy rcp flash command, the system also prompts you to name the system image file that will reside in Flash memory once the copy is complete. You can use the filename of the source file, or you can choose another name.

When free space is available in Flash memory, you are given the option of erasing the existing Flash memory before writing onto it. If no free Flash memory space is available, or if the Flash memory has never been written to, the erase routine is required before new files can be copied. The system informs you of these conditions and prompts you for a response. If you accept the erasure, the system prompts you again to confirm before erasing. Note that the Flash memory is erased at the factory before shipment.

If you attempt to copy a file into Flash memory that is already there, a prompt informs you that a file with the same name already exists. The older file is "deleted" when you copy the new file into Flash. The first copy of the file still resides within Flash memory, but it is rendered unusable in favor of the newest version, and is listed with the "deleted" tag when you use the show flash command. If you terminate the copy process, the newer file is marked "deleted" because the entire file was not copied. In this case, the original file in Flash memory is valid and available to the system.

The following example shows how to copy a system image named mysysim1 from the netadmin1 directory on the remote server named SERVER1.CISCO.COM with an IP address of 131.108.101.101 to the router's Flash memory. To ensure that enough Flash memory is available to accommodate the system image to be copied, the router software allows you to erase the contents of Flash memory first.

Router1# configure terminal
Router1(config)# ip rcmd remote-username netadmin1
^Z
Router# copy rcp flash
 
System flash directory:
File name/status 
 1 mysysim1 
[2076072 bytes used, 21080 bytes available]

Address or name of remote host[UNKNOWN]? 131.108.101.101
Name of file to copy? mysysim1
Copy mysysim1 from SERVER1.CISCO.COM?[confirm]
 
Checking for file `mysysim1' on SERVER1.CISCO.COM...[OK]

Erase Flash device before writing?[confirm]
Are you sure?[confirm]
Erasing device...ezeeze...erased.

Connected to 131.108.101.101

Loading 2076007 byte file mysysim1: -
[OK]

Verifying checksum... (0x87FD)...[OK] 
Router#

A spinning line indicates that the copy process is taking place.


Note   If you enter n after the "Erase Flash device before writing?" prompt, the copy process continues. If you enter y and confirm the erasure, the erasing routine begins. Be sure to have ample Flash memory space before entering n at the erasure prompt.


The following example uses the copy rcp file_id command to copy the router-image file from a network server using rcp to the Flash memory card inserted in slot 0 of the RP or RSP card:

Router1# configure terminal
Router1(config)# ip rcmd remote-username netadmin1
^Z
Router1# copy rcp slot0:router-image

You can copy normal or compressed images to Flash memory. You can produce a compressed system image on any UNIX platform using the compress command. Refer to your UNIX platform's documentation for the exact usage of the compress command.

Copy from a MOP Server to Flash Memory

On all platforms except the Cisco 7500 series, you can copy a system image from a MOP server to Flash memory. To do so, perform the following task in EXEC mode:

Task
Command

Copy a boot image using MOP.

copy mop flash


The following example shows a sample output from the copy mop flash command. In this example, the system image junk, which already exists in Flash memory, is copied to Flash memory, and there is enough memory to copy the file without erasing any existing files.

Router# copy mop flash 

System flash directory:
File  Length   Name/status
  1   984      junk [deleted]
  2   984      junk
[2096 bytes used, 8386512 available, 8388608 total]
Source file name? junk
Destination file name [junk]?

Erase flash device before writing? [confirm]
Flash contains files. Are you sure you want to erase? [confirm]

Copy 'junk' from server
  as 'junk' into Flash WITH erase? [yes/no]yes
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Loading junk from 1234.5678.9abc via Ethernet0: !
[OK - 984/8388608 bytes]

Verifying checksum...  OK (0x14B3)
Flash copy took 0:00:01 [hh:mm:ss]

Copy Configuration Files from a Network Server to the Router

You can also copy configuration files from a TFTP server or an rcp server to the router. You might use this process to restore a configuration file to the router if you have backed up the file to a server. If you replace a router and want to use the configuration file that you created for the original router, you can restore that file instead of recreating it. You can also use this process to copy to the router a different configuration that is stored on a network server.

The following sections describe these tasks:

Copy from a TFTP Server to the Router

Copy from an rcp Server to the Router

Copy from a TFTP Server to the Router

You can copy a configuration file from a TFTP server to the running configuration or to the startup configuration. When you copy a configuration file to the running configuration, you copy to and run the file from RAM.

On all platforms except the Cisco 7000 series and Cisco 7500 series, when you copy a configuration file to the startup configuration, you copy it to the nonvolatile random-access memory (NVRAM). On the Cisco 7000 series and Cisco 7500 series, when you copy a file to the startup configuration, you copy the file to a location specified by the CONFIG_FILE environment variable.

To copy a configuration file from a TFTP server to the router, complete the following tasks:

Task
Command

Step 1 Copy a file from a TFTP server to the router.

copy tftp running-config

or

copy tftp startup-config

Step 2 When prompted, enter the IP address or domain name of the server.

ip-address or name

Step 3 If prompted, enter the filename of the server system image.

filename


Copy from an rcp Server to the Router

You can copy a configuration file from an rcp server to the local router. As with TFTP, you can copy the configuration file to the running configuration or to the startup configuration. When you copy a configuration file to the running configuration, you copy to and run the file from RAM.

On all platforms except the Cisco 7000 series and Cisco 7500 series, when you copy a configuration file to the startup configuration, you copy it to NVRAM. On the Cisco 7000 series and Cisco 7500 series, when you copy a file to the startup configuration, you copy the file to a location specified by the CONFIG_FILE environment variable.

The rcp protocol requires that a client send the remote username on each rcp request to a network server. When you issue a request to copy a configuration file from an rcp network server, the router sends a default remote username unless you override the default by configuring a remote username. As the default value of the remote username, the router software sends the remote username associated with the current TTY process, if that name is valid. If the TTY username is invalid, the router software uses the router host name as the both the remote and local usernames. You can also specify the path of an existing directory along with the remote username.

For the rcp copy request to execute successfully, an account must be defined on the network server for the remote username. If you copy the configuration file from a personal computer used as a file server, the remote host computer must support the remote shell protocol.

Copy a Configuration File to the Running Configuration

You can copy a configuration file from an rcp server to the running configuration.

A host configuration file contains commands that apply to one network server in particular. A network configuration file contains commands that apply to all network servers on a network.

To copy a configuration file from an rcp server to the running configuration, perform the following tasks:

Task
Command

Step 1 Enter configuration mode from the terminal. This step is required only if you override the default remote username (see Step 2).

configure terminal

Step 2 Specify the remote username. This step is optional, but recommended.

ip rcmd remote-username username

Step 3 Exit configuration mode.

^Z

Step 4 Using rcp, copy the configuration file from a network server to the router's running memory.

copy rcp running-config

Step 5 When prompted, enter the IP address of the server.

ip-address

Step 6 When prompted, enter the name of the configuration file.

filename


The following example copies a host configuration file named host1-confg from the netadmin1 directory on the remote server with an IP address of 131.108.101.101, and loads and runs that file on the router:

Router# configure terminal
Router(config)# ip rcmd remote-username netadmin1
^Z
Router# copy rcp running-config 
Host or network configuration file [host]?
Address of remote host [255.255.255.255]? 131.108.101.101
Name of configuration file [Router-confg]? host1-confg
Configure using host1-confg from 131.108.101.101? [confirm]
Connected to 131.108.101.101
Loading 1112 byte file host1-confg:![OK]
Router#
%SYS-5-CONFIG: Configured from host1-config by rcp from 131.108.101.101

Copy a Configuration File to the Startup Configuration

You can retrieve the commands stored in a configuration file on a server and write them to the startup configuration.

A host configuration file contains commands that apply to one network server in particular. A network configuration file contains commands that apply to all network servers on a network.

To copy a configuration file from an rcp server to the startup configuration, perform the following tasks:

Task
Command

Step 1 Enter configuration mode from the terminal.

This step is required only if you override the default remote username (see Step 2).

configure terminal

Step 2 Specify the remote username. This step is optional, but recommended.

ip rcmd remote-username username

Step 3 Exit configuration mode.

^Z

Step 4 Using rcp, copy the configuration file from a network server to the router's startup configuration.

copy rcp startup-config

Step 5 When prompted, enter the IP address of the network server.

ip-address

Step 6 When prompted, enter the name of the configuration file.

filename


On the Cisco 7000 series and Cisco 7500 series, the copy rcp startup-config command copies the configuration file from the network server to the configuration file pointed to by the CONFIG_FILE environment variable. If you want to write the configuration file from the server to NVRAM on the router, be sure to set the CONFIG_FILE environment variable to NVRAM. Refer to the "Download the CONFIG_FILE Environment Variable Configuration on Cisco 7000 Series and Cisco 7500 Series" section in this chapter for instructions on setting the CONFIG_FILE environment variable with the boot config command.

The following example specifies a remote username of netadmin1. Then it copies a host configuration file host2-confg from the netadmin1 directory on the remote server with an IP address of 131.108.101.101 to the router's NVRAM.

Rtr2# configure terminal
Rtr2(config)# ip rcmd remote-username netadmin1
^Z
Rtr2# copy rcp startup-config 
Address of remote host [255.255.255.255]? 131.108.101.101
Name of configuration file[rtr2-confg]? host2-confg
Configure using rtr2-confg from 131.131.101.101?[confirm]
Connected to 131.131.101.101
Loading 1112 byte file rtr2-confg:![OK]
[OK]
Rtr2#
%SYS-5-CONFIG_NV:Non-volatile store configured from rtr2-config by rcp from 
131.108.101.101

Change the Buffer Size for Loading Configuration Files

The buffer that holds the configuration commands is generally the size of NVRAM. Complex configurations might need a larger configuration file buffer size. To change the buffer size, complete the following tasks:

Task
Command

Step 1 Enter configuration mode from the terminal.

configure terminal

Step 2 Change the buffer size to use for booting a host or network configuration file from a network server.

boot buffersize bytes

Step 3 Exit configuration mode.

^Z

Step 4 Save the configuration file to your startup configuration. On most platforms, this step saves the configuration to NVRAM. On the Cisco 7000 series and Cisco 7500 series, this step saves the configuration to the location specified by the CONFIG_FILE environment variable.

copy running-config startup-config


In the following example, the buffer size is set to 50000 bytes:

Router1# configure terminal
Router1(config)# boot buffersize 50000
^Z
Router1# copy running-config startup-config

Compress Configuration Files

On the Cisco 7000 series, Cisco 4000 series, Cisco 3000, and AGS+ routers that have NVRAM, you can compress configuration files. To do so, perform the following tasks:

Task
Command

Step 1 Verify that your system's ROMs support file compression. If not, you can install new ROMs that support file compression.

Refer to the appropriate hardware installation and maintenance publication.

Step 2 Specify that the configuration file is to be compressed.

service compress-config

Step 3 Enter the privileged EXEC mode.

enable [password]1

Step 4 Enter the new configuration.

Use TFTP or rcp to copy the new configuration. If you try to load a configuration that is more than three times larger than the NVRAM size, the following error message is displayed:
"[buffer overflow - file-size/buffer-size bytes]."

or

configure terminal

Step 5 Save the new configuration.

copy running-config startup-config

1 This command is documented in the "User Interface Commands" chapter of the Router Products Command Reference.


Installing new ROMs is a one-time operation and is necessary only if you do not already have Cisco IOS Release 10 in ROM. Before you can load a configuration file that is larger than the size of NVRAM, you must issue the service compress-config command. The service compress-config command works only if you have Release 10 boot ROMs or later.

Verify the Image in Flash Memory

Before booting from Flash memory, verify that the checksum of the image in Flash memory matches the checksum listed in the README file that was distributed with the system software image. The checksum of the image in Flash memory is displayed at the bottom of the screen when you issue the copy tftp flash, copy rcp flash, or copy rcp bootflash commands. The README file was copied to the network server automatically when you installed the system software image on the server.


Caution   
If the checksum value does not match the value in the README file, do not reboot the router. Instead, issue the copy request and compare the checksums again. If the checksum is repeatedly wrong, copy the original system software image back into Flash memory before you reboot the router from Flash memory. If you have a corrupted image in Flash memory and try to boot from Flash, the router will start the system image contained in ROM (assuming booting from a network server is not configured). If ROM does not contain a fully functional system image, the router will not function and must be reconfigured through a direct console port connection.

Display System Image and Configuration Information

Perform the following tasks in EXEC mode to display information about system software, system image files, and configuration files:

Task
Command

List the system software release version, configuration register setting, and so on.

show version

List the contents of the BOOT environment variable, the name of the configuration file pointed to by the CONFIG_FILE environment variable, and the contents of the BOOTLDR environment variable.

show boot (Cisco 7000 series and Cisco 7500 series only)

List the startup configuration information. On all platforms except the Cisco 7000 series and Cisco 7500 series, the startup configuration is usually NVRAM. On the Cisco 7000 series and Cisco 7500 series, the CONFIG_FILE environment variable points to the startup configuration.

show startup-config

List the configuration information stored in a specified file.

show file device:filename (Cisco 7000 series and Cisco 7500 series only)

List the configuration information in running memory.

show running-config

List information about Flash memory, including system image filenames and amounts of memory used and remaining.

show flash

List information about Flash memory, including system image filenames, amounts of memory used and remaining, and Flash partitions.

show flash [all | chips | detailed | err | partition number [all | chips | detailed | err] | summary]

show flash [all | chips | filesys] [device:] (Cisco 7000 series PCMCIA slot and Cisco 7500 series only)

View the console output generated during the Flash load helper operation.

show flh-log


Refer to the Router Products Command Reference for examples of these commands.

You can also use the o command in ROM monitor mode to list the configuration register settings on some models.

The Flash memory content listing does not include the checksum of individual files. To recompute and verify the image checksum after the image is copied into Flash memory, complete the following task in EXEC mode:

Task
Command

Recompute and verify the image checksum after the image is copied into Flash memory. On the Cisco 7000 series, you can verify the checksum of the image in internal Flash memory only with this command.

verify flash


When you enter this command, the screen prompts you for the filename to verify. By default, it prompts for the last (most recent) file in Flash. Press Return to recompute the default file checksum, or enter the filename of a different file at the prompt. Note that the checksum for microcode images is always 0x0000.

The following example illustrates how to use this command:

Router# verify flash 
 
Name of file to verify [gsxx]? 
Verifying via checksum... 
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv 
 
Flash verification successful. Length = 1923712, checksum = 0xA0C1 
Router#

On a Cisco 7000 series and Cisco 7500 series, you can verify the checksum of individual files on a Flash memory device. On the Cisco 7000 series, you can verify the checksum of a file located in internal Flash (flash:) or in the PCMCIA slot (slot0:). On the Cisco 7500 series, you can verify the checksum of a file located in internal Flash (bootflash:) or in one of the PCMCIA slots (slot0:, slot1:). To do so, perform the following task in EXEC mode:

Task
Command

Verify the checksum of a file on a specific Flash memory device.

verify [device:]filename


The following example verifies the gsxx file on the Flash memory card inserted in slot 0 of a Cisco 7000's RP card or a Cisco 7500's RSP card:

Router# verify slot0:gsxx

Reexecute the Configuration Commands in Startup Configuration

On all platforms except the Cisco 7000 series and Cisco 7500 series, you can reexecute the configuration commands stored in NVRAM. On the Cisco 7000 series and Cisco 7500 series, the same command allows you to reexecute the configuration specified by the CONFIG_FILE environment variable.

To reexecute the commands located in the startup configuration, complete the following task in privileged EXEC mode:

Task
Command

Reexecute the configuration commands located in NVRAM.

or

On the Cisco 7000 series and Cisco 7500 series, configure the router to reexecute the configuration specified by the CONFIG_FILE environment.

configure memory


Clear the Configuration Information

To clear the contents of your startup configuration, perform the following task in EXEC mode:

Task
Command

Clear the contents of your startup configuration. On most platforms, this command erases the contents of NVRAM. On the Cisco 7000 series and Cisco 7500 series, this command erases the configuration specified by the CONFIG_FILE environment variable.

erase startup-config


On the Cisco 7000 series and Cisco 7500 series, when you use the erase startup-config command, the router erases or deletes the configuration pointed to by CONFIG_FILE environment variable. If this variable points to NVRAM, the router erases NVRAM. If the CONFIG_FILE environment variable specifies a Flash memory device and configuration filename, the router deletes the configuration file. That is, the router marks the file as "deleted," rather than erasing it. This feature allows you to recover a "deleted" file. Refer to the "Manage Flash Files" section for more information on recovering deleted files.

To erase a saved configuration from a specific Flash device on a Cisco 7000 series or Cisco 7500 series, complete the following task in EXEC mode:

Task
Command

Erase or delete a specified configuration file on a specified Flash device.

erase [device:]filename

or

delete [device:]filename


As with the erase startup-config command, when you erase or delete a specific file, the system marks the file as deleted, allowing you to later recover a "deleted" file. If you omit the device, the router uses the default device specified by the cd command.

If you attempt to erase or delete the configuration file specified by the CONFIG_FILE or BOOTLDR environment variable, the system prompts you to confirm the deletion. Also, if you attempt to erase or delete the last valid system image specified in the BOOT environment variable, the system prompts you to confirm the deletion.


Note   On the Cisco 7000 series, the erase [device:]filename command differs from the erase flash command. The erase [device:]filename command erases a specified file located in internal Flash memory or on the Flash memory card inserted in the PCMCIA slot. The erase flash command erases internal Flash memory.


The following example erases the myconfig file from a Flash memory card inserted in the slot 0 of the RP or RSP card:

Router# erase slot0:myconfig

The following example deletes the myconfig file from a Flash memory card inserted in the slot 0 of the RP or RSP card:

Router# delete slot0:myconfig

Perform General Startup Tasks

When modifying your routing environment, you perform some general startup tasks. For example, to modify a configuration file, you enter configuration mode. You also modify the configuration register boot field to tell the router if and how to load a system image upon startup. Also, instead of using the default system image and configuration file to start up, you can specify a particular system image and configuration file that the router uses to start up.

General Startup Task List

General startup tasks include the following:

Enter Configuration Mode and Select a Configuration Source

Modify the Configuration Register Boot Field

Specify the Startup System Image

Specify the Startup Configuration File

Schedule a Reload of the System Image

Enter Configuration Mode and Select a Configuration Source

To enter configuration mode, enter the configure command at the privileged EXEC prompt. The router responds with the following prompt asking you to specify the terminal or memory, or a file stored on a network server (network) as the source of configuration commands:

Configuring from terminal, memory, or network [terminal]?

Each of these three methods is described in the following three sections:

Configure the Router from the Terminal

Configure the Router from Memory

Configure the Router from the Network

The router accepts one configuration command per line. You can enter as many configuration commands as you want.

You can add comments to a configuration file describing the commands you have entered. Precede a comment with an exclamation point (!). Because comments are not stored in NVRAM or in the active copy of the configuration file, comments do not appear when you list the active configuration with the show running-config EXEC command. Also, when the startup configuration is NVRAM, comments do not show up when you list the startup configuration with the show startup-config EXEC command. Comments are stripped out of the configuration file when it is loaded onto the router. However, you can list the comments in configuration files stored on a TFTP, rcp, or MOP server.

Configure the Router from the Terminal

When you configure the router from the terminal, the router executes the commands you enter at the system prompts. To configure the router from the terminal, complete the following tasks:

Task
Command

Step 1 Enter configuration mode and select the terminal option.

configure terminal

Step 2 Enter the necessary configuration commands.

See the appropriate chapter for specific configuration commands.

Step 3 Quit configuration mode.

^Z

Step 4 Save the configuration file to your startup configuration. On most platforms, this step saves the configuration to NVRAM. On the Cisco 7000 series and Cisco 7500 series, this step saves the configuration to the location specified by the CONFIG_FILE environment variable.

copy running-config startup-config


In the following example, the router is configured from the terminal. The comment "The following command provides the router host name" identifies the purpose of the next command line. The hostname command changes the router name from router1 to router2. By pressing Ctrl-Z (^Z), the user quits configuration mode. Finally, the copy running-config startup-config command saves the current configuration to the startup configuration.

Router1# configure terminal
Router1(config)# !The following command provides the router host name.
Router1(config)# hostname router2
^Z
Router2# copy running-config startup-config

When the startup configuration is NVRAM, it stores the current configuration information in text format as configuration commands, recording only nondefault settings. The memory is checksummed to guard against corrupted data.

On all platforms except the Cisco 7000 series and Cisco 7500 series, the router startup software always checks for configuration information in NVRAM. If NVRAM holds valid configuration commands, the router executes the commands automatically at startup. If the router detects a problem with NVRAM or the configuration it contains, it enters setup mode and prompts for configuration. Problems can include a bad checksum for the information in NVRAM or the absence of critical configuration information. See the publication Troubleshooting Internetworking Systems for troubleshooting procedures. See the Router Products Getting Started Guide for details on the setup command facility.

On the Cisco 7000 series and Cisco 7500 series, the router startup software uses the configuration pointed to by the CONFIG_FILE environment variable to start up. When the CONFIG_FILE environment variable does not exist or is null (such as at first-time startup), the router uses NVRAM as the default startup device. When the router uses NVRAM to start up and the system detects a problem with NVRAM or the configuration it contains, the router enters setup mode. Refer to the Router Products Getting Started Guide for more information on the setup command facility. For more information on environment variables, refer to the "Cisco's Implementation of Environment Variables" section in this chapter.

Configure the Router from Memory

On all platforms except the Cisco 7000 series and Cisco 7500 series, you can configure the router to execute the commands located in NVRAM. On the Cisco 7000 series and Cisco 7500 series, the same command configures the router to execute the configuration specified by the CONFIG_FILE environment variable.

To configure the router to execute the commands located in NVRAM or to execute the configuration specified by the CONFIG_FILE environment variable, complete the following task in privileged EXEC mode:

Task
Command

Configure the router to execute the commands located in NVRAM.

or

On the Cisco 7000 series and Cisco 7500 series, configure the router to execute the configuration specified by the CONFIG_FILE environment variable.

configure memory


Configure the Router from the Network

You can configure the router by retrieving and modifying a configuration file stored on one of your network servers. To do so, complete the following tasks:

Task
Command

Step 1 Enter configuration mode with the network option.

copy rcp running-config

or

copy tftp running-config

Step 2 At the system prompt, select a network or host configuration file. The network configuration file contains commands that apply to all network servers and terminal servers on the network. The host configuration file contains commands that apply to one network server in particular.

host or network

Step 3 At the system prompt, enter the optional IP address of the remote host from which you are retrieving the configuration file.

ip-address

Step 4 At the system prompt, enter the name of the configuration file or accept the default name.

filename

Step 5 Confirm the configuration filename that the system supplies.

y


In the following example, the router is configure