cisco IOS — Copying a Configuration File from the Device to a TFTP Server

• 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 , on page 30 section). The CONFIG_FILE variable defaults to NVRAM and can be a file in the following file systems: nvram: (NVRAM) flash: (internal flash memory) usbflash0: (external usbflash file system) usbflash1: (external usbflash file system) Copy Configuration Files from a Network Server to the Device You can copy configuration files from a TFTP, rcp, or FTP server to the running configuration or startup configuration of the device.

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 device. For example, you may add another device to your network and want it to have a similar configuration to the original device. By copying the file to the new device, you can change the relevant parts rather than recreating the whole file. • To load the same configuration commands on to all of the devices in your network so that all of the devices have similar configurations. The copy { ftp: | rcp:

| tftp:system:running-config } EXEC command loads the configuration files into the device as if you were typing the commands on the command line. The device 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 is 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 is used. However, some commands in the existing configuration may not be replaced or negated.

In this case, the resulting configuration file is a mixture of the existing configuration file and the copied configuration file, with the copied configuration file having precedence. 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 copy ftp: | rcp: | tftp: } nvram:startup-config command) and reload the device. To copy configuration files from a server to a device, perform the tasks described in the following sections. The protocol that 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. Copying a Configuration File from the Device to a TFTP Server In some implementations of TFTP, you must create a dummy file on the TFTP server and give it read, write, and execute permissions before copying a file over it. Refer to your TFTP documentation for more information. Managing Configuration Files Copy Configuration Files from a Network Server to the Device Managing Configuration Files 3