Managing Configuration Files Configuration Guide, Cisco IOS XE Release 3SE (Cisco WLC 5700 Series)
Managing Configuration Files
Downloads: This chapterpdf (PDF - 242.0KB) The complete bookPDF (PDF - 589.0KB) | The complete bookePub (ePub - 702.0KB) | Feedback

Managing Configuration Files

Contents

Managing Configuration Files

Last Updated: January 23, 2013

This chapter describes how to create, load, and maintain configuration files. Configuration files contain a set of user-configured commands that customize the functionality of your Cisco routing device.

The tasks in this chapter assume that you have at least a minimal configuration running on your system. You can create a basic configuration file using the setup command (see "Using Setup Mode to Configure a Cisco Networking Device" for details).

For a complete description of the configuration file management commands in this chapter, refer to the Cisco IOS Configuration Fundamentals Command Reference.

To identify hardware or software image support for a specific feature, use Feature Navigator on Cisco.com to search for information about the feature or refer to the software release notes for a specific release. For more information, see About Cisco IOS Software Documentation.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

Prerequisites for Managing Configuration Files

  • You should have at least a basic familiarity with the Cisco IOS environment and the command-line interface.
  • You should have at least a minimal configuration running on your system. You can create a basic configuration file using the setup command (see Using Setup Mode to Configure a Cisco Networking Device for details).

Restrictions for Managing Configuration Files

  • Many of the Cisco IOS commands described in this document are available and function only in certain configuration modes on the router.
  • Some of the Cisco IOS configuration commands are only available on certain router platforms, and the command syntax may vary on different platforms.

Information About Managing Configuration Files

Types of Configuration Files

Startup configuration files (startup-config) are used during system startup to configure the software. Running configuration files (running-config) contain the current configuration of the software. The two configuration files can be different. For example, you may want to change the configuration for a short time period rather than permanently. In this case, you would change the running configuration using the configure terminal EXEC command but not save the configuration using the copy running-config startup-config EXEC command.

To change the running configuration, use the configure terminal command, as described in the "Modifying the Configuration File at the CLI" section later in this chapter. As you use the Cisco IOS XE configuration modes, commands generally are executed immediately and are saved to the running configuration file either immediately after you enter them or when you exit a configuration mode.

To change the startup configuration file, you can either save the running configuration file to the startup configuration using the copy running-config startup-config EXEC command or copy a configuration file from a file server to the startup configuration (see the "Copying Configuration Files from a Network Server to the Router" section for more information).

Configuration Mode and Selecting a Configuration Source

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

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

Configuring from the terminal allows you to enter configuration commands at the command line, as described in the following section. Configuring from memory loads the startup configuration file. See the "Reexecuting the Configuration Commands in the Startup Configuration File " section for more information. Configuring from the network allows you to load and execute configuration commands over the network. See the "Copying a Configuration File from a TFTP Server to the Router " section for more information.

Configuration File Changes Using the CLI

The Cisco IOS software 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 theshowrunning-configormoresystem:running-config EXEC command. Comments do not display when you list the startup configuration with the showstartup-config or morenvram:startup-config EXEC mode 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 File Transfer Protocol (FTP), remote copy protocol (rcp), or Trivial File Transfer Protocol (TFTP) server. When you configure the software using the CLI, the software executes the commands as you enter them.

Location of Configuration Files

Configuration files are stored in the following locations:

  • The running configuration is stored in RAM.
  • On all platforms except the Class A Flash file system platforms, the startup configuration is stored in nonvolatile random-access memory (NVRAM).
  • On Class A Flash file system platforms, the startup configuration is stored in the location specified by the CONFIG_FILE environment variable (see the "Specifying the CONFIG_FILE Environment Variable on Class A Flash File Systems" section for more information). The CONFIG_FILE variable defaults to NVRAM and can be a file in the following file systems:
    • nvram: (NVRAM)
    • bootflash: (internal Flash memory)
    • HDD: (harddisk)
    • usb0: (external USB media 1)
    • usb1: (external USB media 2)

Copy Configuration Files from a Network Server to the Router

You can copy configuration files from a TFTP, rcp, or FTP server to the running configuration or startup configuration of the router. You may want to perform this function for one of the following reasons:

  • To restore a backed-up configuration file.
  • To use the configuration file for another router. For example, you may add another router to your network and want it to have a similar configuration to the original router. By copying the file to the new router, you can change the relevant parts rather than re-creating the whole file.
  • To load the same configuration commands on to all the routers in your network so that all the routers have similar configurations.

The copy{ftp: | rcp: | tftp:system:running-configEXECcommand loads the configuration files into the router as if you were typing the commands in at the command line. The router does not erase the existing running configuration before adding the commands. If a command in the copied configuration file replaces a command in the existing configuration file, the existing command will be erased. For example, if the copied configuration file contains a different IP address in a particular command than the existing configuration, the IP address in the copied configuration will be used. However, some commands in the existing configuration may not be replaced or negated. In this case, the resulting configuration file will be a mixture of the existing configuration file and the copied configuration file, with the copied configuration file having precedence.

In order to restore a configuration file to an exact copy of a file stored on a server, you need to copy the configuration file directly to the startup configuration (using the copyftp:| rcp:| tftp:} nvram:startup-configcommand) and reload the router.

To copy configuration files from a server to a router, perform the tasks described in the following sections:

The protocol you use depends on which type of server you are using. The FTP and rcp transport mechanisms provide faster performance and more reliable delivery of data than TFTP. These improvements are possible because the FTP and rcp transport mechanisms are built on and use the TCP/IP stack, which is connection-oriented.

Configuration Files Larger than NVRAM

To maintain a configuration file that exceeds size of NVRAM, you should be aware of the information in the following sections:

Controlling the Parser Cache

The Cisco IOS XE command-line parser in the Cisco IOS XE software performs the translation and execution (parsing) of command lines. The Parser Cache feature was developed to rapidly process large configuration files, thereby dramatically improving load time.

The Parser Cache feature allows the rapid recognition and translation of configuration lines in a configuration file that differ slightly from previously used configuration lines (for example, pvc 0/100, pvc 0/101, and so on) by dynamically creating, caching, and reusing simplified parse graphs. This improvement is useful primarily for configuration files that repeat similar commands hundreds or thousands of times, such as cases in which thousands of virtual circuits must be configured for subinterfaces, or hundreds of access lists must be configured. Performance will improve the most for those files in which the same commands are used repeatedly but the numerical arguments change from command to command.

The Parser Cache is enabled by default. However, users with Cisco devices that do not require large configuration files may want to disable the Parser Cache to free the resources used by this feature. (Memory used by this feature depends on the size of the configuration files parsed, but is generally less than 512 KB.)

To control the Parser Cache feature, perform the tasks described in the following sections. All of these tasks are optional.

Configuring the Router to Download Configuration Files

You can configure the router to load one or two configuration files at system startup. The configuration files are loaded into memory and read in as if you were typing the commands at the command line. Thus, the configuration for the router will be a mixture of the original startup configuration and the one or two downloaded configuration files.

How to Manage Configuration File Information

Displaying Configuration File Information

To display information about configuration files, use the following commands in EXEC mode, as needed:

Command

Purpose

 
Router# show bootvar

Lists 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.

 
Router# more file-url

Displays the contents of a specified file.

 
Router# show running-config

Displays the contents of the running configuration file. (Command alias for the more system:running-config command.)

 
Router# show startup-config

Displays the contents of the startup configuration file. (Command alias for the more nvram:startup-config command.)

On all platforms except the Class A Flash file system platforms, the default startup-config file usually is stored in NVRAM. On the Class A Flash file system platforms, the CONFIG_FILE environment variable points to the default startup-config file. The CONFIG_FILE variable defaults to NVRAM.

Modifying the Configuration File at the CLI

The Cisco IOS XE software 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 or more system:running-config EXEC command. Comments do not display when you list the startup configuration with the show startup-config or more nvram:startup-config EXEC mode 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 Trivial File Transfer Protocol (TFTP) server.

When you configure the software using the CLI, the software executes the commands as you enter them. To configure the software using the CLI, use the following commands beginning in privileged EXEC mode:

SUMMARY STEPS

1.    Router# configure terminal

2.   

3.   Do one of the following:

  • Router(config)# end
  • Router(config)# ^Z

4.    Router# copy system:running-config nvram:startup-config


DETAILED STEPS
  Command or Action Purpose
Step 1
Router# configure terminal 

Enters global configuration mode.

 
Step 2

 

Enter the necessary configuration commands. The Cisco IOS XE documentation set describes configuration commands organized by technology.

 
Step 3
Do one of the following:
  • Router(config)# end
  • Router(config)# ^Z
 

Ends the configuration session and exits to EXEC mode.

Note    When you press the Ctrl and Z keys simultaneously, ^Z is displayed to the screen.
 
Step 4
Router# copy system:running-config nvram:startup-config 

Saves the running configuration file as the startup configuration file.

You may also use the copy running-config startup-config command alias, but you should be aware that this command is less precise. On most platforms, this command saves the configuration to NVRAM. On the Class A Flash file system platforms, this step saves the configuration to the location specified by the CONFIG_FILE environment variable (the default CONFIG_FILE variable specifies that the file should be saved to NVRAM).

 
What to Do Next

In the following example, the router prompt name of the router is configured. The comment line, indicated by the exclamation mark (!), does not execute any command.

In this example, the hostname command is used to change the router name from Router to new_name. By pressing Ctrl-Z (^Z) or entering the endcommand, the user quits configuration mode. The copy system:running-config nvram:startup-config command saves the current configuration to the startup configuration.

Router# configure terminal
Router(config)# !The following command provides the router host name.
Router(config)# hostname new_name
new_name(config)# end
new_name# copy system:running-config nvram: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.


Note


Some specific commands might not get saved to NVRAM. You will need to enter these commands again if you reboot the machine. These commands are noted in the documentation. We recommend that you keep a list of these settings so that you can quickly reconfigure your router after rebooting.

Copying a Configuration File from the Router to a TFTP Server

To copy configuration information on a TFTP network server, complete the tasks in this section:

SUMMARY STEPS

1.    enable

2.    copy system:running-config tftp: [[[//location ]/directory ]/filename ]

3.    copy nvram:startup-config tftp: [[[//location ]/directory ]/filename ]


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
copy system:running-config tftp: [[[//location ]/directory ]/filename ]


Example:

Router# copy system:running-config tftp: //server1/topdir/file10

 

Copies the running configuration file to a TFTP server.

 
Step 3
copy nvram:startup-config tftp: [[[//location ]/directory ]/filename ]


Example:

Router# copy nvram:startup-config tftp: //server1/1stdir/file10

 

Copies the startup configuration file to a TFTP server.

 

Examples

The following example copies a configuration file from a router to a TFTP server:

Tokyo# copy system:running-config tftp://172.16.2.155/tokyo-confg
Write file tokyo-confg on host 172.16.2.155? [confirm] y
Writing tokyo-confg!!! [OK]

Copying a Configuration File from the Router to the FTP Server

To copy a startup configuration file or a running configuration file from the router to an FTP server, complete the following tasks:

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    ip ftp username username

4.    ip ftp password password

5.    end

6.   Do one of the following:

  • copy system:running-config ftp: [[[//[username [:password ]@]location/directory ]/filename ]
  • copy nvram:sta rtup-config ftp: [[[//[username [:password ]@]location/directory ]/filename ]


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

Enters global configuration mode.

 
Step 3
ip ftp username username


Example:

Router(config)# ip ftp username user1

 

(Optional) Specifies the default remote username.

 
Step 4
ip ftp password password


Example:

Router(config)# ip ftp username guessme

 

(Optional) Specifies the default password.

 
Step 5
end


Example:

Router(config)# end

 

(Optional) Exits global configuration mode. This step is required only if you override the default remote username or password (see Steps 2 and 3).

 
Step 6
Do one of the following:
  • copy system:running-config ftp: [[[//[username [:password ]@]location/directory ]/filename ]
  • copy nvram:sta rtup-config ftp: [[[//[username [:password ]@]location/directory ]/filename ]


Example:

Router# copy system:running-config ftp: //user1:guessme@company.com /dir10/file1

 

Copies the running configuration or startup configuration file to an FTP server.

 

Copying a Configuration File from a TFTP Server to the Router

To copy a configuration file from a TFTP server to the router, complete the tasks in this section:

SUMMARY STEPS

1.    enable

2.    copy tftp: [[[//location ]/directory ]/filename ] system:running-config

3.    copy tftp: [[[//location ]/directory ]/filename ] nvram:startup-config


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
copy tftp: [[[//location ]/directory ]/filename ] system:running-config


Example:

Router# copy tftp://server1/dir10/datasource system:running-config

 

Copies a configuration file from a TFTP server to the running configuration.

 
Step 3
copy tftp: [[[//location ]/directory ]/filename ] nvram:startup-config


Example:

Router# copy tftp://server1/dir10/datasource nvram:startup-config

 

Copies a configuration file from a TFTP server to the startup configuration.

 

Examples

In the following example, the software is configured from the file named tokyo-config at IP address 172.16.2.155:

Router1# copy tftp://172.16.2.155/tokyo-confg system:running-config
 
Configure using tokyo-confg from 172.16.2.155? [confirm] y
 
Booting tokyo-confg from 172.16.2.155:!!! [OK - 874/16000 bytes]

Copying a Configuration File from the rcp Server to the Router

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

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    ip rcmd remote-username username

4.    end

5.    copy rcp: [[[//[username@]location ]/directory ]/filename ]system:running-config


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

(Optional) Enters configuration mode from the terminal. This step is required only if you override the default remote username (see Step 3).

 
Step 3
ip rcmd remote-username username


Example:

Router(config)# ip rcmd remote-username user1

 

(Optional) Specifies the remote username.

 
Step 4
end


Example:

Router(config)# end

 

(Optional) Exits global configuration mode. This step is required only if you override the default remote username (see Step 2).

 
Step 5
copy rcp: [[[//[username@]location ]/directory ]/filename ]system:running-config


Example:



Example:

or



Example:

copy rcp:[[[//[username@]location ]/directory ]/filename ] nvram:startup-config



Example:

Router# copy rcp://[user1@company.com/dir10/fileone] nvram:s tartup-config

 

Copies the configuration file from a rcp server to the running configuration or startup configuration.

 

Copying a Configuration File from an FTP Server to the Router

To copy a configuration file from an F TP server to the running configuration or startup configuration, complete the tasks in this section:

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    ip ftp username username

4.    ip ftp password password

5.    end

6.    copy ftp: [[[//[username [:password ]@]location ]/directory ]/filename ]system:running-config


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

(Optional) Allows you to enter global configuration mode. This step is required only if you want to override the default remote username or password (see Steps 2 and 3).

 
Step 3
ip ftp username username


Example:

Router(config)# ip ftp username user1

 

(Optional) Specifies the default remote username.

 
Step 4
ip ftp password password


Example:

Router(config)# ip ftp password guessme

 

(Optional) Specifies the default password.

 
Step 5
end


Example:

Router(config)# end

 

(Optional) Exits global configuration mode. This step is required only if you override the default remote username or password (see Steps 2 and 3).

 
Step 6
copy ftp: [[[//[username [:password ]@]location ]/directory ]/filename ]system:running-config


Example:

Example:

or



Example:

copy ftp:[[[//[username [:password ]@]location/directory ]/filename ] nvram:startup-config



Example:

Router# copy ftp://user1:guessme@company.com /dir10/datasource nvram:startup-config

 

Using FTP, copies the configuration file from a network server to running memory or the startup configuration.

 

Maintaining Configuration Files Larger than NVRAM

To maintain a configuration file that exceeds size of NVRAM, perform the tasks described in the following sections:

Managing the Parser Cache

To control the Parser Cache feature, perform the tasks described in the following sections. All of these tasks are optional:

Clearing the Parser Cache

To clear the information stored by the Parser Cache feature, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    clear parser cache


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
clear parser cache


Example:

Router# clear parser cache

 

Clears the parse cache entries and hit/miss statistics stored for the Parser Cache feature.

 

Disabling the Parser Cache

The Parser Cache feature is enabled by default. To disable the Parser Cache feature, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    no parser cache


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
no parser cache


Example:

Router# no parser cache

 

Disables the Parser Cache feature:

  • When the parser cache is disabled, the noparsercache command line is written to the running configuration file.
  • If you wish to disable the parser cache to free system resources, you should clear the parser cache before issuing the noparsercache command. You will not be able to clear the parser cache after disabling it.
 

Reenabling the Parser Cache

To reenable the Parser Cache feature after disabling it, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    parser cache


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
parser cache


Example:

Router# parser cache

 

Enables the Parser Cache feature.

 

Copying Configuration Files from Flash Memory to the Startup or Running Configuration

To copy a configuration file from Flash memory directly to your startup configuration in NVRAM or your running configuration, enter one of the commands in Step 2:

SUMMARY STEPS

1.    enable

2.   Do one of the following:

  • copy filesystem : [partition-number:][filename ] nvram:startup-config
  • copy filesystem : [partition-number:][filename ] system:running-config


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
Do one of the following:
  • copy filesystem : [partition-number:][filename ] nvram:startup-config
  • copy filesystem : [partition-number:][filename ] system:running-config


Example:

Router# copy slot0:4:ios-upgrade-1 nvram:startup-config

 

Loads a configuration file directly into NVRAM.

or

Copies a configuration file to your running configuration.

 

Examples

The following example copies the file named ios-upgrade-1 from partition 4 of the Flash memory PC Card in slot 0 to the router startup configurations:

Router# copy slot0:4:ios-upgrade-1 nvram:startup-config
 
Copy '
ios-upgrade-1
' from flash device
  as 'startup-config' ? [yes/no] yes
 
[OK]

Copying Configuration Files Between Flash Memory File Systems

On platforms with multiple Flash memory file systems, you can copy files from one Flash memory file system, such as internal Flash memory or a Flash memory card in a PCMCIA slot, to another Flash memory file system. Copying files to different Flash memory file systems lets you create backup copies of working configurations and duplicate configurations for other routers. To copy a configuration file between Flash memory file systems, use the following commands in EXEC mode:

SUMMARY STEPS

1.    enable

2.    show source-filesystem :

3.    copy source-filesystem : [partition-number:][filename ] dest-filesystem:[partition-number:][filename ]

4.    verify dest-filesystem : [partition-number:][filename ]


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
show source-filesystem :


Example:

Router# copy slot0:4:ios-upgrade-1 nvram:startup-config

 

Displays the layout and contents of Flash memory to verify the filename.

 
Step 3
copy source-filesystem : [partition-number:][filename ] dest-filesystem:[partition-number:][filename ]


Example:

Router# copy flash: slot1:

 

Copies a configuration file between Flash memory devices.

  • The source device and the destination device cannot be the same. For example, the copyslot1:slot1: command is invalid.
 
Step 4
verify dest-filesystem : [partition-number:][filename ]


Example:

Router# verify flash: slot1:

 

Verifies the checksum of the file you copied.

 

Example

The following example copies the file named running-config from partition 1 of internal Flash memory to partition 1 of slot 1 on a Cisco 3600 series router. In this example, the source partition is not specified, so the router prompts for the partition number.

Router# copy flash: slot1:
 
System flash
Partition   Size    Used      Free      Bank-Size  State          Copy Mode
  1         4096K   3070K     1025K     4096K      Read/Write     Direct
  2        16384K   1671K    14712K     8192K      Read/Write     Direct
[Type ?<no> for partition directory; ? for full directory; q to abort]
Which partition? [default = 1] 
System flash directory, partition 1:
File  Length   Name/status
  1   3142748  dirt/network/mars-test/c3600-j-mz.latest  
  2   850      running-config  
[3143728 bytes used, 1050576 available, 4194304 total]
PCMCIA Slot1 flash directory:
File  Length   Name/status
  1   1711088  dirt/gate/c3600-i-mz 
  2   850      running-config 
[1712068 bytes used, 2482236 available, 4194304 total]
Source file name? running-config
 
Destination file name [running-config]? 
Verifying checksum for 'running-config' (file # 2)...  OK
Erase flash device before writing? [confirm]
Flash contains files. Are you sure you want to erase? [confirm]
Copy 'running-config' from flash: device
  as 'running-config' into slot1: device WITH erase? [yes/no] yes
 
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
!
 [OK - 850/4194304 bytes]
Flash device copy took 00:00:30 [hh:mm:ss]
Verifying checksum...  OK (0x16)

Copying a Configuration File from an FTP Server to Flash Memory Devices

To copy a configuration file from an FTP server to a Flash memory device, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    ip ftp username username

4.    ip ftp password password

5.    end

6.    copy ftp: [[[//[username:password@]location ]/directory ]/filename ] flash-filesystem:[partition-number:][filename ]


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

(Optional) Enters global configuration mode. This step is required only if you override the default remote username or password (see Steps 3 and 4).

 
Step 3
ip ftp username username


Example:

Router(config)# ip ftp username user1

 

(Optional) Specifies the remote username.

 
Step 4
ip ftp password password


Example:

Router(config)# ip ftp password guessme

 

(Optional) Specifies the remote password.

 
Step 5
end


Example:

Router(config)# end

 

(Optional) Exits configuration mode. This step is required only if you override the default remote username (see Steps 3 and 4).

 
Step 6
copy ftp: [[[//[username:password@]location ]/directory ]/filename ] flash-filesystem:[partition-number:][filename ]


Example:

Router> copy ftp:router-config slot0:new-config

 

Copies the configuration file from a network server to the Flash memory device using FTP.

 

Copying a Configuration File from an rcp Server to Flash Memory Devices

To copy a configuration file from an rcp server to a Flash memory device, complete the tasks in this section:

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    ip rcmd remote-username username

4.    end

5.    copy rcp: [[[//[username@]location ]/directory ]/filename ] flash-filesystem:[partition-number:][filename ]


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

(Optional) Enters global configuration mode.This step is required only if you override the default remote username or password (see Steps 3 and 4).

 
Step 3
ip rcmd remote-username username


Example:

Router(config)# ip rcmd remote-username user1

 

(Optional) Specifies the remote username.

 
Step 4
end


Example:

Router(config)# end

 

(Optional) Exits configuration mode.This step is required only if you override the default remote username or password (see Steps 3 and 4).

 
Step 5
copy rcp: [[[//[username@]location ]/directory ]/filename ] flash-filesystem:[partition-number:][filename ]


Example:

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

 

Copies the configuration file from a network server to the Flash memory device using rcp. Reply to any router prompts for additional information or confirmation. The prompting will depending on how much information you provide in the copy command and the current setting of the fileprompt command.

 

Copying a Configuration File from a TFTP Server to Flash Memory Devices

To copy a configuration file from a TFTP server to a Flash memory device, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    copy tftp: [[[//location ]/directory ]/filename ] flash-filesystem:[partition-number:][filename ]


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
copy tftp: [[[//location ]/directory ]/filename ] flash-filesystem:[partition-number:][filename ]


Example:

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

 

Copies the file from a TFTP server to the Flash memory device. Reply to any router prompts for additional information or confirmation. The prompting will depending on how much information you provide in the copy command and the current setting of the fileprompt command.

 

Examples

The following example shows the copying of the configuration file named router-config from a TFTP server to the Flash memory card inserted in slot 0 of the Network Processing Engine (NPE) or Route Switch Processor (RSP) card of a Cisco 7500 series router. The copied file is renamed new-config.

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

Reexecuting the Configuration Commands in the Startup Configuration File

To reexecute the commands located in the startup configuration file, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    configure memory


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure memory


Example:

Router# configure memory

 

Reexecutes the configuration commands located in the startup configuration file .

 

Clearing the Startup Configuration

You can clear the configuration information from the startup configuration. If you reboot the router with no startup configuration, the router will enter the Setup command facility so that you can configure the router from scratch.To clear the contents of your startup configuration, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    erase nvram


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
erase nvram


Example:

Router# erase nvram

 

Clears the contents of your startup configuration.

Note    For all platforms except the Class A Flash file system platforms, this command erases NVRAM. The startup configuration file cannot be restored once it has been deleted. On Class A Flash file system platforms, when you use the erasestartup-configEXECcommand, 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.
 

Deleting a Specified Configuration File

To delete a specifi ed configuration on a specific Flash device, complete the task in this section:

SUMMARY STEPS

1.    enable

2.    delete flash-filesystem : filename


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
delete flash-filesystem : filename


Example:

Router# delete slot0:myconfig

 

Deletes a specified configuration file on a specified Flash device.

Note    On Class A and B Flash file systems, when you delete a specific file in Flash memory, the system marks the file as deleted, allowing you to later recover a deleted file using the undelete EXEC command. Erased files cannot be recovered. To permanently erase the configuration file, use the squeeze EXEC command. On Class C Flash file systems, you cannot recover a file that has been deleted. If you attempt to erase or delete the configuration file specified by the CONFIG_FILE environment variable, the system prompts you to confirm the deletion.
 

Specifying the CONFIG_FILE Environment Variable on Class A Flash File Systems

On Class A Flash file systems, you can configure the Cisco IOS software to load the startup configuration file specified by the CONFIG_FILE environment variable. The CONFIG_FILE variable defaults to NVRAM. To change the CONFIG_FILE environment variable, complete the tasks in this section:

SUMMARY STEPS

1.    enable

2.    copy [flash-url| ftp-url | rcp-url| tftp-url | system:running-config | nvram:startup-config] dest-flash-url

3.    configure terminal

4.    boot config dest-flash-url

5.    end

6.    copy system:running-config nvram:startup-config

7.    show bootvar


DETAILED STEPS
  Command or Action Purpose
Step 1
enable

Example:

enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
copy [flash-url| ftp-url | rcp-url| tftp-url | system:running-config | nvram:startup-config] dest-flash-url


Example:

Router# copy system:running-config nvram:startup-config

 

Copies the configuration file to the Flash file system from which the router will load the file upon restart.

 
Step 3
configure terminal


Example:

Router# configure terminal

 

Enters global configuration mode.

 
Step 4
boot config dest-flash-url


Example:

Router(config)# boot config 172.16.1.1

 

Sets the CONFIG_FILE environment variable. This step modifies the runtime CONFIG_FILE environment variable.

 
Step 5
end


Example:

Router(config)# end

 

Exits global configuration mode.

 
Step 6
copy system:running-config nvram:startup-config


Example:

Router# copy system:running-config nvram:startup-config

 

Saves the configuration performed in Step 3 to the startup configuration.

 
Step 7
show bootvar


Example:

Router# show bootvar

 

(Optional) Allows you to verify the contents of the CONFIG_FILE environment variable.

 

Examples

The following example copies the running configuration file to the first PCMCIA slot of the RSP card in a Cisco 7500 series router. This configuration is then used as the startup configuration when the system is restarted.

Router# copy system:running-config slot0:config2
Router# configure terminal
Router(config)# boot config slot0:config2
Router(config)# end
Router# copy system:running-config nvram:startup-config
[ok]
Router# show bootvar
BOOT variable = slot0:rsp-boot-m
CONFIG_FILE variable = nvram:
Current CONFIG_FILE variable = slot0:config2
Configuration register is 0x010F

Configuring the Router to Download the Network Configuration File

To configure the Cisco IOS software to download a network configuration file from a server at startup, complete the tasks in this section:

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    boot network {ftp:[[[//[username [:password ]@]location ]/directory ]/filename ] | rcp:[[[//[username@]location ]/directory ]/filename ] | tftp:[[[//location ]/directory ]/filename ]}

4.    service config

5.    end

6.    Router#copysystem:running-confignvram:startup-config


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

Enters global configuration mode.

 
Step 3
boot network {ftp:[[[//[username [:password ]@]location ]/directory ]/filename ] | rcp:[[[//[username@]location ]/directory ]/filename ] | tftp:[[[//location ]/directory ]/filename ]}


Example:

Router(config)# boot network tftp:hostfile1

 

Specifies the network configuration file to download at startup, and the protocol to be used (TFTP, rcp, or FTP).

  • If you do not specify a network configuration filename, the Cisco IOS software uses the default filename network-confg. If you omit the address, the router uses the broadcast address.
  • You can specify more than one network configuration file. The software tries them in order entered until it loads one. This procedure can be useful for keeping files with different configuration information loaded on a network server.
 
Step 4
service config


Example:

Router(config)# service config

 

Enables the system to automatically load the network file upon restart.

 
Step 5
end


Example:

Router(config)# end

 

Exits global configuration mode.

 
Step 6
Router#copysystem:running-confignvram:startup-config

Example:

Router# copy system:running-config nvram:startup-config

 

Saves the running configuration to the startup configuration file.

 

Configuring the Router to Download the Host Configuration File

To configure the Cisco IOS software to download a host configuration file from a server at startup, complete the tasks in this section:

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    boot host {ftp:[[[//[username [:password ]@]location ]/directory ]/filename ] | rcp:[[[//[username@]location ]/directory ]/filename ] | tftp:[[[//location ]/directory ]/filename ] }

4.    service config

5.    end

6.    copy system:running-config nvram:startup-config


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

Enters global configuration mode.

 
Step 3
boot host {ftp:[[[//[username [:password ]@]location ]/directory ]/filename ] | rcp:[[[//[username@]location ]/directory ]/filename ] | tftp:[[[//location ]/directory ]/filename ] }


Example:

Router(config)# boot host tftp:hostfile1

 

Specifies the host configuration file to download at startup, and the protocol to be used (FTP, rcp, or TFTP):

  • If you do not specify a host configuration filename, the router uses its own name to form a host configuration filename by converting the name to all lowercase letters, removing all domain information, and appending "-confg." If no host name information is available, the software uses the default host configuration filename router-confg. If you omit the address, the router uses the broadcast address.
  • You can specify more than one host configuration file. The Cisco IOS software tries them in order entered until it loads one. This procedure can be useful for keeping files with different configuration information loaded on a network server.
 
Step 4
service config


Example:

Router(config)# service config

 

Enables the system to automatically load the host file upon restart.

 
Step 5
end


Example:

Router(config)# end

 

Exits global configuration mode.

 
Step 6
copy system:running-config nvram:startup-config


Example:

Router# copy system:running-config nvram:startup-config

 

Saves the running configuration to the startup configuration file.

 

Examples

In the following example, a router is configured to download the host configuration file named hostfile1 and the network configuration file named networkfile1. The router uses TFTP and the broadcast address to obtain the file.

Router# configure terminal
Router(config)# boot host tftp:hostfile1
Router(config)# boot network tftp:networkfile1
Router(config)# service config
Router(config)# end
Router# copy system:running-config nvram:startup-config

Additional References

Related Documents

Related Topic

Document Title

Cisco IOS commands

Cisco IOS Master Commands List, All Releases

Cisco IOS configuration commands

Cisco IOS Configuration Fundamentals Command Reference

Standards

Standard

Title

No new or modified standards are supported, and support for existing standards has not been modified

--

MIBs

MIB

MIBs Link

  • No new or modified MIBs are supported, and support for existing MIBs has not been modified.

To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs

RFCs

RFC

Title

No new or modified RFCs are supported, and support for existing RFCs has not been modified.

--

Technical Assistance

Description

Link

The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

http://www.cisco.com/cisco/web/support/index.html

Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other countries. A listing of Cisco's trademarks can be found at www.cisco.com/go/trademarks. Third party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1005R)

Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)

Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.

© 2013 Cisco Systems, Inc. All rights reserved.