01-Fundamentals Command Reference

HomeSupportSwitchesS6300 SeriesReference GuidesCommand ReferencesH3C S6300 Switch Series Command References-Release 243x-6W10001-Fundamentals Command Reference
04-FTP and TFTP commands
Title Size Download
04-FTP and TFTP commands 207.74 KB

FTP commands

The device supports the FIPS mode that complies with NIST FIPS 140-2 requirements. Support for features, commands, and parameters might differ in FIPS mode and non-FIPS mode. For more information about FIPS mode, see Security Configuration Guide.

FTP is not supported in FIPS mode.

FTP server commands

display ftp-server

Use display ftp-server to display FTP server configuration and status information.

Syntax

display ftp-server

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display FTP server configuration and status information.

<Sysname> display ftp-server

FTP server is running.

User count:                        1

Idle-timeout timer (in minutes):  30

Table 1 Command output

Field

Description

User count

Number of the current logged-in users.

Idle-timeout timer (in minutes)

If no packet is exchanged between the FTP server and client during this period, the FTP connection is broken.

 

Related commands

·     ftp server enable

·     ftp timeout

display ftp-user

Use display ftp-user to display detailed information about logged-in FTP users.

Syntax

display ftp-user

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display detailed information about logged-in FTP users.

<Sysname> display ftp-user

UserName     HostIP             Port     HomeDir

root         192.168.20.184     46539    flash:

A field value is wrapped if its length exceeds the limit. The wrapped value is right justified.

The limits for fields are as follows:

·     UserName10 characters.

·     HostIP15 characters.

·     HomeDir37 characters.

<Sysname> display ftp-user

UserName     HostIP             Port     HomeDir

user2        2000:2000:2000:    1499     flash:/user2

             2000:2000:2000:

                  2000:2000

administra   100.100.100.100    10001    flash:/123456789/123456789/123456789/

       tor                               123456789/123456789/123456789/1234567

                                                                  89/123456789

Table 2 Command output

Field

Description

UserName

Name of the user.

HostIP

IP address of the user.

Port

Port number of the user.

HomeDir

Authorized directory for the user.

 

free ftp user

Use free ftp user to manually release the FTP connections established by using a specific user account.

Syntax

free ftp user username

Views

User view

Predefined user roles

network-admin

Parameters

username: Specifies a username. You can use the display ftp-user command to display FTP user information.

Examples

# Release the FTP connections established by using the user account ftpuser.

<Sysname> free ftp user ftpuser

Are you sure to free FTP connection? [Y/N]:y

<Sysname>

free ftp user-ip

Use free ftp user-ip to manually release the FTP connections established from a specific IPv4 address.

Syntax

free ftp user-ip ipv4-address [ port port ]

Views

User view

Predefined user roles

network-admin

Parameters

ipv4-address: Specifies the source IP address of an FTP connection. You can use the display ftp-user command to view the source IP addresses of FTP connections.

port port: Specifies the source port of an FTP connection. You can use the display ftp-user command to view the source ports of FTP connections.

Examples

# Release the FTP connections established from IP address 192.168.20.184.

<Sysname> free ftp user-ip 192.168.20.184

Are you sure to free FTP connection? [Y/N]:y

<Sysname>

free ftp user-ip ipv6

Use free ftp user-ip ipv6 to manually release the FTP connections established from a specific IPv6 address.

Syntax

free ftp user-ip ipv6 ipv6-address [ port port ]

Views

User view

Predefined user roles

network-admin

Parameters

ipv6-address: Specifies the source IPv6 address of an FTP connection. You can use the display ftp-user command to view the source IPv6 addresses of FTP connections.

port port: Specifies the source port of an FTP connection. You can use the display ftp-user command to view the source ports of FTP connections.

Examples

# Release the FTP connections established from IPv6 address 2000::154.

<Sysname> free ftp user-ip ipv6 2000::154

Are you sure to free FTP connection? [Y/N]:y

<Sysname>

ftp server acl

Use ftp server acl to use an ACL to control FTP clients' access to the FTP server.

Use undo ftp server acl to restore the default.

Syntax

ftp server acl { acl-number | ipv6 acl-number6 }

undo ftp server acl [ ipv6 ]

Default

No ACL is used to control FTP clients' access to the FTP server.

Views

System view

Predefined user roles

network-admin

Parameters

acl-number: Specifies an IPv4 ACL number in the range of 2000 to 3999.

ipv6 acl-number6: Specifies an IPv6 ACL number in the range of 2000 to 3999.

Usage guidelines

You can use this command to permit only FTP requests from specific FTP clients. This configuration takes effect only for FTP connections to be established. It does not impact existing FTP connections. If you execute the command multiple times, the most recently specified ACL takes effect.

Examples

# Use ACL 2001 to allow only client 1.1.1.1 to access the FTP server.

<Sysname> system-view

[Sysname] acl number 2001

[Sysname-acl-basic-2001] rule 0 permit source 1.1.1.1 0

[Sysname-acl-basic-2001] rule 1 deny source any

[Sysname-acl-basic-2001] quit

[Sysname] ftp server acl 2001

ftp server dscp

Use ftp server dscp to set the DSCP value for IPv4 to use for outgoing FTP packets on an FTP server.

Use undo ftp server dscp to restore the default.

Syntax

ftp server dscp dscp-value

undo ftp server dscp

Default

IPv4 uses the DSCP value 0 for outgoing FTP packets on an FTP server.

Views

System view

Predefined user roles

network-admin

Parameters

dscp-value: Specifies a DSCP value in the range of 0 to 63.

Usage guidelines

The DSCP value is carried in the ToS field of an IP packet, and it indicates the transmission priority of the packet.

Examples

# Set the DSCP value for IPv4 to use for outgoing FTP packets to 30 on an FTP server.

<Sysname> system-view

[Sysname] ftp server dscp 30

ftp server enable

Use ftp server enable to enable the FTP server.

Use undo ftp server enable to disable the FTP server.

Syntax

ftp server enable

undo ftp server enable

Default

The FTP server is disabled.

Views

System view

Predefined user roles

network-admin

Examples

# Enable the FTP server.

<Sysname> system-view

[Sysname] ftp server enable

ftp server ipv6 dscp

Use ftp server ipv6 dscp to set the DSCP value for IPv6 to use for outgoing FTP packets on an FTP server.

Use undo ftp server ipv6 dscp to restore the default.

Syntax

ftp server ipv6 dscp dscp-value

undo ftp server ipv6 dscp

Default

IPv6 uses the DSCP value 0 for outgoing FTP packets on an FTP server.

Views

System view

Predefined user roles

network-admin

Parameters

dscp-value: Specifies a DSCP value in the range of 0 to 63.

Usage guidelines

The DSCP value is carried in the Traffic class field of an IPv6 packet, and it indicates the transmission priority of the packet.

Examples

# Set the DSCP value for IPv6 to use for outgoing FTP packets to 30 on an FTP server.

<Sysname> system-view

[Sysname] ftp server ipv6 dscp 30

ftp server ssl-server-policy

Use ftp server ssl-server-policy to associate an SSL server policy with the FTP server.

Use undo ftp server ssl-server-policy to remove the association.

Syntax

ftp server ssl-server-policy policy-name

undo ftp server ssl-server-policy

Default

No SSL server policy is associated with the FTP server.

Views

System view

Predefined user roles

network-admin

Parameters

policy-name: Specifies an SSL server policy by its name, a string of 1 to 31 characters.

Usage guidelines

After you associate an SSL server policy with the FTP server, a client that supports SFTP will establish a secure connection to the device to ensure data security.

Examples

# Associate SSL server policy myssl with the FTP server.

<Sysname> system-view

[Sysname] ftp server ssl-server-policy myssl

Related commands

·     ftp server enable

·     ssl server-policy (Security Command Reference)

ftp timeout

Use ftp timeout to set the FTP connection idle-timeout timer.

Use undo ftp timeout to restore the default.

Syntax

ftp timeout minute

undo ftp timeout

Default

The FTP connection idle-timeout timer is 30 minutes.

Views

System view

Predefined user roles

network-admin

Parameters

Minute: Specifies an idle-timeout interval in the range of 1 to 35791 minutes.

Usage guidelines

If no data transfer occurs on an FTP connection within the idle-timeout interval, the FTP server closes the FTP connection to release resources.

Examples

# Set the FTP connection idle-timeout timer to 36 minutes.

<Sysname> system-view

[Sysname] ftp timeout 36

FTP client commands

Before executing FTP client configuration commands, make sure you have configured authorization settings for users on the FTP server. Authorized operations include viewing the files in the working directory, reading/downloading/uploading/renaming/removing files, and creating directories.

The FTP client commands in this section are supported by the device, but whether they can be executed successfully depends on the FTP server.

The output in the examples of this section varies by FTP server.

append

Use append to add the content of a file on the FTP client to a file on the FTP server.

Syntax

append localfile [ remotefile ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

localfile: Specifies a local file on the FTP client.

remotefile: Specifies a remote file on the FTP server.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Append the content of the local a.txt file to the b.txt file on the FTP server.

ftp> append a.txt b.txt

local: a.txt remote: b.txt

150 Connecting to port 50190

226 File successfully transferred

1657 bytes sent in 0.000736 seconds (2.15 Mbyte/s)

ascii

Use ascii to set the file transfer mode to ASCII.

Syntax

ascii

Default

The file transfer mode is binary.

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

You can perform this operation only after you log in to the FTP server.

The carriage return characters vary by operating system. For example, HP and Windows use /r/n, and Linux uses /n. To transfer files between two systems that use different carriage return characters, select the FTP transfer mode according to the file type.

FTP transfers files in either of the following modes:

·     Binary modeTransfers image files or pictures. This mode is also called flow mode.

·     ASCII modeTransfers text files.

Examples

# Set the file transfer mode to ASCII.

ftp> ascii

200 TYPE is now ASCII

Related commands

binary

binary

Use binary to set the file transfer mode to binary, which is also called the flow mode.

Syntax

binary

Default

The file transfer mode is binary.

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

You can perform this operation only after you log in to the FTP server.

The carriage return characters vary by operating system. For example, HP and Windows use /r/n, and Linux uses /n. To transfer files between two systems that use different carriage return characters, determine FTP transfer mode according to the file type.

FTP transfers files in either of the following modes:

·     Binary modeTransfers program file or pictures. This mode is also called flow mode.

·     ASCII modeTransfers text files.

Examples

# Set the file transfer mode to binary.

ftp> binary

200 TYPE is now 8-bit binary

Related commands

ascii

bye

Use bye to terminate the connection to the FTP server and return to user view.

If no connection is established between the device and the FTP server, use this command to return to user view.

Syntax

bye

Views

FTP client view

Predefined user roles

network-admin

network-operator

Examples

# Terminate the connection to the FTP server and return to user view.

ftp> bye

221-Goodbye. You uploaded 2 and downloaded 2 kbytes.

221 Logout.

<Sysname>

Related commands

quit

cd

Use cd to change the current working directory to another directory on the FTP server.

Syntax

cd { directory | .. | / }

Views

FTP client view

Predefined user roles

network-admin

Parameters

directory: Specifies the name of the target directory in the format [drive:][/]path, where drive represents the storage medium name, typically flash. If the target directory does not exist, the cd command does not change the current working directory. If no drive information is provided, the argument represents a folder or subfolder in the current directory. For more information about the drive and path arguments, see Fundamentals Configuration Guide.

..: Returns to the upper directory. Executing the cd .. command is the same as executing the cdup command. If the current working directory is the FTP root directory, the cd .. command does not change the current working directory.

/: Returns to the FTP root directory.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

The directory that can be accessed must be authorized by the FTP server.

Examples

# Change the working directory to the subdirectory logfile of the current directory.

ftp> cd logfile

250 OK. Current directory is /logfile

# Change the working directory to the subdirectory folder of the FTP root directory.

ftp> cd /folder

250 OK. Current directory is /folder

# Change the working directory to the upper directory of the current directory.

ftp> cd ..

250 OK. Current directory is /

# Change the working directory to the FTP root directory.

ftp> cd /

250 OK. Current directory is /

Related commands

·     cdup

·     pwd

cdup

Use cdup to enter the upper directory of the FTP server.

This command does not change the working directory if the current directory is the FTP root directory.

Syntax

cdup

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Change the working directory to the upper directory.

ftp> pwd

257 "/ftp/subdir" is your current location

ftp> cdup

250 OK. Current directory is /ftp

ftp> pwd

257 "/ftp" is your current location

Related commands

·     cd

·     pwd

close

Use close to terminate the connection to the FTP server without exiting FTP client view.

Syntax

close

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Terminate the connection to the FTP server without exiting the FTP client view.

ftp> close

221-Goodbye. You uploaded 0 and downloaded 0 kbytes.

221 Logout.

ftp>

Related commands

disconnect

debug

Use debug to enable or disable FTP client debugging.

Syntax

debug

Default

FTP client debugging is disabled.

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

When FTP client debugging is enabled, executing this command disables FTP client debugging.

When FTP client debugging is disabled, executing this command enables FTP client debugging.

Examples

# Enable and then disable FTP client debugging.

ftp> debug

Debugging on (debug=1).

ftp> debug

Debugging off (debug=0).

# When the device acts as the FTP client, enable FTP client debugging and download file a.txt from the current directory of the FTP server.

ftp> debug

Debugging on (debug=1).

ftp> get a.txt

local: a.txt remote: a.txt

---> EPRT |2|8::124|50198|

200 PORT command successful

---> RETR a.txt

150 Connecting to port 50198

226 File successfully transferred

1569 bytes received in 0.0104 seconds (147.2 kbyte/s)

Table 3 Command output

Field

Description

---> EPRT |2|8::124|50198|

FTP command.

·     2—IPv6 (1 for IPv4).

·     8::124—IPv6 address of the FTP server.

·     50198—Port number of the FTP server.

200 PORT command successful

Received FTP reply code. 200 represents the reply code, defined in RFC 959.

---> RETR a.txt

Downloads file a.txt.

 

delete

Use delete to permanently delete a file on the FTP server.

Syntax

delete remotefile

Views

FTP client view

Predefined user roles

network-admin

Parameters

remotefile: Specifies the name of a file on the FTP server.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

To perform this operation, you must have delete permission on the FTP server.

Examples

# Delete file b.txt.

ftp> delete b.txt

250 Deleted b.txt

dir

Use dir to display detailed information about the files and subdirectories in the current directory on the FTP server.

Use dir remotefile to display detailed information about a file or directory on the FTP server.

Use dir remotefile localfile to save detailed information about a file or directory on the FTP server to a local file.

Syntax

dir [ remotefile [ localfile ] ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

remotefile: Specifies the name of a file or directory on the FTP server.

localfile: Specifies the name of the local file used for saving the displayed information.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

In FTP client view, executing the dir command is the same as executing the ls command.

Examples

# Display detailed information about the files and subdirectories in the current directory on the FTP server.

ftp> dir

150 Connecting to port 50201

-rwxr-xr-x    1 0          0                1481 Jul  7 15:36 a.txt

-rwxr-xr-x    1 0          0                   0 Sep 27  2010 base.bin

drwxr-xr-x    2 0          0                8192 Jul  2 14:33 diagfile

drwxr-xr-x    3 0          0                8192 Jul  7 15:21 ftp

-rwxr-xr-x    1 0          0                   0 Sep 27  2010 kernel.bin

drwxr-xr-x    2 0          0                8192 Jul  5 09:15 logfile

drwxr-xr-x    2 0          0                8192 Jul  2 14:33 seclog

-rwxr-xr-x    1 0          0            40808448 Jul  2 14:33 simware-cmw710-sys

tem-a1801.bin

-rwxr-xr-x    1 0          0                3050 Jul  7 12:26 startup.cfg

-rwxr-xr-x    1 0          0               54674 Jul  4 09:24 startup.mdb

-rwxr-xr-x    1 0          0                1481 Jul  7 12:34 x.cfg

226 11 matches total

# Save detailed information about file a.txt to s.txt.

ftp> dir a.txt s.txt

output to local-file: s.txt ? [Y/N]y

150 Connecting to port 50203

226-Glob: a.txt

# Display the content of file s.txt.

ftp> bye

221-Goodbye. You uploaded 0 and downloaded 2 kbytes.

221 Logout.

<Sysname> more s.txt

-rwxr-xr-x    1 0          0                1481 Jul  7 12:34 a.txt

Related commands

ls

disconnect

Use disconnect to terminate the connection to the FTP server without exiting FTP client view.

Syntax

disconnect

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Terminate the connection to the FTP server without exiting the FTP client view.

ftp> disconnect

221-Goodbye. You uploaded 0 and downloaded 0 kbytes.

221 Logout.

ftp>

Related commands

close

display ftp client source

Use display ftp client source to display the source address settings on the FTP client.

Syntax

display ftp client source

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display the source address settings on the FTP client.

<Sysname> display ftp client source

The source IP address of the FTP client is 1.1.1.1.

The source IPv6 address of the FTP client is 2001::1.

ftp

Use ftp to log in to an FTP server and enter FTP client view.

Syntax

ftp [ ftp-server [ service-port ] [ vpn-instance vpn-instance-name ] [ dscp dscp-value | source { interface interface-type interface-number | ip source-ip-address } ] ] *

Views

User view

Predefined user roles

network-admin

Parameters

ftp-server: Specifies the IPv4 address or host name of an FTP server. A host name can be a case-insensitive string of 1 to 253 characters. Valid characters for a host name include letters, digits, hyphens (-), underscores (_), and dots (.).

service-port: Specifies the TCP port number of the FTP server, in the range of 0 to 65535. The default value is 21.

vpn-instance vpn-instance-name: Specifies the VPN instance to which the FTP server belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the FTP server belongs to the public network, do not specify this option.

dscp dscp-value: Specifies the DSCP value for IPv4 to use in outgoing FTP packets to indicate the packet transmission priority. The value range is 0 to 63. The default is 0.

source { interface interface-type interface-number | ip source-ip-address }: Specifies the source address used to establish the FTP connection.

·     interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's primary IPv4 address as the source address. To establish the FTP connection successfully, make sure the interface is up and has the primary IPv4 address configured.

·     ip source-ip-address: Specifies an IPv4 address. To establish the FTP connection successfully, make sure this address is the IPv4 address of an interface in up state on the device.

Usage guidelines

This command is only applicable to IPv4 networks.

If no parameters are specified, this command enters the FTP client view without logging in to the FTP server.

If the server parameters are specified, you are prompted to enter the username and password for logging in to the FTP server.

Examples

# Log in to the FTP server 192.168.0.211. Use the source IPv4 address of 192.168.0.212 for outgoing FTP packets.

<Sysname>ftp 192.168.0.211 source ip 192.168.0.212

Press CTRL+C to abort.

Connected to 192.168.0.211 (192.168.0.211).

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

User (192.168.0.211:(none)): abc

331 Give me your password, please

Password:

230 Logged in successfully

Remote system type is MSDOS.

ftp>

ftp client ipv6 source

Use ftp client ipv6 source to specify the source IPv6 address for FTP packets sent to the IPv6 FTP server.

Use undo ftp client ipv6 source to restore the default.

Syntax

ftp client ipv6 source { interface interface-type interface-number | ipv6 source-ipv6-address }

undo ftp client ipv6 source

Default

No source address is specified for FTP packets sent to the IPv6 FTP server. The device automatically selects a source IPv6 address as defined in RFC 3484.

Views

System view

Predefined user roles

network-admin

Parameters

interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's IPv6 address as the source address. For successful FTP packet transmission, make sure the interface is up and is configured with an IPv6 address.

ipv6 source-ipv6-address: Specifies an IPv6 address. For successful FTP packet transmission, make sure this address is the IPv6 address of an interface in up state on the device.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

The source address specified with the ftp ipv6 command takes precedence over the source address specified with the ftp client ipv6 source command.

The source address specified with the ftp client ipv6 source command applies to all FTP connections. The source address specified with the ftp ipv6 command applies only to the current FTP connection.

Examples

# Specify the source IPv6 address of 2000::1 for outgoing FTP packets.

<Sysname> system–view

[Sysname] ftp client ipv6 source ipv6 2000::1

Related commands

ftp ipv6

ftp client source

Use ftp client source to specify the source IPv4 address for FTP packets sent to the IPv4 FTP server.

Use undo ftp client source to restore the default.

Syntax

ftp client source { interface interface-type interface-number | ip source-ip-address }

undo ftp client source

Default

No source IPv4 address is specified for FTP packets sent to the IPv4 FTP server. The device uses the primary IPv4 address of the output interface for the route to the server as the source address.

Views

System view

Predefined user roles

network-admin

Parameters

interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's primary IPv4 address as the source address. For successful FTP packet transmission, make sure the interface is up and has the primary IPv4 address configured.

ip source-ip-address: Specifies an IPv4 address. For successful FTP packet transmission, make sure this address is the IPv4 address of an interface in up state on the device.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

The source address specified with the ftp command takes precedence over the source address specified with the ftp client source command.

The source address specified with the ftp client source command applies to all FTP connections. The source address specified with the ftp command applies only to the current FTP connection.

Examples

# Specify the source IPv4 address of 192.168.20.222 for outgoing FTP packets.

<Sysname> system-view

[Sysname] ftp client source ip 192.168.20.222

Related commands

ftp

ftp ipv6

Use ftp ipv6 to log in to an FTP server and enter FTP client view.

Syntax

ftp ipv6 [ ftp-server [ service-port ] [ vpn-instance vpn-instance-name ] [ dscp dscp-value | source { ipv6 source-ipv6-address | interface interface-type interface-number } ] * [ -i interface-type interface-number ] ]

Views

User view

Predefined user roles

network-admin

Parameters

ftp-server: Specifies the IPv6 address or host name of an FTP server. A host name can be a case-insensitive string of 1 to 253 characters. Valid characters for a host name include letters, digits, hyphens (-), underscores (_), and dots (.).

service-port: Specifies the TCP port number of the FTP server, in the range of 0 to 65535. The default value is 21.

dscp dscp-value: Specifies the DSCP value for IPv6 to use in outgoing FTP packets to indicate the packet transmission priority. The value range is 0 to 63. The default is 0.

source { ipv6 source-ipv6-address | interface interface-type interface-number }: Specifies the source address used to establish the FTP connection.

·     interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's IPv6 address as the source address. To establish the FTP connection successfully, make sure the interface is up and is configured with an IPv6 address.

·     ipv6 source-ipv6-address: Specifies an IPv6 address. To establish the FTP connection successfully, make sure this address is the IPv6 address of an interface in up state on the device.

vpn-instance vpn-instance-name: Specifies the VPN instance to which the FTP server belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the FTP server belongs to the public network, do not specify this option.

-i interface-type interface-number: Specifies an output interface by its type and number. This option can be used only when the FTP server address is a link local address and the specified output interface has a link local address. For more information about link local addresses, see Layer 3—IP Services Configuration Guide.

Usage guidelines

This command is only applicable to IPv6 networks.

If no parameters are specified, this command enters the FTP client view.

If the FTP server parameters are specified, you are prompted to enter the username and password for logging in to the FTP server.

Examples

# Log in to the FTP server 2000::154.

<Sysname>ftp ipv6 2000::154

Press CTRL+C to abort.

Connected to 2000::154 (2000::154).

220 FTP service ready.

User (2000::154): root

331 Password required for root.

Password:

230 User logged in

Remote system type is HP

get

Use get to download a file from the FTP server and save the file.

Syntax

get remotefile [ localfile ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

remotefile: Specifies the name of the file to be downloaded.

localfile: Specifies a name for the downloaded file.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

To save the downloaded file to the working directory accessed by the ftp command, the localfile argument must specify a file name such as a.cfg. If you do not provide the localfile argument, the downloaded file uses its original name.

To save the downloaded file to some other directory, the localfile argument must specify the target directory plus the file name such as flash:/subdirectory/a.cfg. Otherwise, the command fails to take effect.

Examples

# Download file a.txt and save it as b.txt in the working directory accessed by the ftp command.

ftp> get a.txt b.txt

# Download file a.txt to the folder test from the working directory accessed by the ftp command.

ftp> get a.txt flash:/test/b.txt

# Download file a.txt to the Flash root directory of member device 1 and save it as c.txt.

ftp> get a.txt slot1#flash:/c.txt

Related commands

put

help

Use help to display all commands supported by an FTP client.

Use help command-name to display the help information of a command.

Syntax

help [ command-name ]

Views

FTP client view

Predefined user roles

network-admin

network-operator

Parameters

command-name: Specifies a command supported by the FTP client.

Usage guidelines

In FTP client view, executing the help command is the same as entering?.

Examples

# Display all commands supported by the FTP client.

ftp> help

Commands may be abbreviated.  Commands are:

 

append           delete          ls              quit            rmdir

ascii            debug           mkdir           reget           status

binary           dir             newer           rstatus         system

bye              disconnect      open            rhelp           user

cd               get             passive         rename          verbose

cdup             help            put             reset           ?

close            lcd             pwd             restart

# Display the help information for the dir command.

ftp> help dir

dir              list contents of remote directory

Related commands

?

lcd

Use lcd to display the local working directory of the FTP client.

Use lcd directory to change the local working directory of the FTP client to the specified directory.

Use lcd / to change the local working directory of the FTP client to the local root directory.

Syntax

lcd [ directory | / ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

directory: Specifies a local directory of the FTP client. There must be a slash sign (/) before the name of the storage medium, for example, /flash:/logfile.

/: Specifies the root directory of the FTP client.

Examples

# Display the local working directory.

ftp> lcd

Local directory now /flash:

# Change the local working directory to flash:/logfile.

ftp> lcd /flash:/logfile

Local directory now /flash:/logfile

ls

Use ls to display detailed information about the files and subdirectories under the current directory on the FTP server.

Use ls remotefile to display detailed information about a file or directory on the FTP server.

Use ls remotefile localfile to save detailed information about a file or directory on the FTP server to a local file.

Syntax

ls [ remotefile [ localfile ] ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

remotefile: Specifies the file name or directory on the FTP server.

localfile: Specifies the local file used to save the displayed information.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

In FTP client view, executing the ls command is the same as executing the dir command.

Examples

# Display detailed information about the files and subdirectories under the current directory on the FTP server.

ftp> ls

150 Connecting to port 50201

-rwxr-xr-x    1 0          0                1481 Jul  7 15:36 a.txt

-rwxr-xr-x    1 0          0                   0 Sep 27  2010 base.bin

drwxr-xr-x    2 0          0                8192 Jul  2 14:33 diagfile

drwxr-xr-x    3 0          0                8192 Jul  7 15:21 ftp

-rwxr-xr-x    1 0          0                   0 Sep 27  2010 kernel.bin

drwxr-xr-x    2 0          0                8192 Jul  5 09:15 logfile

drwxr-xr-x    2 0          0                8192 Jul  2 14:33 seclog

-rwxr-xr-x    1 0          0            40808448 Jul  2 14:33 simware-cmw710-sys

tem-a1801.bin

-rwxr-xr-x    1 0          0                3050 Jul  7 12:26 startup.cfg

-rwxr-xr-x    1 0          0               54674 Jul  4 09:24 startup.mdb

-rwxr-xr-x    1 0          0                1481 Jul  7 12:34 x.cfg

226 11 matches total

# Save detailed information about file a.txt to s.txt.

ftp> ls a.txt s.txt

output to local-file: s.txt ? [Y/N]y

150 Connecting to port 50203

226-Glob: a.txt

# Display the content of file s.txt.

ftp> bye

221-Goodbye. You uploaded 0 and downloaded 2 kbytes.

221 Logout.

<Sysname> more s.txt

-rwxr-xr-x    1 0          0                1481 Jul  7 12:34 a.txt

Related commands

dir

mkdir

Use mkdir to create a subdirectory in the current directory on the FTP server.

Syntax

mkdir directory

Views

FTP client view

Predefined user roles

network-admin

Parameters

directory: Specifies the name of the directory to be created.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

You must have permission to perform this operation on the FTP server.

Examples

# Create subdirectory newdir in the current directory of the remote FTP server.

ftp> mkdir newdir

257 "newdir" : The directory was successfully created

newer

Use newer to update a local file by using a remote file on the FTP server.

Syntax

newer remotefile [ localfile ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

remotefile: Specifies the name of the remote file on the FTP server.

localfile: Specifies the name of the local file to be updated.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

If the local file does not exist, this command downloads the file from the FTP server and saves it locally.

If the remote file on the FTP server is not newer than the local file, this command does not update the local file.

Examples

# Update the local file with the file a.txt on the FTP server.

ftp> newer a.txt

local: a.txt remote: a.txt

150 Connecting to port 63513

226 File successfully transferred

1573 bytes received in 0.0293 seconds (52.3 kbyte/s)

open

Use open to log in to the FTP server in FTP client view.

Syntax

open server-address [ service-port ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

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

service-port: Specifies the TCP port number of the FTP server, in the range of 0 to 65535. The default value is 21.

Usage guidelines

After you issue this command, the system will prompt you to enter the username and password.

After you log in to one FTP server, you must disconnect from the server before you can use the open command to log in to another server.

Examples

# In FTP client view, log in to the FTP server 192.168.40.7.

<Sysname>ftp

ftp> open 192.168.40.7

Press CTRL+C to abort.

Connected to 192.168.40.7 (192.168.40.7).

220 FTP service ready.

User (192.168.40.7:(none)): root

331 Password required for root.

Password:

230 User logged in.

Remote system type is HP.

ftp>

passive

Use passive to set the FTP operation mode to passive.

Syntax

passive

Default

The FTP operation mode is passive.

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

FTP can operate in either of the following modes:

·     Active mode—The FTP server initiates the TCP connection.

·     Passive mode—The FTP client initiates the TCP connection.

You can use this command multiple times to change between active and passive modes.

This command is mainly used together with a firewall to control FTP session establishment between private network users and public network users.

Examples

# Set the FTP operation mode to passive.

ftp> passive

Passive mode on.

ftp> passive

Passive mode off.

put

Use put to upload a file on the client to the remote FTP server.

Syntax

put localfile [ remotefile ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

localfile: Specifies the name of the local file to be uploaded.

remotefile: Specifies the file name for saving the uploaded file on the FTP server.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

To upload a file in the working directory accessed by the ftp command, the localfile argument must specify a file name such as a.cfg.

To upload a file in some other directory, the localfile argument must specify the target directory plus the file name such as flash:/subdirectory/a.cfg. Otherwise, the command fails to take effect.

Examples

# Upload the file a.txt in the working directory accessed by the ftp command. Save the file as b.txt on the FTP server.

ftp> put a.txt b.txt

# Upload the file a.txt in the folder test from the working directory accessed by the ftp command. Save the file as b.txt on the FTP server.

ftp> put flash:/test/a.txt b.txt

# Upload the file a.txt in the root directory of the storage medium of member device 2. Save the file as b.txt on the FTP server.

ftp> put slot2#flash:/test/a.txt b.txt

Related commands

get

pwd

Use pwd to display the currently accessed directory on the FTP server.

Syntax

pwd

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Display the currently accessed directory on the remote FTP server.

ftp> cd subdir

250 OK. Current directory is /subdir

ftp> pwd

257 "/subdir" is your current location

quit

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

Syntax

quit

Views

FTP client view

Predefined user roles

network-admin

network-operator

Examples

# Terminate the connection to the FTP server and return to user view

ftp> quit

221-Goodbye. You uploaded 0 and downloaded 0 kbytes.

221 Logout.

<Sysname>

Related commands

bye

reget

Use reget to get the missing part of a file from the FTP server.

Syntax

reget remotefile [ localfile ]

Views

FTP client view

Predefined user roles

network-admin

network-operator

Parameters

remotefile: Specifies the name of the file on the FTP server.

localfile: Specifies the name of the local file.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

If a file download is not completed due to network or storage space problems, use this command to get the part that has not been downloaded yet.

Examples

# Get the part of the s.bin file that is missing due to transmission interruption.

ftp> reget s.bin

rename

Use rename to rename a file.

Syntax

rename [ oldfilename [ newfilename ] ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

oldfilename: Specifies the original file name.

newfilename: Specifies the new file name.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Rename the file a.txt as b.txt.

·     Method 1:

ftp> rename

(from-name) a.txt

(to-name) b.txt

350 RNFR accepted - file exists, ready for destination

250 File successfully renamed or moved

·     Method 2:

ftp> rename a.txt

(to-name) b.txt

350 RNFR accepted - file exists, ready for destination

250 File successfully renamed or moved

·     Method 3:

ftp> rename a.txt b.txt

350 RNFR accepted - file exists, ready for destination

250 File successfully renamed or moved

reset

Use reset to clear the reply information received from the FTP server in the buffer.

Syntax

reset

Views

FTP client view

Predefined user roles

network-admin

Examples

# Clear the reply information received from the FTP server.

ftp> reset

restart

Use restart to specify the file retransmission offset.

Syntax

restart marker

Views

FTP client view

Predefined user roles

network-admin

Parameters

marker: Specifies the retransmission offset, in bytes.

Usage guidelines

The file retransmission starts from the (offset+1)th byte.

You can perform this operation only after you log in to the FTP server.

Support for this command depends on the FTP server.

Examples

# Set retransmission offset to 2 bytes and retransmit the file h.c. The file has 82 bytes in total.

ftp> restart 2

restarting at 2. execute get, put or append to initiate transfer

ftp> put h.c h.c

local: h.c remote: h.c

350 Restart position accepted (2).

150 Ok to send data.

226 File receive OK.

80 bytes sent in 0.000445 seconds (175.6 kbyte/s)

ftp> dir

150 Here comes the directory listing.

-rw-r--r--    1 0        0              80 Jul 18 02:58 h.c

rhelp

Use rhelp to display the FTP-related commands supported by the FTP server.

Use rhelp protocol-command to display the help information of an FTP-related command supported by the FTP server.

Syntax

rhelp [ protocol-command ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

protocol-command: Specifies an FTP-related command.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Display the FTP-related commands supported by the FTP.

ftp> rhelp

214-The following FTP commands are recognized

 USER PASS NOOP QUIT SYST TYPE

 HELP CWD  XCWD PWD  CDUP XCUP

 XPWD LIST NLST MLSD PORT EPRT

 PASV EPSV REST RETR STOR APPE

 DELE MKD  XMKD RMD  XRMD ABOR

 SIZE RNFR RNTO

4 UNIX Type: L8

Table 4 Command output

Field

Description

USER

Username, corresponding to the xx command in FTP client view.

PASS

Password.

NOOP

Null operation.

SYST

System parameters.

TYPE

Request type.

CWD

Changes the current working directory.

XCWD

Extended command with the meaning of CWD.

PWD

Prints the working directory.

CDUP

Changes the directory to the upper directory.

XCUP

Extended command with the meaning of CDUP.

XPWD

Extended command with the meaning of PWD.

LIST

Lists files.

NLST

Lists brief file description.

MLSD

Lists file content.

PORT

Active mode (IPv4).

EPRT

Active mode (IPv6).

PASV

Passive mode (IPv4).

EPSV

Passive mode (IPv6).

REST

Restarts.

RETR

Downloads files.

STOR

Uploads files.

APPE

Appends uploading.

DELE

Deletes files.

MKD

Creates folders.

XMKD

Extended command with the meaning of MKD.

RMD

Removes folders.

XRMD

Extended command with the meaning of RMD.

ABOR

Aborts the transmission.

SIZE

Size of the transmission file.

RNFR

Original name.

RNTO

New name.

 

rmdir

Use rmdir to permanently delete a directory on the FTP server.

Syntax

rmdir directory

Views

FTP client view

Predefined user roles

network-admin

Parameters

directory: Specifies the name of a directory on the remote FTP server.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

To perform this operation, you must have delete permission on the FTP server.

Delete all files and subdirectories in a directory before you delete the directory. For more information about how to delete files, see the delete command.

Executing the rmdir command also deletes the files in the recycle bin of the specified directory.

Examples

# Delete the empty directory subdir1.

ftp>rmdir subdir1

250 The directory was successfully removed

Related commands

delete

rstatus

Use rstatus to display FTP server status.

Use rstatus remotefile to display detailed information about a directory or file on the FTP server.

Syntax

rstatus [ remotefile ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

remotefile: Specifies a directory or file on the FTP server.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Support for this command depends on the FTP server.

Examples

# Display FTP server status.

ftp> rstatus

211-FTP server status:

     Connected to 192.168.20.177

     Logged in as root

     TYPE: ASCII

     No session bandwidth limit

     Session timeout in seconds is 300

     Control connection is plain text

     Data connections will be plain text

     At session startup, client count was 1

     vsFTPd 2.0.6 - secure, fast, stable

211 End of status

Table 5 Command output

Filed

Description

211-FTP server status:

Beginning of the display of FTP server status, where 211 specifies the FTP command.

Connected to 192.168.20.177

IP address of the FTP client.

Logged in as root

Login username root.

TYPE: ASCII

File transfer mode ASCII.

Session timeout in seconds is 300

Timeout interval is 300 seconds.

Control connection is plain text

Control connection type is plain text.

Data connections will be plain text

Data connection type is plain text.

At session startup, client count was 1

FTP connection number is 1.

vsFTPd 2.0.6 - secure, fast, stable

FTP version is 2.0.6.

211 End of status

End of the display of FTP server status.

 

# Display file a.txt.

ftp> rstatus a.txt

213-Status follows:

-rw-r--r--    1 0        0              80 Jul 18 02:58 a.txt

213 End of status

Table 6 Command output

Field

Description

213-Status follows:

Beginning of the display of the file, where 213 specifies the FTP command.

-rw-r--r--

The first bit specifies the file type.

·     -—Common.

·     B—Block.

·     c—Character.

·     d—Directory.

·     l—Symbol connection file.

·     p—Pipe.

·     s—socket.

The second bit through the tenth bit are divided into three groups. Each group contains three characters, representing the access permission of the owner, group, and other users.

·     -—No permission.

·     r—Read permission.

·     w—Write permission.

·     x—Execution permission.

1

Number of connections.

0

Name of the file owner.

0

Group number of the file owner.

80

File size, in bytes.

Jul 18 02:58

Date and time when the file was most recently modified.

a.txt

File name.

213 End of status

End of the display of the file information.

 

status

Use status to display FTP status.

Syntax

status

Views

FTP client view

Predefined user roles

network-admin

Examples

# Display FTP status.

ftp> status

Connected to 192.168.1.56.

No proxy connection.

Not using any security mechanism.

Mode: stream; Type: ascii; Form: non-print; Structure: file

Verbose: on; Bell: off; Prompting: on; Globbing: off

Store unique: off; Receive unique: off

Case: off; CR stripping: on

Ntrans: off

Nmap: off

Hash mark printing: off; Use of PORT cmds: on

Table 7 Command output

Field

Description

Connected to 192.168.1.56.

IP address of the FTP server that is connected to the FTP client.

Verbose: on; Bell: off; Prompting: on; Globbing: off

Displays debugging information.

Store unique: off; Receive unique: off

The name of the file on the FTP server is unique and the name of the local file is unique.

Case: off; CR stripping: on

Does not support obtaining multiple files once and deletes "\r" when downloading text files.

Ntrans: off

Does not use the input-output transmission table.

Nmap: off

The file name does not use the input-to-output mapping template.

Hash mark printing: off; Use of PORT cmds: on

Does not end with a pound sign (#) and uses "PORT" data transmission.

 

system

Use system to display the system information of the FTP server.

Syntax

system

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

You can perform this operation only after you log in to the FTP server.

Examples

# Display the system information of the FTP server.

ftp> system

215 UNIX Type: L8

user

Use user to change to another user account after login.

Syntax

user username [ password ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

username: Specifies the username of the target user account.

password: Specifies the password of the target user account.

Usage guidelines

You can perform this operation only after you log in to the FTP server.

The username and password of the target user account must have already been configured. Otherwise, the user account change operation fails and the FTP connection is closed.

Examples

# After logging in to the FTP server, use the username ftp and password 123456 to log in again to the FTP server.

·     Method 1:

ftp> user ftp 123456

331 Password required for ftp.

230 User logged in.

·     Method 2:

ftp> user ftp

331 Password required for ftp.

Password:

230 User logged in.

verbose

Use verbose to enable or disable the device to display detailed information about FTP operations.

Syntax

verbose

Default

The device displays detailed information about FTP operations.

Views

FTP client view

Predefined user roles

network-admin

Usage guidelines

This command takes effect only for the current session. When you log in again, the command restores to the default setting.

Examples

# Disable the device from displaying detailed information about FTP operations.

ftp> verbose

Verbose mode off.

# Execute the get command.

ftp> get a.cfg 1.cfg

# Enable the device to display detailed information about FTP operations.

ftp> verbose

Verbose mode on.

# Execute the get command.

ftp> get a.cfg 2.cfg

227 Entering Passive Mode (192,168,1,58,68,14)

150-Accepted data connection

150 The computer is your friend. Trust the computer

226 File successfully transferred

3796 bytes received in 0.00762 seconds (486.5 kbyte/s)

?

Use ? to display all commands supported by an FTP client.

Use ? command-name to display the help information for a command.

Syntax

? [ command-name ]

Views

FTP client view

Predefined user roles

network-admin

Parameters

command-name: Specifies a command supported by the FTP client.

Usage guidelines

In FTP client view, entering ? is the same as executing the help command.

Examples

# Display all commands supported by the FTP client.

ftp> ?

Commands may be abbreviated.  Commands are:

 

append           delete          ls              quit            rmdir

ascii            debug           mkdir           reget           status

binary           dir             newer           rstatus         system

bye              disconnect      open            rhelp           user

cd               get             passive         rename          verbose

cdup             help            put             reset           ?

close            lcd             pwd             restart

# Display the help information for the dir command.

ftp> ? dir

dir              list contents of remote directory

Related commands

help

 


TFTP commands

The device supports the FIPS mode that complies with NIST FIPS 140-2 requirements. Support for features, commands, and parameters might differ in FIPS mode and non-FIPS mode. For more information about FIPS mode, see Security Configuration Guide.

TFTP is not supported in FIPS mode.

tftp

Use tftp to download a file from a TFTP server or upload a file to a TFTP server in an IPv4 network.

Syntax

tftp tftp-server { get | put | sget } source-filename [ destination-filename ] [ vpn-instance vpn-instance-name ] [ dscp dscp-value | source { interface interface-type interface-number | ip source-ip-address } ] *

Views

User view

Predefined user roles

network-admin

Parameters

tftp-server: Specifies the IPv4 address or host name of a TFTP server. The host name can be a case-insensitive string of 1 to 253 characters and can contain only letters, digits, hyphens (-), underscores (_), and dots (.).

get: Downloads a file and writes the file directly to the destination file. If the destination file already exists, the system deletes the existing file before starting the download operation. The existing file is permanently deleted even if the download operation fails.

put: Uploads a file.

sget: Downloads a file and saves the file to memory before writing it to the destination file. The system starts to write the downloaded file to the destination file only after the downloaded file is saved to memory successfully. If the destination file already exists, the downloaded file overwrites the existing file. If the download or save-to-memory operation fails, the existing file is not overwritten.

source-filename: Specifies the source file name, a case-insensitive string of 1 to 1 to 255 characters.

destination-filename: Specifies the destination file name, a case-insensitive string of 1 to 255 characters. If this argument is not specified, the file uses the source file name.

vpn-instance vpn-instance-name: Specifies the VPN instance to which the TFTP server belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the TFTP server belongs to the public network, do not specify this option.

dscp dscp-value: Specifies the DSCP value for IPv4 to use for outgoing TFTP packets to indicate the packet transmission priority. The value range is 0 to 63. The default is 0.

source { interface interface-type interface-number | ip source-ip-address }: Specifies the source address for outgoing TFTP packets. If you do not specify this option, the device uses the primary IPv4 address of the output interface for the route to the TFTP server as the source address.

·     interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's primary IPv4 address as the source IPv4 address. For successful TFTP packet transmission, make sure the interface is up and has the primary IPv4 address configured.

·     ip source-ip-address: Specifies an IPv4 address. For successful TFTP packet transmission, make sure this address is the IPv4 address of an interface in up state on the device.

Usage guidelines

The source address specified with the tftp command takes precedence over the source address specified with the tftp client source command.

The source address specified with the tftp client source command applies to all TFTP connections. The source address specified with the tftp command applies only to the current TFTP connection.

Examples

# Download the new.bin file from the TFTP server at 192.168.1.1 and save it as new.bin.

<Sysname> tftp 192.168.1.1 get new.bin

Press CTRL+C to abort.

   % Total    % Received % Xferd  Average Speed   Time    Time     Time   Current

                                  Dload  Upload   Total   Spent    Left   Speed

100 13.9M  100 13.9M    0     0  1206k      0  0:00:11  0:00:11  --:--:-- 1206k

<System>

Table 8 Command output

Field

Description

%

Percentage of file transmission progress.

Total

Size of files to be transmitted, in bytes.

%

Percentage of received file size to total file size.

Received

Received file size, in bytes.

%

Percentage of sent file size to total file size.

Xferd

Sent file size, in bytes.

Average Dload

Average download speed, in bps.

Speed Upload

Average upload speed, in bps.

 

Related commands

tftp client source

tftp client ipv6 source

Use tftp client ipv6 source to specify the source IPv6 address for TFTP packets sent to the IPv6 TFTP server.

Use undo tftp client ipv6 source to restore the default.

Syntax

tftp client ipv6 source { interface interface-type interface-number | ipv6 source-ipv6-address }

undo tftp client ipv6 source

Default

No source address is specified for TFTP packets sent to the IPv6 TFTP server. The device automatically selects a source IPv6 address as defined in RFC 3484.

Views

System view

Predefined user roles

network-admin

Parameters

interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's IPv6 address as the source address. For successful TFTP packet transmission, make sure the interface is up and is configured with an IPv6 address.

ipv6 source-ipv6-address: Specifies an IPv6 address . For successful TFTP packet transmission, make sure this address is the IPv6 address of an interface in up state on the device.

 Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

The source address specified with the tftp ipv6 command takes precedence over the source address specified with the tftp client ipv6 source command.

The source address specified with the tftp client ipv6 source command applies to all TFTP connections. The source address specified with the tftp ipv6 command applies only to the current TFTP connection.

Examples

# Specify the source IPv6 address of 2000::1 for outgoing TFTP packets.

<Sysname> system–view

[Sysname] tftp client ipv6 source ipv6 2000::1

Related commands

tftp ipv6

tftp client source

Use tftp client source to specify the source IPv4 address for TFTP packets sent to the IPv4 TFTP server.

Use undo tftp client source to restore the default.

Syntax

tftp client source { interface interface-type interface-number | ip source-ip-address }

undo tftp client source

Default

No source IPv4 address is specified for TFTP packets sent to the IPv4 TFTP server. The device uses the primary IPv4 address of the output interface for the route to the server as the source address.

Views

System view

Predefined user roles

network-admin

Parameters

interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's primary IPv4 address as the source address. For successful TFTP packet transmission, make sure the interface is up and has the primary IPv4 address configured.

ip source-ip-address: Specifies an IPv4 address. For successful TFTP packet transmission, make sure this address is the IPv4 address of an interface in up state on the device.

Usage guidelines

If you execute this command multiple times, the most recent configuration takes effect.

The source address specified with the tftp command takes precedence over the source address specified with the tftp client source command.

The source address specified with the tftp client source command applies to all TFTP connections. The source address specified with the tftp command applies only to the current TFTP connection.

Examples

# Specify the source IP address of 192.168.20.222 for outgoing TFTP packets.

<Sysname> system-view

[Sysname] tftp client source ip 192.168.20.222

Related commands

tftp

tftp ipv6

Use tftp ipv6 to download a file from a TFTP server or upload a file to a TFTP server in an IPv6 network.

Syntax

tftp ipv6 tftp-server [ -i interface-type interface-number ] { get | put | sget } source-filename [ destination-filename ] [ vpn-instance vpn-instance-name ] [ dscp dscp-value | source { interface interface-type interface-number | ipv6 source-ipv6-address } ] *

Views

User view

Predefined user roles

network-admin

Parameters

tftp-server: Specifies the IPv6 address or host name of a TFTP server. The host name can be a case-insensitive string of 1 to 253 characters and can contain only letters, digits, hyphens (-), underscores (_), and dots (.).

-i interface-type interface-number: Specifies an output interface by its type and number. This option can be used only when the TFTP server address is a link local address and the specified output interface has a link local address. For link local address configuration, see Layer 3—IP Services Configuration Guide.

get: Downloads a file and writes the file directly to the destination file. If the destination file already exists, the system deletes the existing file before starting the download operation. The existing file is permanently deleted even if the download operation fails.

put: Uploads a file.

sget: Downloads a file and saves the file to memory before writing it to the destination file. The system starts to write the downloaded file to the destination file only after the downloaded file is saved to memory successfully. If the destination file already exists, the downloaded file overwrites the existing file. If the download or save-to-memory operation fails, the existing file is not overwritten.

source-file: Specifies the source file name, a case-insensitive string of 1 to 255 characters.

destination-file: Specifies the destination file name, a case-insensitive string of 1 to 255 characters. If this argument is not specified, the file uses the source file name.

vpn-instance vpn-instance-name: Specifies the VPN instance to which the TFTP server belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the TFTP server belongs to the public network, do not specify this option.

dscp dscp-value: Specifies the DSCP value for IPv6 to use in outgoing TFTP packets to indicate the packet transmission priority. The value range is 0 to 63. The default is 0.

source { interface interface-type interface-number | ipv6 source-ipv6-address }: Specifies the source address for outgoing TFTP packets. If you do not specify this option, the device uses the primary IPv6 address of the route for the route to the TFTP server as the source address.

·     interface interface-type interface-number: Specifies an interface by its type and number. The device will use the interface's IPv6 address as the source IPv6 address. For successful TFTP packet transmission, make sure the interface is up and is configured with an IPv6 address.

·     ipv6 source-ipv6-address: Specifies an IPv6 address. For successful TFTP packet transmission, make sure this address is the IPv6 address of an interface in up state on the device.

Usage guidelines

The source address specified with the tftp ipv6 command takes precedence over the source address specified with the tftp client ipv6 source command.

The source address specified with the tftp client ipv6 source command applies to all TFTP connections. The source address specified with the tftp ipv6 command applies only to the current TFTP connection.

Examples

# Download the new.bin file from the TFTP server at 2001::1 and save it as new.bin.

<Sysname> tftp ipv6 2001::1 get new.bin new.bin

Press CTRL+C to abort.

   % Total    % Received % Xferd  Average Speed   Time    Time     Time   Current

                                  Dload  Upload   Total   Spent    Left   Speed

100 13.9M  100 13.9M    0     0  1206k      0  0:00:11  0:00:11  --:--:-- 1206k

For more information about the command output, see Table 8.

tftp-server acl

Use tftp-server acl to use an ACL to control the device's access to TFTP servers in an IPv4 network.

Use undo tftp-server acl to restore the default.

Syntax

tftp-server acl acl-number

undo tftp-server acl

Default

No ACL is used to control the device's access to TFTP servers.

Views

System view

Predefined user roles

network-admin

Parameters

acl-number: Specifies the number of a basic ACL, in the range of 2000 to 2999.

Usage guidelines

You can use an ACL to deny or permit the device's access to specific TFTP servers.

Examples

# Allow the device to access only the TFTP server at 1.1.1.1.

<Sysname> System-view

[Sysname] acl number 2000

[Sysname-acl-basic-2000] rule permit source 1.1.1.1 0

[Sysname-acl-basic-2000] quit

[Sysname] tftp-server acl 2000

tftp-server ipv6 acl

Use tftp-server ipv6 acl to use an ACL to control the device's access to TFTP servers in an IPv6 network.

Use undo tftp-server ipv6 acl to restore the default.

Syntax

tftp-server ipv6 acl acl-number

undo tftp-server ipv6 acl

Default

No ACL is used to control the device's access to TFTP servers.

Views

System view

Predefined user roles

network-admin

Parameters

acl-number: Specifies the number of a basic ACL, in the range of 2000 to 2999.

Usage guidelines

You can use an ACL to deny or permit the device's access to specific TFTP servers.

Examples

# Allow the device to access only the TFTP server at 2001::1.

<Sysname> System-view

[Sysname] acl ipv6 number 2001

[Sysname-acl6-basic-2001] rule permit source 2001::1/128

[Sysname-acl6-basic-2001] quit

[Sysname] tftp-server ipv6 acl 2001

 

 

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