The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to manipulate the flash file system, how to copy configuration files, and how to archive (upload and download) software images on the Cisco Industrial Ethernet 2000U Series (IE 2000U) and Connected Grid Switches, hereafter referred to as switch.
NoteFor complete syntax and usage information for the commands used in this chapter, see the documents listed in the“Related Documents” section.
The flash file system is a single flash device on which you can store files. It also provides several commands to help you manage software image and configuration files. The default flash file system on the switch is named flash: .
The switch has a removable compact flash card that stores the Cisco IOS software image and configuration files. You can replace and upgrade the switch without reconfiguring it. Removing the compact flash card does not interrupt switch operation. When the compact flash card is removed, you do not have access to the flash file system, and any attempt to access it generates an error message. The switch ships with the compact flash memory card installed and supports any size compact flash card.
Use the show flash: privileged EXEC command to display the compact flash file settings. For information about how to remove or replace the compact flash memory card on the switch, see the Hardware Installation Guide for your switch.
To display the available file systems on your switch, use the show file systems privileged EXEC command as shown in this example.
When the switch starts and detects an unsupported Secure Digital (SD) flash memory card, or when you insert an unsupported SD flash memory card while the switch is running, the following warning message is displayed:
WARNING: Non-IT SD flash detected. Use of this card during normal
operation can impact and severely degrade performance of the system.
Please use supported SD flash cards only.
To display information about the SD flash memory card on the screen, use the show platform sdflash privileged EXEC command.
This example shows an unsupported SD flash memory card:
SD Flash Manufacturer : SMART MODULAR (ID=27h) - Non IT
This example shows a supported SD flash memory card:
SD Flash Manufacturer : SMART MODULAR (ID=27h)
NoteWhen you enter theshow platform sdflash privileged EXEC command, the name, date, and other fields that are displayed depend on the manufacturer of the SD flash memory card. However, if the SD flash memory card is unsupported, “Non IT” is displayed after the manufacturer’s name.
NoteThe output of theshow platform sdflash privileged EXEC command is also included in the show tech-support privileged EXEC command output.
You can specify the file system or directory that the system uses as the default file system by using the cd filesystem: privileged EXEC command. You can set the default file system to omit the filesystem: argument from related commands. For example, for all privileged EXEC commands that have the optional filesystem: argument, the system uses the file system specified by the cd command.
By default, the default file system is flash:.
You can display the current default file system as specified by the cd command by using the pwd privileged EXEC command.
You can view a list of the contents of a file system before manipulating its contents. For example, before copying a new configuration file to flash memory, you might want to verify that the file system does not already contain a configuration file with the same name. Similarly, before copying a flash configuration file to another location, you might want to verify its filename for use in another command.
To display information about files on a file system, use one of the following privileged EXEC commands:
Review the “Working with the Flash File System” section.
Review the “Working with the Flash File System” section.
To delete a directory with all its files and subdirectories, use the delete /force /recursive filesystem :/ file-url privileged EXEC command.
Use the /recursive keyword to delete the named directory and all subdirectories and the files contained in it. Use the /force keyword to suppress the prompting that confirms a deletion of each file in the directory. You are prompted only once at the beginning of this deletion process. Use the /force and /recursive keywords for deleting old software images that were installed by using the archive download-sw command but are no longer needed.
For filesystem , use flash: for the system board flash device. For file-url , enter the name of the directory to be deleted. All the files in the directory and the directory are removed.
The following example deletes the directory named old_image and all files and subdirectories in it.
To copy a file from a source to a destination, use the copy source-url destination-url privileged EXEC command. For the source and destination URLs, you can use running-config and startup-config keyword shortcuts. For example, the copy running-config startup-config command saves the currently running configuration file to the NVRAM section of flash memory to be used as the configuration during system initialization.
You can also copy from special file systems ( xmodem: , ymodem: ) as the source for the file from a network machine that uses the Xmodem or Ymodem protocol.
Network file system URLs include ftp: , rcp: , and tftp: and have these syntaxes:
In addition, the Secure Copy Protocol (SCP) provides a secure and authenticated method for copying switch configurations or switch image files. SCP relies on Secure Shell (SSH), an application and a protocol that provides a secure replacement for the Berkeley r-tools.
NoteFor more information on how to configure and verify SCP, see the “Secure Copy Protocol” chapter of theSecure Shell Configuration Guide, Cisco IOS Release 15M&T.
Local writable file systems include flash:.
Some invalid combinations of source and destination exist. Specifically, you cannot copy these combinations:
For specific examples of using the copy command with configuration files, see the “Working with Configuration Files” section.
To copy software images either by downloading a new version or by uploading the existing one, use the archive download-sw or the archive upload-sw privileged EXEC command. For more information, see the “Working with Software Images” section.
When you no longer need a file on a flash memory device, you can permanently delete it. To delete a file or directory from a specified flash device, use the delete [ /force ] [ /recursive ] [ filesystem : ] / file-url privileged EXEC command.
Use the /recursive keyword for deleting a directory and all subdirectories and the files contained in it. Use the /force keyword to suppress the prompting that confirms a deletion of each file in the directory. You are prompted only once at the beginning of this deletion process. Use the /force and /recursive keywords for deleting old software images that were installed by using the archive download-sw command but are no longer needed.
If you omit the filesystem : option, the switch uses the default device specified by the cd command. For file-url , you specify the path (directory) and the name of the file to be deleted.
When you attempt to delete any files, the system prompts you to confirm the deletion.
This example shows how to delete the file myconfig from the default flash memory device:
You can create a tar file and write files into it, list the files in a tar file, and extract the files from a tar file as described in the next sections.
NoteInstead of using thecopy privileged EXEC command or the archive tar privileged EXEC command, we recommend using the archive download-sw and archive upload-sw privileged EXEC commands to download and upload software image files.
To create a tar file and write files into it, use this privileged EXEC command:
archive tar /create destination-url flash:/ file-url
For destination-url , specify the destination URL alias for the local or network file system and the name of the tar file to create. These options are supported:
The tar-filename .tar is the tar file to be created.
For flash:/ file-url , specify the location on the local flash file system from which the new tar file is created. You can also specify an optional list of files or directories within the source directory to write to the new tar file. If none are specified, all files and directories at this level are written to the newly created tar file.
This example shows how to create a tar file. This command writes the contents of the new-configs directory on the local flash device to a file named saved.tar on the TFTP server at 172.20.10.30:
To display the contents of a tar file on the screen, use this privileged EXEC command:
For source-url , specify the source URL alias for the local or network file system. These options are supported:
The tar-filename .tar is the tar file to display.
This example shows how to display the contents of a switch tar file that is in flash memory:
image-name
.tar
To extract a tar file into a directory on the flash file system, use this privileged EXEC command:
archive tar /xtract source-url flash:/ file-url [ dir/file ...]
For source-url , specify the source URL alias for the local file system. These options are supported:
The tar-filename .tar is the tar file from which to extract files.
For flash:/ file-url [ dir/file ...], specify t he location on the local flash file system into which the tar file is extracted. Use the dir/file ... option to specify an optional list of files or directories within the tar file to be extracted. If none are specified, all files and directories are extracted.
This example shows how to extract the contents of a tar file located on the TFTP server at 172.20.10.30. This command extracts just the new-configs directory into the root directory on the local flash file system. The remaining files in the saved.tar file are ignored.
To display the contents of any readable file, including a file on a remote file system, use the more [ /ascii | /binary | /ebcdic ] file-url privileged EXEC command:.
This example shows how to display the contents of a configuration file on a TFTP server:
This section describes how to create, load, and maintain configuration files.
Configuration files contain commands entered to customize the function of the Cisco IOS software. A way to create a basic configuration file is to use the setup program or to enter the setup privileged EXEC command. For more information, see the “Assigning the Switch IP Address and Default Gateway” chapter in the System Management Software Configuration Guide for Cisco IE 2000U and Connected Grid Switches .
You can copy ( download ) configuration files from a TFTP, FTP, or RCP server to the running configuration or startup configuration of the switch. You might want to perform this for one of these reasons:
You can copy ( upload ) configuration files from the switch to a file server by using TFTP, FTP, or RCP. You might perform this task to back up a current configuration file to a server before changing its contents so that you can later restore the original configuration file from the server.
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 FTP and RCP are built on and use the TCP/IP stack, which is connection-oriented.
This section includes the following topics:
Creating configuration files can aid in your switch configuration. Configuration files can contain some or all of the commands needed to configure one or more switches. For example, you might want to download the same configuration file to several switches that have the same hardware configuration.
Use these guidelines when creating a configuration file:
NoteThecopy {ftp: | rcp: | tftp:} system:running-config privileged EXEC command loads the configuration files on the switch as if you were entering the commands at the command line. The switch 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 might 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, copy the configuration file directly to the startup configuration (by using the copy {ftp: | rcp: | tftp:} nvram:startup-config privileged EXEC command), and reload the switch.
Startup configuration files are used during system startup to configure the software. Running configuration files contain the current configuration of the software. The two configuration files can be different. For example, you might want to change the configuration for a short time period rather than permanently. In this case, you would change the running configuration but not save the configuration by using the copy running-config startup-config privileged EXEC command.
The running configuration is saved in DRAM; the startup configuration is stored in the NVRAM section of flash memory.
When creating a configuration file, you must list commands logically so that the system can respond appropriately. This is one method of creating a configuration file:
Step 1 Copy an existing configuration from a switch to a server.
For more information, see the “Downloading the Configuration File By Using TFTP” section, the “Downloading a Configuration File By Using FTP” section, or the “Downloading a Configuration File By Using RCP” section.
Step 2 Open the configuration file in a text editor, such as vi or emacs on UNIX or Notepad on a PC.
Step 3 Extract the portion of the configuration file with the desired commands, and save it in a new file.
Step 4 Copy the configuration file to the appropriate server location. For example, copy the file to the TFTP directory on the workstation (usually / tftpboot on a UNIX workstation).
Step 5 Make sure the permissions on the file are set to world-read.
You can configure the switch by using configuration files you create, download from another switch, or download from a TFTP server. You can copy (upload) configuration files to a TFTP server for storage.
Before you begin downloading or uploading a configuration file by using TFTP, do these tasks:
Make sure that the /etc/services file contains this line:
Note You must restart the inetd daemon after modifying the /etc/inetd.conf and /etc/services files. To restart the daemon, either stop the inetd process and restart it, or enter a fastboot command (on the SunOS 4.x) or a reboot command (on Solaris 2.x or SunOS 5.x). For more information on the TFTP daemon, see the documentation for your workstation.
Follow this procedure to configure the switch by using a configuration file downloaded from a TFTP server.
Verify that the TFTP server is properly configured by referring to the “Preparing to Download or Upload a Configuration File By Using TFTP” section.
Step 1 Copy the configuration file to the appropriate TFTP directory on the workstation.
Step 2 Log into the switch through the console port or a Telnet session.
Step 3 Download the configuration file from the TFTP server to configure the switch.
Specify the IP address or hostname of the TFTP server and the name of the file to download.
Use one of these privileged EXEC commands:
The configuration file downloads, and the commands are executed as the file is parsed line-by-line.
This example shows how to configure the software from the file tokyo-confg at IP address 172.16.2.155:
Follow this procedure to upload a configuration file from a switch to a TFTP server for storage.
Verify that the TFTP server is properly configured by referring to the “Preparing to Download or Upload a Configuration File By Using TFTP” section.
Step 1 Log into the switch through the console port or a Telnet session.
Step 2 Upload the switch configuration to the TFTP server. Specify the IP address or hostname of the TFTP server and the destination filename.
Use one of these privileged EXEC commands:
The file is uploaded to the TFTP server.
This example shows how to upload a configuration file from a switch to a TFTP server:
You can copy configuration files to or from an FTP server.
The FTP protocol requires a client to send a remote username and password on each FTP request to a server.
When you copy a configuration file from the switch to a server by using FTP, the Cisco IOS software sends the first valid username in this list:
The switch sends the first valid password in this list:
The username and password must be associated with an account on the FTP server. If you are writing to the server, the FTP server must be properly configured to accept your FTP write request.
Use the ip ftp username and ip ftp password commands to specify a username and password for all copies. Include the username in the copy command if you want to specify only a username for that copy operation.
If the server has a directory structure, the configuration file is written to or copied from the directory associated with the username on the server. For example, if the configuration file resides in the home directory of a user on the server, specify that user's name as the remote username.
For more information, see the documentation for your FTP server.
Before you begin downloading or uploading a configuration file by using FTP, do these tasks:
For more information, see the documentation for your FTP server.
Verify that the FTP server is properly configured by referring to the “Preparing to Download or Upload a Configuration File By Using FTP” section.
This example shows how to copy a configuration file named host1-confg from the netadmin1 directory on the remote server with an IP address of 172.16.101.101 and to load and run those commands on the switch:
This example shows how to specify a remote username of netadmin1 . The software copies the configuration file host2-confg from the netadmin1 directory on the remote server with an IP address of 172.16.101.101 to the switch startup configuration.
Verify that the FTP server is properly configured by referring to the “Preparing to Download or Upload a Configuration File By Using FTP” section.
This example shows how to copy the running configuration file named switch2-confg to the netadmin1 directory on the remote host with an IP address of 172.16.101.101:
This example shows how to store a startup configuration file on a server by using FTP to copy the file:
The RCP provides another method of downloading, uploading, and copying configuration files between remote hosts and the switch. Unlike TFTP, which uses User Datagram Protocol (UDP), a connectionless protocol, RCP uses TCP, which is connection-oriented.
To use RCP to copy files, the server from or to which you will be copying files must support RCP. The RCP copy commands rely on the rsh server (or daemon) on the remote system. To copy files by using RCP, you do not need to create a server for file distribution as you do with TFTP. You only need to have access to a server that supports the remote shell (rsh). (Most UNIX systems support rsh.) Because you are copying a file from one place to another, you must have read permission on the source file and write permission on the destination file. If the destination file does not exist, RCP creates it for you.
The RCP requires a client to send a remote username with each RCP request to a server. When you copy a configuration file from the switch to a server, the Cisco IOS software sends the first valid username in this list:
For a successful RCP copy request, you must define an account on the network server for the remote username. If the server has a directory structure, the configuration file is written to or copied from the directory associated with the remote username on the server. For example, if the configuration file is in the home directory of a user on the server, specify that user's name as the remote username.
Before you begin downloading or uploading a configuration file by using RCP, do these tasks:
If the switch IP address translates to Switch1.company.com , the .rhosts file for User0 on the RCP server should contain this line:
For more information, see the documentation for your RCP server.
Verify that the RCP server is properly configured by referring to the “Preparing to Download or Upload a Configuration File By Using RCP” section.
This example shows how to copy a configuration file named host1-confg from the netadmin1 directory on the remote server with an IP address of 172.16.101.101 and load and run those commands on the switch:
This example shows how to specify a remote username of netadmin1 . Then it copies the configuration file host2-confg from the netadmin1 directory on the remote server with an IP address of 172.16.101.101 to the startup configuration:
Verify that the RCP server is properly configured by referring to the “Preparing to Download or Upload a Configuration File By Using RCP” section.
This example shows how to copy the running configuration file named switch2-confg to the netadmin1 directory on the remote host with an IP address of 172.16.101.101:
This example shows how to store a startup configuration file on a server:
You can clear the configuration information from the startup configuration. If you reboot the switch with no startup configuration, the switch enters the setup program so that you can reconfigure the switch with all new settings.
To clear the contents of your startup configuration, use the erase nvram: or the erase startup-config privileged EXEC command.
To delete a saved configuration from flash memory, use the delete flash: filename privileged EXEC command. Depending on the setting of the file prompt global configuration command, you might be prompted for confirmation before you delete a file. By default, the switch prompts for confirmation on destructive file operations.
The configuration replacement and rollback feature replaces the running configuration with any saved Cisco IOS configuration file. You can use the rollback function to roll back to a previous configuration.
The configuration archive provides a mechanism to store, organize, and manage an archive of configuration files. The configure replace privileged EXEC command increases the configuration rollback capability. As an alternative, you can save copies of the running configuration by using the copy running-config destination-url privileged EXEC command, storing the replacement file either locally or remotely. However, this method lacks any automated file management. The configuration replacement and rollback feature can automatically save copies of the running configuration to the configuration archive.
You use the archive config privileged EXEC command to save configurations in the configuration archive by using a standard location and filename prefix that is automatically appended with an incremental version number (and optional timestamp) as each consecutive file is saved. You can specify how many versions of the running configuration are kept in the archive. After the maximum number of files are saved, the oldest file is automatically deleted when the next, most recent file is saved. The show archive privileged EXEC command displays information for all the configuration files saved in the configuration archive.
The Cisco IOS configuration archive, in which the configuration files are stored and available for use with the configure replace command, is in any of these file systems: FTP, HTTP, RCP, TFTP.
The configure replace privileged EXEC command replaces the running configuration with any saved configuration file. When you enter the configure replace command, the running configuration is compared with the specified replacement configuration, and a set of configuration differences is generated. The resulting differences are used to replace the configuration. The configuration replacement operation is usually completed in no more than three passes. To prevent looping behavior no more than five passes are performed.
You can use the copy source-url running-config privileged EXEC command to copy a stored configuration file to the running configuration. When using this command as an alternative to the configure replace target-url privileged EXEC command, note these major differences:
You can also use the configure replace command to roll back changes that were made since the previous configuration was saved. Instead of basing the rollback operation on a specific set of changes that were applied, the configuration rollback capability reverts to a specific configuration based on a saved configuration file.
If you want the configuration rollback capability, you must first save the running configuration before making any configuration changes. Then, after entering configuration changes, you can use that saved configuration file to roll back the changes by using the configure replace target-url command.
You can specify any saved configuration file as the rollback configuration. You are not limited to a fixed number of rollbacks, as is the case in some rollback models.
– A configuration replacement operation cannot remove the interface interface-id command line from the running configuration if that interface is physically present on the device.
– The interface interface-id command line cannot be added to the running configuration if no such interface is physically present on the device.
NoteIf you generate the replacement configuration file externally, it must comply with the format of files generated by Cisco IOS devices.
Using the configure replace command with the configuration archive and with the archive config command is optional but offers significant benefit for configuration rollback scenarios. Before using the archive config command , you must first configure the configuration archive.
Review the “Replacing and Rolling Back Configurations” section.
The following example shows how to specify the hostname, date, and time as the filename prefix for which to save archive files of the running configuration. In this example, the time-period command is also configured to automatically save an archive file of the running configuration every 20 minutes.
Before using the archive config command , you must first enter the path archive configuration command as described in Configuring the Configuration Archive.
The following example shows how to make changes to the current running configuration and then roll back the changes. As part of the configuration rollback operation, you must save the current running configuration before making changes to the file. In this example, the archive config command is used to save the current running configuration. Note that the generated output of the configure replace command indicates that only one pass was performed to complete the rollback operation.
NoteThe path command must be configured before using the archive config command.
You first save the current running configuration in the configuration archive as follows:
You then enter configuration changes as shown in the following example:
After making changes to the running configuration file, you might want to roll back these changes and revert to the configuration that existed before the changes were made. The show archive command is used to verify the version of the configuration to be used as a target file. The configure replace command is then used to revert to the target configuration file as shown in the following example:
This section describes how to archive (download and upload) software image files, which contain the system software, the Cisco IOS code, and the embedded device manager software.
NoteInstead of using thecopy privileged EXEC command or the archive tar privileged EXEC command, we recommend using the archive download-sw and archive upload-sw privileged EXEC commands to download and upload software image files.
You can download a switch image file from a TFTP, FTP, or RCP server to upgrade the switch software. For information about upgrading your switch by using a TFTP server, see the release notes for this release.
You can replace the current image with the new one or keep the current image in flash memory after a download.
You upload a switch image file to a TFTP, FTP, or RCP server for backup purposes. You can use this uploaded image for future downloads to the same switch or to another of the same type.
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 FTP and RCP are built on and use the TCP/IP stack, which is connection-oriented.
This section includes the following topics:
NoteFor a list of software images and the supported upgrade paths, see the release notes for your switch.
The Cisco IOS image is stored as a .bin file in a directory that shows the version number. A subdirectory contains the files needed for web management. The image is stored on the system board flash memory (flash:).
You can use the show version privileged EXEC command to see the software version that is currently running on your switch. In the display, check the line that begins with System image file is...
. It shows the directory name in flash memory where the image is stored.
You can also use the dir filesystem : privileged EXEC command to see the directory names of other software images that you might have stored in flash memory.
Software images located on a server or downloaded from Cisco.com are provided in a tar file format, which contains these files:
This example shows some of the information contained in the info file. The following table provides additional details about this information:
NoteDisregard the stacking_number field. It does not apply to the switch.
You can download a switch image from a TFTP server or upload the image from the switch to a TFTP server.
You download a switch image file from a server to upgrade the switch software. You can overwrite the current image with the new one or keep the current image after a download.
You upload a switch image file to a server for backup purposes; this uploaded image can be used for future downloads to the same or another switch of the same type.
NoteInstead of using thecopy privileged EXEC command or the archive tar privileged EXEC command, we recommend using the archive download-sw and archive upload-sw privileged EXEC commands to download and upload software image files.
Before you begin downloading or uploading an image file by using TFTP, do these tasks:
Make sure that the /etc/services file contains this line:
Note You must restart the inetd daemon after modifying the /etc/inetd.conf and /etc/services files. To restart the daemon, either stop the inetd process and restart it, or enter a fastboot command (on the SunOS 4.x) or a reboot command (on Solaris 2.x or SunOS 5.x). For more information on the TFTP daemon, see the documentation for your workstation.
You can download a new image file and replace the current image or keep the current image.
Follow Steps 1 through 3 to download a new image from a TFTP server and overwrite the existing image. To keep the current image, go to Step 4.
Make sure the TFTP server is properly configured; see the “Preparing to Download or Upload an Image File By Using TFTP” section.
The download algorithm verifies that the image is appropriate for the switch model and that enough DRAM is present, or it aborts the process and reports an error. If you specify the /overwrite option, the download algorithm removes the existing image on the flash device whether or not it is the same as the new one, downloads the new image, and then reloads the software.
NoteIf the flash device has sufficient space to hold two images and you want to overwrite one of these images with the same version, you must specify the/overwrite option.
If you specify the /leave-old-sw , the existing files are not removed. If there is not enough space to install the new image and keep the current running image, the download process stops, and an error message is displayed.
The algorithm installs the downloaded image on the system board flash device (flash:). The image is placed into a new directory named with the software version string, and the BOOT environment variable is updated to point to the newly installed image.
If you kept the old image during the download process (you specified the /leave-old-sw keyword), you can remove it by entering the delete /force /recursive filesystem :/ file-url privileged EXEC command. For filesystem , use flash: for the system board flash device. For file-url , enter the directory name of the old image. All the files in the directory and the directory are removed.
This example shows how to download a new image from a TFTP server at 172.20.129.10 and to overwrite the image on the switch:
You can upload an image from the switch to a TFTP server. You can later download this image to the switch or to another switch of the same type.
Use the upload feature only if the web management pages associated with the embedded device manager have been installed with the existing image.
Make sure the TFTP server is properly configured; see the “Preparing to Download or Upload an Image File By Using TFTP” section.
The archive upload-sw privileged EXEC command builds an image file on the server by uploading these files in order: info, the Cisco IOS image, and the web management files. After these files are uploaded, the upload algorithm creates the tar file format.
This example shows how to upload the currently running image to a TFTP server at 172.20.140.2:
You can download a switch image from an FTP server or upload the image from the switch to an FTP server.
You download a switch image file from a server to upgrade the switch software. You can overwrite the current image with the new one or keep the current image after a download.
You upload a switch image file to a server for backup purposes. You can use this uploaded image for future downloads to the switch or another switch of the same type.
NoteInstead of using thecopy privileged EXEC command or the archive tar privileged EXEC command, we recommend using the archive download-sw and archive upload-sw privileged EXEC commands to download and upload software image files.
You can copy images files to or from an FTP server.
The FTP protocol requires a client to send a remote username and password on each FTP request to a server. When you copy an image file from the switch to a server by using FTP, the Cisco IOS software sends the first valid username in this list:
The switch sends the first valid password in this list:
The username and password must be associated with an account on the FTP server. If you are writing to the server, the FTP server must be properly configured to accept the FTP write request from you.
Use the ip ftp username and ip ftp password commands to specify a username and password for all copies. Include the username in the archive download-sw or archive upload-sw privileged EXEC command if you want to specify a username only for that operation.
If the server has a directory structure, the image file is written to or copied from the directory associated with the username on the server. For example, if the image file resides in the home directory of a user on the server, specify that user's name as the remote username.
Before you begin downloading or uploading an image file by using FTP, do these tasks:
For more information, see the documentation for your FTP server.
You can download a new image file and overwrite the current image or keep the current image.
Follow Steps 1 through 6 to download a new image from an FTP server and overwrite the existing image. To keep the current image, go to Step 7.
Verify that the FTP server is properly configured by referring to the “Preparing to Download or Upload an Image File By Using FTP” section.
|
|
|
---|---|---|
Log into the switch through the console port or a Telnet session. |
||
Enter global configuration mode. This step is required only if you override the default remote username or password (see Steps 4, 5, and 6). |
||
archive download-sw /overwrite /reload ftp: [[ // username [ : password ] @ location ] / directory ] / image-name .tar |
Download the image file from the FTP server to the switch, and overwrite the current image.
|
|
archive download-sw /leave-old-sw /reload ftp: [[ // username [ : password ] @ location ] / directory ] / image-name .tar |
Download the image file from the FTP server to the switch, and keep the current image.
|
The download algorithm verifies that the image is appropriate for the switch model and that enough DRAM is present, or it aborts the process and reports an error. If you specify the /overwrite option, the download algorithm removes the existing image on the flash device, whether or not it is the same as the new one, downloads the new image, and then reloads the software.
NoteIf the flash device has sufficient space to hold two images and you want to overwrite one of these images with the same version, you must specify the/overwrite option.
If you specify the /leave-old-sw , the existing files are not removed. If there is not enough space to install the new image and keep the running image, the download process stops, and an error message is displayed.
The algorithm installs the downloaded image onto the system board flash device (flash:). The image is placed into a new directory named with the software version string, and the BOOT environment variable is updated to point to the newly installed image.
If you kept the old image during the download process (you specified the /leave-old-sw keyword), you can remove it by entering the delete /force /recursive filesystem :/ file-url privileged EXEC command. For filesystem , use flash: for the system board flash device. For file-url , enter the directory name of the old software image. All the files in the directory and the directory are removed.
This example shows how to download a new image from an FTP server at 172.20.140.2 and to keep the old image:
You can upload an image from the switch to an FTP server. You can later download this image to the same switch or to another switch of the same type.
Use the upload feature only if the web management pages associated with the embedded device manager have been installed with the existing image.
Verify that the FTP server is properly configured by referring to the “Preparing to Download or Upload a Configuration File By Using FTP” section.
|
|
|
---|---|---|
Log into the switch through the console port or a Telnet session. |
||
Enter global configuration mode. This step is required only if you override the default remote username or password (see Steps 4, 5, and 6). |
||
archive upload-sw ftp: [[ // [ username [ : password ] @ ] location ] / directory ] / image-name .tar |
Upload the currently running switch image to the FTP server.
|
The archive upload-sw command builds an image file on the server by uploading these files in order: info, the Cisco IOS image, and the web management files. After these files are uploaded, the upload algorithm creates the tar file format.
This example shows how to upload an image from the switch to the FTP server at 172.20.140.2:
You can download a switch image from an RCP server or upload the image from the switch to an RCP server.
You download a switch image file from a server to upgrade the switch software. You can overwrite the current image with the new one or keep the current image after a download.
You upload a switch image file to a server for backup purposes. You can use this uploaded image for future downloads to the same switch or another of the same type.
NoteInstead of using thecopy privileged EXEC command or the archive tar privileged EXEC command, we recommend using the archive download-sw and archive upload-sw privileged EXEC commands to download and upload software image files.
RCP provides another method of downloading and uploading image files between remote hosts and the switch. Unlike TFTP, which uses User Datagram Protocol (UDP), a connectionless protocol, RCP uses TCP, which is connection-oriented.
To use RCP to copy files, the server from or to which you will be copying files must support RCP. The RCP copy commands rely on the rsh server (or daemon) on the remote system. To copy files by using RCP, you do not need to create a server for file distribution as you do with TFTP. You only need to have access to a server that supports the remote shell (rsh). (Most UNIX systems support rsh.) Because you are copying a file from one place to another, you must have read permission on the source file and write permission on the destination file. If the destination file does not exist, RCP creates it for you.
RCP requires a client to send a remote username on each RCP request to a server. When you copy an image from the switch to a server by using RCP, the Cisco IOS software sends the first valid username in this list:
For the RCP copy request to execute successfully, an account must be defined on the network server for the remote username. If the server has a directory structure, the image file is written to or copied from the directory associated with the remote username on the server. For example, if the image file resides in the home directory of a user on the server, specify that user’s name as the remote username.
Before you begin downloading or uploading an image file by using RCP, do these tasks:
If the switch IP address translates to Switch1.company.com , the .rhosts file for User0 on the RCP server should contain this line:
For more information, see the documentation for your RCP server.
You can download a new image file and replace or keep the current image.
Follow Steps 1 through 5 to download a new image from an RCP server and overwrite the existing image. To keep the current image, go to Step 6.
Verify that the RCP server is properly configured by referring to the “Preparing to Download or Upload an Image File By Using RCP” section.
|
|
|
---|---|---|
Log into the switch through the console port or a Telnet session. |
||
Enter global configuration mode. This step is required only if you override the default remote username (see Steps 4 and 5). |
||
archive download-sw /overwrite /reload rcp: [[[ // [ username @ ] location ] / directory ] / image-name .tar ] |
Download the image file from the RCP server to the switch, and overwrite the current image.
|
|
archive download-sw /leave-old-sw /reload rcp: [[[ // [ username @ ] location ] / directory ] / image-name .tar ] |
Download the image file from the RCP server to the switch, and keep the current image.
|
The download algorithm verifies that the image is appropriate for the switch model and that enough DRAM is present, or it aborts the process and reports an error. If you specify the /overwrite option, the download algorithm removes the existing image on the flash device whether or not it is the same as the new one, downloads the new image, and then reloads the software.
NoteIf the flash device has sufficient space to hold two images and you want to overwrite one of these images with the same version, you must specify the/overwrite option.
If you specify the /leave-old-sw , the existing files are not removed. If there is not enough room to install the new image an keep the running image, the download process stops, and an error message is displayed.
The algorithm installs the downloaded image onto the system board flash device (flash:). The image is placed into a new directory named with the software version string, and the BOOT environment variable is updated to point to the newly installed image.
If you kept the old software during the download process (you specified the /leave-old-sw keyword), you can remove it by entering the delete /force /recursive filesystem :/ file-url privileged EXEC command. For filesystem , use flash: for the system board flash device. For file-url , enter the directory name of the old software image. All the files in the directory and the directory are removed.
This example shows how to download a new image from an RCP server at 172.20.140.2 and to overwrite the old image:
You can upload an image from the switch to an RCP server. You can later download this image to the same switch or to another switch of the same type.
Verify that the RCP server is properly configured by referring to the “Preparing to Download or Upload an Image File By Using RCP” section.
The upload feature should be used only if the web management pages associated with the embedded device manager have been installed with the existing image.
|
|
|
---|---|---|
Log into the switch through the console port or a Telnet session. |
||
Enter global configuration mode. This step is required only if you override the default remote username (see Steps 4 and 5). |
||
archive upload-sw rcp: [[[ // [ username @ ] location ] / directory ] / image-name .tar ] |
Upload the currently running switch image to the RCP server.
|
The archive upload-sw privileged EXEC command builds an image file on the server by uploading these files in order: info, the Cisco IOS image, and the web management files. After these files are uploaded, the upload algorithm creates the tar file format.
This example shows how to upload an image from the switch to the RCP server at 172.20.140.2:
|
|
---|---|