Configuring File Upload and File Download

File Upload Overview

File uploading refers to uploading files in DUT flash to external file servers, such as host files, configuration files, SSH key files, and log files in the upgrade file for analysis, backup, or migration to other compatible devices.

It is recommended that the uploaded file name is the same suffix as the file download:

File Type Suffix

Host File

.arj

Bootrom file

.bin

Configuration file

.txt

SSH key file

.txt

The following upload tools are supported: tftp and ftp.

File Download Overview

File download is to download files from the external to the DUT's flash, such as the upgrade files (host file, bootrom file), the configuration file, and the SSH key file.

The suffix of the files must be the following:

File Type Suffix

Host File

.arj

Bootrom file

.bin

Configuration file

.txt

SSH key file

.txt

The following download tools are supported: xmodem, tftp, and ftp.

When using the xmodem tool, after entering the command, select Send -> Send File in the HyperTerminal menu. In the Send File dialog box, enter the full path and file name of the file in the File Name field. Select Xmodem from the Protocol drop-down list, and then click Send.

When an external file is downloaded to the DUT, it is saved in the flash memory and does not take effect immediately. You must use the related configuration commands. After upgrading the host and bootrom, restart the DUT. When you download the configuration file, it will overwrite the original configuration file in flash. You must use the downloaded configuration file in the privileged EXEC mode with the copy startup-config running-config .

Refer to the SSH module user manual for key usage.

How to Configure File Upload and File Download

Configuring File Upload

To upload a file, perform the following steps:

SUMMARY STEPS

  1. enable
  2. Use either ftp: or tftp: to upload a file:
    • upload application ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • upload application tftp { inet | inet6 } tftp-server-ip-address file-name
  3. Use either ftp: or tftp: to upload a file:
    • upload logging ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • upload logging tftp { inet | inet6 } tftp-server-ip-address file-name
  4. copy running-config startup-config
  5. Use either ftp: or tftp: to upload a file:
    • upload configuration ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • upload configuration tftp { inet | inet6 } tftp-server-ip-address file-name
  6. Use either ftp: or tftp: to upload a file:
    • upload automatically configuration ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password per hours hours minutes minutes
    • upload automatically configuration tftp { inet | inet6 } tftp-server-ip-address file-name per hours hours minutes minutes
  7. Use either ftp: or tftp: to upload a file:
    • upload keyfile { private | public } ftp{ inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • upload keyfile { private | public } tftp{ inet | inet6 } tftp-server-ip-address file-name

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

Use either ftp: or tftp: to upload a file:

  • upload application ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • upload application tftp { inet | inet6 } tftp-server-ip-address file-name

Example:

Device# upload application tftp inet 10.23.13.1 host.arj

Uploads the host file.

Step 3

Use either ftp: or tftp: to upload a file:

  • upload logging ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • upload logging tftp { inet | inet6 } tftp-server-ip-address file-name

Example:

Device# upload logging tftp inet 10.23.13.1 log.arj

Uploads the log file.

Step 4

copy running-config startup-config

Example:

Device# copy running-config startup-config

Saves the current configuration to flash.

Step 5

Use either ftp: or tftp: to upload a file:

  • upload configuration ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • upload configuration tftp { inet | inet6 } tftp-server-ip-address file-name

Example:

Device# upload configuration tftp inet 10.23.13.1 config.txt

Uploads the configuration file.

Step 6

Use either ftp: or tftp: to upload a file:

  • upload automatically configuration ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password per hours hours minutes minutes
  • upload automatically configuration tftp { inet | inet6 } tftp-server-ip-address file-name per hours hours minutes minutes

Example:

Device# upload automatically configuration tftp inet 10.23.13.1 config2.txt per hours 20 minutes 30

Automatically uploads the configuration file.

Step 7

Use either ftp: or tftp: to upload a file:

  • upload keyfile { private | public } ftp{ inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • upload keyfile { private | public } tftp{ inet | inet6 } tftp-server-ip-address file-name

Example:

Device# upload keyfile public tftp inet 10.23.13.1 ssh.txt

Uploads the SSH key file.

Configuring File Download

To download a file, perform the following steps:

SUMMARY STEPS

  1. enable
  2. Use either ftp:, tftp:, or xmodem: to download a file:
    • load application ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • load application tftp { inet | inet6 } tftp-server-ip-address file-name
    • load application xmodem
  3. Use either ftp:, tftp:, or xmodem: to download a file:
    • load whole-bootrom ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • load whole-bootrom tftp { inet | inet6 } tftp-server-ip-address file-name
    • load whole-bootrom xmodem
  4. Use either ftp: or tftp: to download a file:
    • load ont-image ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • load ont-image tftp { inet | inet6 } tftp-server-ip-address file-name
  5. load epld ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  6. Use either ftp:, tftp:, or xmodem: to download a file:
    • load configuration ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • load configuration tftp { inet | inet6 } tftp-server-ip-address file-name
    • load configuration xmodem
  7. Use either ftp: or tftp: to download a file:
    • load keyfile { private | public } ftp{ inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
    • load keyfile { private | public } tftp{ inet | inet6 } tftp-server-ip-address file-name

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

Use either ftp:, tftp:, or xmodem: to download a file:

  • load application ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • load application tftp { inet | inet6 } tftp-server-ip-address file-name
  • load application xmodem

Example:

Device# load application tftp inet 10.23.13.1 host.arj

Upgrades the host file.

Step 3

Use either ftp:, tftp:, or xmodem: to download a file:

  • load whole-bootrom ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • load whole-bootrom tftp { inet | inet6 } tftp-server-ip-address file-name
  • load whole-bootrom xmodem

Example:

Device# load whole-bootrom tftp inet 10.23.13.1 bootrom1.bin

Upgrades the bootrom file.

Step 4

Use either ftp: or tftp: to download a file:

  • load ont-image ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • load ont-image tftp { inet | inet6 } tftp-server-ip-address file-name

Example:

Device# load ont-image tftp inet 10.23.13.1 ont1.image

Upgrades the ont-image file.

Step 5

load epld ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password

Example:

Device# load epld tftp inet 10.23.13.1 epld1.epld

Upgrades the epld file.

Step 6

Use either ftp:, tftp:, or xmodem: to download a file:

  • load configuration ftp { inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • load configuration tftp { inet | inet6 } tftp-server-ip-address file-name
  • load configuration xmodem

Example:

Device# load configuration tftp inet 10.23.13.1 config.txt

Downloads the configuration file.

Step 7

Use either ftp: or tftp: to download a file:

  • load keyfile { private | public } ftp{ inet | inet6 } ftp-server-ip-address file-name ftp-username ftp-password
  • load keyfile { private | public } tftp{ inet | inet6 } tftp-server-ip-address file-name

Example:

Device# load keyfile public tftp inet 10.23.13.1 ssh.txt

Downloads the SSH key file.

Configuration Examples for File Upload and File Download

Configuration Example for File Upload

The following example shows how to upload the host file and the configuration file:

Device# upload application tftp 192.168.1.99 host.arj
Uploading APP file via TFTP...
Upload APP file via TFTP successfully.

Device# upload configuration tftp 192.168.1.99 text.txt
Uploading config file via TFTP...
Upload config file via TFTP successfully.

Configuration Example for File Download

The following example shows how to download the host file and the bootrom file:

Device# load application tftp 192.168.1.99 host.arj
Downloading application via TFTP...
Download application via TFTP successfully.

Device# load whole-bootrom tftp 192.168.1.99 bootrom_rom.bin