3.3 Important Cisco IOS Features
3.3.7 Backup and restoration of a configuration using a TFTP server

Most switches have a TFTP client, allowing you to retrieve and send configuration files from/to a TFTP server. The actual syntax to perform TFTP configuration file transfers varies based on the type of switch and version of Supervisor module installed in the switch.

To save a configuration file from either a Supervisor I or Supervisor II module, use the write net command. Figure shows a session writing a configuration file to a TFTP server. The server IP address and the filename are clearly seen in the output.

For the switch to obtain the new configuration over the network, after having cleared the configuration, you need to restore a valid IP address and default gateway setting. Retrieving a file from the server uses the command configure network. When retrieving a file, you need to specify the source filename on the TFTP server.

For complete system recovery, make sure that you have a copy of the configuration file of each switch stored somewhere other than on the switch itself. If anything happens to the Supervisor module, you might not be able to recover the configuration file. It is a big mistake to have to rebuild the entire configuration file from scratch during a system outage, especially when a backup copy could have easily been created as a backup on a network-accessible machine.

Through TFTP, you can store your configuration file on a TFTP server and recover it later when needed. The syntax varies, depending upon the version of Supervisor module you have. This section assumes you have either a Cisco IOS command-based switch or a set command-based switch with a Supervisor module.

As a side note, TFTP servers are inherently weak security wise. It is highly recommended that you do not keep your configuration files in a TFTP directory space until you actually need to retrieve them. Anyone who compromises your TFTP server can modify the configuration files without your knowledge. The prudent network administrator will maintain configuration files in a secure directory space and copy them back to the TFTP directory space only when he or she is ready to use them. Although this adds another step to the recovery process, the security benefits definitely outweigh the procedural disadvantages.

Transferring Cisco IOS command-based switch configuration files via TFTP to another device works the same as with a router. The command copy running-config tftp will copy the configuration file to a TFTP server at the location you specify. The recovery process works in reverse. To recover a configuration file from a TFTP server, issue the command copy tftp running-config. This will load the configuration file you specify into NVRAM and the "active" memory of the switch.

Transferring Supervisor III and Catalyst 4000/6000 configuration files via TFTP to another device looks much like it does with a router. The command copy config flash | file-id | tftp  copies the configuration file to one of three locations. You can store the configuration file in the bootflash memory, a Flash card in a Flash slot (with a supervisor module that supports flash cards), or to a TFTP server. When copying configuration files to or from the switch, you need to specify the source filename. Because of the Flash architecture on the Supervisor III, you might have several configuration files stored locally. However, only one can be active. Therefore, you need to specify which of the local files you are trying to copy.

Recovering a configuration file works in reverse. If you intend to retrieve the file from a TFTP server, use the command copy tftp flash | file-id | config. When retrieving, you can write the configuration file to your bootflash, a Flash card, or to the running configuration. If you intend to write the configuration file to your running configuration, use the command form copy tftp config. Figure shows a session recovering the configuration filename cat to a Flash device.

If you store your configuration file in your Flash, you can recover it with the command copy flash tftp | file-id | config.

Lab Activity
  In this lab activity, you will learn how to copy your current configuration from a Catalyst 4000 switch to a TFTP server.
 
Lab Activity
  In this lab activity, you will learn how to copy your current configuration from a Catalyst 2900 switch to a TFTP server.