- Table of Contents
-
- H3C S9500 Operation Manual-Release1648[v1.24]-08 System Volume
- 00-1Cover
- 01-Command Line Interface Configuration
- 02-Login and User Interface Configuration
- 03-FTP and TFTP Configuration
- 04-HA Configuration
- 05-NQA Configuration
- 06-NetStream Configuration
- 07-NTP Configuration
- 08-RMON Configuration
- 09-SNMP Configuration
- 10-Packet Statistics Accounting Configuration
- 11-Device Management Configuration
- 12-Configuration File Management Configuration
- 13-File System Management Configuration
- 14-Cluster Management Configuration
- 15-System Maintenance and Debugging Configuration
- 16-Information Center Configuration
- 17-PoE Configuration
- 18-Clock Module Configuration
- 19-ACSEI Server Configuration
- 20-OAP Module Configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
03-FTP and TFTP Configuration | 105.82 KB |
Table of Contents
Chapter 1 FTP and TFTP Configuration
1.1.2 Introduction to FTP Client
1.2.1 Enabling/Disabling FTP Server
1.2.2 Configuring the FTP Server Authentication and Authorization
1.2.3 Configuring the Running Parameters of FTP Server
1.2.4 Displaying and Maintaining FTP Server
1.2.5 Disconnecting an FTP User
1.3 FTP Configuration Examples
1.3.1 FTP Client Configuration Example
1.3.2 FTP Server Configuration Example
1.5.1 Downloading Files by Means of TFTP
1.5.2 Uploading Files by Means of TFTP
1.6 TFTP Configuration Example
Chapter 1 FTP and TFTP Configuration
When configuring FTP and TFTP, go to these sections for information you are interested in:
1.1 FTP Overview
1.1.1 FTP Overview
File Transfer Protocol (FTP) is a universal method for transmitting files on the Internet and IP networks. In this method, files are copied from one system to another. FTP supports definite file types (such as ASCII and Binary) and file structures (byte stream and record). Even now, FTP is still used widely, while most users transmit files by Email and Web.
FTP, a TCP/IP protocol on the application layer, is used for transmitting files between a remote server and a local host.
The switch provides the following FTP services:
l FTP server: You can run FTP client program to log in the server and access the files on it.
l FTP client: You can run the ftp X.X.X.X command (where, X.X.X.X represents the IP address of the remote FTP server) to set up a connection between the switch and a remote FTP server to access the files on the remote server.
Table 1-1 Configuration of the switch as FTP client
Device |
Configuration |
Default |
Remarks |
Switch |
Log into the remote FTP server directly with the ftp command. |
— |
You need first get FTP user command and password, and then log into the remote FTP server. Then you can get the directory and file authority. |
PC |
Start FTP server and make such settings as username, password, and authority. |
— |
— |
Table 1-2 Configuration of the switch as FTP server
Device |
Configuration |
Default |
Remarks |
Switch |
Start FTP server. |
FTP server is disabled |
You can view the configuration information of FTP server with the display ftp-server command |
Configure authentication and authorization for FTP server. |
— |
Configure username, password and authorized directory for FTP users |
|
Configure running parameters for FTP server. |
— |
Configure timeout time value for FTP server. |
|
PC |
Log into the switch from FTP client. |
— |
— |
Caution:
The prerequisite for normal FTP function is that the switch and PC are reachable.
1.1.2 Introduction to FTP Client
As an additional function provided by the switch, FTP client is an application module and no configuration is needed on FTP clients. The switch connects the FTP clients and the remote server and inputs the command from the clients for corresponding operations (such as creating or deleting a directory).
1.2 FTP Configuration
This section covers the following topics:
l Enabling/Disabling FTP Server
l Configuring the FTP Server Authentication and Authorization
l Configuring the Running Parameters of FTP Server
l Displaying and Maintaining FTP Server
1.2.1 Enabling/Disabling FTP Server
Perform the following configuration to enable/disable FTP Server:
To do… |
Use the command… |
Remarks |
Enable the FTP server |
ftp server enable |
Available in system view |
Disable the FTP server |
undo ftp server |
Available in system view |
FTP server supports multiple users to access at the same time. A remote FTP client sends request to the FTP server. Then, the FTP server will carry out the corresponding operation and return the result to the client.
By default, FTP server is disabled.
1.2.2 Configuring the FTP Server Authentication and Authorization
The authorization information of FTP server includes the path to the desired directory for FTP users. The FTP server service is available only for the authenticated and authorized users. The authorization information of FTP server includes the top working directory provided for FTP clients.
Perform the following configuration to configure the FTP Server Authentication and Authorization:
To do… |
Use the command… |
Remarks |
Create new local FTP user and enter local user view |
local-user { username | password-display-mode { auto | cipher-force } } |
Available in system view |
Delete local FTP user |
undo local-user { username | all [ service-type { ftp | lan-access | telnet | ppp | ssh | terminal } ] | password-display-mode } |
Available in system view |
Configure password for local user |
password [ cipher | simple ] password |
Available local user view |
Configure service type for local user |
service-type { ftp [ ftp-directory directory ] | lan-access | ppp [ call-number call-number | callback-nocheck | callback-number callback-number ] | ssh [ level level | telnet | terminal ] | telnet [ level level | ssh | terminal ] | terminal [ level level | ssh | telnet ] } |
Available local user view |
Cancel password for local user |
undo password |
Available local user view |
Cancel authorization information for FTP user |
undo service-type { ftp [ ftp-directory directory ] | lan-access | ppp [ call-number call-number | callback-nocheck | callback-number callback-number ] | ssh [ level level | telnet | terminal ] | telnet [ level level | ssh | terminal ] | terminal [ level level | ssh | telnet ] } |
Available local user view |
Only the clients who have passed the authentication and authorization can access the FTP server.
Caution:
When using the file manager or IE browser to perform the FTP operations, you are recommended to input the user name and password in the address column in the following format: ftp://username:password@URL. If you input the URL of the FTP site you want to connect directly, the login may fail because of the bugs in the file manager or in the IE browser.
1.2.3 Configuring the Running Parameters of FTP Server
You can use the following commands to configure the connection timeout of the FTP server. If the FTP server receives no service request from the FTP client for a period of time, it will cut the connection to it, thereby avoiding the illegal access from the unauthorized users. The period of time is FTP connection timeout.
Perform the following configuration to configure FTP server connection timeout:
To do… |
Use the command… |
Remarks |
Configure FTP server connection timeouts |
ftp timeout minute |
Available in system view |
Restoring the default FTP server connection timeouts |
undo ftp timeout |
Available in system view |
By default, the FTP server connection timeout is 30 minutes.
1.2.4 Displaying and Maintaining FTP Server
To do… |
Use the command… |
Remarks |
Display FTP server |
display ftp-server |
Available in any view |
Display the connected FTP users |
display ftp-user |
Available in any view |
The display ftp-server command can be used for displaying the configuration information about the current FTP server, including the maximum amount of users supported by FTP server and the FTP connection timeout. The display ftp-user command can be used for displaying the detail information about the connected FTP users.
1.2.5 Disconnecting an FTP User
Perform the following configuration to disconnect an FTP user:
To do… |
Use the command… |
Remarks |
Disconnect an FTP user |
ftp disconnect user-name |
Available in system view |
1.3 FTP Configuration Examples
1.3.1 FTP Client Configuration Example
I. Network requirements
The switch serves as FTP client and the remote PC as FTP server. The configuration on FTP server: Configure an FTP user named as switch, with password hello and with read & write authority over the Switch root directory on the PC. The IP address of a VLAN interface on the switch is 1.1.1.1, and that of the PC is 2.2.2.2. The switch and PC are reachable.
The switch application switch.app is stored on the PC. Using FTP, the switch can download the switch.app from the remote FTP server and upload the config.txt to the FTP server under the switch directory for backup purpose.
II. Network diagram
Figure 1-2 Network diagram for FTP configuration
III. Configuration procedure
1) Configure FTP server parameters on the PC: a user named as switch, password hello, read and write authority over the Switch directory on the PC.
2) Configure the switch
# Log into the switch through the Console port locally or Telnet remotely (for detail, refer to Login and User Interface Configuration in the System Volume).
Then type in the right command in user view to establish FTP connection, and then input correct username and 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]
Caution:
l If the Flash Memory of the switch is not enough, you need to first delete the existing programs in the Flash Memory and then upload the new ones.
l When uploading a file, name the file in ASCII characters to ensure normal operation of the system.
# Enter the authorized directory of the FTP server.
[ftp] cd switch
# Use the put command to upload the config.txt to the FTP server.
[ftp] put config.txt
# Use the get command to download the switch.app from the FTP server to the Flash directory on the FTP server.
[ftp] get switch.app
# Use the quit command to release FTP connection and return to user view.
[ftp] quit
<H3C>
# Use the boot boot-loader command to specify the downloaded program as the application at the next login and reboot the switch.
<H3C> boot boot-loader primary switch.app
<H3C> reboot
1.3.2 FTP Server Configuration Example
I. Network requirements
Switch serves as FTP server and the remote PC as FTP client. The configuration on FTP server: Configure an FTP user named as switch, with password hello and with read & write authority over the flash root directory on the PC. The IP address of a VLAN interface on the switch is 1.1.1.1, and that of the PC is 2.2.2.2. The switch and PC are reachable.
The switch application switch.app is stored on the PC. Using FTP, the PC can upload the switch.app from the remote FTP server and download the config.txt from the FTP server for backup purpose.
II. Network diagram
Figure 1-3 Network diagram for FTP configuration
III. Configuration procedure
1) Configure the switch
# Log into the switch through the console port locally or Telnet remotely (for detail, refer to the Login and User Interface Configuration in the System Volume), and start FTP function and set username, password and file directory.
[H3C] ftp server enable
[H3C] local-user switch
[H3C-luser-switch] service-type ftp ftp-directory flash:
[H3C-luser-switch] password simple hello
2) Run FTP client on the PC and establish FTP connection. Upload the switch.app to the switch under the Flash directory and download the config.txt from the switch. FTP client is not shipped with the switch, so you need to buy it separately.
Caution:
If the Flash Memory of the switch is not enough, you need to first delete the existing programs in the Flash Memory and then upload the new ones.
3) When the uploading is completed, initiate file upgrade on the switch.
# Use the boot boot-loader command to specify the downloaded program as the application at the next login and reboot the switch.
<H3C> boot boot-loader primary switch.app
<H3C> reboot
1.4 TFTP Overview
Trivial File Transfer Protocol (TFTP) is a simple file transmission protocol. It is initially designed for the booting of free-disk systems (work stations or X terminals in general). Compared with FTP, another file transmission protocol, TFTP has no complicated interactive access interface or authentication control, and therefore it can be used when there is no complicated interaction between the clients and server. TFTP is implemented on the basis of UDP.
TFTP transmission is originated from the client end. To download a file, the client sends a request to the TFTP server and then receives data from it and sends acknowledgement to it. To upload a file, the client sends a request to the TFTP server and then transmits data to it and receives the acknowledgement from it. TFTP transmits files in binary mode only.
The administrator needs to configure the IP addresses of TFTP client and server before configuring TFTP, and makes sure that the route between the client and server is reachable.
The switch can only function as a TFTP client.
Table 1-3 Configuration of the switch as TFTP client
Device |
Configuration |
Default |
Remarks |
Switch |
Configure IP address for the VLAN interface of the switch, in the same network segment as that of TFTP server. |
— |
TFTP is right for the case where no complicated interactions are required between the client and server. Make sure that the route is reachable between the switch and the TFTP server. |
Use the tftp command to log into the remote TFTP server for file uploading and downloading. |
— |
— |
|
PC |
Start TFTP server and set authorized TFTP directory. |
— |
— |
1.5 TFTP Applications
1.5.1 Downloading Files by Means of TFTP
To download a file, the client sends a request to the TFTP server and then receives data from it and sends acknowledgement to it.
Perform the following configuration to download a file by means of TFTP:
To do… |
Use the command… |
Remarks |
Download a file by means of TFTP |
tftp tftp-server get source-file [ dest-file ] |
Available in user view |
In the command, tftp-server indicates the IP address or host name of TFTP server; source-file indicates the file information to be downloaded from TFTP server; dest-file indicates the name of the file downloaded on switch.
1.5.2 Uploading Files by Means of TFTP
To upload a file, the client sends a request to the TFTP server and then transmits data to it and receives the acknowledgement from it.
Perform the following configuration to upload a file by means of TFTP:
To do… |
Use the command… |
Remarks |
Upload a file by means of TFTP |
tftp tftp-server put source-file [ dest-file ] |
Available in user view |
In the command, source-file indicates the file to be uploaded to server; dest-file indicates the saved-as name of the file on TFTP server; tftp-server indicates the IP address or host name of TFTP server.
1.6 TFTP Configuration Example
I. Network requirements
The switch serves as TFTP client and the remote PC as TFTP server. Authorized TFTP directory is set on the TFTP server. The IP address of a VLAN interface on the switch is 1.1.1.1, and that of the PC is 1.1.1.2.
The switch application switch.app is stored on the PC. Using TFTP, the switch can download the switch.app from the remote TFTP server and upload the config.txt to the TFTP server under the switch directory for backup purpose.
II. Network diagram
Figure 1-5 Network diagram for TFTP configuration
III. Configuration procedure
1) Start TFTP server on the PC and set authorized TFTP directory.
2) Configure the switch
# Log into the switch (through local console or remote Telnet, refer to the Login and User Interface Configuration in the System Volume for login information), and then enter the system view.
<H3C> system-view
[H3C]
Caution:
If the Flash Memory of the switch is not enough, you need to first delete the existing programs in the Flash Memory and then upload the new ones.
# Configure IP address 1.1.1.1 for the VLAN interface, ensure the port connecting the PC is also in this VLAN (VLAN 1 in this example).
[H3C] interface vlan 1
[H3C-vlan-interface1] ip address 1.1.1.1 255.255.255.0
[H3C-vlan-interface1] quit
# Enter system view and download the switch.app from the TFTP server to the Flash Memory of the switch.
<H3C> tftp 1.1.1.2 get switch.app switch.app
# Upload the config.txt to the TFTP server.
<H3C> tftp 1.1.1.2 put config.txt config.txt
# Use the boot boot-loader command to specify the downloaded program as the application at the next login and reboot the switch.
<H3C> boot boot-loader primary switch.app
<H3C> reboot