H3C S3100-52P Ethernet Switch Command Manual-Release 1500(V1.01)

HomeSupportSwitchesH3C S3100 Switch SeriesReference GuidesCommand ReferencesH3C S3100-52P Ethernet Switch Command Manual-Release 1500(V1.01)
29-FTP and TFTP Command
Title Size Download
29-FTP and TFTP Command 188 KB

Chapter 1  FTP and TFTP

1.1  FTP Server Configuration Commands

1.1.1  display ftp-server

Syntax

display ftp-server

View

Any view

Parameter

None

Description

Use the display ftp-server command to display the FTP server-related settings of a switch when it operates as an FTP server.

You can use this command to verify FTP server-related configurations.

Example

# Display the FTP server-related settings of the switch (assuming that the switch is operating as an FTP server).

<H3C> display ftp-server

   FTP server is running

   Max user number       1

   User count            0

   Timeout value(in minute)       30

Table 1-1 Description on the fields of the display ftp-server command

Field

Description

FTP server is running

The FTP server is started

Max user number       1

The FTP server can accommodate up to one user.

User count                 0

The current login user number is 0.

Timeout value (in minute)       30

The connection idle time is 30 minutes.

 

1.1.2  display ftp-server source-ip

Syntax

display ftp-server source-ip

View

Any view

Parameter

None

Description

Use the display ftp-server source-ip command to display the source IP address set for an FTP server. If a source interface is specified for the FTP server, the IP address of the source interface will be displayed. If neither source interface nor source IP address is specified, 0.0.0.0 will be displayed.

Example

# Display the source IP address set for the FTP server.

<H3C> display ftp-server source-ip

The source IP you specified is 192.168.0.1

1.1.3  display ftp-user

Syntax

display ftp-user

View

Any view

Parameter

None

Description

Use the display ftp-user command to display the settings of the current FTP user, including the user name, host IP address, port number, connection idle time, and authorized directory.

Example

# Display FTP user settings.

<H3C> display ftp-user

Username     Host IP     Port        Idle        Homedir

H3C          10.110.3.5  1074        2       flash:

# If the user name exceeds ten characters, characters behind the tenth will be displayed in the second line with a left-aligning mode. Take username username@test for example, the result is:

<H3C> display ftp-user

Username     Host IP     Port        Idle        Homedir

username@t   10.110.3.5  1074        2       flash:

est

1.1.4  ftp disconnect

Syntax

ftp disconnect user-name

View

System view

Parameter

user-name: Name of the user to be disconnected from the FTP server.

Description

Use the ftp disconnect command to terminate the connection between a specified user and the FTP server.

 

&  Note:

If you attempt to disconnect a user that is uploading/downloading data to/from the FTP server that is acted by an S3100-52P Ethernet switch, the S3100-52P Ethernet switch will disconnect the user after the data transmission is completed.

 

Example

# Display the current online FTP users.

<H3C> display ftp-user

  UserName             HostIP    Port    Idle              HomeDir

test              192.168.0.3    1229       0              flash: 

# Disconnect the user named “test” from the FTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] ftp disconnect test

% The user connection will be disconnected after the data transfer finished

1.1.5  ftp server enable

Syntax

ftp sever enable

undo ftp sever

View

System view

Parameter

None

Description

Use the ftp server enable command to enable the FTP server for users to log in.

Use the undo ftp server command to disable the FTP server.

By default, the FTP server is disabled to avoid potential security risks.

Example

# Enable the FTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] ftp server enable

% Start FTP server

1.1.6  ftp timeout

Syntax

ftp timeout minutes

undo ftp timeout

View

System view

Parameter

minutes: Connection idle time (in minutes) ranging from 1 to 35,791. The default connection idle time is 30 minutes.

Description

Use the ftp timeout command to set the connection idle time.

Use the undo ftp timeout command to restore the default connection idle time.

If a FTP connection between an FTP server and an FTP client breaks down abnormally, the FTP server is not acknowledged with this and will keep this connection as usual.

You can set a connection idle time, so that the FTP server considers a FTP connection to be invalid and terminate it if no data exchange occurs on it in a specific period known as connection idle time.

Example

# Set the connection idle time to 36 minutes.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] ftp timeout 36

1.1.7  ftp-server source-interface

Syntax

ftp-server source-interface interface-type interface-number

undo ftp-server source-interface

View

System view

Parameter

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the ftp-server source-interface command to specify the source interface for an FTP server. If the specified interface does not exist, a prompt appears to show the configuration fails.

Use the undo ftp-server source-interface command to cancel the source interface setting. After you execute this command, the FTP server system decides which interface  will be used for being accessed by FTP clients.

Example

# Specify VLAN-interface2 as the source interface of the FTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] ftp-server source-interface Vlan-interface 2 

1.1.8  ftp-server source-ip

Syntax

ftp-server source-ip ip-address

undo ftp-server source-ip

View

System view

Parameter

ip-address: IP address that is to be specified as the source IP address.

Description

Use the ftp-server source-ip command to specify the source IP address for an FTP server. The value of argument ip-address must be an IP address on the device where the configuration is performed. Otherwise, a prompt appears to show the configuration fails.

Use the undo ftp-server source-ip command to cancel the source IP address setting. After you execute this command, the FTP server system decides which IP address on it will be used for being accessed by FTP clients.

Example

# Specify 192.168.1.1 as the source IP address of the FTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] ftp-server source-ip 192.168.1.1

1.2  FTP Client Configuration Commands

1.2.1  ascii

Syntax

ascii

View

FTP client view

Parameter

None

Description

Use the ascii command to specify that files be transferred in ASCII mode. That is, data is transferred in ASCII characters.

By default, files are transferred in ASCII mode.

Example

# Enter FTP client view.

<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]

# Specify to transfer text files in ASCII mode.

[ftp] ascii

200 Type is ASCII

1.2.2  binary

Syntax

binary

View

FTP Client view

Parameter

None

Description

Use the binary command to specify that program files be transferred in binary mode.

Example

# Enter FTP client view.

<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]

# Specify to transfer files in binary mode.

[ftp] binary

200 Type is Image (Binary)

1.2.3  bye

Syntax

bye

View

FTP client view

Parameter

None

Description

Use the bye command to terminate the control connection and data connection with the remote FTP server and quit to user view.

This command has the same effect as that of the quit command.

Example

# Enter FTP client view.

<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]

# Terminate the connections with the remote FTP server and quit to user view.

[ftp] bye

221 Windows FTP Server (WFTPD, by Texas Imperial Software) says goodbye.

<H3C>

1.2.4  cd

Syntax

cd pathname

View

FTP client view

Parameter

pathname: Path name

Description

Use the cd command to change the work directory on the remote FTP server.

Note that you can use this command to enter only authorized directories.

Example

# Enter FTP client view.

<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]

# Change the work directory to flash:/temp.

[ftp] cd flash:/temp

# Display the current work directory.

[ftp] pwd

257 "flash:/temp" is current directory.

1.2.5  cdup

Syntax

cdup

View

FTP client view

Parameter

None

Description

Use the cdup command to exit the current work directory and enter the parent directory.

Example

# Enter FTP client view.

<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]

# Change the work directory to flash:/temp.

[ftp] cd flash:/temp

# Change the work directory to the parent directory.

[ftp] cdup

# Display the current directory.

[ftp] pwd

257 "flash:" is current directory.

1.2.6  close

Syntax

close

View

FTP client view

Parameter

None

Description

Use the close command to terminate an FTP connection without quitting FTP client view.

This command has the same effect as that of the disconnect command.

Example

# Enter FTP client view.

<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]

# Terminate the FTP connection without quitting FTP client view.

[ftp] close

221 Windows FTP Server (WFTPD, by Texas Imperial Software) says goodbye.

[ftp]

1.2.7  debugging

Syntax

debugging

undo debugging

View

FTP client view

Parameter

None

Description

Use the debugging command to enable system debugging.

Use the undo debugging command to disable system debugging.

Example

# Enter FTP client view.

<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]

# Enable system debugging.

[ftp] debugging

% Debug is on.

1.2.8  delete

Syntax

delete remotefile

View

FTP client view

Parameter

remotefile: File name

Description

Use the delete command to delete a specified remote file.

Example

# Enter FTP client view.

<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]

# Delete the file named temp.c.

[ftp] delete temp.c

250 File deleted from remote host.

1.2.9  dir

Syntax

dir [ filename [ localfile ] ]

View

FTP client view

Parameter

filename: Name of the file to be queried.

localfile: Name of the local file where the query result is to be saved.

Description

Use the dir command to query specified files on a remote FTP server, or to display file information in the current directory. The output information, which includes the name, size and creation time of files, will be saved in a local file.

If you do not specify the filename argument, the information about all the files in the current directory is displayed.

Example

# Enter FTP client view.

<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]

# Display the information about all the files in the current directory on the remote FTP server.

[ftp] dir

200 PORT command okay

150 File Listing Follows in ASCII mode

-rwxrwxrwx   1 noone    nogroup   430585 Dec 21  2004 4.app

-rwxrwxrwx   1 noone    nogroup   430585 Dec 21  2004 5.app

-rwxrwxrwx   1 noone    nogroup   430585 Dec 23  2004 6. app

-rwxrwxrwx   1 noone    nogroup   430585 Dec 21  2004 6. app.bak

-rwxrwxrwx   1 noone    nogroup   638912 Nov 15  2004 abc.BTM

drwxrwxrwx   1 noone    nogroup        0 Dec 15  2004 TEST

-rwxrwxrwx   1 noone    nogroup  3212176 Jul 14  2004 21.bin

226 Transfer finished successfully.

FTP: 5346 byte(s) received in 6.782 second(s) 788.00 byte(s)/sec.

# Display the information about the file named 4.app and save the output information in the file named temp1.

[ftp] dir 4.app temp1

200 PORT command okay

150 File Listing Follows in ASCII mode

-rwxrwxrwx   1 noone    nogroup   430585 Dec 21  2004 4. app

226 Transfer finished successfully.

FTP: 70 byte(s) received in 0.122 second(s) 573.00 byte(s)/sec.

1.2.10  disconnect

Syntax

disconnect

View

FTP client view

Parameter

None

Description

Use the disconnect command to terminate a FTP connection without quitting FTP client view.

This command has the same effect as that of the close command.

Example

# Enter FTP client view.

<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]

# Terminate the FTP connection without quitting FTP Client view.

[ftp] disconnect

221 Windows FTP Server (WFTPD, by Texas Imperial Software) says goodbye

[ftp]

1.2.11  display ftp source-ip

Syntax

display ftp source-ip

View

Any view

Parameter

None

Description

Use the display ftp source-ip command to display the source IP address that the FTP client uses every time it connects to an FTP server. If a source interface is specified for the FTP client, the IP address of the source interface will be displayed. If neither a source IP address nor source interface is specified for the FTP client, 0.0.0.0 will be displayed.

Example

# Display the source IP address that the FTP client uses every time it connects to an FTP server.

<H3C> display ftp source-ip

The source IP you specified is 192.168.0.1

1.2.12  ftp

Syntax

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

View

User view

Parameter

ip-address: Host name or the IP address of an FTP server. Note that the host name can be a string comprising 1 to 20 characters.

port-number: Port number of the FTP server, ranging from 0 to 65535. The default is 21.

Description

Use the ftp command to establish a control connection with an FTP server and enter FTP client view.

Example

# Connect to the FTP server whose IP address is 2.2.2.2.

<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]

1.2.13  ftp { cluster | remote-server } source-interface

Syntax

ftp { cluster | remote-server } source-interface interface-type interface-number

View

User view

Parameter

cluster: Specifies to connect to a cluster FTP server.

remote-server: IP address or host name of the FTP server.

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the ftp { cluster | remote-server } source-interface command to connect to an FTP server through the specified source interface. This command will fail to be executed if the specified interface does not exist.

Example

# Connect to the FTP server whose IP address is 192.168.8.8 through the source interface VLAN-interface1.

<H3C> ftp 192.168.8.8 source-interface Vlan-interface 1

1.2.14  ftp { cluster | remote-server } source-ip

Syntax

ftp { cluster | remote-server } source-ip ip-address

View

User view

Parameter

cluster: Specifies to connect to a cluster FTP server.

remote-server: IP address or host name of the FTP server.

ip-address: Source IP address.

Description

Use the ftp { cluster | remote-server } source-ip command to connect to an FTP server through the specified source IP address. This command will fail to be executed if the specified source IP address does not exist.

Example

#  Connect to the FTP server whose IP address is 192.168.8.8 through the source IP address 192.168.0.1.

<H3C> ftp 192.168.8.8 source-ip 192.168.0.1

1.2.15  ftp source-interface

Syntax

ftp source-interface interface-type interface-number

undo ftp source-interface

View

System view

Parameter

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the ftp source-interface command to specify a source interface as the fixed source interface the FTP client uses every time it connects to an FTP server. This command will fail to be executed if the specified interface does not exist.

Use the undo ftp source-interface command to cancel the source interface setting. After you execute this command, the FTP client system decides which interface will be used for accessing FTP servers.

Example

# Specify VLAN-interface1 as the fixed source interface to be used in each connection between the FTP client and an FTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] ftp source-interface Vlan-interface 1 

1.2.16  ftp source-ip

Syntax

ftp source-ip ip-address

undo ftp source-ip

View

System view

Parameter

ip-address: IP address that is to be specified as the source IP address.

Description

Use the ftp source-ip command to specify the source IP address of an FTP client that the FTP client uses every time it connects to an FTP server. The value of argument ip-address must be an IP address on the device where the configuration is performed. Otherwise, a prompt appears to show the configuration fails.

Use the undo ftp source-ip command to cancel the source IP address setting. After you execute this command, the FTP client system decides which IP address on it will be used for accessing FTP servers.

Example

# Specify 192.168.0.1 as the source IP address that the FTP client uses every time it connects to an FTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] ftp source-ip 192.168.0.1

1.2.17  get

Syntax

get remotefile [ localfile ]

View

FTP client view

Parameter

remotefile: Name of a file on an FTP server.

localfile: Name of a local file.

Description

Use the get command to download a remote file and save it as a local file.

If you do not specify the localfile argument, the downloaded file is saved with its original name.

 

  Caution:

When using the get command to download files from a remote FTP server, note to limit the lengths of file path and file name within the following ranges regulated for an S3100-52P Ethernet switch.

l      A directory name should be no more than 91 characters.

l      A file name plus its local path name should be no more than 127 characters.

l      A device name should be no more than 14 characters.

l      A file name plus its complete path name should be no more than 142 characters.

 

Example

# Enter FTP client view.

<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]

# Download the file named temp.c.

[ftp] get temp.c

200 Port command okay.

150 Opening ASCII mode data connection for temp.c.

...............226 Transfer complete.

FTP: 749881 byte(s) received in 17.186 second(s) 43.00K byte(s)/sec. 

1.2.18  lcd

Syntax

lcd

View

FTP client view

Parameter

None

Description

Use the lcd command to display the local work directory on the FTP client.

Example

# Enter FTP client view.

<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]

# Display the local work directory.

[ftp] lcd

% Local directory now flash:/temp

1.2.19  ls

Syntax

ls [ remotefile [ localfile ] ]

View

FTP client view

Parameter

remotefile: Name of the remote file to be queried.

Localfile: Name of the local file where the querying result is to be saved.

Description

Use the ls command to display the information about a specified file on a remote FTP server.

If you do not specify the remotefile argument, names of all the files in the current remote directory are displayed.

 

  Caution:

The ls command only displays file names, while the dir command displays file information in more detail, including file size, creation date and so on.

 

Example

# Enter FTP client view.

<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]

# Display the names of all the files in the current directory on the remote FTP server.

[ftp] ls

200 PORT command okay

150 File Listing Follows in ASCII mode

4.app

5.app

6.app

6.app.bak

abc.BTM

TEST

21.bin

226 Transfer finished successfully.

FTP: 1235 byte(s) received in 1.595 second(s) 774.00byte(s)/sec.

1.2.20  mkdir

Syntax

mkdir pathname

View

FTP client view

Parameter

pathname: Path name.

Description

Use the mkdir command to create a directory on an FTP server.

This command is available only to the FTP clients that are assigned the permission to create directories on FTP servers.

Example

# Enter FTP client view.

<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]

# Create the directory flash:/lanswitch on the FTP server.

[ftp] mkdir flash:/lanswitch

257 "flash:/ lanswitch" directory created.

1.2.21  open

Syntax

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

View

FTP client view

Parameter

ip-address: IP address of an FTP server.

server-name: Host name of the FTP server, a string comprising 1 to 20 characters.

port: Port number on the remote FTP server, ranging from 0 to 65535. The default value is 21.

Description

Use the open command to establish a control connection with an FTP server.

Related command: close.

Example

# Enter FTP client view.

<H3C> ftp

[ftp]

# Establish a control connection with the FTP server whose IP address is 1.1.1.1.

[ftp]open 1.1.1.1

Trying ...

Press CTRL+K to abort

Connected.

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

User(none):abc

331 Give me your password, please

Password:

230 Logged in successfully

1.2.22  passive

Syntax

passive

undo passive

View

FTP client view

Parameter

None

Description

Use the passive command to set the data transfer mode to the passive mode.

Use the undo passive command to set the data transfer mode to the active mode.

By default, the passive mode is adopted.

Example

# Enter FTP client view.

<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]

# Set the data transfer mode to the passive mode.

[ftp] passive

% Passive is on

1.2.23  put

Syntax

put localfile [ remotefile ]

View

FTP client view

Parameter

localfile: Name of a local file.

remotefile: File name which the local file is to be saved as on the remote FTP server.

Description

Use the put command to upload a local file to an FTP server.

If you do not specify the remotefile argument, the local file is saved on the FTP server with its original name.

Example

# Enter FTP client view.

<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]

# Upload the local file named temp.c to the FTP server.

[ftp] put temp.c

200 Port command okay.

150 Opening ASCII mode data connection for temp.c.

226 Transfer complete.

FTP: 749881 byte(s) sent in 17.691 second(s) 42.00Kbyte(s)/sec.

1.2.24  pwd

Syntax

pwd

View

FTP Client view

Parameter

None

Description

Use the pwd command to display the work directory on an FTP server.

Example

# Enter FTP client view.

<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]

# Display the work directory on the FTP server.

[ftp] pwd

257 "flash:/temp" is current directory.

1.2.25  quit

Syntax

quit

View

FTP client view

Parameter

None

Description

Use the quit command to terminate FTP control connection and FTP data connection and quit to user view.

This command has the same effect as that of the bye command.

Example

# Enter FTP client view.

<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]

# Terminate the FTP control connection and FTP data connection and quit to user view.

[ftp] quit

221 Windows FTP Server (WFTPD, by Texas Imperial Software) says goodbye

<H3C>

1.2.26  remotehelp

Syntax

remotehelp [ protocol-command ]

View

FTP client view

Parameter

protocol-command: FTP protocol command.

Description

Use the remotehelp command to display the help information about an FTP protocol command.

This command works only when the FTP server provides the help information about FTP protocol commands.

 

  Caution:

l      This command is always valid when a H3C series switch operates as the FTP server.

l      If you use other FTP server software, refer to related instructions to know whether the FTP server provides help information about FTP protocol commands.

 

Example

# Enter FTP client view.

<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]

# Display the syntax of the user command.

[ftp] remotehelp user

214 Syntax: USER <sp> <username>

1.2.27  rename

Syntax

rename remote-source remote-dest

View

FTP client view

Parameter

remote-source: Name of a file on a remote host.

remote-dest: Destination file name.

Description

Use the rename command to rename a file on a remote FTP server.

If the destination file name conflicts with the name of an existing file or directory, you will fail to rename the file.

Example

# Enter FTP client view.

<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]

# Rename the file named temp.c as forever.c.

[ftp] rename temp.c forever.c

350 Enter the name to rename it to...

250 File renamed successfully

1.2.28  rmdir

Syntax

rmdir pathname

View

FTP client view

Parameter

pathname: Name of a directory on an FTP server.

Description

Use the rmdir command to remove a specified directory on an FTP server.

Note that you can only use this command to remove directories that are empty.

Example

# Enter FTP client view.

<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]

# Remove the directory flash:/temp1 on the FTP server. (Assume that the directory is empty.)

[ftp] rmdir flash:/temp1

200 Directory flash:/temp1 removed.

1.2.29  user

Syntax

user username [ password ]

View

FTP client view

Parameter

username: User name used to log into an FTP server.

password: Password used to log into an FTP server.

Description

Use the user command to log into an FTP server with the specified user name and password.

Example

# Enter FTP client view.

<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]

# Log into the FTP server using the user account with the user name being tom and the password being 111.

[ftp] user tom 111

331 Give me your password, please

230 Logged in successfully

1.2.30  verbose

Syntax

verbose

undo verbose

View

FTP client view

Parameter

None

Description

Use the verbose command to enable the verbose function, which displays execution and response information of other related commands.

Use the undo verbose command to disable the verbose function.

The verbose function is enabled by default.

Example

# Enter FTP client view.

<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]

# Enable the verbose function.

[ftp] verbose

1.3  TFTP Configuration Commands

1.3.1  display tftp source-ip

Syntax

display tftp source-ip

View

Any view

Parameter

None

Description

Use the display tftp source-ip display the source IP address that the TFTP client uses every time it connects to a TFTP server. If a source interface is specified for the TFTP client, the IP address of the source interface will be displayed. If neither source IP address nor source interface is specified for the TFTP client, 0.0.0.0 will be displayed.

Example

# Display the source IP address that the TFTP client uses every time it connects to a TFTP server.

<H3C> display tftp source-ip

The source IP you specified is 192.168.0.1

1.3.2  tftp

Syntax

tftp { ascii | binary }

View

System view

Parameter

ascii: Transfers data in the ASCII mode.

binary: Transfers data in the binary mode.

Description

Use the tftp { ascii | binary } command to set the TFTP data transfer mode.

By default, the binary mode is adopted.

Example

# Specify to adopt the ASCII mode.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] tftp ascii

TFTP transfer mode changed to ASCII.

1.3.3  tftp get

Syntax

tftp tftp-server get source-file [ dest-file ]

View

User view

Parameter

tftp-server: IP address or the host name of a TFTP server.

source-file: Name of the file to be downloaded from the TFTP server.

dest-file: File name which the downloaded file is to be saved as.

Description

Use the tftp get command to download a file from a TFTP server to the local switch.

Related command: tftp put.

Example

# Download the file named abc.txt from the TFTP server whose IP address is 1.1.1.1 and save it as efg.txt.

<H3C>tftp 1.1.1.1 get abc.txt efg.txt

  File will be transferred in binary mode.

  Downloading file from remote tftp server, please wait......

  TFTP:       35 bytes received in 0 second(s).

  File downloaded successfully.

1.3.4  tftp put

Syntax

tftp tftp-server put source-file [ dest-file ]

View

User view

Parameter

tftp-server: IP address or the host name of a TFTP server.

source-file: Name of the file to be uploaded to the TFTP server.

dest-file: File name which the uploaded file is to be saved as.

Description

Use the tftp put command to upload a file to a specified directory on a TFTP server.

Related command: tftp get.

Example

# Upload the file named config.cfg to the TFTP server whose IP address is 1.1.1.1 and save it as temp.cfg.

<H3C> tftp 1.1.1.1 put config.cfg temp.cfg

  File will be transferred in binary mode.

  Copying file to remote tftp server. Please wait... /

  TFTP:      962 bytes sent in 0 second(s).

  File uploaded successfully.

1.3.5  tftp tftp-server source-interface

Syntax

tftp tftp-server source-interface interface-type interface-number { get source-file [ dest-file ] | put source-file-url [ dest-file ] }

View

User view

Parameter

tftp-server: IP address or host name of the TFTP server to be connected to.

interface-type: Type of the source interface.

interface-number: Number of the source interface.

get: Specifies to download a file from the TFTP server.

source-file: Name of the file to be downloaded.

dest-file: Name of the downloaded file to be saved locally.

put:  Specifies to upload a file to the TFTP server.

source-file-url: Path and name of the file to be uploaded.

dest-file: Name of the uploaded file to be saved on the TFTP server.

Description

Use the tftp tftp-server source-interface command to connect to a TFTP server through the specified source interface, and perform download or upload operations. If the specified source interface does not exist, a prompt appears to show the command fails to be executed.

Example

# Connect to the remote TFTP server whose IP address is 192.168.8.8 through the source interface VLAN-interface1, and download the file named switch.bin from it.

<H3C> tftp 192.168.8.8 source-interface Vlan-interface 1 get switch.bin

1.3.6  tftp tftp-server source-ip

Syntax

tftp tftp-server source-ip ip-address { get source-file [ dest-file ] | put source-file-url [ dest-file ] }

View

User view

Parameter

tftp-server: IP address or host name of the TFTP server to be connected to.

ip-address: IP address to be set as the source IP address.

get: Specifies to download a file from the TFTP server.

source-file: Name of the file to be downloaded.

dest-file: Name of the downloaded file to be saved locally.

put:  Specifies to upload a file to the TFTP server.

source-file-url: Path and name of the file to be uploaded.

dest-file: Name of the uploaded file to be saved on the TFTP server.

Description

Use the tftp tftp-server source-ip command to connect to a TFTP server through the specified source IP address, and perform download or upload operations. If the specified source IP address does not exist, a prompt appears to show the command fails to be executed.

Example

# Connect to the remote TFTP server whose IP address is 192.168.8.8 through the source IP address 192.168.0.1, and download the file named switch.bin from it.

<H3C> tftp 192.168.8.8 source-ip 192.168.0.1 get switch.bin

1.3.7  tftp source-interface

Syntax

tftp source-interface interface-type interface-number

undo tftp source-interface

View

System view

Parameter

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the tftp source-interface command to specify the source interface of a TFTP client that the TFTP client uses every time it connects to a TFTP server. This command will fail to be executed if the specified interface does not exist.

Use the undo tftp source-interface command to cancel the source interface setting. After you execute this command, the TFTP client system decides which interface will be used for accessing TFTP servers.

Example

# Specify VLAN-interface1 as the source interface that the TFTP client uses every time it connects to a TFTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] tftp source-interface Vlan-interface 1

1.3.8  tftp source-ip

Syntax

tftp source-ip ip-address

undo tftp source-ip

View

System view

Parameter

ip-address: IP address that is to be specified as the source IP address.

Description

Use the tftp source-ip command to specify the source IP address of a TFTP client that the TFTP client uses every time it connects with a TFTP server. The value of argument ip-address must be an IP address on the device where the configuration is performed. Otherwise, a prompt appears to show the configuration fails.

Use the undo tftp source-ip command to cancel the source IP address setting. After you execute this command, the TFTP client system decides which IP address on it will be used for accessing TFTP servers.

Example

# Specify 192.168.0.1 as the source IP address that the TFTP client uses every time it connects to a TFTP server.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] tftp source-ip 192.168.0.1

1.3.9  tftp-server acl

Syntax

tftp-server acl acl-number

undo tftp-server acl

View

System view

Parameter

acl-number: Basic ACL number ranging from 2000 to 2999.

Description

Use the tftp-server acl command to specify the ACL adopted for the connection between a TFTP client and a TFTP server.

Use the undo tftp-server acl command to cancel all ACLs adopted.

Example

# Specify to adopt ACL 2000 on the TFTP client.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] tftp-server acl 2000

 

  • 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 Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网