H3C S3610[S5510] Series Ethernet Switches Command Manual-Release 0001-(V1.02)

HomeSupportSwitchesH3C S3610[S5510] Switch SeriesReference GuidesCommand ReferencesH3C S3610[S5510] Series Ethernet Switches Command Manual-Release 0001-(V1.02)
26-File System Management Command
Title Size Download
26-File System Management Command 228 KB

Table of Contents

Chapter 1 File System Management Commands. 1-1

1.1 File System Configuration Commands. 1-1

1.1.1 cd. 1-1

1.1.2 copy. 1-1

1.1.3 delete. 1-2

1.1.4 dir 1-3

1.1.5 execute. 1-4

1.1.6 file prompt 1-5

1.1.7 fixdisk. 1-5

1.1.8 format 1-6

1.1.9 mkdir 1-6

1.1.10 more. 1-7

1.1.11 move. 1-8

1.1.12 pwd. 1-8

1.1.13 rename. 1-9

1.1.14 reset recycle-bin. 1-9

1.1.15 rmdir 1-10

1.1.16 undelete. 1-11

1.2 File Management Configuration Commands. 1-11

1.2.1 backup startup-configuration. 1-11

1.2.2 display saved-configuration. 1-12

1.2.3 display startup. 1-18

1.2.4 reset saved-configuration. 1-18

1.2.5 restore startup-configuration. 1-19

1.2.6 save. 1-20

1.2.7 startup saved-configuration. 1-21

Chapter 2 FTP Configuration Commands. 2-1

2.1 FTP Server Configuration Commands. 2-1

2.1.1 display ftp-server 2-1

2.1.2 display ftp-user 2-1

2.1.3 ftp server enable. 2-2

2.1.4 ftp timeout 2-2

2.1.5 ftp update. 2-3

2.2 FTP Client Configuration Commands. 2-4

2.2.1 ascii 2-4

2.2.2 binary. 2-5

2.2.3 bye. 2-5

2.2.4 cd. 2-6

2.2.5 cdup. 2-6

2.2.6 close. 2-7

2.2.7 delete. 2-7

2.2.8 dir 2-8

2.2.9 disconnect 2-9

2.2.10 ftp. 2-9

2.2.11 get 2-10

2.2.12 lcd. 2-11

2.2.13 ls. 2-11

2.2.14 mkdir 2-13

2.2.15 open. 2-13

2.2.16 passive. 2-14

2.2.17 put 2-15

2.2.18 pwd. 2-15

2.2.19 quit 2-16

2.2.20 remotehelp. 2-16

2.2.21 rmdir 2-17

2.2.22 user 2-17

2.2.23 verbose. 2-18

Chapter 3 TFTP Configuration Commands. 3-1

3.1 TFTP Client Configuration Commands. 3-1

3.1.1 tftp-server acl 3-1

3.1.2 tftp get 3-2

3.1.3 tftp ipv6. 3-2

3.1.4 tftp put 3-3

3.1.5 tftp sget 3-4

 


Chapter 1  File System Management Commands

 

&  Note:

Throughout this document, a filename can be entered as either of the following:

l      A fully qualified filename with the path included to indicate a file under a specific path. The filename can be 1 to 135 characters in length.

l      A short filename with the path excluded to indicate a file in the current working path. The filename can be 1 to 91 characters in length.

 

1.1  File System Configuration Commands

1.1.1  cd

Syntax

cd directory

View

User view

Parameter

directory: Name of the target directory.

Description

Use the cd command to change the current directory.

Example

# Change the current directory to flash:.

<Sysname> cd flash:

1.1.2  copy

Syntax

copy fileurl-source fileurl-dest

View

User view

Parameter

fileurl-source: Name of the source file.

fileurl-dest: Name of the target file or directory.

Description

Use the copy command to copy a file.

If the name of the target file is the same with the name of an existing file, the system asks whether to overwrite the exiting one.

Example

# Copy file config.cfg and save it as tt.cfg.

<Sysname> copy config.cfg tt.cfg

Copy flash:/config.cfg to flash:/tt.cfg?[Y/N]:y

 

%Copy file flash:/config.cfg to flash:/tt.cfg...Done.

1.1.3  delete

Syntax

delete [ /unreserved ] file-url

View

User view

Parameter

/unreserved: Permanently deletes the specified file, and the deleted file can never be restored.

file-url: Name of the file to be deleted including the path. Asterisks (*) are acceptable as wildcards. For example, to remove files with the expansion of txt, you may use the delete * command.

Description

Use the delete command to remove a file from the storage device to the recycle bin, where you can restore the file with the undelete command or permanently delete it with the reset recycle-bin command.

The dir /all command displays the files removed to the recycle bin. These files are enclosed in pairs of brackets.

This command supports the wildcard *.

 

  Caution:

If you delete two files in different directories but with the same filename, only the last one is retained in the recycle bin.

 

Example

# Remove file tt.cfg from the root directory.

<Sysname> delete tt.cfg

Delete flash:/tt.cfg?[Y/N]:y

...

%Delete file flash:/tt.cfg...Done.

1.1.4  dir

Syntax

dir [ /all | file-url ]

View

User view

Parameter

/all: Displays all files (including those in the recycle bin).

file-url: Name of the file or directory to be displayed. Asterisks (*) are acceptable as wildcards. For example, to remove files with the .txt extension, you may use the delete * command.

Description

Use the dir command to display information about all visible files and folders in the current directory.

Use the dir /all command to display information about all files and folders on your device, including hidden files, hidden subfiles and those in the recycle bin. The names of these deleted files are enclosed in pairs of brackets ([ ]).

The dir file-url command displays information about a file or folder.

Example

# Display information about all files and folders.

<Sysname> dir /all

Directory of flash:/

   0   -rw-   6985954  Apr 26 2005 21:06:29   mainup.bin

   1   -rwh      1842  Apr 27 2005 04:37:17   private-data.txt

   2   -rw-      1518  Apr 26 2005 12:05:38   config.cfg

   3   -rw-      2045  May 04 2005 15:50:01   backcfg.cfg

   4   -rwh       428  Apr 27 2005 16:41:21   hostkey

   5   -rwh       572  Apr 27 2005 16:41:31   serverkey

   6   -rw-   2737556  Oct 12 2005 01:31:44   [a.bin]

 

14605 KB total (5096 KB free)

1.1.5  execute

Syntax

execute filename

View

System view

Parameter

filename: Name of a batch file with a .bat extension.

Description

Use the execute command to execute the specified batch file.

Batch files are command line files. Executing a batch file is to execute a set of command lines in the file.

You should not include invisible characters in a batch file. If an invisible character is found during the execution, the batch process will abort and the commands that have been executed cannot be cancelled. Not every command in a batch file is sure to be executed. For example, if a certain command is not correctly configured, the system omits this command and goes to the next one. A batch file does not support hot backup. Each configuration command in a batch file must be a standard configuration command, meaning the valid configuration information which can be displayed with the display current-configuration command after this command is configured successfully; otherwise, this command may not be executed correctly.

Example

# Execute the batch file test.bat in the root directory.

<Sysname> system-view

[Sysname] execute test.bat

1.1.6  file prompt

Syntax

file prompt {alert | quiet }

View

System view

Parameter

alert: Enables the system to warn you about operations that may bring undesirable results such as file corruption or data loss.

quiet: Disables the system to warn you about any operation.

Description

Use the file prompt command to set a prompt mode for file operations.

By default, the prompt mode is alert.

Note that when the prompt mode is set to quiet, the system does not warn for any file operation. To prevent undesirable consequents resulted from misoperations, the alert mode is preferred.

Example

# Set the file operation prompt mode to alert.

<Sysname> system-view

[Sysname] file prompt alert

1.1.7  fixdisk

Syntax

fixdisk device

View

User view

Parameter

device: Device name.

Description

Use the fixdisk command to restore the space of a storage device when it becomes unavailable because of some abnormal operation.

Example

# Restore the space of the Flash.

<Sysname> fixdisk flash:

Fixdisk flash: may take some time to complete.

%Fixdisk flash: completed.

1.1.8  format

Syntax

format device

View

User view

Parameter

device: Device name.

Description

Use the format command to format a storage device.

 

  Caution:

Formatting a device results in loss of all the files and these files cannot be restored. In particular, if you format the flash, the configuration file on it will be removed.

 

Example

# Format the Flash.

<Sysname> format flash:

All data on flash: will be lost , proceed with format ? [Y/N]:y

./

%Format flash: completed.

1.1.9  mkdir

Syntax

mkdir directory

View

User view

Parameter

directory: Name of directory.

Description

Use the mkdir command to create a subdirectory under the specified directory on the storage device.

The name of the subdirectory to be created must be unique under the specified directory.

This command does not allow you to create multiple directory levels at one time. For instance, to create a subdirectory “flash:/test/mytest”, the test directory must have been created.

Example

# Create a directory named test.

<Sysname> mkdir ddtest

...

% Created dir flash:/ddtest

# create a subdirectory named mytest under test.

<Sysname>mkdir test/mytest

...

%Created dir flash:/test/mytest

1.1.10  more

Syntax

more file-url

View

User view

Parameter

file-url: File name.

Description

Use the more command to display the contents of the specified file.

So far, this command is valid only for txt files.

Example

# Display the contents of file test.txt.

<Sysname> more test.txt

AppWizard has created this test application for you.

This file contains a summary of what you will find in each of the files that make up your test application.

Test.dsp

This file (the project file) contains information at the project level and is used to build a single project or subproject. Other users can share the project (.dsp) file, but they should export the makefiles locally.

1.1.11  move

Syntax

move fileurl-source fileurl-dest

View

User view

Parameter

fileurl-source: Name of the source file.

fileurl-dest: Name of the target file.

Description

Use the move command to move a file.

If the name of the target file is the same as an existing one in the intended directory, the system will ask you whether to overwrite the existing one.

Example

# Move the file flash:/test/sample.txt to flash:/sample.txt.

<Sysname> move flash:/test/sample.txt flash:/sample.txt

Move flash:/test/sample.txt to flash:/sample.txt ? [Y/N]:y

% Moved file flash:/test/sample.txt to flash:/sample.txt

1.1.12  pwd

Syntax

pwd

View

User view

Parameter

None

Description

Use the pwd command to display the current path.

If the current path is not set, the operation will fail.

Example

# Display the current path.

<Sysname> pwd

flash:

1.1.13  rename

Syntax

rename fileurl-source fileurl-dest

View

User view

Parameter

fileurl-source: Name of the source file or directory.

fileurl-dest: Name of the target file or directory.

Description

Use the rename command to rename a file or directory.

The target file name must be unique under the current path.

Example

# Rename the file sample.txt to sample.bak.

<Sysname> rename sample.txt sample.bak

Rename flash:/sample.txt to flash:/sample.bak ? [Y/N]:y

.

% Renamed file flash:/sample.txt to flash:/sample.bak

1.1.14  reset recycle-bin

Syntax

reset recycle-bin [ file-url ] [ /force ]

View

User view

Parameter

file-url: Name of the file to be deleted. This argument accepts asterisks (*) as wildcards. For example, you may perform reset recycle-bin *.txt to delete all files with the .txt extension from the recycle bin.

/force: Empties the recycle bin.

Description

Use the reset recycle-bin command to permanently remove deleted file or files from the recycle bin.

Unlike this command, the delete file-url command only moves files to the recycle bin.

Example

# Empty the recycle bin.

<Sysname> reset recycle-bin

Clear flash:/ ~/tt.cfg ?[Y/N]:y

Clearing files from flash may take a long time. Please wait...

...

%Cleared file flash:/~/tt.cfg...

1.1.15  rmdir

Syntax

rmdir directory

View

User view

Parameter

directory: Name of the directory.

Description

Use the rmdir command to remove a directory.

The directory must be an empty one. If it is not, first delete all files and subdirectory under it with the delete command.

Example

# Remove directory mydir.

<Sysname> rmdir mydir

Rmdir flash:/mydir?[Y/N]:y

.

%Removed directory flash:/mydir.

1.1.16  undelete

Syntax

undelete file-url

View

User view

Parameter

filename: Name of the file to be restored.

Description

Use the undelete command to restore a file from the recycle bin.

If another file with the same name has already existed under the same path, the undelete operation will cause it to be overwritten and the system will ask you whether to continue.

Example

# Restore file sample.bak from the recycle bin.

<Sysname> undelete sample.bak

Undelete flash:/sample.bak ? [Y/N]:y

% Undeleted file flash:/sample.bak

1.2  File Management Configuration Commands

1.2.1  backup startup-configuration

Syntax

backup startup-configuration to dest-addr [ dest-filename ]

View

Use view

Parameter

dest-addr: IP address or name of a TFTP server. The address cannot be an IPv6 address.

dest-filename: Filename used to save the next startup configuration file on the server.

Description

Use the backup startup-configuration command to backup the startup configuration file (for next startup) using a filename you specify. If you do not specify this filename, the original filename will be used.

Presently, the device uses TFTP to implement backup operation.

Example

# Backup the configuration file for next startup on the TFTP server with IP address 2.2..2.2, using the filename config.cfg.

<Sysname> backup startup-configuration to 2.2.2.2 config.cfg

Backup next startup-configuration file to 2.2.2.2, please wait…

finished!

<Sysname>

1.2.2  display saved-configuration

Syntax

display saved-configuration [ by-linenum ]

View

Any view

Parameter

by-linenum: Identifies each line of displayed information with a line number.

Description

Use the display saved-configuration command to display the configuration file saved in the storage device.

In case the device malfunctions after being powered up, if you find some configurations are not validated or incorrect, you may use this command to identify the problem.

If you do not use the configuration file when the device starts up, meaning the displayed startup configuration file is empty after you execute the display startup command, no information is displayed when you execute the display saved-configuration command; if you have saved the configuration file after the device starts up, the information saved in the configuration file the last time is displayed.

Related command: save, reset saved-configuration, and the display current-configuration command in System Maintenance and Debugging Command Module.

Example

# Display the configuration file saved in the flash.

<Sysname> display saved-configuration

#

 sysname Sysname

#

 domain default enable system

#

 telnet server enable

#

vlan 1

#

vlan 10

#

vlan 40

#

vlan 50

#

vlan 99

#

vlan 200

#

vlan 300

#

vlan 400

#

vlan 500

#

vlan 600

#

radius scheme system

 server-type extended

 primary authentication 127.0.0.1 1645

 primary accounting 127.0.0.1 1646

 user-name-format without-domain

#

domain system

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

#

dhcp server ip-pool 98

 static-bind client-identifier aabb

 expired unlimited

#

dhcp server ip-pool 99

 network 99.9.0.0 mask 255.255.0.0

 gateway-list 10.110.1.99

 dns-list 10.1.1.254

 domain-name mydomain.com

 nbns-list 10.12.1.99

 netbios-type b-node

 expired day 1 hour 2 minute 3

 tftp-server domain-name aaa

 tftp-server ip-address 10.1.1.1

 option 100 hex  1122

#

acl number 2000

 rule 0 permit source 1.0.0.0 0.255.255.255

#

interface NULL0

#

interface Vlan-interface1

 ip address 192.168.0.36 255.255.255.0

#

interface Vlan-interface10

 ip address 10.10.1.1 255.255.255.0

#

interface Vlan-interface40

 ip address 10.10.4.1 255.255.255.0

#

interface Vlan-interface50

 ip address 10.10.5.1 255.255.255.0

#

interface Vlan-interface99

#

interface Vlan-interface200

 ip address 200.1.1.1 255.255.255.0

#

interface Vlan-interface300

 ip address 200.1.2.2 255.255.255.0

#

interface Vlan-interface400

 ip address 10.1.2.1 255.255.255.0

#

interface Vlan-interface500

 ip address 200.1.3.1 255.255.255.0

#

interface Vlan-interface600

 ip address 10.1.4.1 255.255.255.0

#

interface Ethernet1/0/1

#

interface Ethernet1/0/2

#

interface Ethernet1/0/3

#

interface Ethernet1/0/4

#

interface Ethernet1/0/5

#

interface Ethernet1/0/6

 port access vlan 50

#

interface Ethernet1/0/7

#

interface Ethernet1/0/8

#

interface Ethernet1/0/9

 port access vlan 400

#

interface Ethernet1/0/10

#

interface Ethernet1/0/11

#

interface Ethernet1/0/12

 port access vlan 10

#

interface Ethernet1/0/13

#

interface Ethernet1/0/14

#

interface Ethernet1/0/15

#

interface Ethernet1/0/16

#

interface Ethernet1/0/17

#

interface Ethernet1/0/18

 port access vlan 40

#

interface Ethernet1/0/19

#

interface Ethernet1/0/20

#

interface Ethernet1/0/21

#

interface Ethernet1/0/22

 port access vlan 200

#

interface Ethernet1/0/23

#

interface Ethernet1/0/24

#

interface Ethernet1/0/25

#

interface Ethernet1/0/26

#

interface Ethernet1/0/27

#

interface Ethernet1/0/28

#

interface Ethernet1/0/29

#

interface Ethernet1/0/30

#

interface Ethernet1/0/31

#

interface Ethernet1/0/32

#

interface Ethernet1/0/33

#

interface Ethernet1/0/34

#

interface Ethernet1/0/35

#

interface Ethernet1/0/36

#

interface Ethernet1/0/37

#

interface Ethernet1/0/38

#

interface Ethernet1/0/39

#

interface Ethernet1/0/40

#

interface Ethernet1/0/41

#

interface Ethernet1/0/42

#

interface Ethernet1/0/43

#

interface Ethernet1/0/44

#

interface Ethernet1/0/45

#

interface Ethernet1/0/46

#

interface Ethernet1/0/47

#

interface Ethernet1/0/48

#

interface GigabitEthernet1/1/1

#

interface GigabitEthernet1/1/2

#

interface GigabitEthernet1/1/3

#

interface GigabitEthernet1/1/4

#

bgp 10

 network 200.1.1.0

 undo synchronization

 balance 2

 peer 10.10.4.2 as-number 40

 peer 10.10.1.2 as-number 20

#

route-policy apply_med_50 permit node 10

 if-match acl 2000

 apply cost 50

route-policy apply_med_100 permit node 10

 if-match acl 2000

 apply cost 100

route-policy 12 permit node 10

 apply community 10

#

 ip community-list 1 permit internet

#

user-interface aux 0

user-interface vty 0 4

 authentication-mode none

 user privilege level 3

#

return

# The configurations are displayed in the order of global, port, and user interface.

1.2.3  display startup

Syntax

display startup

View

User view

Parameter

None

Description

Use the display startup command to display the configuration file used at this startup and the one used for next startup.

Related command: startup saved-configuration.

Example

# Display the configuration information used at this startup.

<Sysname> display startup

  Current startup saved-configuration file:          flash:/config.cfg

  Next startup saved-configuration file:             flash:/config.cfg

1.2.4  reset saved-configuration

Syntax

reset saved-configuration

View

User view

Parameter

None

Description

Use the reset saved-configuration command to erase the configuration file saved in the storage device.

 

  Caution:

This command will permanently delete the configuration file on the device.

 

In case no configuration file is available, the device starts up with the default settings.

Related command: save, display saved-configuration.

Example

# Erase the configuration file saved in flash.

<Sysname> reset saved-configuration

The saved configuration file will be erased.

Are you sure?[Y/N]:y

Configuration file in flash is being cleared.

Please wait ...

......

Configuration in flash is cleared.

1.2.5  restore startup-configuration

Syntax

restore startup-configuration from src-addr src-filename

View

Use view

Parameter

src-addr: IP address or name of a TFTP server. The address cannot be an IPv6 address.

src-filename: Filename of the configuration file to be downloaded from the specified server.

Description

Use the restore startup-configuration command to download the configuration file from the specified TFTP server for the next startup of the device.

If the file to be downloaded has the same filename as an existing file on the device, you will be prompted whether you want to overwrite the existing file or not.

Example

# Download the configuration file config.cfg for the next startup from the TFTP server whose IP address is .2.2.2.2.

<Sysname> restore startup-configuration from 2.2.2.2 config.cfg

Restore next startup-configuration file from 2.2.2.2. Please wait........

finished!

1.2.6  save

Syntax

save [ file-name | safely ]

View

Any view

Parameter

file-name: File name, whose extension must be cfg.

safely: Sets the configuration saving mode to safe. Executing the command without the safely keyword is fast, but the file cannot survive a reboot or power-off during saving operation.

Description

Use the save command to save the current configuration to the specified file, or if no filename is specified, to the default file at the root directory.

When using this command to save a configuration file, if you specify a file name for the current configuration to be saved to the specified file, you cannot use the safely keyword.

 

&  Note:

You are recommended to use the save command to save your current configuration before restart your device, so that your device can use the same configuration after rebooting.

 

Related command: reset saved-configuration, display current-configuration, display saved-configuration.

Example

# Save the current configuration as test.cfg in the flash.

<Sysname> save test.cfg

The current configuration will be saved to flash:/test.cfg [Y/N]:y

Now saving current configuration to the device.

Saving configuration flash:/test.cfg. Please wait...

..................

Configuration is saved to flash successfully.

1.2.7  startup saved-configuration

Syntax

startup saved-configuration cfgfile

undo startup saved-configuration

View

User view

Parameter

cfgfile: Configuration file name.

Description

Use the startup saved-configuration command to specify a configuration file for next startup.

Use the undo startup saved-configuration command to start up with an empty configuration, which means startup with the initial configuration of the system.

The specified file must be ended with a .cfg extension and saved in the root directory of the storage device.

Related command: display startup.

Example

# Specify a configuration file for next startup.

<Sysname> startup saved-configuration config.cfg

Please wait ....... Done!

# Specify a backup configuration file for next startup (when main/backup attribute is supported).

<Sysname> startup saved-configuration vrpcfg.cfg backup

Please wait......Done!

 


Chapter 2  FTP Configuration Commands

2.1  FTP Server Configuration Commands

2.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 configuration of the device.

After configuring FTP parameters, you may verify them with this command.

Example

# Display the FTP server configuration.

<Sysname> display ftp-server

   FTP server is running

   Max user number:                1

   User count                      1

   Timeout value(in minute)  ):     30

   Put Method  :                   fast

The output indicates that the FTP server is running with support to only one login user; now one logged-in user is present; timeout of the user is 30 minutes, and FTP put mode is fast.

2.1.2  display ftp-user

Syntax

display ftp-user

View

Any view

Parameter

None

Description

Use the display ftp-user command to display the parameter settings of current FTP users.

Example

# Display the parameter settings of FTP users.

<Sysname> display ftp-user

  UserName             HostIP    Port    Idle              HomeDir

       abc       192.168.0.55    1025       0               flash:

2.1.3  ftp server enable

Syntax

ftp server enable

undo ftp server

View

System view

Parameter

None

Description

Use the ftp server enable command to enable the FTP server.

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

By default, the FTP server is disabled to prevent attacks.

Example

# Disable the FTP server.

<Sysname> system-view

[Sysname] undo ftp server

% Close FTP server

2.1.4  ftp timeout

Syntax

ftp timeout minute

undo ftp timeout

View

System view

Parameter

minute: Idle-timeout timer in minutes, in the range 1 to 35791. The default is 30 minutes.

Description

Use the ftp timeout command to set the idle-timeout timer.

Use the undo ftp timeout command to restore the default.

After you log onto the FTP server, you set up an FTP connection. When the connection is disrupted or aborted, the FTP server, if not notified, cannot realize that and maintains the connection all the same. To address this problem, you can set an idle-timeout timer to have the FTP server disconnect if no command is received or/and transmitted before the timer expires.

Example

# Set the idle-timeout timer to 36 minutes.

<Sysname> system-view

[Sysname] ftp timeout 36

2.1.5  ftp update

Syntax

ftp update { fast | normal }

undo ftp update

View

System view

Parameter

fast: Fast update.

normal: Normal update.

Description

Use the ftp update command to set the file update mode that the FTP server uses while receiving data.

Use the undo ftp update command to restore the default, namely, the normal mode.

Example

# Set the FTP update mode to fast.

<Sysname> system-view

[Sysname] ftp update fast

2.2  FTP Client Configuration Commands

 

&  Note:

l      You must use the ftp command to enter the FTP client view for configurations under this view. For details, refer to 2.2.10  ftp.

l       The prompt information in the examples of this section depends on your FTP server type.

 

2.2.1  ascii

Syntax

ascii

View

FTP client view

Parameter

None

Description

Use the ascii command to set the file transfer mode to ASCII for the FTP connection.

FTP provides two file transfer modes: ASCII and binary. To transfer text files, use the ASCII mode; to transfer program files, use the binary mode.

By default, the file transfer mode is ASCII.

Example

# Set the file transfer mode to ASCII.

[ftp] ascii

200 Type set to A.

2.2.2  binary

Syntax

binary

View

FTP client view

Parameter

None

Description

Use the binary command to set the file transfer mode to binary (also called flow mode).

FTP uses two modes to transfer files, one is binary mode, which is used to transfer program file; the other is ASCII mode, which is used to transfer text files.

By default, the transfer mode is ASCII mode.

Example

# Set the file transfer mode to binary.

[ftp] binary

200 Type set to I.

2.2.3  bye

Syntax

bye

View

FTP client view

Parameter

None

Description

Use the bye command to disconnect from the remote FTP server and exit to user view.

Example

# Terminate the connection with the remote FTP server and exit to user view.

[ftp] bye

221 Server closing.

 

<Sysname>

2.2.4  cd

Syntax

cd pathname

View

FTP client view

Parameter

pathname: Path name.

Description

Use the cd command to change the current working directory path on the remote FTP server.

You can use this command to access another authorized directory on the FTP server.

Example

# Change the current working directory path to flash:/temp.

[ftp] cd flash:/temp

250 CWD command successful.

2.2.5  cdup

Syntax

cdup

View

FTP client view

Parameter

None

Description

Use the cdup command to exit the current directory and enter the upper directory of the FTP server.

Example

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

[ftp] cdup

200 CDUP command successful.

2.2.6  close

Syntax

close

View

FTP client view

Parameter

None

Description

Use the close command to terminate the connection to the FTP server, but remain in FTP client view.

This command is equal to the disconnect command.

Example

# Terminate the connection to the FTP server and remain in FTP client view.

[ftp] close

221 Server closing.

[ftp]

2.2.7  delete

Syntax

delete remotefile

View

FTP client view

Parameter

remotefile: File name.

Description

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

To do this, you must be a user with the delete permission on the FTP server.

Example

# Delete file temp.c.

[ftp] delete temp.c

250 DELE command successful.

2.2.8  dir

Syntax

dir [ remotefile [ localfile ] ]

View

FTP client view

Parameter

remotefile: Name of the file or directory on the remote FTP server.

localfile: Name of the local file to save the displayed information.

Description

Use the dir command to view detailed information of the files and subdirectories under the current directory on the remote FTP server.

Use the dir remotefile command to display the detailed information of the specified file or directory on the remote FTP server.

Use the dir remotefile localfile command to display the detailed information of the specified file or directory on the remote FTP server, and save the displayed information into a local file specified by the localfile argument.

 

&  Note:

The Is command can only display the names of files and directories, whereas the dir command can display other extra information of the files and directories, such as the size, the date they are created.

 

Example

# View the information of the file ar-router.cfg, and save the result to aa.txt.

[ftp] dir ar-router.cfg aa.txt

227 Entering Passive Mode (192,168,0,36,6,20).

125 ASCII mode data connection already open, transfer starting for ar-router.cfg.

..226 Transfer complete.

FTP: 71 byte(s) received in 2.063 second(s), 34.00 byte(s)/sec.

# View the content of aa.txt

[ftp] quit

<Sysname> more aa.txt

-rwxrwxrwx   1 noone    nogroup      3077 Jun 20 15:34 ar-router.cfg

2.2.9  disconnect

Syntax

disconnect

View

FTP client view

Parameter

None

Description

Use the disconnect command to disconnect from the remote FTP server but remain in FTP client view.

This command is equal to the close command.

Example

# Disconnect from the remote FTP server but remain in FTP client view.

[ftp] disconnect

221 Server closing.

2.2.10  ftp

Syntax

ftp [ ftp-server [ port ] [ –a source-ip ] ]

View

User view

Parameter

server-address: IP address or host name (a string of 1 to 20 characters) of a remote FTP server.

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

-a source-ip: The source IP address of the current FTP client. This source address must be one that has been configured on the device.

Description

Use the ftp command to log onto the remote FTP server and enter FTP client view.

Note that:

l           This command applies to IPv4 network.

l           If you use this command without specifying any parameters, you will simply enter the FTP client view without log onto the FTP server.

l           If you specify the parameter, you will be asked to enter the username and password for accessing the FTP server.

Example

# Log in the FTP server with the IP address of 192.168.0.50.

<Sysname1> ftp 192.168.1.50

Trying 192.168.1.50 ...

Press CTRL+K to abort

Connected to 192.168.1.50.

220 FTP service ready.

User(192.168.1.50:(none)):aa

331 Password required for aa.

Password:

230 User logged in.

2.2.11  get

Syntax

get remotefile [ localfile ]

View

FTP client view

Parameter

remotefile: File name on the remote FTP server.

localfile: Local file name.

Description

Use the get command to FTP a file from a remote server and save it.

If no name is specified, the local file uses the name of the source file on the FTP server by default.

Example

# Download file temp1.c and save it as temp.c.

[ftp]get temp1.c temp.c

 

227 Entering Passive Mode (192,168,1,50,17,163).

125 ASCII mode data connection already open, transfer starting for temp1.c.

.....226 Transfer complete.

FTP: 5190 byte(s) received in 7.754 second(s), 669.00 byte(s)/sec.

2.2.12  lcd

Syntax

lcd

View

FTP client view

Parameter

None

Description

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

Example

# Display the local working directory path.

[ftp] lcd

FTP: Local directory now flash:/temp

2.2.13  ls

Syntax

ls [ remotefile ] [ localfile ]

View

FTP client view

Parameter

remotefile: Filename or directory on the remote FTP server.

localfile: Name of a local file used to save the displayed information.

Description

Use the ls command to view the information of all the files and subdirectories under the current directory of the remote FTP server. The file names and subdirectory names are displayed.

Use the ls remotefile command to view the information of a specified file or subdirectory.

Use the ls remotefile localfile command view the information of a specified file or subdirectory, and save the result to a local file specified by the localfile argument.

 

&  Note:

The Is command can only display the names of files and directories, whereas the dir command can display other extra information of the files and directories, such as the size, the date they are created.

 

Example

# View the information all files and subdirectories under the current directory of the FTP server.

[ftp] ls

227 Entering Passive Mode (192,168,0,36,6,24).

125 ASCII mode data connection already open, transfer starting for *.

ar-router.cfg

logfile

mainar.bin

arbasicbtm.bin

ftp

test

bb.cfg

vrpcfg.cfg

226 Transfer complete.

FTP: 7216 byte(s) received in 0.031 second(s), 6.00K byte(s)/sec.

# View the information of directory logfile, and save the result to file aa.txt.

[ftp] ls logfile aa.txt

227 Entering Passive Mode (192,168, 0,36,6,31).

125 ASCII mode data connection already open, transfer starting for logfile.

..226 Transfer complete.

FTP: 6 byte(s) received in 2.053 second(s), 2.00 byte(s)/sec.

# View the content of file aa.txt

[ftp] quit

<Sysname> more aa.txt

logfile

2.2.14  mkdir

Syntax

mkdir directory

View

FTP client view

Parameter

directory: Directory name.

Description

Use the mkdir command to create a subdirectory under the specified directory on the remote FTP server.

To do this, you must be a user with the permission on the FTP server.

Example

# Create subdirectory mytest on the current directory of the remote FTP server.

[ftp] mkdir mytest

257 "flash:/mytest" new directory created. 

2.2.15  open

Syntax

open ftp-server [port ] [ -a source-ip ]

View

FTP client view

Parameter

ftp-server: IP address or host name (a string of 1 to 20 characters) of a remote FTP server.

port: Port number of the remote FTP server, in the range of 0 to 65535, with the default value of 21.

-a source-ip: Specifies a source IP address for transmitted FTP packets. This source address must be one that has been configured on the device.

Description

Use the open command to log onto the IPv4 FTP server under the FTP client view.

At login, you will be asked to enter the username and password for accessing the FTP server. If your input is correct, the login succeeds; otherwise, it fails.

This command supports IPv4 protocols.

Related command: close

Example

# Enter FTP client view.

<System> ftp

[ftp]

# Log onto the FTP server with the IP address of 192.168.1.50.

[ftp] open 192.168.1.50

Trying 192.168.1.50 ...

Press CTRL+K to abort

Connected to 192.168.1.50.

220 FTP service ready.

User(192.168.1.50:(none)):aa

331 Password required for aa.

Password:

230 User logged in.

 

[ftp]

2.2.16  passive

Syntax

passive

undo passive

View

FTP client view

Parameter

None

Description

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

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

The default transmission mode is passive.

Example

# Set the data transmission mode to passive.

[ftp] passive

FTP: passive is on

2.2.17  put

Syntax

put localfile [ remotefile ]

View

FTP client view

Parameter

localfile: Source file name.

remotefile: Name of the file to be saved on the remote FTP server.

Description

Use the put command to FTP a file to the remote FTP server.

If no name is assigned to the file to be saved on the FTP server, the name of the source file is used.

Example

# Upload source file temp.c to the remote FTP server and save it as temp1.c.

[ftp] put temp.c temp1.c

227 Entering Passive Mode (192,168,1,50,17,169).

125 ASCII mode data connection already open, transfer starting for temp1.c.

226 Transfer complete.

FTP: 9 byte(s) sent in 0.112 second(s), 80.00 byte(s)/sec.

2.2.18  pwd

Syntax

pwd

View

FTP client view

Parameter

None

Description

Use the pwd command to display the working directory on the remote FTP server.

Example

# Display the working directory on the remote FTP server.

[ftp] pwd

257 "flash:/temp" is current directory.

2.2.19  quit

Syntax

quit

View

FTP client view

Parameter

None

Description

Use the quit command to disconnect from the remote FTP server and exit to user view.

Example

# Disconnect from the remote FTP server and exit to user view.

[ftp] quit

221 Server closing. 

<Sysname>

2.2.20  remotehelp

Syntax

remotehelp [ protocol-command ]

View

FTP client view

Parameter

protocol-command: FTP command.

Description

Use the remotehelp command to display the help for FTP commands.

Example

# Display the syntax of the user command.

[ftp] remotehelp user

214 Syntax: USER <sp> <username>.

2.2.21  rmdir

Syntax

rmdir directory

View

FTP client view

Parameter

directory: Directory name on the remote FTP server.

Description

Use the rmdir command to delete a specified directory from the FTP server.

Note that only authorized users are allowed to use this command.

Note that:

l           The directory to be deleted must be empty, meaning you should delete all files and the subdirectory under the directory before you delete a directory. For the delete of files, refer to the delete command.

l           After you execute the rmdir command, the files in the remote recycle bin under the directory will be automatically deleted.

Example

# Delete the flash:/temp1 directory from the FTP server.

[ftp] rmdir flash:/temp1

200 RMD command successful.

2.2.22  user

Syntax

user username [ password ]

View

FTP client view

Parameter

username: Other login username.

password: Login password.

Description

Use the user command to relog onto the currently accessing FTP server after you have logged onto the FTP server.

Before using this command, you must configure the corresponding username and password on the FTP server; otherwise, you login fails and the FTP is disconnected.

Example

# User ftp1 has logged on the FTP server and relog onto the current FTP server with the username of ftp2. (Suppose username ftp2 and password 123123123123 have been configured on the FTP server).

[ftp] user ftp2

331 Password required for ftp2.

Password:

230 User logged in.

 

[ftp]

2.2.23  verbose

Syntax

verbose

undo verbose

View

FTP client view

Parameter

None

Description

Use the verbose command to enable the verbose function to display detailed prompt information.

Use the undo verbose command to disable the verbose function.

By default, the verbose function is enabled.

Example

# Enable the verbose function.

[ftp] verbose

FTP: verbose is on

 


Chapter 3  TFTP Configuration Commands

3.1  TFTP Client Configuration Commands

3.1.1  tftp-server acl

Syntax

tftp-server [ ipv6 ] acl acl-number

undo tftp-server [ ipv6 ] acl

View

System view

Parameter

ipv6: References an IPv6 ACL. If it is not specified, an IPv4 ACL is referenced.

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

Description

Use the tftp-server acl command to reference an ACL to control access to the TFTP server. Users can use the configured rules in ACL to allow or prevent the use of TFTP server in a network.

Use the undo tftp-server acl command to remove the access restriction.

For more information about ACL, refer to ACL Module.

Example

# Reference ACL 2000 to control access to the TFTP application in IPv4.

<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

# Associate IPv6 ACL 2001 with TFTP application in Ipv6.

<Sysname> system-view

[Sysname] acl ipv6 number 2001

[Sysname-acl6-basic-2001] rule permit source 2030:5060::9050/64

[Sysname-acl6-basic-2001] quit

[Sysname] tftp-server ipv6 acl 2001

3.1.2  tftp get

Syntax

tftp tftp-server get source-file [ dest-file | -a source-ip ]*

View

User view

Parameter

tftp-server: IP address or host name (a string of 1 to 20 characters) of a TFTP server.

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

dest-file: Name of the new file saved on the switch.

-a source-ip: Specifies a source IP address for transmitted TFTP packets. Note that the specified source IP address must has been configured on the switch.

Description

Use the tftp command to upload files from the local device to a TFTP server or download files from the TFTP server to the local device.

If no destination file name is specified, the saved file uses the source file name.

This command applies to IPv4 network.

Related command: tftp put, tftp sget

Example

# Download the LANSwitch.bin file from the TFTP server with the IP address of 1.1.3.1 and save it as vxWorks.bin.

<Sysname> tftp 1.1.3.1 get LANSwitch.bin vxWorks.bin

  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.

3.1.3  tftp ipv6

Syntax

tftp ipv6 tftp-ipv6-server [ -i interface-type interface-number ] { get | put } source-file [ destination-file ]

View

User view

Parameter

tftp-ipv6-server: IPv6 address or host name (a string of 1 to 46 characters) of a TFTP server.

-i interface-type interface-number: Specifies a outbound interface. This parameter is used only when the address of the TFTP server is a link-local address, and the specified outbound interface must has a link-local address (refer to IPv6 Configuration module for details about link-local address).

get: Downloads a file.

put: Uploads a file.

source-file: Filename of the source.

destination-file: Filename of the destination. If not specified, this filename is the same as the source filename.

Description

Use the tftp ipv6 command to download a specified file from a TFTP server or upload a specified local file to a TFTP server.

This command applies to IPv6 network.

Example

# Download files from TFTP server and save them as filetoget.txt.

<Sysname> tftp ipv6 fe80::250:daff:fe91:e058 -i Vlan-interface 300 get filetoget.txt

 

File will be transferred in binary mode

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

  TFTP:       32 bytes received in 5 second(s).

  File downloaded successfully

3.1.4  tftp put

Syntax

tftp tftp-server put source-file [ dest-file | -a source-ip ]*

View

User view

Parameter

tftp-server: IP address or host name (a string of 1 to 20 characters) of a TFTP server.

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

dest-file: Filename used to save the uploaded file on the TFTP server.

-a source-ip: Specifies a source IP address for transmitted TFTP packets. This address must one that has been configured on the device.

Description

Use the tftp put command to TFTP a file to a TFTP server.

If no destination file name is specified, the saved file uses the source file name.

This command is available in IPv4 networks.

Related command: tftp get, tftp sget.

Example

# TFTP file config.txt in the root directory to the TFTP server with the IP address of 1.1.1.2 and save it as config.bak under the default path on the server.

<Sysname> tftp 1.1.1.2 put flash:/config.txt  config.bak

  File will be transferred in binary mode.

  Sending file to remote TFTP server. Please wait... /

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

  File uploaded successfully.

3.1.5  tftp sget

Syntax

tftp tftp-server sget source-file [ dest-file | -a source-ip ]*

View

User view

Parameter

tftp-server: IP address or host name (a string of 1 to 20 characters) of a TFTP server.

source-file: Source file name, identifies the file to be gotten from the TFTP server.

dest-file: Destination file name, identifies the file to be saved on the local device.

-a source-ip: Specifies a source IP address for transmitted TFTP packets. This source address must be one that has been configured on the device

Description

Use the tftp sget command to securely TFTP a file from a TFTP server.

In this approach, the device starts writing data to the Flash after file transfer completes. If the file is intended to overwrite another file on the device, this can protect the latter from being corrupted in the event that anomalies, power failure for example, occur during file transfer.

When using this approach, you need to ensure that adequate NVRAM space is available.

This command is available in IPv4 networks.

Related command: tftp get, tftp put.

Example

# Download (in save mode) file config.txt from the root directory of the TFTP server (with IP address 1.1.1.1) and save it as config.bak on the server.

<Sysname> tftp 1.1.1.1 sget config.txt flash:/config.bak

  Write file to memory

  Downloading file from remote TFTP server, please wait.../

  TFTP:     1868 bytes received in 0 second(s)

  File downloaded successfully.

 

  Writing data into local file, please wait... ...

  Succeed to write data into file .

 

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