H3C S7500 Series Operation Manual(Release 3100 Series)-(V1.04)

HomeSupportSwitchesH3C S7500 Switch SeriesConfigure & DeployConfiguration GuidesH3C S7500 Series Operation Manual(Release 3100 Series)-(V1.04)
34-FTP and TFTP Configuration
Title Size Download
34-FTP and TFTP Configuration 134 KB

Chapter 1  FTP and TFTP Configuration

1.1  FTP Configuration

1.1.1  Introduction to FTP

The File Transfer Protocol (FTP) is commonly used in IP-based networks to transmit files. Before the World Wide Web comes into being, files are transferred through command lines, and the most popular application is the FTP. At present, although E-mail and Web are the usual methods for file transmission, the FTP still has its strongholds.

As an application layer protocol, the FTP is used for file transfer between a remote server and a local host. TCP port 21 is used for control connections, and port 20 is used for data connections. Basic FTP operations are described in RFC959.

FTP-based file transmission is performed in the following two modes:

l           Binary mode, which is used for program file transfer.

l           ASCII mode, which is used for text file transfer.

An Ethernet switch can act as an FTP client or an FTP server in an FTP implementation.

l           FTP server

An Ethernet switch can function as an FTP server to provide file transmission services for FTP clients. You can log into a switch functioning as an FTP server by running an FTP client program on your PC to access the files on the FTP server. To accept login requests, an FTP server must be assigned an IP address.

Table 1-1 describes the configurations needed when a switch functions as an FTP server.

Table 1-1 Configurations needed when a switch functions as an FTP server

Device

Configuration

Default

Description

Switch

Enable the FTP server function

The FTP server function is disabled by default

You can run the display ftp-server command to view the FTP server configuration on the switch.

Perform authentication-/authorization-related configuration

By default, FTP server logon authentication and authorization are not configured.

Configure user names, passwords, and the work directory.

Configure the connection idle time

The default idle time is 30 minutes.

PC

Log into a switch functioning as an FTP server through an FTP client application

 

  Caution:

The FTP-related functions require that an FTP client and the FTP server should be reachable to each other.

 

l           FTP client

A switch can function as an FTP client, through which you can access files on an FTP server. In this case, you need to establish a connection between your PC and the switch through a terminal emulation program or Telnet and then execute the ftp X.X.X.X command on your PC (X.X.X.X is the IP address of an FTP server).

Table 1-2 describes the configurations needed when a switch functions as an FTP client.

Table 1-2 Configurations needed when a switch functions as an FTP client

Device

Configuration

Default

Description

Switch

Run the ftp command to log into a remote FTP server directly

To log into a remote FTP server and manipulate files and directories on it, you need to obtain a user name and password first.

FTP server

Enable the FTP server, and configure user names, passwords, and the corresponding rights

 

1.1.2  FTP Configuration: A Switch Functioning as an FTP Server

I. Prerequisites

A switch functions as an FTP server. A remote PC functions as an FTP client. The network operates properly, as shown in Figure 1-1.

Figure 1-1 Network diagram for FTP configuration

II. Configuration procedure

Follow these steps to configure an FTP server:

To do…

Use the command…

Remarks

Enter system view

system-view

Enable the FTP server function

ftp server enable

Required

By default, the FTP server function is disabled.

Set the connection idle time

ftp timeout minutes

Optional

The default connection idle time is 30 minutes.

 

&  Note:

l      Only one user can access an S7500 switch at a time when the switch functions as an FTP server.

l      FTP services are implemented in this way: An FTP client sends FTP requests to the FTP server. The FTP server receives the requests, performs operations accordingly, and returns the results to the FTP client.

l      To prevent unauthorized access, an FTP server disconnects itself from an FTP client when it does not receive requests from the FTP client within a specific period known as the connection idle time.

l      An S7500 switch functioning as an FTP server cannot receive a file whose size exceeds its storage space. A client attempting to upload such a file will be disconnected from the FTP server due to lack of storage space on the FTP server.

 

III. Authentication and authorization configuration

An FTP server authenticates an FTP client by the user name and the password it provides. When an FTP client passes the authentication, the authorization is done by allocating the FTP client a work directory. An FTP server provides services to the FTP clients that are both authenticated and authorized successfully.

The configurations such as configuring a user name, password, the way to display passwords, service type, are performed on FTP servers. Refer to the information about the local-user, local-user password-display-mode, password, and service-type commands in the “AAA&RADIUS&HWTACACS&EAD” part of this manual.

IV. Displaying and maintaining FTP server configuration

To do…

Use the command…

Remarks

Display the information about FTP server configurations on a switch

display ftp-server

Available in any view

Display the current online FTP user

display ftp-user

 

1.1.3  Configuration Example: A Switch Functioning as an FTP Server

I. Network requirements

A switch functions as an FTP server and a remote PC functions as an FTP client.

l           Create a user account on the FTP server with the user name “switch” and password “hello”. The work directory assigned for FTP clients is the root directory of the flash.

l           Configure the IP address 1.1.1.1 for a VLAN interface on the switch, and 2.2.2.2 for the PC. Ensure that the switch and the PC are reachable to each other.

The switch application named switch.bin is stored on the PC. Upload it to the FTP server through the FTP to upgrade the application of the switch, and download the switch configuration file named config.cfg from the switch to backup the configuration file.

II. Network diagram

Figure 1-2 Network diagram for FTP configurations

III. Configuration procedure

1)         Configure the switch

# Log in to the switch. (You can log into a switch through the Console port or by Telnet. See the Login part of this manual for detailed information.)

<H3C>

# Start the FTP service on the switch and create a user account and the corresponding password.

<H3C> system-view

[H3C] ftp server enable

[H3C] local-user switch

[H3C-luser-switch] password simple hello

[H3C-luser-switch] service-type ftp ftp-directory flash:/

2)         Run an FTP client application on the PC to connect to the FTP server. Upload the application named switch.bin to the root directory of the Flash memory of the FTP server, and download the configuration file named config.cfg from the FTP server. Take the command line window tool provided by Windows for example.

# Enter the command line window and switch to the directory where the file switch.bin is located. Assume that the file resides in C:\.

C:\>

# Access the Ethernet switch through FTP. Enter the user name “switch” and password “hello” to log in and enter FTP view.

C:\> ftp 1.1.1.1

Connected to 1.1.1.1.

220 FTP service ready.

User (1.1.1.1:(none)): switch

331 Password required for switch.

Password:

230 User logged in.

ftp>

# Upload the switch.bin file.

ftp> put switch.bin

200 Port command okay.

150 Opening ASCII mode data connection for switch.bin.

226 Transfer complete.

# Download the config.cfg file.

ftp> get config.cfg

200 Port command okay.

150 Opening ASCII mode data connection for config.cfg.

226 Transfer complete.

ftp: 3980 bytes received in 8.277 seconds 0.48Kbytes/sec.

This example uses the command line window tool provided by Windows. When you log into the FTP server through another FTP client, refer to the corresponding instructions for operation description.

 

  Caution:

l      If the available space of the flash of the switch is not enough to hold the file to be uploaded, you need to delete the existing applications in the flash and then upload new applications to the flash of the switch.

l      The H3C Series Switches are not loaded with FTP client applications. You need to purchase and install them separately.

 

3)         After uploading the application, you can update the application on the switch.

# Use the boot boot-loader command to specify the uploaded file (switch.bin) to be the startup file used when the switch starts the next time, and restart the switch. Thus the switch application is upgraded.

<H3C> boot boot-loader switch.bin

<H3C> reboot

 

&  Note:

For information about the boot boot-loader command and how to specify the startup file for a switch, refer to the “System Maintenance and Debugging” part of this manual.

 

1.1.4  FTP Configuration: A Switch Functioning as an FTP Client

The function for a switch to function as an FTP client is implemented by an application module in the switch. Thus a switch can function as an FTP client without any configuration. You can perform FTP-related operations (such as creating/removing a directory) by executing FTP client commands on a switch functioning as an FTP client. Follow these steps to perform basic FTP client configuration:

To do…

Use the command…

Remarks

Enter FTP client view

ftp [ cluster | ftp-server [ port-number ] ]

Set the ASCII mode for file transfer

ascii

Optional

By default, files are transferred in ASCII characters.

Set the binary mode for file transfer

binary

Optional

Set the passive mode for data transmission

passive

Optional

By default, the passive mode is adopted.

Change the work directory on the remote FTP server

cd pathname

Optional

Change the work directory to the parent directory

cdup

Optional

Get the local work directory on the FTP client

lcd

Optional

Display the directories on the FTP server

pwd

Optional

Create a directory on the remote FTP server

mkdir pathname

Optional

Remove a directory on the remote FTP server

rmdir pathname

Optional

Delete a specified file

delete remotefile

Optional

Query a specified file

dir [ filename ] [ localfile ]

Optional

Query a specified remote file

ls [ remotefile ] [ localfile ]

Optional

Download a remote file

get remotefile [ localfile ]

Optional

Upload a local file to the remote FTP server

put localfile [ remotefile ]

Optional

Switch to another FTP user

user username [ password ]

Optional

Establish a control connection to the FTP server

open { ip-address | server-name } [ port ]

Optional

Terminate the current FTP connection without exiting FTP client view

disconnect

Optional

Terminate the current FTP connection without exiting FTP client view

close

Optional

Terminate the current FTP connection and quit to user view

quit

Optional

Terminate the current FTP connection and quit to user view

bye

Optional

Display the on-line help on a specified FTP command

remotehelp [ protocol-command ]

Optional

Enable debugging for the FTP

debugging

Optional

Enable the verbose function

verbose

Optional

The verbose function is enabled by default.

 

1.1.5  Configuration Example: A Switch Functioning as an FTP Client

I. Network requirements

A switch functions as an FTP client and a remote PC functions as an FTP server.

l           Create a user account on the FTP server with the username “switch” and password “hello”, and grant the Read/Write authority on the directory named “switch” on the PC.

l           Configure the IP address 1.1.1.1 for a VLAN interface on the switch, and 2.2.2.2 for the PC. Ensure that the switch and PC are reachable to each other.

The switch application named switch.bin is stored on the PC. Download it to the switch through FTP to upgrade the switch application, and upload the switch configuration file named config.cfg to the switch directory of the PC to backup the configuration file.

II. Network diagram

Figure 1-3 Network diagram for FTP configuration

III. Configuration procedure

1)         Perform FTP server–related configurations on the PC, that is, create a user account on the FTP server with user name “switch” and password “hello”. (For detailed configuration, refer to the use instruction of the FTP server software.)

2)         Configure the switch.

# Log into the switch. (You can log into a switch through the Console port or by Telnet. Refer to the Login part of this manual for detailed information.)

<H3C>

 

  Caution:

If the available space of the flash of the switch is not enough to hold the file to be uploaded, you need to delete existing applications in the flash first and then download new applications to the flash of the switch.

 

# Execute the ftp command in user view and enter a correct username & password to log into the FTP server.

<H3C> ftp 2.2.2.2

Trying ...                                                              

Press CTRL+K to abort                                                   

Connected.                                                               

220 WFTPD 2.0 service (by Texas Imperial Software) ready for new user   

User(none):switch                                                       

331 Give me your password, please                                       

Password:                                                           

230 Logged in successfully      

[ftp]

# Run the put command to upload the configuration file named config.cfg to the FTP server.

[ftp] put config.cfg

# Run the get command to download the file named switch.bin to the flash of the switch.

[ftp] get switch.bin

# Run the quit command to terminate the FTP connection and return to user view.

[ftp] quit

<H3C>

# Run the boot boot-loader command to specify the downloaded file (switch.bin) to be the startup file used when the switch starts the next time, and then restart the switch. Thus the switch application is upgraded.

<H3C> boot boot-loader switch.bin

<H3C> reboot

 

&  Note:

For information about the boot boot-loader command and how to specify the startup file for a switch, refer to the “System Maintenance and Debugging” part of this manual.

 

1.2  TFTP Configuration

1.2.1  Introduction to TFTP

Compared with the FTP, the Trivial File Transfer Protocol (TFTP) features simple interactive access interfaces and no authentication control. It simplifies the interaction between servers and clients remarkably. The TFTP is implemented on the UDP. It transfers data through UDP port 69. Basic TFTP operations are described in RFC1986.

TFTP transmission is initiated by clients, as described in the following:

l           To download a file, a client sends a read request to the TFTP server, receives data from the TFTP server, and then sends an acknowledgement to the TFTP server.

l           To upload a file, a client sends a Write request to the TFTP server, sends data to the TFTP server, and then receives the acknowledgement from the TFTP server.

 

&  Note:

l      Before performing TFTP-related configurations, you need to configure IP addresses of the TFTP client and the TFTP server, and make sure that they are reachable to each other .

l      A switch can only function as a TFTP client.

 

Figure 1-4 Network diagram for TFTP configuration

Table 1-3 describes the operations needed when a switch functions as a TFTP client.

Table 1-3 Configurations needed when a switch functions as a TFTP client

Device

Configuration

Default

Description

Switch

Configure an IP address for the VLAN interface of the switch so that it is reachable to the TFTP server.

The TFTP applies to networks where client-server interactions are comparatively simple. It requires that the switch and the TFTP server are reachable to each other.

You can log into a TFTP server directly for file accessing through TFTP commands.

TFTP server

The TFTP server is started and the TFTP work directory is configured.

 

1.2.2  TFTP Configuration

I. Prerequisites

A switch functions as a TFTP client and a remote PC functions as a TFTP server. The network operates properly, as shown in Figure 1-4.

II. Basic TFTP configurations

Follow these steps to perform basic TFTP configurations:

To do…

Use the command…

Remarks

Download a file through TFTP

tftp { cluster | tftp-server } get source-file [ dest-file ]

Optional

Upload a file through TFTP

tftp { cluster | tftp-server } put source-file [ dest-file ]

Optional

Enter system view

system-view

Specify the ACL adopted when a switch attempts to connect a TFTP server

tftp-server acl acl-number

Optional

 

1.2.3  TFTP Configuration Example

I. Network requirements

A switch functions as a TFTP client and a PC functions as a TFTP server.

l           The TFTP work directory is configured on the TFTP server.

l           The IP address of a VLAN interface on the switch is 1.1.1.1. The port through which the switch connects with the PC belongs to the VLAN. The IP address of the PC is 1.1.1.2.

The application named switch.bin is stored on the PC. Download it to the switch through TFTP, and upload the configuration file named config.cfg to the work directory on the PC to backup the configuration file.

II. Network diagram

Figure 1-5 Network diagram for TFTP configuration

III. Configuration procedure

1)         Start the TFTP server and configure the work directory on the PC.

2)         Configure the switch.

# Log into the switch. (You can log into a switch through the Console port or by Telnet. Refer to the “Login” part of this manual for detailed information.)

<H3C>

 

  Caution:

If the available space of the flash of the switch is not enough to hold the file to be uploaded, you need to delete the existing applications in the flash and then upload new applications to the flash of the switch.

 

# Download the switch application named switch.bin from the TFTP server to the switch.

<H3C> tftp 1.1.1.2 get switch.bin switch.bin

# Upload the switch configuration file named config.cfg to the TFTP server.

<H3C> tftp 1.1.1.2 put config.cfg config.cfg

# Use the boot boot-loader command to specify the downloaded file (switch.bin) to be the startup file used when the switch starts the next time, and restart the switch. Thus the switch application is upgraded.

<H3C> boot boot-loader switch.bin

<H3C> reboot

 

&  Note:

For information about the boot boot-loader command and how to specify the startup file for a switch, refer to the “System Maintenance and Debugging” part module of this manual.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网