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

HomeSupportSwitchesH3C S7500 Switch SeriesReference GuidesCommand ReferencesH3C S7500 Series Command Manual(Release 3100 Series)-(V1.04)
34-FTP and TFTP Commands
Title Size Download
34-FTP and TFTP Commands 137 KB

Chapter 1  FTP and TFTP Configuration Commands

1.1  FTP Server Configuration Commands

1.1.1  display ftp-server

Syntax

display ftp-server

View

Any view

Parameters

None

Description

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

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

Examples

# Display the FTP server-related settings of the switch (assuming that the switch is functioning 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

Maximum number of simultaneous login users supported

User count

Current login user quantity

Timeout value (in minute)

Connection idle time

 

1.1.2  display ftp-user

Syntax

display ftp-user

View

Any view

Parameters

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 work directory.

Examples

# Display FTP user settings.

<H3C> display ftp-user

Username     Host IP     Port        Idle        Homedir

H3C      10.110.3.5  1074        2       flash:/H3C

# If the user name exceeds ten characters in length, characters behind the tenth will be displayed in a new line in the flush-left 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:/H3C

est

1.1.3  ftp server enable

Syntax

ftp sever enable

undo ftp sever

View

System view

Parameters

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.

Examples

# 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.4  ftp timeout

Syntax

ftp timeout minutes

undo ftp timeout

View

System view

Parameters

minutes: Connection idle time (in minutes) ranging from 1 to 35,791.

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.

The default connection idle time is 30 minutes.

If an FTP connection between an FTP server and an FTP client breaks down abnormally and the FTP server is not informed of this timely, the FTP server keeps the connection as usual.

You can set a connection idle time, so that the FTP server considers an FTP connection to be invalid and terminates it if no data exchange occurs on it within the connection idle time.

Examples

# 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.2  FTP Client Configuration Commands

1.2.1  ascii

Syntax

ascii

View

FTP client view

Parameters

None

Description

Use the ascii command to specify that files be transferred in the ASCII mode.

By default, files are transferred in the ASCII mode.

Examples

# 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 mode of data transfer to the ASCII mode.

[ftp] ascii

200 Type set to A.

1.2.2  binary

Syntax

binary

View

FTP client view

Parameters

None

Description

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

Examples

# 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 binary mode for file transfer.

[ftp] binary

200 Type set to I.

1.2.3  bye

Syntax

bye

View

FTP client view

Parameters

None

Description

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

This command has the same effect as the quit command.

Examples

# 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 return to user view.

[ftp]bye

221 Server closing.

<H3C>

1.2.4  cd

Syntax

cd pathname

View

FTP client view

Parameters

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 the authorized directories only.

Examples

# 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

250 CWD command successful. 

# Display the current work directory.

[ftp] pwd

257 "flash:/temp" is current directory.

1.2.5  cdup

Syntax

cdup

View

FTP client view

Parameters

None

Description

Use the cdup command to go to the upper-level directory of the current directory.

Examples

# 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

250 CWD command successful. 

# Change the work directory to the upper-level directory.

[ftp] cdup

200 CDUP command successful.  

# Display the current directory.

[ftp] pwd

257 "flash:" is current directory.

1.2.6  close

Syntax

close

View

FTP client view

Parameters

None

Description

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

This command has the same effect as the disconnect command.

Examples

# 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 Server closing.

[ftp]

1.2.7  debugging

Syntax

debugging

undo debugging

View

FTP client view

Parameters

None

Description

Use the debugging command to enable system debugging.

Use the undo debugging command to disable system debugging.

Examples

# 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

Parameters

remotefile: Name of the file to be deleted.

Description

Use the delete command to delete a specified remote file.

Examples

# 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 DELE command successful.

1.2.9  dir

Syntax

dir [ filename [ localfile ] ]

View

FTP client view

Parameters

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.

Examples

# 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  2005 4.app

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

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

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

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

drwxrwxrwx   1 noone    nogroup        0 Dec 15  2005 TEST

-rwxrwxrwx   1 noone    nogroup  3212176 Jul 14  2005 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

Parameters

None

Description

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

This command has the same effect as the close command.

Examples

# 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 Server closing.

[ftp]

1.2.11  ftp

Syntax

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

View

User view

Parameters

cluster: Specifies to connect to a cluster FTP server.

ftp-server: Host name or 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 65,535. The default is 21.

Description

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

Examples

# 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.12  get

Syntax

get remotefile [ localfile ]

View

FTP client view

Parameters

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 using its original name.

 

  Caution:

When using the get command to download files from a remote FTP server, make sure the number of the characters contained in the path and file name is within the system-acceptable range.

 

Examples

# 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: 2162 byte(s) received in 4.163 second(s) 519.33 byte(s)/sec.    

1.2.13  lcd

Syntax

lcd

View

FTP client view

Parameters

None

Description

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

Examples

# 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.14  ls

Syntax

ls [ remotefile [ localfile ] ]

View

FTP client view

Parameters

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 name of a specified file on a remote FTP server.

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

 

  Caution:

The ls command can only be used to display file names, while the dir command can be used to display file information in detail, including file size, and creation date.

 

Examples

# 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.

200 Port command okay.

150 Opening ASCII mode data connection for *.

s7500.app

test.cfg

s7500-1.app

another.bat

test

default.diag

226 Transfer complete.

FTP: 189 byte(s) received in 0.011 second(s) 17.18Kbyte(s)/sec.    

1.2.15  mkdir

Syntax

mkdir pathname

View

FTP client view

Parameters

Pathname: Name of the directory to be created.

Description

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

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

Examples

# 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" new directory created.

1.2.16  open

Syntax

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

View

FTP client view

Parameters

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 65,535. The default value is 21.

Description

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

Related commands: close.

Examples

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

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.17  passive

Syntax

passive

undo passive

View

FTP client view

Parameters

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.

Examples

# 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.18  put

Syntax

put localfile [ remotefile ]

View

FTP client view

Parameters

localfile: Name of a local file to be uploaded.

remotefile: File name which the local file is to be saved as.

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 using the original name.

Examples

# 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 config.cfg.

 

 Operation may take a long time, please wait...

 226 Transfer complete.

FTP: 2162 byte(s) sent in 12.115 second(s) 178.45byte(s)/sec.   

1.2.19  pwd

Syntax

pwd

View

FTP client view

Parameters

None

Description

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

Examples

# 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.20  quit

Syntax

quit

View

FTP client view

Parameters

None

Description

Use the quit command to terminate an FTP connection and return to user view.

This command has the same effect as the bye command.

Examples

# 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 and return to user view.

[ftp] quit

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

<H3C>

1.2.21  remotehelp

Syntax

remotehelp [ protocol-command ]

View

FTP client view

Parameters

protocol-command: FTP protocol command.

Description

Use the remotehelp command to display the on-line help of an FTP protocol command.

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

 

  Caution:

l      This command is always valid when a H3C switch functions as an FTP server.

l      If you use other FTP server software, refer to related instructions to see whether it provides on-line help information about FTP protocol commands.

 

Examples

# 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.22  rmdir

Syntax

rmdir pathname

View

FTP client view

Parameters

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.

Examples

# 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 RMD command successful.

1.2.23  user

Syntax

user username [ password ]

View

FTP client view

Parameters

username: Name of the login user.

password: Password corresponding to the user.

Description

Use the user command to switch to a specified user.

Examples

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

# Switch to the user named tom, assuming that the corresponding password is 111.

[ftp] user tom 111

331 Give me your password, please

230 Logged in successfully

1.2.24  verbose

Syntax

verbose

undo verbose

View

FTP client view

Parameters

None

Description

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

Use the undo verbose command to disable the verbose function.

The verbose function is enabled by default.

Examples

# 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

% Verbose is on

1.3  TFTP Configuration Commands

1.3.1  tftp get

Syntax

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

View

User view

Parameters

cluster: Specifies to connect to a cluster FTP server.

tftp-server: IP address or 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 commands: tftp put.

Examples

# 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.2  tftp put

Syntax

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

View

User view

Parameters

cluster: Specifies to connect to a cluster FTP server.

tftp-server: IP address or 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 from an Ethernet switch to a specified directory on a TFTP server.

Related commands: tftp get.

Examples

# 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.3  tftp-server acl

Syntax

tftp-server acl acl-number

undo tftp-server acl

View

System view

Parameters

acl-number: Basic ACL number ranging from 2,000 to 2,999.

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 the ACLs adopted.

Examples

# 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
新华三官网