HP A7500 Command Reference Manual

HP A7500 Switch Series
Fundamentals Command Reference
Part number: 5998-1877
Software version: Release 6626 and later
Document version: 6W101-20111130
Legal and notice information
© Copyright 2011 Hewlett-Packard Development Company, L.P.
No part of this documentation may be reproduced or transmitted in any form or by any means without prior written consent of Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice.
HEWLETT-PACKARD COMPANY MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material.
The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.

Contents

CLI configuration commands······································································································································· 1
command-alias enable·············································································································································1 command-alias mapping ·········································································································································1 command-privilege···················································································································································2 display clipboard ·····················································································································································3 display command-alias ············································································································································4 display history-command ·········································································································································5 display hotkey···························································································································································5 hotkey ········································································································································································7 quit ·············································································································································································7 return··········································································································································································8 screen-length disable················································································································································8 super ··········································································································································································9 super authentication-mode···································································································································· 10 super password ····················································································································································· 11 system-view ····························································································································································12
Logging in to the switch commands··························································································································13
acl (user interface view)········································································································································ 13 activation-key ·························································································································································14 auto-execute command ········································································································································· 15 authentication-mode ·············································································································································· 17 command accounting············································································································································ 18 command authorization········································································································································ 19 databits··································································································································································· 19 display telnet client configuration ························································································································ 20 display user-interface ············································································································································ 21 display users ·························································································································································· 23 escape-key······························································································································································ 24 flow-control····························································································································································· 25 free user-interface ·················································································································································· 26 history-command max-size···································································································································· 27 idle-timeout ····························································································································································· 27 lock·········································································································································································· 28 modem···································································································································································· 29 modem auto-answer·············································································································································· 30 modem timer answer············································································································································· 30 parity······································································································································································· 31 protocol inbound ···················································································································································32 screen-length ··························································································································································32 send ········································································································································································ 33 set authentication password································································································································· 35 shell········································································································································································· 35 speed (user interface view)··································································································································· 36 stopbits···································································································································································· 37 telnet ······································································································································································· 38 telnet client source················································································································································· 39 telnet ipv6······························································································································································· 39 telnet server enable ··············································································································································· 40
i
terminal type ·························································································································································· 40 user privilege level ················································································································································41 user-interface·························································································································································· 42
FTP configuration commands ····································································································································44
FTP server configuration commands····························································································································· 44
display ftp-server···················································································································································· 44 display ftp-user······················································································································································· 45 free ftp user ···························································································································································· 46 ftp server acl ·························································································································································· 46 ftp server enable···················································································································································· 47 ftp timeout······························································································································································· 47 ftp update······························································································································································· 48
FTP client configuration commands ······························································································································ 49
ascii········································································································································································· 49 binary ····································································································································································· 49 bye ·········································································································································································· 50 cd ············································································································································································50 cdup········································································································································································ 51 close········································································································································································52 debugging······························································································································································ 52 delete ······································································································································································ 54 dir············································································································································································ 54 disconnect ······························································································································································ 55 display ftp client configuration····························································································································· 56 ftp ············································································································································································ 57 ftp client source······················································································································································ 58 ftp ipv6 ··································································································································································· 58 get ··········································································································································································· 60 lcd ··········································································································································································· 61 ls·············································································································································································· 61 mkdir······································································································································································· 62 open········································································································································································ 63 open ipv6······························································································································································· 64 passive···································································································································································· 64 put ··········································································································································································· 65 pwd········································································································································································· 66 quit ·········································································································································································· 66 remotehelp ····························································································································································· 67 rmdir ······································································································································································· 69 user ········································································································································································· 69 verbose ··································································································································································· 70
TFTP client configuration commands·························································································································72
display tftp client configuration···························································································································· 72 tftp-server acl·························································································································································· 72 tftp ··········································································································································································· 73 tftp client source····················································································································································· 75 tftp ipv6 ·································································································································································· 76
File management commands·····································································································································77
cd ············································································································································································77 copy ········································································································································································ 78 delete ······································································································································································ 79 dir············································································································································································ 81 execute ··································································································································································· 85
ii
file prompt ······························································································································································ 86 fixdisk······································································································································································ 86 format······································································································································································ 87 mkdir······································································································································································· 87 more········································································································································································88 mount ······································································································································································ 90 move ······································································································································································· 91 pwd········································································································································································· 91 rename···································································································································································· 92 reset recycle-bin····················································································································································· 92 rmdir ······································································································································································· 94 umount ···································································································································································· 95 undelete·································································································································································· 96
Configuration file management commands·············································································································98
archive configuration ············································································································································ 98 archive configuration interval ······························································································································ 98 archive configuration location ····························································································································· 99 archive configuration max··································································································································101 backup startup-configuration······························································································································102 configuration replace file····································································································································102 display archive configuration·····························································································································103 display current-configuration······························································································································104 display saved-configuration ·······························································································································105 display startup ·····················································································································································107 display this ···························································································································································109 reset saved-configuration····································································································································110 restore startup-configuration·······························································································································111 save·······································································································································································112 slave auto-update config·····································································································································115 startup saved-configuration ································································································································116
Software upgrade commands································································································································ 118
boot-loader···························································································································································118 bootrom ································································································································································120 display boot-loader ·············································································································································123 display patch ·······················································································································································124 display patch information···································································································································125 patch active··························································································································································127 patch deactive ·····················································································································································128 patch delete ·························································································································································129 patch install··························································································································································130 patch load····························································································································································131 patch location ······················································································································································132 patch run ······························································································································································133
ISSU configuration commands······························································································································· 135
display issu rollback-timer···································································································································135 display issu state··················································································································································136 display version comp-matrix·······························································································································138 issu accept····························································································································································140 issu commit···························································································································································141 issu load ·······························································································································································143 issu rollback ·························································································································································146 issu rollback-timer ················································································································································147 issu run switchover ··············································································································································148
iii
Device management commands ···························································································································· 151
clock datetime······················································································································································151 clock summer-time one-off···································································································································151 clock summer-time repeating······························································································································152 clock timezone·····················································································································································153 copyright-info enable ··········································································································································154 display alarm ·······················································································································································155 display clock ························································································································································156 display cpu-usage················································································································································157 display cpu-usage history ···································································································································160 display device······················································································································································163 display device manuinfo·····································································································································165 display diagnostic-information ···························································································································167 display environment ············································································································································168 display fan ···························································································································································169 display job ···························································································································································170 display memory ···················································································································································171 display oem··························································································································································172 display power······················································································································································173 display schedule job ···········································································································································175 display schedule reboot······································································································································175 display switch-mode status ·································································································································176 display system-failure ··········································································································································177 display transceiver ··············································································································································178 display transceiver alarm ···································································································································180 display transceiver diagnosis·····························································································································182 display transceiver manuinfo ·····························································································································183 display version·····················································································································································184 display version-update-record ····························································································································186 header ··································································································································································187 job·········································································································································································188 loadsharing enable ·············································································································································189 monitor handshake-timeout disable-port ···········································································································189 mmu-monitor enable············································································································································190 oem hp··································································································································································191 reboot ···································································································································································192 reset unused porttag············································································································································193 reset version-update-record ································································································································194 schedule job·························································································································································194 schedule reboot at···············································································································································196 schedule reboot delay·········································································································································197 shutdown-interval·················································································································································198 strict-standby enable············································································································································199 switch-mode (for MPUs) ······································································································································199 switch-mode (for LPUs) ········································································································································201 switch-mode optional-proxy-board ····················································································································202 sysname································································································································································203 system-failure························································································································································203 temperature-limit ··················································································································································204 time at···································································································································································205 time delay·····························································································································································207 view ······································································································································································208
iv
Index ········································································································································································ 210
v

CLI configuration commands

command-alias enable

Syntax
command-alias enable
undo command-alias enable
View
System view
Default level
2: System level
Parameters
None
Description
Use the command-alias enable command to enable the command alias function.
Use the undo command-alias enable command to disable the command alias function.
By default, the command alias function is disabled.
Related commands: command-alias mapping.
Examples
# Enable the command alias function.
<Sysname> system-view [Sysname] command-alias enable
# Disable the command alias function.
<Sysname> system-view [Sysname] undo command-alias enable

command-alias mapping

Syntax
command-alias mapping cmdkey alias
undo command-alias mapping cmdkey
View
System view
Default level
2: System level
Parameters
cmdkey: The complete form of the first keyword of a command.
1
alias: Specifies the command alias, which cannot be the same as the first keyword of an existing command.
Description
Use the command-alias mapping command to configure command aliases.
Use the undo command-alias mapping command to delete command aliases.
By default, a command has no alias.
The configured alias takes effect only after you enable the command alias function.
Examples
# Configure command aliases by specifying show to replace the display keyword.
<Sysname> system-view [Sysname] command-alias mapping display show
After configuring the command aliases, the display commands have their aliases. For example, if the original command is display clock, now its alias is show clock and you can input the alias to view the system time and date.
# Delete the command aliases by canceling the replacement of the display keyword.
<Sysname> system-view [Sysname] undo command-alias mapping display

command-privilege

Syntax
command-privilege level level view view command
undo command-privilege view view command
View
System view
Default level
3: Manage level
Parameters
level level: Command level, in the range of 0 to 3.
view view: Specifies a view. The value shell represents a user view. The view argument must be the view
where the command resides.
command: Command to be set in the specified view.
Description
Use the command-privilege command to assign a level for the specified command in the specified view.
Use the undo command-privilege view command to restore the default.
By default, each command in a view has a specified level.
Command levels include four privileges: visit (0), monitor (1), system (2), and manage (3). You can assign a privilege level according to the user’s need. When logging in to the switch, the user can access the assigned level and all levels below it.
2
Level changes can cause maintenance, operation, and security problem. HP recommends that you
use the default command level or that you modify the command level under the guidance of professional staff.
The command specified in the command-privilege command must be complete, and has valid
arguments. For example, the default level of the tftp server-address { get | put | sget }
source-filename [ destination-filename ] [ source { interface interface-type interface-number | ip source-ip-address } ] command is 3. After the command-privilege level 0 view shell tftp 1.1.1.1 put
a.cfg command is executed, when users with the user privilege level of 0 log in to the switch, they can execute the tftp server-address put source-filename command (such as the tftp 192 .168 .1. 26 put syslog.txt command), but cannot execute the command with the get, sget or source keyword, and cannot specify the destination-filename argument.
The command specified in the undo command-privilege view command can be incomplete. For
example, after the undo command-privilege view system ftp command is executed, all commands starting with the keyword ftp (such as ftp server acl, ftp server enable, and ftp timeout) are restored to their default level. If you have modified the level of commands ftp server enable and ftp timeout, and you want to restore only the ftp server enable command to its default level, you should use the undo command-privilege view system ftp server command.
If you modify the command level of a command in a specified view from the default command level
to a lower level, remember to modify the command levels of the quit c corresponding command used to enter this view. For example, the default command level of commands interface and system-view is 2 (system level). If you want to make the interface command available to the level 1 users, you need to execute the following three commands:
command-privilege level 1 view shell system-view, command-privilege level 1 view system interface GigabitEthernet 2/0/1, and command-privilege level 1 view system quit. Then, the level
1 users can enter system view, execute the interface GigabitEthernet command, and return to user view.
ommand and the
Examples
# Set the command level of the system-view command to 3 in system view. (By default, level 2 and level 3 users can use the system-view command. After the configuration, only level 3 users can use this command.)
<Sysname> system-view [Sysname] command-privilege level 3 view shell system-view

display clipboard

Syntax
display clipboard [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
3
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display clipboard command to view the contents of the clipboard.
To copy the specified content to the clipboard:
Move the cursor to the starting position of the content and press the <Esc+Shift+,> combination.
Move the cursor to the ending position of the content and press the <Esc+Shift+.> combination.
Examples
# View the content of the clipboard.
<Sysname> display clipboard
---------------- CLIPBOARD----------------­display current-configuration

display command-alias

Syntax
display command-alias [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display command-alias command to display defined command aliases and the corresponding commands.
Examples
# Display the defined command aliases and the corresponding commands.
<Sysname> display command-alias Command alias is enabled index alias command key 1 show display
4

display history-command

Syntax
display history-command [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display history-command command to display commands saved in the history command buffer.
By default, the system saves the last 10 executed commands in the history command buffer.
To set the size of the history command buffer, use the history-command max-size command. For more information, see the chapter “Logging in to the switch commands.”
Examples
# Display history commands in current user view.
<Sysname> display history-command display history-command system-view vlan 2 quit

display hotkey

Syntax
display hotkey [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
5
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display hotkey command to display hotkey information.
Examples
# Display hotkey information.
<Sysname> display hotkey
----------------- HOTKEY -----------------
=Defined hotkeys= Hotkeys Command CTRL_G display current-configuration CTRL_L display ip routing-table CTRL_O undo debug all
=Undefined hotkeys= Hotkeys Command CTRL_T NULL CTRL_U NULL
=System hotkeys= Hotkeys Function CTRL_A Move the cursor to the beginning of the current line. CTRL_B Move the cursor one character left. CTRL_C Stop current command function. CTRL_D Erase current character. CTRL_E Move the cursor to the end of the current line. CTRL_F Move the cursor one character right. CTRL_H Erase the character left of the cursor. CTRL_K Kill outgoing connection. CTRL_N Display the next command from the history buffer. CTRL_P Display the previous command from the history buffer. CTRL_R Redisplay the current line. CTRL_V Paste text from the clipboard. CTRL_W Delete the word left of the cursor. CTRL_X Delete all characters up to the cursor. CTRL_Y Delete all characters after the cursor. CTRL_Z Return to the User View. CTRL_] Kill incoming connection or redirect connection. ESC_B Move the cursor one word back. ESC_D Delete remainder of word. ESC_F Move the cursor forward one word. ESC_N Move the cursor down a line. ESC_P Move the cursor up a line. ESC_< Specify the beginning of clipboard.
6
ESC_> Specify the end of clipboard.

hotkey

Syntax
hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_T | CTRL_U } command
undo hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_T | CTRL_U }
View
System view
Default level
2: System level
Parameters
CTRL_G: Associates hot key Ctrl+G to the specified command.
CTRL_L: Associates hot key Ctrl+L to the specified command.
CTRL_O: Associates hot key Ctrl+O to the specified command.
CTRL_T: Associates hot key Ctrl+T to the specified command.
CTRL_U: Associates hot key Ctrl+U to the specified command.
command: The command line associated with the hot key.
Description
Use the hotkey command to associate a hot key to a command.
Use the undo hotkey command to restore the default.
By default, Ctrl+G, Ctrl+L and Ctrl+O have these corresponding commands:
Ctrl+G corresponds to display current-configuration.
Ctrl+L corresponds to display ip routing-table.
Ctrl+O corresponds to undo debugging all.
You can modify the associations as needed.
Examples
# Associate the hot key Ctrl+T to the display tcp status command.
<Sysname> system-view [Sysname] hotkey ctrl_t display tcp status

quit

Syntax
quit
View
Any view
Default level
0: Visit level (in user view)
7
2: System level (in other views)
Parameters
None
Description
Use the quit command to return to a lower-level view.
In user view, the quit command terminates the connection and reconnects to the switch.
Examples
# Switch from GigabitEthernet 2/0/1 interface view to system view, and then to user view.
[Sysname-GigabitEthernet2/0/1] quit [Sysname] quit <Sysname>

return

Syntax
return
View
Any view except user view
Default level
2: System level
Parameters
None
Description
Use the return command to return to user view from the current view, which can also be done with the hot key Ctrl+Z.
Related commands: quit.
Examples
# Return to user view from GigabitEthernet 2/0/1 view.
[Sysname-GigabitEthernet2/0/1] return <Sysname>

screen-length disable

Syntax
screen-length disable
undo screen-length disable
View
User view
Default level
1: Monitor level
8
Parameters
None
Description
Use the screen-length disable command to disable the multiple-screen output function.
Use the undo screen-length disable command to enable the multiple-screen output function.
By default, a login user uses the settings of the screen-length command. The default settings of the screen-length command are: multiple-screen output is enabled and 24 lines are displayed on the next screen. (For more information about the screen-length command, see the chapter “Logging in to the switch commands.”)
Disabling the multiple-screen output function prevents you from viewing the information in time because the information refreshes continuously.
When the user logs out, the settings restore to their default values.
Examples
# Disable multiple-screen output for the current user.
<Sysname> screen-length disable

super

Syntax
super [ level ]
View
User view
Default level
0: Visit level
Parameters
level: User level, in the range of 0 to 3. The default value is 3.
Description
Use the super command to switch from the current user privilege level to a specified user privilege level.
If a level is not specified, the command switches the user privilege level to 3. Command levels include four privileges: visit (0), monitor (1), system (2), and manage (3). You can assign a privilege level according to the user’s need. When logging in to the switch, the user can access the assigned level and all levels below it.
A user can switch to a lower privilege level unconditionally. An AUX user can switch to a higher privilege level without inputting any password. A VTY user must input the switching password set by the super password command to switch to a higher privilege level. If the password is incorrect or no password is configured, the switching operation fails.
Examples
Related commands: super password.
# Switch to user privilege level 2 (The current user privilege level is 3.).
<Sysname> super 2 User privilege level is 2, and only those commands can be used
9
whose level is equal or less than this. Privilege note: 0-VISIT, 1-MONITOR, 2-SYSTEM, 3-MANAGE
# Switch the user privilege level back to 3 (switching password 12 3 has been set. If no password is set, the user privilege level cannot be switched to 3.).
<Sysname> super 3 Password: User privilege level is 3, and only those commands can be used whose level is equal or less than this. Privilege note: 0-VISIT, 1-MONITOR, 2-SYSTEM, 3-MANAGE

super authentication-mode

Syntax
super authentication-mode { local | scheme } *
undo super authentication-mode
View
System view
Default level
2: System level
Parameters
local: Authenticates a user by using the local password set with the super password command. When no
password is set with the super password command, two results can occur: The privilege level switch succeeds if the user is logged in through the console port. The switch fails if the user logs in through a VTY user interface or inputs an incorrect switch password.
scheme: AAA authentication. For more information about AAA, see Security Configuration Guide.
local scheme: First local and then scheme, which means to authenticate a user by using the local
password first. If no password is set for the user logged in through the console port, the privilege level switch succeeds. If no password is set for the user logged in through a VTY user interface, the AAA authentication is performed.
scheme local: First scheme and then local, which means that AAA authentication is performed first. If the AAA configuration is invalid (the domain parameters or authentication scheme are not configured) or the server does not respond, the local password authentication is performed.
Description
Use the super authentication-mode command to set the authentication mode for user privilege level switch.
Use the undo super authentication-mode command to restore the default.
By default, the authentication mode for the user privilege level switch is local.
Related commands: super password.
Examples
# Set the authentication mode for the user privilege level switch to local.
<Sysname> system-view [Sysname] super authentication-mode local
10
# Set the authentication mode for the user privilege level switch to scheme local.
<Sysname> system-view [Sysname] super authentication-mode scheme local

super password

Syntax
super password [ level user-level ] { simple | cipher } password
undo super password [ level user-level ]
View
System view
Default level
2: System level
Parameters
level user-level: User privilege level, in the range of 1 to 3. The default value is 3.
simple: Sets a password in plain text, and the password is displayed in plain text.
cipher: Sets a password in cipher text, and the password is displayed in cipher text.
password: Password, a case-sensitive string of characters.
A simple password is a string of 1 to 16 characters.
A cipher password is a string of 1 to 16 characters in plain text or 24 characters in cipher text. For
Description
Use the super password command to set the password used to switch from the current user privilege level to a higher one.
Use the undo super password command to restore the default.
By default, no password is set for switching to a higher privilege level.
A cipher-text password is recommended because a simple-text password easily gets cracked.
During authentication, you must input a simple-text password regardless of the password type you
Examples
# Set simple-text password abc for switching to user privilege level 3.
<Sysname> system-view [Sysname] super password level 3 simple abc
# Display the configured password for level switching.
[Sysname] display current-configuration # super password level 3 simple abc
example, the simple text “1234567” corresponds to the cipher text “(TT8F]Y\5SQ=^Q`MAF4<1!!”.
set.
# Set cipher-text password abc for switching to user privilege level 3.
<Sysname> system-view [Sysname] super password level 3 cipher abc
11
# Display the configured password for level switching.
[Sysname] display current-configuration | include super super password level 3 cipher ;)<01%^&;YGQ=^Q`MAF4<1!!

system-view

Syntax
system-view
View
User view
Default level
2: System level
Parameters
None
Description
Use the system-view command to enter system view from the current user view.
Related commands: quit, return.
Examples
# Enter system view from the current user view.
<Sysname> system-view System View: return to User View with Ctrl+Z. [Sysname]
12

Logging in to the switch commands

acl (user interface view)

Syntax
To use a basic or advanced ACL:
acl [ ipv6 ] acl-number { inbound | outbound }
undo acl [ ipv6 ] acl-number { inbound | outbound }
To use an Ethernet frame header ACL:
acl acl-number inbound
undo acl acl-number inbound
View
VTY user interface view
Default level
2: System level
Parameters
ipv6: When this keyword is present, the command supports IPv6; otherwise, it supports IPv4.
acl-number: Number of the access control list (ACL):
Basic ACL: 2000 to 2999
Advanced ACL: 3000 to 3999
Ethernet frame header ACL: 4000 to 4999
inbound: Restricts Telnet or SSH connections established in the inbound direction through the VTY user interface. If the received packets for establishing a Telnet or SSH connection are permitted by an ACL rule, the connection is allowed to be established. When the device functions as a Telnet server or SSH server, this keyword is used to control access of Telnet clients or SSH clients.
outbound: Restricts Telnet connections established in the outbound direction through the VTY user interface. If the packets sent for establishing a Telnet connection are permitted by an ACL rule, the connection is allowed to be established. When the device functions as a Telnet client, this keyword is used to define Telnet servers accessible to the client.
Description
Use the acl command to reference ACLs to control access to the VTY user interface.
Use the undo acl command to cancel the ACL application. For more information about ACL, see ACL and QoS Configuration Guide.
By default, access to the VTY user interface is not restricted.
If no ACL is referenced in VTY user interface view, the V TY user interface has no access control over
establishing a Telnet or SSH connection.
If an ACL is referenced in VTY user interface view, the connection is permitted to be established
only when packets for establishing a Telnet or SSH connection match a permit statement in the ACL.
13
Examples
The system regards the basic/advanced ACL with the inbound keyword, the basic/advanced ACL with the outbound keyword, and Ethernet frame header ACL as different types of ACLs, which can coexist in one VTY user interface. The match order is basic/advanced ACL, Ethernet frame header ACL. At most one ACL of each type can be referenced in the same VTY user interface, and the last configured one takes effect.
# Allow only the user with the IP address of 192.168.1.26 to access the device through Telnet or SSH.
<Sysname> system-view [Sysname] acl number 2001 [Sysname-acl-basic-2001] rule permit source 192.168.1.26 0 [Sysname-acl-basic-2001] quit [Sysname] user-interface vty 0 [Sysname-ui-vty0] acl 2001 inbound
After your configuration, user A (with IP address 192.168.1.26) can Telnet to the device while user B (with IP address 192.168.1.60) cannot Telnet to the device. Upon a connection failure, a message appears, saying "%connection closed by remote host!"
# Allow the device to only Telnet to the Telnet server with IP address 192.168.1.41.
<Sysname> system-view [Sysname] acl number 3001 [Sysname-acl-adv-3001] rule permit tcp destination 192.168.1.41 0 [Sysname-acl-adv-3001] quit [Sysname] user-interface vty 0 15 [Sysname-ui-vty0-15] acl 3001 outbound [Sysname-ui-vty0-15] return <Sysname>
After your configuration, if you Telnet to 192.168.1.46, your operation fails.
<Sysname> telnet 192.168.1.46 %Can't access the host from this terminal!
But you can Telnet to 192.168.1.41.
<Sysname> telnet 192.168.1.41 Trying 192.168.1.41 ... Press CTRL+K to abort Connected to 192.168.1.41 ...

activation-key

Syntax
activation-key character
undo activation-key
View
User interface view
Default level
3: Manage level
14
Parameters
character: Shortcut key for starting a terminal session, a single character (or its corresponding ASCII code value that ranges from 0 to 127) or a string of 1 to 3 characters. However, only the first character functions as the shortcut key. For example, if you input an ASCII code value of 97, the system uses its corresponding character a as the shortcut key. If you input string b@c, the system uses the first character
b as the shortcut key.
Description
Use the activation-key command to define a shortcut key for starting a terminal session.
Use the undo activation-key command to restore the default.
By default, pressing the Enter key starts a terminal session. However, if a new shortcut key is defined with the activation-key command, the Enter key no longer functions. To display the shortcut key you have defined, use the display current-configuration | include activation-key command.
NOTE:
The activation-key command is not supported by the VTY user interface.
Examples
# Configure character s as the shortcut key for starting a terminal session on the console port.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] activation-key s
To verify the configuration:
Exit the terminal session on the console port.
[Sysname-ui-aux0] return <Sysname> quit
Log in to the console port again. The following message appears.
****************************************************************************** * Copyright (c) 2010-2011 Hewlett-Packard Development Company, L.P. * * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ******************************************************************************
User interface aux0 is available.
Please press ENTER.
At this moment, pressing Enter does not start a session. To start the terminal session, enter s.
<Sysname> %Mar 2 18:40:27:981 2005 Sysname SHELL/5/LOGIN: Console login from aux0

auto-execute command

Syntax
auto-execute command command
15
g
undo auto-execute command
View
User interface view
Default level
3: Manage level
Parameters
command: Specifies a command to be automatically executed.
Description
Use the auto-execute command command to specify a command to be automatically executed when a user logs in to the current user interface.
Use the undo auto-execute command command to remove the configuration.
By default, command auto-execution is disabled.
The auto-execute command command is not supported by the AUX user interface.
The system automatically executes the specified command when a user logs in to the user interface, and tears down the user connection after the command is executed. If the command triggers another task, the system does not tear down the user connection until the task is completed.
Examples
Typically, you can use the auto-execute command telnet command in user interface view to enable a user to automatically Telnet to the specified host when the user logs in to the device. After the user terminates the connection with the host, the user’s connection with the device is automatically terminated.
CAUTION:
The auto-execute command command may disable you from configuring the system through the user interface to which the command is applied. Before confi
uring the command and saving the configuration (by using the save command), make sure that you can access the device through VTY or AUX user interfaces to remove the configuration when a problem occurs.
# Configure the device to automatically Telnet to 192.168.1.41 after a user logs in to interface VTY 0.
<Sysname> system-view <Sysname> system-view [Sysname] user-interface vty 0 [Sysname -ui-vty0] auto-execute command telnet 192.168.1.41 % This action will lead to configuration failure through ui-vty0. Are you sure? [Y/N]:y [Sysname-ui-vty0]
To verify the configuration:
Tel net to 19 2.168 .1.4 0 . T h e d e vic e aut o ma tic a ll y Tel n et s to 19 2.168 .1.41. T he f oll owin g ou tpu t is displayed:
C:\> telnet 192.168.1.40 ****************************************************************************** * Copyright (c) 2010-2011 Hewlett-Packard Development Company, L.P. * * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. *
16
******************************************************************************
<Sysname> Trying 192.168.1.41 ... Press CTRL+K to abort Connected to 192.168.1.41 ... ****************************************************************************** * Copyright (c) 2010-2011 Hewlett-Packard Development Company, L.P. * * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ******************************************************************************
<Sysname.41>
This operation is the same as directly logging in to the device at 192.168.1.41. If the Telnet connection to
192.168.1.41 is broken down, the Telnet connection to 192.168.1.40 breaks down at the same time.

authentication-mode

Syntax
authentication-mode { none | password | scheme }
undo authentication-mode
View
User interface view
Default level
3: Manage level
Parameters
none: Performs no authentication.
password: Performs local password authentication.
scheme: Performs AAA authentication. For more information about AAA, see Security Configuration Guide.
Description
Use the authentication-mode command to set the authentication mode for the user interface.
Use the undo authentication-mode command to restore the default.
By default, the authentication mode for VTY user interfaces is password, and for AUX user interfaces is none.
Related commands: set authentication password.
Examples
# Specify that no authentication is needed for VTY 0. (This mode is insecure.)
<Sysname> system-view [Sysname] user-interface vty 0 [Sysname-ui-vty0] authentication-mode none
17
# Use password authentication when users log in to the device through VTY 0, and set the authentication password to 321.
<Sysname> system-view [Sysname] user-interface vty 0 [Sysname-ui-vty0] authentication-mode password [Sysname-ui-vty0] set authentication password cipher 321
# Authenticate users by username and password for VTY 0. Set the username to 12 3 and the password to 321.
<Sysname> system-view [Sysname] user-interface vty 0 [Sysname-ui-vty0] authentication-mode scheme [Sysname-ui-vty0] quit [Sysname] local-user 123 [Sysname-luser-123] password cipher 321 [Sysname-luser-123] service-type telnet [Sysname-luser-123] authorization-attribute level 3

command accounting

Syntax
command accounting
undo command accounting
View
User interface view
Default level
3: Manage level
Parameters
None
Description
Use the command accounting command to enable command accounting.
Use the undo command accounting command to restore the default.
By default, command accounting is disabled. The accounting server does not record the commands that users have executed.
When command accounting is enabled and command authorization is not, every executed command is recorded on the HWTACACS server.
When both command accounting and command authorization are enabled, only the authorized and executed commands are recorded on the HWTACACS server.
Examples
# Enable command acc ounting on VTY 0. Then t he HW TACACS ser ver records the commands executed by users that have logged in through VTY 0.
<Sysname> system-view [Sysname] user-interface vty 0 [Sysname-ui-vty0] command accounting
18

command authorization

Syntax
command authorization
undo command authorization
View
User interface view
Default level
3: Manage level
Parameters
None
Description
Use the command authorization command to enable command authorization.
Use the undo command authorization command to restore the default.
By default, command authorization is disabled. Logged-in users can execute commands without authorization.
With command authorization enabled, users can perform only commands authorized by the server.
Examples
# Enable command accounting for VTY 0 so that users logging in from VTY 0 can perform only the commands authorized by the HWTACACS server.
<Sysname> system-view [Sysname] user-interface vty 0 [Sysname-ui-vty0] command authorization

databits

Syntax
databits { 5 | 6 | 7 | 8 }
undo databits
View
User interface view
Default level
2: System level
Parameters
5: Sets 5 data bits for each character.
6: Sets 6 data bits for each character.
7: Sets 7 data bits for each character.
8: Sets 8 data bits for each character.
19
g
Description
Use the databits command to set data bits for each character.
Use the undo databits command to restore the default.
By default, 8 data bits are set for each character.
NOTE:
The command is only applicable to the asynchronous serial port (console port).
The data bits settin
must be the same for the user interfaces of the connecting ports on the device and
the terminal device for communication.
Examples
# Specify 5 data bits for each character.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] databits 5

display telnet client configuration

Syntax
display telnet client configuration [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display telnet client configuration command to display the configuration of the device when it serves as a Telnet client.
Examples
# Display the configuration of the device when it serves as a Telnet client.
<Sysname> display telnet client configuration The source IP address is 1.1.1.1.
The output shows that when the device serves as a client, the source IPv4 address for sending Telnet p a c k et s i s 1.1.1.1.
20

display user-interface

Syntax
display user-interface [ num1 | { aux | vty } num2 ] [ summary ] [ | { begin | exclude | include }
regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
num1: Absolute number of a user interface. The value range varies with devices, and typically starts from
0.
aux: Specifies the AUX user interface.
vty: Specifies the VTY user interface.
num2: Relative number of a user interface. The value range varies with devices for an AUX user interface and the value is in the range of 0 to 15 for a VTY user interface.
summary: Displays summary about user interfaces.
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display user-interface command to display information about the specified or all user interfaces.
If the summary keyword is not included, the command displays the type of the user interface, absolute or relative number, transmission rate, user privilege level, authentication mode, and the access port.
If the summary keyword is included, the command displays all the numbers and types of user interfaces.
Examples
# Display information about user interface 0.
<Sysname> display user-interface 0 Idx Type Tx/Rx Modem Privi Auth Int F 0 AUX 0 9600 - 3 N -
+ : Current user-interface is active. F : Current user-interface is active and work in async mode. Idx : Absolute index of user-interface. Type : Type and relative index of user-interface. Privi: The privilege of user-interface. Auth : The authentication mode of user-interface. Int : The physical location of UIs.
21
A : Authentication use AAA. L : Authentication use local database. N : Current UI need not authentication. P : Authentication use current UI's password.
Table 1 Output description
Field Description
+ The current user interface is active.
F The current user interface is active and works in asynchronous mode.
Idx Absolute number of the user interface.
Type Type and relative number of the user interface.
Tx/Rx Transmission/Receive rate of the user interface
Modem
Whether the modem is allowed to dial in (in), dial out (out), or both (inout)
By default, the character - is displayed to indicate that this function is disabled.
Privi Indicates the command level of a user under that user interface
Auth Authentication mode for the users, which can be A, P, L, and N.
Int
The physical port that corresponds to the user interface. (For AUX and VTY user interfaces,
- is displayed.)
A AAA authentication
L Local authentication (not supported)
N No authentication
P Password authentication
# Display summary about all user interfaces.
<Sysname> display user-interface summary User interface type : [AUX] 0:UX User interface type : [VTY] 18:UXXX XXXX XXXX XXXX
2 character mode users. (U) 16 UI never used. (X) 2 total UI in use
Table 2 Output description
Field Description
User interface type Type of user interface (AUX/VTY)
0:X
character mode users. (U) Number of users, or, the total number of character U.
UI never used. (X)
0 represents the absolute number of the user interface. X means this user interface is not used; U means this user interface is in use.
Number of user interfaces not used, or, the total number of character X.
22
Field Description
total UI in use Total number of user interfaces in use

display users

Syntax
display users [ all ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
all: Displays information about all user interfaces that the device supports.
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display users command to display information about the user interfaces that are being used.
Use the display users all command to display information about all user interfaces supported by the device.
Examples
# Display information about the user interfaces that are being used.
<Sysname> display users The user application information of the user interface(s): Idx UI Delay Type Userlevel + 18 VTY 0 00:00:00 TEL 3 19 VTY 1 00:02:34 TEL 3
Following are more details. VTY 0 : Location: 192.168.1.54 VTY 1 : Location: 192.168.1.58 + : Current operation user. F : Current operation user work in async mode.
The output shows that two users have logged in to the device. The one with IP address 192.168.1.54 uses VTY 0, and the other with IP address 192.168.1.58 uses VTY 1.
23
Table 3 Output description
Field Description
Idx Absolute number of the user interface
UI
Delay Time elapsed since the user's last input, in the format of hh:mm:ss.
Type User type, such as Telnet or SSH.
Userlevel User level: 0 for visit, 1 for monitor, 2 for system, and 3 for manage.
+ Current user
Location IP address of the user
F The current user works in asynchronous mode

escape-key

Syntax
Relative number of the user interface. For example, with VTY, the first column represents user interface type, and the second column represents the relative number of the user interface.
escape-key { default | character }
undo escape-key
View
User interface view
Default level
3: Manage level
Parameters
character: Specifies the shortcut key for terminating a task, a single character (or its corresponding ASCII code value in the range 0 to 127) or a string of 1 to 3 characters. Only the first character of a string functions as the shortcut key. For example, if you enter an ASCII code value of 113 , t h e s ys te m u s es i t s corresponding character q as the shortcut key. If you enter the string q@c, the system uses the first character q as the shortcut key.
default: Restores the default escape key combination of Ctrl+C.
Description
Use the escape-key command to define a shortcut key for terminating a task.
Use the undo escape-key command to disable the shortcut key for terminating tasks.
By default, you can use Ctrl+C to terminate a task.
After you define a new shortcut key by using the escape-key command, the new shortcut key is used to terminate a task. To display the shortcut key you have defined, use the display current-configuration command.
If you set the character argument in a user interface to log in to the device and then Telnet to another device, the character argument can be used as a control character to terminate a task rather than used as a common character. For example, if you specify character e in VTY 0 user interface of Device A, when you log in to Device A by using VTY 0 from a PC (Hyper Terminal), you can input e as a common
24
Examples
character on the PC, and you can also use e to terminate the task running on Device A. If you Telnet to Device B from Device A, you can only use e to terminate the task running on Device B, rather than use e as a common character, so specify character as a key combination.
# Define key a as the shortcut key for terminating a task.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] escape-key a
To verify the configuration:
# Ping the IP address of 192.168.1.49 and use the -c keyword to specify the number of ICMP echo packets to be sent as 20.
<Sysname> ping -c 20 192.168.1.49 PING 192.168.1.49: 56 data bytes, press a to break Reply from 192.168.1.49: bytes=56 Sequence=1 ttl=255 time=3 ms Reply from 192.168.1.49: bytes=56 Sequence=2 ttl=255 time=3 ms
# Enter a. The task terminates immediately and the system returns to system view.
--- 192.168.1.49 ping statistics --­ 2 packet(s) transmitted 2 packet(s) received
0.00% packet loss round-trip min/avg/max = 3/3/3 ms
<Sysname>

flow-control

Syntax
flow-control { hardware | none | software }
undo flow-control
View
User interface view
Default level
2: System level
Parameters
hardware: Performs hardware flow control.
none: Disables flow control.
software: Performs software flow control.
Description
Use the flow-control command to configure the flow control mode.
Use the undo flow-control command to restore the default.
By default, the flow control mode is none, which means no flow control is performed.
25
A flow control mode takes effect on both inbound and outbound directions. In inbound flow control, the local device listens to the remote device for flow control information while in the outbound flow control, the local device sends flow control information to the remote device.
Two ends must be configured with the same flow control mode.
NOTE:
The command is only applicable to the asynchronous serial port (console port).
The switch supports the none flow control mode only.
Examples
# Configure no flow control in the inbound and outbound directions for AUX 0.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] flow-control none

free user-interface

Syntax
free user-interface { num1 | { aux | vty } num2 }
View
User view
Default level
3: Manage level
Parameters
num1: Absolute number of a user interface. The value range varies with devices, and typically starts from
0.
aux: Specifies the AUX user interface.
vty: Specifies the VTY user interface.
num2: Relative number of a user interface. The value range varies with devices for an AUX user interface and the value is in the range of 0 to 15 for a VTY user interface.
Description
Use the free user-interface command to release the connection(s) established on the specified user interface.
This command cannot release the connection that you are using.
Examples
# Release the connection established on user interface VTY 1.
Display the users that are operating the device.
<Sysname> display users The user application information of the user interface(s): Idx UI Delay Type Userlevel + 18 VTY 0 00:00:00 TEL 3 19 VTY 1 00:09:51 TEL 3 Following are more details.
26
VTY 0 : Location: 192.168.0.10 VTY 1 : Location: 192.168.0.5 + : Current operation user. F : Current operation user work in async mode.
If the operations of the user using VTY 1 affect the operations of the administrator, log out the user.
<Sysname> free user-interface vty 1 Are you sure to free user-interface vty1? [Y/N]:y

history-command max-size

Syntax
history-command max-size size-value
undo history-command max-size
View
User interface view
Default level
2: System level
Parameters
size-value: Specifies the maximum number of history commands that the buffer can store. The value is in the range of 0 to 256.
Description
Use the history-command max-size command to set the size of the history command buffer of the current user interface.
Use the undo history-command max-size command to restore the default.
By default, the buffer saves 10 history commands.
The history command buffer saves executed history commands per user interface and buffers for different user interfaces do not affect each other. To displ ay the commands that are stored in the history buffer, use the display history-command command. To view the recently executed commands, press the upper arrow or lower arrow key. For more information about the display history-command command, see Fundamentals Command Reference.
After you terminate the current session, the system automatically removes the commands saved in the corresponding history buffer.
Examples
# Set the buffer to store 20 history commands at most.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] history-command max-size 20

idle-timeout

Syntax
27
idle-timeout minutes [ seconds ]
undo idle-timeout
View
User interface view
Default level
2: System level
Parameters
minutes: Specifies the timeout time in minutes, in the range of 0 to 35791. The default value is 10 minutes.
seconds: Specifies timeout time in seconds, in the range of 0 to 59. The default value is 0 seconds.
Description
Use the idle-timeout command to set the idle-timeout timer.
Use the undo idle-timeout command to restore the default.
The default idle-timeout is 10 minutes.
NOTE:
The system automatically terminates the user’s connection(s) if there is no information interaction
between the device and the users within the idle timeout time.
Setting idle-timeout to zero disables the timer. In this case, connections are maintained unless you
Examples
# Set the idle-timeout timer to 1 minute and 30 seconds.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] idle-timeout 1 30

lock

Syntax
lock
View
User view
Default level
3: Manage level
Parameters
None
terminate them.
Description
Use the lock command to lock the user interface. This method prevents unauthorized users from using the user interface.
28
Examples
When entering the lock command, you are asked to input a password (up to 16 characters) and then confirm it by inputting the password again. After locking the user interface, you must press Enter and input the correct password next time you enter this user interface.
By default, this function is disabled.
# Lock the current user interface.
<Sysname> lock Please input password<1 to 16> to lock current user terminal interface: Password: Again:
locked !
Password: <Sysname>

modem

Syntax
modem [ both | call-in | call-out ]
undo modem [ both | call-in | call-out ]
View
AUX interface view
Default level
2: System level
Parameters
both: Allows both incoming and outgoing calls.
call-in: Allows incoming calls only.
call-out: Allows outgoing calls only.
Description
Use the modem command to enable the switch-side modem to accept incoming calls, initiate outgoing calls, or both.
Use the undo modem command to remove the modem dial-up configuration.
By default, modem calls are not allowed.
29
Examples
# Enable the modem to accept both incoming and outgoing calls.
<Sysname> system-view System View: return to User View with Ctrl+Z. [Sysname] user-interface aux 0 [Sysname-ui-aux0] modem both

modem auto-answer

Syntax
modem auto-answer
undo modem auto-answer
View
AUX interface view
Default level
2: System level
Parameters
None
Description
Use the modem auto-answer command to configure the switch-side modem to operate in the auto-answer mode.
Use the undo modem auto-answer command to restore the default.
By default, the switch-side modem operates in the manual answer mode.
Examples
# Configure the switch-side modem to operate in the auto-answer mode.
<Sysname> system-view System View: return to User View with Ctrl+Z. [Sysname] user-interface aux 0 [Sysname-ui-aux0] modem auto-answer

modem timer answer

Syntax
modem timer answer seconds
undo modem timer answer
View
AUX interface view
Default level
2: System level
Parameters
seconds: Timeout time in seconds, in the range of 1 to 60. The default value is 30 seconds.
30
g
Description
Use the modem timer answer command to set the maximum amount of time that the modem waits for the carrier signal after the off-hook action during incoming call connection setup.
Use the undo modem timer answer command to restore the default.
Examples
# Set the maximum amount of time that the switch-side modem waits for the carrier signal after the off-hook action to 45 seconds.
<Sysname> system-view System View: return to User View with Ctrl+Z. [Sysname] user-interface aux 0 [Sysname-ui-aux0] modem timer answer 45

parity

Syntax
parity { even | mark | none | odd | space }
undo parity
View
User interface view
Default level
2: System level
Parameters
even: Performs an even parity check.
mark: Performs a mark parity check.
none: Performs no parity check.
odd: Performs an odd parity check.
space: Performs a space parity check.
Description
Use the parity command to set a parity check method.
Use the undo parity command to restore the default.
By default, no parity check is performed.
NOTE:
The command is only applicable to the asynchronous serial port (console port).
The parity check setting must be the same for the user interfaces of the connectin
Examples
ports on the device
and the target terminal device for communication.
# Configure the Console port to perform odd parity check.
<Sysname> system-view [Sysname] user-interface aux 0
31
[Sysname-ui-aux0] parity odd

protocol inbound

Syntax
protocol inbound { all | ssh | telnet }
undo protocol inbound
View
VTY interface view
Default level
3: Manage level
Parameters
all: Supports both protocols: Telnet and SSH.
ssh: Supports SSH only.
telnet: Supports Telnet only.
Description
Use the protocol inbound command to enable the current user interface to support either Telnet, SSH, or all of them. The configuration takes effect next time you log in.
Use the undo protocol inbound command to restore the default.
By default, both protocols are supported.
NOTE:
Before configuring a user interface to support SSH, set the authentication mode to scheme for the user
interface; otherwise, the protocol inbound ssh command fails. For more information, see authentication-mode.
By default, the authentication mode of the Telnet protocol is password.
Examples
# Enable the VTYs 0 through 4 to support SSH only.
<Sysname> system-view [Sysname] user-interface vty 0 4 [Sysname-ui-vty0-4] authentication-mode scheme [Sysname-ui-vty0-4] protocol inbound ssh

screen-length

Syntax
screen-length screen-length
undo screen-length
View
User interface view
Default level
32
2: System level
Parameters
screen-length: Number of lines to be displayed on the screen, in the range of 0 to 512. The value of 0 disables pausing between screens of output.
Description
Use the screen-length command to set the number of lines to be displayed on the screen.
Use the undo screen-length command to restore the default.
By default, the screen displays 24 lines.
When screen output pauses, press the Space key to display the next screen. Not all terminals support this command setting. For example, assume that you set screen-length to 40, but the terminal can display 24 lines in one screen at most. When you press Space, the device sends 40 lines to the terminal, but the next screen displays only lines 18 through 40. To view the first 17 lines, you must press the page up or page down key.
To disable multiple-screen output of the current user interface, use the screen-length disable command. For more information about the screen-length disable command, see the chapter “CLI commands.”
Examples
# Set the next screen of the AUX user interface 0 to display 30 lines.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] screen-length 30

send

Syntax
send { all | num1 | { aux | vty } num2 }
View
User view
Default level
1: Monitor level
Parameters
all: Sends messages to all user interfaces.
aux: Specifies the AUX user interface.
vty: Specifies the VTY user interface.
num1: Absolute number of a user interface. The value range varies with devices, and typically starts from
0.
num2: Relative number of a user interface. The value range varies with devices for an AUX user interface and the value is in the range of 0 to 15 for a VTY user interface.
Description
Use the send command to send messages to the specified user interfaces.
To end message input, press Ctrl+Z. To cancel message input and return to user view, press Ctrl+C.
33
Examples
# Send message hello abc to the AUX user interface 0.
<Sysname> send aux 0 Enter message, end with CTRL+Z or Enter; abort with CTRL+C: hello abc^Z Send message? [Y/N]:y <Sysname>
*** *** ***Message from aux0 to aux0 *** hello abc
<Sysname>
# Assume you are using VTY 0. Before you restart the device, to inform users that are accessing the device through other user interfaces, perform the following steps.
Display information about all users
<Sysname> display users The user application information of the user interface(s): Idx UI Delay Type Userlevel + 18 VTY 0 00:00:00 TEL 3 19 VTY 1 00:00:03 TEL 3
Following are more details. VTY 0 : Location: 192.168.1.26 VTY 1 : Location: 192.168.1.20 + : Current operation user. F : Current operation user work in async mode.
// The output shows that a user is using VTY 0.
<Sysname> send vty 1 Enter message, end with CTRL+Z or Enter; abort with CTRL+C: Note please, I will reboot the system in 3 minutes!^Z Send message? [Y/N]:y
// A message is sent to VTY 1, telling that the system will reboot in 3 minutes.
If a user is trying to log in through VTY 1, the message appears. (VTY 1 receives the message from
VTY 0 when the interface GigabitEthernet command is input.)
[Sysname] interface gigabiteth
*** *** ***Message from vty0 to vty1 ***
34
Note please, I will reboot the system in 3 minutes!

set authentication password

Syntax
set authentication password { cipher | simple } password
undo set authentication password
View
User interface view
Default level
3: Manage level
Parameters
cipher: Cipher text password.
simple: Plain text password.
password: A case sensitive string. If the password format is simple, the password argument must be in plain text, and the configuration file saves the password in plain text. If the format is cipher, password can be either in cipher text or in plain text, and the configuration file always saves the password in cipher text. A plain text password can be a string of no more than 16 characters, 1234567 for example. A cipher text password or the encrypted version of the plain text password comprises 24 characters, such as _(TT8F]Y\5SQ=^Q`MAF4<1!!.
Description
Use the set authentication password command to set an authentication password.
Use the undo set authentication password command to remove the local authentication password.
By default, no local authentication password is set.
No matter whether the password format is plain text or cipher text, you must type the password in plain text during authentication.
A plain text password easily gets cracked. Therefore, a cipher text password is recommended.
Related commands: authentication-mode.
Examples
# Set the local authentication password for the AUX 0 user interface to hello.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] authentication-mode password [Sysname-ui-aux0] set authentication password cipher hello
Next time you enter the system, the password is required.

shell

Syntax
shell
undo shell
35
View
User interface view
Default level
3: Manage level
Parameters
None
Description
Use the shell command to enable terminal services on the current user interface.
Use the undo shell command to disable terminal services on the current user interface.
The console port does not support the undo shell command.
You cannot disable the terminal services on the user interface through which you are logged in.
By default, terminal services are enabled on all user interfaces.
Examples
# Disable terminal services on VTYs 0 through 15, which means you cannot log in to the device through VTYs 0 through 15.
<Sysname> system-view [Sysname] user-interface vty 0 15 [Sysname-ui-vty0-15] undo shell % Disable ui-vty0-15 , are you sure? [Y/N]:y [Sysname-ui-vty0-15]
The following message appears when a terminal tries to Telnet to the device:
The connection was closed by the remote host!

speed (user interface view)

Syntax
speed speed-value
undo speed
View
User interface view
Default level
2: System level
Parameters
speed-value: Transmission rate in bps.
The transmission rates available with asynchronous serial interfaces include:
300 bps
600 bps
1200 bps
2400 bps
4800 bps
36
9600 bps
19200 bps
38400 bps
57600 bps
115200 bps
The transmission rate varies with devices and configuration environment.
Description
Use the speed command to set the transmission rate on the user interface.
Use the undo speed command to restore the default transmission rate.
By default, the transmission rate is 9600 bps.
NOTE:
The command is only applicable to the asynchronous serial port (console port).
The transmission rate setting must be identical for the user interfaces of the connecting ports on the
Examples
device and the target terminal device for communication.
# Set the transmission rate on the AUX 0 user interface to 19200 bps.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] speed 19200

stopbits

Syntax
stopbits { 1 | 1.5 | 2 }
undo stopbits
View
User interface view
Default level
2: System level
Parameters
1: One stop bit.
1.5: One and a half stop bits.
2: Two stop bits.
Description
Use the stopbits command to set the number of stop bits transmitted per byte.
Use the undo stopbits command to restore the default.
By default, the stop bit is one.
37
g
NOTE:
The command is only applicable to the asynchronous serial port ( console port).
The stop bits setting must be the identical for the user interfaces of the connectin
Examples
# Set the stop bits on the user interface AUX 0 to 1.5.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0] stopbits 1.5

telnet

Syntax
telnet remote-host [ service-port ] [ vpn-instance vpn-instance-name ] [ source { interface interface-type interface-number | ip ip-address } ]
View
User view
Default level
0: Visit level
Parameters
ports on the device and
the target device for communication.
remote-host: IPv4 address or host name of a remote host, a case-insensitive string of 1 to 20 characters.
service-port: TCP port number of the Telnet service on the remote host. It is in the range of 0 to 65535 and
defaults to 23.
vpn-instance vpn-instance-name: Specifies the MPLS L3VPN that the remote system belongs to, where vpn-instance-name is a case-sensitive string of 1 to 31 characters.
source: Specifies the source interface or source IPv4 address of Telnet packets.
interface interface-type interface-number: Specifies the source interface. The source IPv4 address of the
Telnet packets sent is the IPv4 address of the specified interface. interface-type interface-number represents the interface type and number.
ip ip-address: Specifies the source IPv4 address of Telnet packets.
Description
Use the telnet command to Telnet to a remote host.
To terminate the current Telnet connection, press Ctrl+K or use the quit command.
The source IPv4 address or source interface specified by this command is applicable to the current Telnet connection only.
Examples
# Telnet to the remote host 1.1.1.2, specifying the source IP address of Telnet packets as 1.1.1.1.
<Sysname> telnet 1.1.1.2 source ip 1.1.1.1
38

telnet client source

Syntax
telnet client source { interface interface-type interface-number | ip ip-address }
undo telnet client source
View
System view
Default level
2: System level
Parameters
interface interface-type interface-number: Specifies the source interface. The source IPv4 address of the
Telnet packets sent is the IPv4 address of the specified interface. interface-type interface-number represents the interface type and number.
ip ip-address: Specifies the source IPv4 address of Telnet packets.
Description
Use the telnet client source command to specify the source IPv4 address or source interface for sending Telnet packets when the device serves as a Telnet client.
Use the undo telnet client source command to remove the source IPv4 address or source interface for sending Telnet packets.
By default, no source IPv4 address or source interface for sending Telnet packets is specified. The source IPv4 address is selected by routing.
The source IPv4 address or source interface specified by this command is applicable all Telnet connections.
If you use both this command and the telnet command to specify the source IPv4 address or source interface, the source IPv4 address or interface specified by the telnet command takes effect.
Related commands: display telnet client configuration.
Examples
# Specify the source IPv4 address for sending Telnet packets when the device serves as a Telnet client as
1.1.1.1.
<Sysname> system-view [Sysname] telnet client source ip 1.1.1.1

telnet ipv6

Syntax
telnet ipv6 remote-host [ -i interface-type interface-number ] [ port-number ] [ vpn-instance vpn-instance-name ]
View
User view
Default level
0: Visit level
39
Parameters
remote-host: IP address or host name of a remote host, a case-insensitive string of 1 to 46 characters.
-i interface-type interface-number: Specifies the outbound interface for sending Telnet packets, where interface-type interface-number represents the interface type and number. If the destination address is a link-local address, provide the –i interface-type interface-number argument.
port-number: TCP port number for the remote host to provide the Telnet service. It is in the range of 0 to
65535 and defaults to 23.
vpn-instance vpn-instance-name: Specifies the MPLS L3VPN that the remote system belongs to, where vpn-instance-name is a case-sensitive string of 1 to 31 characters.
Description
Use the telnet ipv6 command to Telnet to a remote h ost i n an IP v6 net work. To terminate the cu rrent Telnet connection, press Ctrl+K or use the quit command.
Examples
# Telnet to the remote host with the IPv6 address 5000::1.
<Sysname> telnet ipv6 5000::1

telnet server enable

Syntax
telnet server enable
undo telnet server enable
View
System view
Default level
3: Manage level
Parameters
None
Description
Use the telnet server enable command to enable the Telnet server.
Use the undo telnet server enable command to disable the Telnet server.
The Telnet server is disabled by default.
Examples
# Enable the Telnet server.
<Sysname> system-view [Sysname] telnet server enable

terminal type

Syntax
terminal type { ansi | vt100 }
undo terminal type
40
View
User interface view
Default level
2: System level
Parameters
ansi: Specifies the terminal display type as ANSI.
vt100: Specifies the terminal display type as VT100.
Description
Use the terminal type command to configure the type of terminal display of the current user interface.
Use the undo terminal type command to restore the default.
By default, the terminal display type is ANSI.
The device supports two types of terminal display: ANSI and VT100. HP recommends you to set the display type of both the device and the client to VT100. If the device and the client use different display types (for example, hyper terminal or Telnet terminal) or both are set to ANSI, when the total number of characters of the currently edited command line exceeds 80, an anomaly such as cursor corruption or abnormal display of the terminal display may occur on the client.
Examples
# Set the terminal display type to VT100.
<Sysname> system-view [Sysname] user-interface vty 0 [Sysname-ui-vty0] terminal type vt100

user privilege level

Syntax
user privilege level level
undo user privilege level
View
User interface view
Default level
3: Manage level
Parameters
level: Specifies a user privilege level, in the range of 0 to 3.
NOTE:
User privilege levels include visit, monitor, system, and manage, represented by the number 0, 1, 2 and 3 respectively. The administrator can change the user privilege level when necessary.
Description
Use the user privilege level command to configure the user privilege level. Users logging into the user interface are assigned a user privilege level.
41
Examples
Use the undo user privilege level command to restore the default.
By default, the default command level is 3 for the console user interface and 0 for other user interfaces.
# Set the command level for users logging in through VTY 0 to 0.
<Sysname> system-view [Sysname] user-interface vty 0 [Sysname-ui-vty0] user privilege level 0
After you Telnet to the device through VTY 0, the terminal only displays commands of level 0 in the help information:
<Sysname> ? cfd Connectivity fault detection (IEEE 802.1ag) display Display current system information ping Ping function quit Exit from current command view ssh2 Establish a secure shell client connection super Set the current user priority level telnet Establish one TELNET connection tracert Trace route function

user-interface

Syntax
user-interface { first-num1 [ last-num1 ] | { aux | vty } first-num2 [ last-num2 ] }
View
System view
Default level
2: System level
Parameters
first-num1: Absolute number of the first user interface. The value range varies with devices, and typically starts from 0.
last-num1: Absolute number of the last user interface. The value range varies with devices, and typically starts from 0, but cannot be smaller than the first-num1.
aux: Specifies the AUX user interface.
vty: Specifies the VTY user interface.
first-num2: Relative number of the first user interface. The value range varies with devices for an AUX user interface and the value is in the range of 0 to 15 for a VTY user interface.
last-num2: Relative number of the last user interface. The value range varies with devices for an AUX user interface and the value is in the range of 0 to 15 for a VTY user interface, but cannot be smaller than first-num 2.
Description
Use the user-interface command to enter a single or multiple user interface views.
In a single user interface view, the configuration takes effect in the user view only.
42
Examples
In multiple user interface views, the configuration takes effect in these user views.
# Enter the user interface view of AUX 0.
<Sysname> system-view [Sysname] user-interface aux 0 [Sysname-ui-aux0]
# Enter the user interface views of VTYs 0 to 4.
<Sysname> system-view [Sysname] user-interface vty 0 4 [Sysname-ui-vty0-4]
43

FTP configuration commands

FTP server configuration commands

display ftp-server

Syntax
display ftp-server [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
3: Manage level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display ftp-server command to display the FTP server configuration.
After configuring FTP server parameters, you may verify them with this command.
Related commands: ftp server enable, ftp timeout, and ftp update.
Examples
# 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
Table 4 Output description
Field Description
Max user number Maximum number of concurrent login users
User count Number of the current login users
44
Field Description
Timeout value (in minute)
Put Method

display ftp-user

Syntax
display ftp-user [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
3: Manage level
Parameters
Allowed idle time of an FTP connection. If there is no packet exchange between the FTP server and client during the time frame, the FTP connection will be disconnected.
File update method of the FTP server:
fast
normal
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display ftp-user command to display the detailed information of current FTP users.
Examples
# Display the detailed information of FTP users.
<Sysname> display ftp-user UserName HostIP Port Idle HomeDir ftp 192.168.1.54 1190 0 flash:
# If the name of the logged-in user exceeds 10 characters, the exceeded characters will be displayed in the next line and right justified, for example, if the logged-in user name is administrator, the following information will appear:
<Sysname> display ftp-user UserName HostIP Port Idle HomeDir administra tor 192.168.0.152 1031 0 flash:
Table 5 Output description
Field Description
UserName Name of the currently logged-in user
45
Field Description
HostIP IP address of the currently logged-in user
Port Port which the currently logged-in user is using
Idle Duration time of the FTP connection, in minutes
HomeDir Authorized path of the logged-in user

free ftp user

Syntax
free ftp user username
View
User view
Default level
3: Manage level
Parameters
username: Username. You can use the display ftp-user command to view FTP login user information.
Description
Use the free ftp user command to manually release the FTP connection established by the specified user.
This command releases the FTP connection established by the specified user no matter whether the user is transmitting a file.
Examples
# Manually release the FTP connection established with username ftpuser.
<Sysname> free ftp user ftpuser Are you sure to free FTP user ftpuser? [Y/N]:y <Sysname>

ftp server acl

Syntax
ftp server acl acl-number
undo ftp server acl
View
System view
Default level
3: Manage level
Parameters
acl-number: Basic access control list (ACL) number, in the range of 2000 to 2999.
Description
Use the ftp server acl command to use an ACL to control FTP clients’ access to the FTP server.
46
Use the undo ftp server acl command to restore the default.
By default, no ACL is used to control FTP clients’ access to the FTP server.
An ACL enables the FTP server to permit the FTP requests from specific FTP clients. This configuration only filters the FTP connections to be established, and has no effect on existing FTP connections and operations. If you execute the command multiple times, the last specified ACL takes effect.
Examples
# Associate the FTP service with ACL 2001 to allow only the client 1.1.1.1 to access the FTP server through FTP.
<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 enable

Syntax
ftp server enable
undo ftp server
View
System view
Default level
3: Manage level
Parameters
None
Description
Use the ftp server enable command to enable the FTP server and allow the login of FTP users.
Use the undo ftp server command to disable the FTP server.
By default, the FTP server is disabled.
Examples
# Enable the FTP server.
<Sysname> system-view [Sysname] ftp server enable

ftp timeout

Syntax
ftp timeout minute
undo ftp timeout
47
View
System view
Default level
3: Manage level
Parameters
minute: Idle-timeout timer in minutes, in the range of 1 to 35791.
Description
Use the ftp timeout command to set the idle-timeout timer.
Use the undo ftp timeout command to restore the default.
By default, the FTP idle time is 30 minutes.
If the idle time of an FTP connection exceeds the FTP timeout value, the FTP server breaks the connection to save resources.
Examples
# Set the idle-timeout timer to 36 minutes.
<Sysname> system-view [Sysname] ftp timeout 36

ftp update

Syntax
ftp update { fast | normal }
undo ftp update
View
System view
Default level
3: Manage level
Parameters
fast: Fast update. In this mode, the FTP server writes the complete file to the memory before writing it to
the storage medium.
normal: Normal update. In this mode, the FTP server writes the data of a file from the memory to the storage medium multiple times, with up to 4096 bytes per time.
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.
Examples
By default, the file update mode is normal.
# Set the FTP update mode to normal.
<Sysname> system-view [Sysname] ftp update normal
48
g

FTP client configuration commands

NOTE:
You must use the ftp command to enter FTP client view before making client configurations. For more
information, see “ftp.”
Before executing the FTP client configuration commands in this section, check that you have confi
The prompt information for the examples varies with FTP server types.

ascii

Syntax
ascii
View
FTP client view
Default level
3: Manage level
Parameters
None
Description
Use the ascii command to set the file transfer mode to ASCII.
ured the proper authority, including view the files under the current directory, read/download the specified file, create directory/upload files, and rename/remove files) for users on the FTP server.
By default, the file transfer mode is ASCII.
The carriage return characters vary with operating systems. For example, HP and Windows use characters /r/n, and Linux uses characters /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 the following modes:
Binary mode: for program file or picture transmission.
ASCII mode: for text file transmission.
Related commands: binary.
Examples
# Set the file transfer mode to ASCII.
[ftp] ascii 200 Type set to A.

binary

Syntax
binary
49
View
FTP client view
Default level
3: Manage level
Parameters
None
Description
Use the binary command to set the file transfer mode to binary (flow) mode.
By default, the transfer mode is ASCII mode.
Related commands: ascii.
Examples
# Set the file transfer mode to binary.
[ftp] binary 200 Type set to I.
bye
Syntax
bye
View
FTP client view
Default level
3: Manage level
Parameters
None
Description
Use the bye command to disconnect from the remote FTP server and return to user view.
If no connection is established between the device and the remote FTP server, use this command to return to user view directly.
Related commands: close, disconnect, and quit.
Examples
# Terminate the connection with the remote FTP server and return to user view.
[ftp] bye 221 Server closing.
cd
Syntax
cd { directory | .. | / }
50
View
FTP client view
Default level
3: Manage level
Parameters
directory: Name of the target directory, in the format of [drive:][/]path, where drive represents the storage medium name, typically flash or cf. 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 an upper directory. The execution of the cd .. command equals the execution of the cdup command. If the current working directory is the root directory, or no upper directory exists, the current working directory does not change when the cd .. command is executed. This argument does not support command line online help.
/: Returns to the root directory of the storage medium. The keyword does not support command line online help.
Description
Use the cd command to change the current working directory on the remote FTP server to access another authorized directory.
Related commands: pwd.
Examples
# Change the working directory to the sub-directory logfile of the current directory.
[ftp] cd logfile 250 CWD command successful.
# Change the working directory to the sub-directory folder of the authorized directory.
[ftp] cd /folder 250 CWD command successful.

cdup

Syntax
cdup
View
FTP client view
Default level
3: Manage level
Parameters
None
Description
Use the cdup command to exit the directory and enter the upper directory of the FTP server.
This command does not change the working directory if the directory is work-directory.
Related commands: cd and pwd.
51
Examples
# Change the working directory path to the upper directory.
[ftp] pwd 257 "/ftp/subdir" is current directory. [ftp] cdup 200 CDUP command successful. [ftp] pwd 257 "/ftp" is current directory.

close

Syntax
close
View
FTP client view
Default level
3: Manage level
Parameters
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.
Examples
# Terminate the connection to the FTP server and remain in FTP client view.
[ftp] close 221 Server closing. [ftp]

debugging

Syntax
debugging
undo debugging
View
FTP client view
Default level
1: M o n it or lev e l
Parameters
None
Description
Use the debugging command to enable FTP client debugging.
52
Examples
Use the undo debugging command to disable FTP client debugging.
By default, FTP client debugging is disabled.
# The device serves as the FTP client. Enable FTP client debugging and use the active mode to download file sample.file from the current directory of the FTP server.
<Sysname> terminal monitor <Sysname> terminal debugging <Sysname> ftp 192.168.1.46 Trying 192.168.1.46 ... Press CTRL+K to abort Connected to 192.168.1.46. 220 FTP service ready. User(192.168.1.46:(none)):ftp 331 Password required for ftp. Password: 230 User logged in.
[ftp]undo passive FTP: passive is off
[ftp] debugging FTP: debugging switch is on
[ftp] get sample.file
---> PORT 192,168,1,44,4,21 200 Port command okay. The parsed reply is 200
---> RETR sample.file 150 Opening ASCII mode data connection for /sample.file. The parsed reply is 150 FTPC: File transfer started with the signal light turned on. FTPC: File transfer completed with the signal light turned off. .226 Transfer complete. FTP: 3304 byte(s) received in 4.889 second(s), 675.00 byte(s)/sec.
[ftp]
Table 6 Output description
Field Description
---> PORT Give an FTP order, with data port numbers being…
The parsed reply is The received reply code, defined in RFC 959.
---> RETR Download the file
FTPC: File transfer started with the signal light turned on.
53
File transfer starts, and the signal light is turned on.
Field Description
FTPC: File transfer completed with the signal light turned off.

delete

Syntax
delete remotefile
View
FTP client view
Default level
3: Manage level
Parameters
remotefile: File name.
Description
Use the delete command to permanently delete a specified file on the remote FTP server.
To perform this operation, you must have delete permissions on the FTP server.
Examples
File transfer is completed, and the signal light is turned off.
# Delete file temp.c.
[ftp] delete temp.c 250 DELE command successful.
dir
Syntax
dir [ remotefile [ localfile ] ]
View
FTP client view
Default level
3: Manage level
Parameters
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 the 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.
54
NOTE:
Examples
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.
The Is command can only display the names of files and directories. The dir command can display other related information of the files and directories, such as the size, and the date they were created.
# View the detailed information of the files and subdirectories under the current directory on the remote FTP server.
[ftp] dir 227 Entering Passive Mode (192,168,1,46,5,68). 125 ASCII mode data connection already open, transfer starting for /*. drwxrwxrwx 1 noone nogroup 0 Aug 08 2006 logfile
-rwxrwxrwx 1 noone nogroup 20471748 May 11 10:21 test.app
-rwxrwxrwx 1 noone nogroup 4001 Dec 08 2007 config.cfg
-rwxrwxrwx 1 noone nogroup 3608 Jun 13 2007 startup.cfg drwxrwxrwx 1 noone nogroup 0 Dec 03 2007 test
-rwxrwxrwx 1 noone nogroup 299 Oct 15 2007 key.pub 226 Transfer complete. FTP: 394 byte(s) received in 0.189 second(s), 2.00K byte(s)/sec.
[ftp]
# 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,1,50,17,158). 125 ASCII mode data connection already open, transfer starting for /ar-router.cfg.
....226 Transfer complete.
FTP: 67 byte(s) received in 4.600 second(s), 14.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

disconnect

Syntax
disconnect
View
FTP client view
Default level
3: Manage level
Parameters
None
55
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.
Examples
# Disconnect from the remote FTP server but remain in FTP client view.
[ftp] disconnect 221 Server closing. [ftp]

display ftp client configuration

Syntax
display ftp client configuration [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display ftp client configuration command to display the source IP address configuration of the FTP client.
Related commands: ftp client source.
Examples
# Display the source IP address configuration of the FTP client.
<Sysname> display ftp client configuration The source IP address is 192.168.0.123
NOTE:
The display ftp client configuration command displays the source IP address configuration of the FTP client. If the specified source IP address is active, this command displays the source IP address. If the specified source interface is active, this command displays the source interface.
56
ftp
Syntax
ftp [ server-address [ service-port ] [ vpn-instance vpn-instance-name ] [ source { interface interface-type interface-number | ip source-ip-address } ] ]
View
User view
Default level
3: Manage level
Parameters
server-address: IP address or host name (a string of 1 to 20 characters) of a remote FTP server.
service-port: TCP port number of the remote FTP server, in the range of 0 to 65535. The default value is
21.
vpn-instance vpn-instance-name: Specifies the MPLS L3 VPN that the FTP server belongs to. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters.
source { interface interface-type interface-number | ip source-ip-address } ]: Specifies the source address used to establish an FTP connection.
interface interface-type interface-number: Specifies the source interface by its type and number. The
ip source-ip-address: Specifies the source IP address of the transmitted FTP packets. This source
Description
Use the ftp command to log in to the remote FTP server and enter FTP client view.
This command applies to IPv4 networks only.
If you use this command without specifying any parameters, you will simply enter the FTP client view
If you specify the parameters, you will be prompted to enter the username and password for
Examples
# Log in the server 192.168.0.211. The source IP address of sent FTP packets is 192.168.0.212.
<Sysname1> ftp 192.168.0.211 source ip 192.168.0.212 Trying 192.168.0.211 ... Press CTRL+K to abort Connected to 192.168.0.211. 220 FTP Server ready. User(192.168.0.211:(none)):abc 331 Password required for abc Password: 230 User logged in.
[ftp]
primary IP address configured on this interface is the source address of the transmitted FTP packets. If no primary IP address is configured on the source interface, the connection fails.
address must be the one that has been configured on the device.
without logging in to the FTP server.
accessing the FTP server.
57

ftp client source

Syntax
ftp client source { interface interface-type interface-number | ip source-ip-address }
undo ftp client source
View
System view
Default level
2: System level
Parameters
interface interface-type interface-number: Specifies the source interface for establishing FTP connections.
The primary IP address of the source interface is used as the source IP address of packets sent to an FTP server. If the source interface has no primary IP address specified, no FTP connection can be established.
ip source-ip-address: Specifies the source IP address of packets sent to an FTP server, which is one of the IP addresses of the device.
Description
Examples
Use the ftp client source command to specify the source IP address of packets sent to an FTP server.
Use the undo ftp client source command to restore the default.
By default, the source IP address is the IP address of the output interface of the route to the server is used as the source IP address.
If you use the ftp client source command to first configure a source interface and then a source IP address, the source IP address overwrites the source interface, and vice versa.
If you first use the ftp client source command to specify a source IP address and then use the ftp command to specify another source IP address, the latter is used.
The source IP address specified with the ftp client source command applies to all FTP connections while the one specified with the ftp command applies to the current FTP connection only.
Related commands: display ftp client configuration.
# Specify the source IP address of packets sent to an FTP server as 2.2.2.2.
<Sysname> system-view [Sysname] ftp client source ip 2.2.2.2
# Specify the IP address of interface VLAN-interface 1 as the source IP address of packets sent to an FTP server.
<Sysname> system-view [Sysname] ftp client source interface vlan-interface 1

ftp ipv6

Syntax
ftp ipv6 [ server-address [ service-port ] [ vpn-instance vpn-instance-name ] [ source ipv6
source-ipv6-address ] [ -i interface-type interface-number ] ]
58
View
User view
Default level
3: Manage level
Parameters
server-address: IP address or host name of the remote FTP server.
service-port: TCP port number of the FTP server, in the range of 0 to 65535. The default value is 21.
source ipv6 source-ipv6-address: Specifies a source IPv6 address for transmitted FTP packets. This address must be an IPv6 address that has been configured on the device.
-i interface-type interface-number: Specifies an output interface by its type and number. This parameter 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 the configuration of link local addresses, see Layer 3—IP Services Configuration Guide.
vpn-instance vpn-instance-name: Specifies the MPLS L3 VPN that the FTP server belongs to. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters.
Description
Examples
Use the ftp ipv6 command to log in to the FTP server and enter FTP client view.
This command applies to IPv6 networks only.
If you use this command without specifying any parameters, you will simply enter the FTP client view
without logging in to an FTP server.
If you specify the parameters, enter the username and password for accessing the FTP server.
# Log in to the FTP server with IPv6 address 3000::200.
<Sysname> ftp ipv6 3000::200 Trying 3000::200 ... Press CTRL+K to abort Connected to 3000::200. 220 Welcome! User(3000::200:(none)): MY_NAME 331 Please specify the password. Password: 230 Login successful. [ftp]
# Log in to the FTP server with IPv6 address 3000::200 in VPN 1.
<Sysname> ftp ipv6 3000::200 vpn-instance vpn1 Trying 3000::200 ... Press CTRL+K to abort Connected to 3000::200. 220 Welcome! User(3000::200:(none)): MY_NAME 331 Please specify the password. Password: 230 Login successful.
59
[ftp]
get
Syntax
get remotefile [ localfile ]
View
FTP client view
Default level
3: Manage level
Parameters
remotefile: Name of the file to be downloaded.
localfile: File name used after a file is downloaded and saved locally. If this argument is not specified, the
local file uses the name of the source file on the FTP server by default.
Description
Use the get command to download a file from a remote FTP server and save it.
Examples
1. In standalone mode
# Download file testcfg.cfg to the root directory of the storage medium of the active MPU, and save it as newest.cfg.
[ftp] get testcfg.cfg newest.cfg
227 Entering Passive Mode (192,168,1,46,4,47). 125 ASCII mode data connection already open, transfer starting for /testcfg.cfg. ..226 Transfer complete. FTP: 3608 byte(s) received in 2.050 second(s), 1.00K byte(s)/sec.
# Download file testcfg.cfg to the root directory of the storage medium of the standby MPU (in slot 1), and save it as newest.cfg.
[ftp] get testcfg.cfg slot1#flash:/newest.cfg
227 Entering Passive Mode (192,168,1,46,4,48). 125 ASCII mode data connection already open, transfer starting for /testcfg.cfg. 226 Transfer complete. FTP: 3608 byte(s) received in 2.322 second(s), 1.00K byte(s)/sec.
2. In IRF mode
# Download file testcfg.cfg to the root directory of the storage medium on the active MPU of the IRF fabric, and save it as newest.cfg.
[ftp] get testcfg.cfg newest.cfg
227 Entering Passive Mode (192,168,1,46,4,47). 125 ASCII mode data connection already open, transfer starting for /testcfg.cfg. ..226 Transfer complete. FTP: 3608 byte(s) received in 2.050 second(s), 1.00K byte(s)/sec.
60
# Download file testcfg.cfg to the root directory of the storage medium of a standby MPU (the ID of the IRF member switch where the standby MPU resides is 2, and the slot number of the standby MPU is 1), and save it as newest.cfg.
[ftp] get testcfg.cfg chassis2#slot1#flash:/newest.cfg
227 Entering Passive Mode (192,168,1,46,4,48). 125 ASCII mode data connection already open, transfer starting for / testcfg.cfg. 226 Transfer complete. FTP: 3608 byte(s) received in 2.322 second(s), 1.00K byte(s)/sec.
lcd
Syntax
lcd
View
FTP client view
Default level
3: Manage level
Parameters
None
Description
Use the lcd command to display the local working directory of the FTP client.
Examples
# Display the local working directory.
[ftp] lcd FTP: Local directory now flash:/clienttemp.
The output shows that the working directory of the FTP client before execution of the ftp command is flash:/clienttemp.
ls
Syntax
ls [ remotefile [ localfile ] ]
View
FTP client view
Default level
3: Manage level
Parameters
remotefile: Filename or directory on the remote FTP server.
localfile: Name of a local file used to save the displayed information.
61
Description
Use the ls command to view the information of all the files and subdirectories in 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 to view the information of a specified file or subdirectory, and save the result to a local file specified by the localfile argument.
NOTE:
The ls command can only display the names of files and directories on the FTP server. The dir command can display other related information of the files and directories, such as the size and the date they were created.
Examples
# View the information of all files and subdirectories in the current directory of the FTP server.
[ftp] ls 227 Entering Passive Mode (192,168,1,50,17,165). 125 ASCII mode data connection already open, transfer starting for /*. ar-router.cfg logfile mainar.app arbasic.app ftp test bb.cfg testcfg.cfg 226 Transfer complete. FTP: 87 byte(s) received in 0.132 second(s) 659.00 byte(s)/sec.

mkdir

Syntax
View
# 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,1,46,4,3). 125 ASCII mode data connection already open, transfer starting for /logfile/*.
....226 Transfer complete.
FTP: 20 byte(s) received in 3.962 second(s), 5.00 byte(s)/sec.
# View the content of file aa.txt.
[ftp] quit <Sysname> more aa.txt . .. logfile.log
mkdir directory
FTP client view
62
Default level
3: Manage level
Parameters
directory: Name of the directory to be created.
Description
Use the mkdir command to create a subdirectory in the current directory on the remote FTP server.
You must have permissions on the FTP server.
Examples
# Create subdirectory mytest on the current directory of the remote FTP server.
[ftp] mkdir mytest 257 "/mytest" new directory created.

open

Syntax
open server-address [ service-port ]
View
FTP client view
Default level
3: Manage level
Parameters
server-address: IP address or host name of a remote FTP server.
service-port: Port number of the remote FTP server, in the range of 0 to 65535. The default value is 21.
Description
Use the open command to log in to the IPv4 FTP server under FTP client view.
At login, enter the username and password. If your input is correct, the login succeeds.
If you have logged in to the IPv4 FTP server, you cannot use the open command to log in to another server. To do so, you must disconnect from the current server first.
Related commands: close.
Examples
# In FTP client view, log in to the FTP server with the IP address of 192.168.1.50.
<Sysname> ftp [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.
63
[ftp]

open ipv6

Syntax
open ipv6 server-address [ service-port ] [ -i interface-type interface-number ]
View
FTP client view
Default level
3: Manage level
Parameters
server-address: IP address or host name of the remote FTP server.
service-port: Port number of the remote FTP server, in the range of 0 to 65535. The default value is 21.
-i interface-type interface-number: Specifies an output interface by its type and number. This parameter 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 the configuration of link local addresses, see Layer 3—IP Services Configuration Guide.
Description
Use the open ipv6 command to log in to the IPv6 FTP server in FTP client view.
At login, enter the username and password for accessing the FTP server. If your input is correct, the login succeeds.
Related commands: close.
Examples
# Log in to the FTP server (with IPv6 address 3000::200) in FTP client view.
<Sysname> ftp [ftp] open ipv6 3000::200 Trying 3000::200 ... Press CTRL+K to abort Connected to 3000::200. 220 Welcome! User(3000::200:(none)): MY_NAME 331 Please specify the password. Password: 230 Login successful.

passive

Syntax
View
passive
undo passive
FTP client view
64
Default level
3: Manage level
Parameters
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.
Data transmission modes fall into the passive mode and the active mode. In active mode, the FTP server initiates a data connection request. In passive mode, the FTP client initiates a data connection request. This command is mainly used in conjunction with a firewall to restrict FTP session establishment between private and public network users.
Examples
# Set the data transmission mode to passive.
[ftp] passive FTP: passive is on
put
Syntax
put localfile [ remotefile ]
View
FTP client view
Default level
3: Manage level
Parameters
localfile: Name of the local file to be uploaded.
remotefile: File name used after a file is uploaded and saved on the FTP server.
Description
Use the put command to upload a file on the client to the remote FTP server.
By default, if no name is assigned to the file to be saved on the FTP server, the name of the source file is used.
When a file is uploaded, it is saved in the user’s authorized directory, which can be set with the
authorization-attribute command on the remote server.
Examples
1. In standalone mode
# Upload source file vrpcfg.cfg on the active MPU to the remote FTP server and save it as ftpclient.cfg.
[ftp] put vrpcfg.cfg ftpclient.cfg 227 Entering Passive Mode (192,168,1,46,4,50). 125 ASCII mode data connection already open, transfer starting for /ftpclient.cfg.
65
226 Transfer complete. FTP: 1366 byte(s) sent in 0.064 second(s), 21.00Kbyte(s)/sec.
# Upload source file a.cfg on the standby MPU (in slot 1) to the remote FTP server and save it as ftpclienta.cfg.
[ftp] put slot1#flash:/a.cfg ftpclienta.cfg 227 Entering Passive Mode (192,168,1,46,4,52). 125 ASCII mode data connection already open, transfer starting for /ftpclienta.cfg. 226 Transfer complete. FTP: 1226 byte(s) sent in 0.065 second(s), 18.00Kbyte(s)/sec.
2. In IRF mode
# Upload source file a.cfg on a standby MPU of the IRF fabric (the ID of the IRF member switch where the standby MPU resides is 2, and the slot number of the standby MPU is 1) to the remote FTP server and save it as ftpclienta.cfg.
[ftp] put chassis2#slot1#flash:/a.cfg ftpclienta.cfg 227 Entering Passive Mode (192,168,1,46,4,52). 125 ASCII mode data connection already open, transfer starting for /ftpclienta.cfg. 226 Transfer complete. FTP: 1226 byte(s) sent in 0.065 second(s), 18.00Kbyte(s)/sec.
pwd
Syntax
pwd
View
FTP client view
Default level
3: Manage level
Parameters
None
Description
Use the pwd command to display the working directory on the remote FTP server.
Examples
# Display the working directory on the remote FTP server.
[ftp] cd servertemp [ftp] pwd 257 "/servertemp" is current directory.
The output shows that the servertemp folder under the root directory of the remote FTP server is being accessed by the user.

quit

Syntax
quit
66
View
FTP client view
Default level
3: Manage level
Parameters
None
Description
Use the quit command to disconnect the FTP client from the remote FTP server and exit to user view.
Examples
# Disconnect from the remote FTP server and exit to user view.
[ftp] quit 221 Server closing.
<Sysname>

remotehelp

Syntax
remotehelp [ protocol-command ]
View
FTP client view
Default level
3: Manage level
Parameters
protocol-command: FTP command.
Description
Use the remotehelp command to display the help information of FTP-related commands supported by the remote FTP server.
If no argument is specified, FTP-related commands supported by the remote FTP server are displayed.
Examples
# Display FTP commands supported by the remote FTP server.
[ftp] remotehelp 214-Here is a list of available ftp commands Those with '*' are not yet implemented. USER PASS ACCT* CWD CDUP SMNT* QUIT REIN* PORT PASV TYPE STRU* MODE* RETR STOR STOU* APPE* ALLO* REST* RNFR* RNTO* ABOR* DELE RMD MKD PWD LIST NLST SITE* SYST STAT* HELP NOOP* XCUP XCWD XMKD XPWD XRMD 214 Direct comments to HP company.
# Display the help information for the user command.
67
[ftp] remotehelp user 214 Syntax: USER <sp> <username>.
[ftp]
Table 7 Output description
Field Description
USER Username
PASS Password
CWD Change the current working directory
CDUP Change to parent directory
SMNT* File structure setting
QUIT Quit
REIN* Re-initialization
PORT Port number
PASV Passive mode
TYPE Request type
STRU* File structure
MODE* Transmission mode
RETR Download a file
STOR Upload a file
STOU* Store unique
APPE* Appended file
ALLO* Allocation space
REST* Restart
RNFR* Rename the source
RNTO* Rename the destination
ABOR* Abort the transmission
DELE Delete a file
RMD Delete a folder
MKD Create a folder
PWD Print working directory
LIST List files
NLST List file description
SITE* Locate a parameter
SYST Display system parameters
STAT* State
HELP Help
68
Field Description
NOOP* No operation
XCUP Extension command, the same meaning as CUP
XCWD Extension command, the same meaning as CWD
XMKD Extension command, the same meaning as MKD
XPWD Extension command, the same meaning as PWD
XRMD Extension command, the same meaning as RMD
Syntax: USER <sp> <username>.

rmdir

Syntax
rmdir directory
View
FTP client view
Default level
3: Manage level
Parameters
directory: Directory name on the remote FTP server.
Description
Use the rmdir command to remove a specified directory from the FTP server.
NOTE:
Only authorized users are allowed to use this command.
Syntax of the user command: user (keyword) + space + username
Examples

user

Syntax
View
Delete all files and subdirectories under a directory before you delete the directory. For how to delete
files, see the delete command.
When you execute the rmdir command, the files in the remote recycle bin in the directory will be
automatically deleted.
# Delete the temp1 directory from the authorized directory on the FTP server.
[ftp] rmdir /temp1 200 RMD command successful.
user username [ password ]
FTP client view
69
Default level
3: Manage level
Parameters
username: Login username.
password: Login password. You can input this argument a space after the username argument; or you
can input this argument when the “Password:” prompt appears after you input the username and then press Enter.
Description
Use the user command to relog in again to the FTP server with another username.
NOTE:
Before using this command, you must configure the corresponding username and password on the FTP server or the login will fail and the FTP connection will close.
Examples
# User ftp1 has logged in to the FTP server. Use username ftp2 to log in to the current FTP server. (Suppose username ftp2 and password 12 312 312 312 3 have been configured on the FTP server).
Method 1
[ftp] user ftp2 331 Password required for ftp2. Password: 230 User logged in.
[ftp]
Method 2
[ftp] user ftp2 123123123123 331 Password required for ftp. 230 User logged in.
[ftp]

verbose

Syntax
verbose
undo verbose
View
FTP client view
Default level
3: Manage level
Parameters
None
70
Description
Use the verbose command to enable display of detailed prompt information received from the server.
Use the undo verbose command to disable display of detailed prompt information.
By default, the display of detailed prompt information is enabled.
Examples
# Enable display of detailed prompt information.
[ftp] verbose FTP: verbose is on
# Disable display of detailed prompt information and perform a Get operation.
[ftp] undo verbose FTP: verbose is off
[ftp] get startup.cfg bb.cfg
FTP: 3608 byte(s) received in 0.052 second(s), 69.00K byte(s)/sec.
[ftp] # Enable display of detailed prompt information. and perform a Get operation. [ftp] verbose FTP: verbose is on
[ftp] get startup.cfg aa.cfg
227 Entering Passive Mode (192,168,1,46,5,85). 125 ASCII mode data connection already open, transfer starting for /startup.cfg. 226 Transfer complete. FTP: 3608 byte(s) received in 0.193 second(s), 18.00K byte(s)/sec.
71

TFTP client configuration commands

display tftp client configuration

Syntax
display tftp client configuration [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display tftp client configuration command to display source IP address configuration of the TFTP client.
Related commands: tftp client source.
Examples
# Display the source IP address configuration of the TFTP client.
<Sysname> display tftp client configuration The source IP address is 192.168.0.123
NOTE:
The display tftp client configuration command displays the source IP address configuration of the TFTP client. If the specified source IP address is active, this command displays the source IP address. If the specified source interface is active, this command displays the source interface.

tftp-server acl

Syntax
View
tftp-server [ ipv6 ] acl acl-number
undo tftp-server [ ipv6 ] acl
System view
72
Default level
3: Manage level
Parameters
ipv6: References an IPv6 ACL. If it is not specified, an IPv4 ACL is referenced.
acl-number: Number of a basic ACL, in the range of 2000 to 2999.
Description
Use the tftp-server acl command to control the device’s access to a specific TFTP server using an ACL.
Use the undo tftp-server acl command to restore the default.
By default, no ACL is used to control the device’s access to TFTP servers.
You can use an ACL to deny or permit the device’s access to a specific TFTP server.
For more information about ACL, see ACL and QoS Configuration Guide.
Examples
# Allow the device to access the TFTP server with the IP address of 1.1.1.1 only (in the IPv4 networking environment).
<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
# Allow the device to access the TFTP server with the IP address of 2001::1 only (in the IPv6 networking environment).
<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

tftp

Syntax
tftp server-address { get | put | sget } source-filename [ destination-filename ] [ vpn-instance vpn-instance-name ] [ source { interface interface-type interface-number | ip source-ip-address } ]
View
User view
Default level
3: Manage level
Parameters
server-address: IP address or host name of a TFTP server.
get: Downloads a file in normal mode.
put: Uploads a file.
sget: Downloads a file in secure mode.
73
source-filename: Source file name.
destination-filename: Destination file name.
vpn-instance vpn-instance-name: Specifies the MPLS L3 VPN where the TFTP server belongs. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters.
source: Configures parameters for source address binding.
interface interface-type interface-number: Specifies the source interface by its type and number. The
ip source-ip-address: Specifies the source IP address for the current TFTP client to transmit packets.
Description
Use the tftp command to download a specified file from the TFTP server to the local device or upload a specified local file to the TFTP server in an IPv4 network.
Examples
1. In standalone mode
# To upgrade the device, download the newest.app file from the TFTP server with the IP address of
192.168.1.26 and save it to both the root directory on the flash of the active MPU and the root directory on the flash of the standby MPU.
<Sysname> tftp 192.168.1.26 get newest.app startup.app . File will be transferred in binary mode
Downloading file from remote TFTP server, please wait..................
TFTP: 2737556 bytes received in 13 second(s) File downloaded successfully.
primary IP address configured on the source interface is the source IP address of the packets sent by TFTP. If no primary IP address is configured on the source interface, the transmission fails.
This source address must be an IP address that has been configured on the device.
// Download the file from the TFTP server to the root directory on the flash of the active MPU.
<Sysname> tftp 192.168.1.26 get newest.app slot1#flash:/startup.app
File will be transferred in binary mode Downloading file from remote TFTP server, please wait...| TFTP: 2737556 bytes received in 14 second(s) File downloaded successfully.
// Download the file from the TFTP server to the root directory on the flash of the standby MPU.
2. In IRF mode
# To upgrade the device, download the newest.app file from the TFTP server with the IP address of
192.168.1.26 and save it to both the root directory on the flash of the active MPU and a standby MPU (the ID of the IRF member switch where the standby MPU resides is 2, and the slot number of the standby MPU is 1) of the IRF fabric.
<Sysname> tftp 192.168.1.26 get newest.app startup.app . File will be transferred in binary mode
Downloading file from remote TFTP server, please wait..................
TFTP: 2737556 bytes received in 13 second(s) File downloaded successfully.
74
// Download the file from the TFTP server to the root directory on the flash of the active MPU of the IRF fabric.
<Sysname> tftp 192.168.1.26 get newest.app slot1#flash:/startup.app
File will be transferred in binary mode Downloading file from remote TFTP server, please wait...| TFTP: 2737556 bytes received in 14 second(s) File downloaded successfully.
// Download the file from the TFTP server to the root directory on the flash of the standby MPU of the IRF fabric.

tftp client source

Syntax
tftp client source { interface interface-type interface-number | ip source-ip-address }
undo tftp client source
View
System view
Default level
2: System level
Parameters
interface interface-type interface-number: Specifies the source interface for establishing TFTP
connections. The primary IP address of the source interface is used as the source IP address of packets sent to a TFTP server. If the source interface has no primary IP address specified, no TFTP connection can be established.
ip source-ip-address: Specifies the source IP address of packets sent to a TFTP server, which is one of the IP addresses configured on the device.
Description
Use the tftp client source command to specify the source IP address of packets sent to a TFTP server.
Use the undo tftp client source command to restore the default.
By default, the source IP address is the IP address of the output interface of the route to the server is used as the source IP address..
If you use the tftp client source command to first configure a source interface and then a source IP address, the source IP address overwrites the source interface, and vice versa.
If you first use the tftp client source command to specify a source IP address and then use the tftp command to specify another source IP address, the latter is used.
Examples
The source IP address specified with the tftp client source command applies to all TFTP connections while the one specified with the tftp command applies to the current TFTP connection only.
Related commands: display tftp client configuration.
# Specify the source IP address of packets sent to a TFTP server as 2.2.2.2.
<Sysname> system-view
75
[Sysname] tftp client source ip 2.2.2.2
# Specify the IP address of interface VLAN-interface 1 as the source IP address of packets sent to a TFTP server.
<Sysname> system-view [Sysname] tftp client source interface vlan-interface 1

tftp ipv6

Syntax
tftp ipv6 tftp-ipv6-server [ -i interface-type interface-number ] { get | put } source-filename [ destination-filename ] [ vpn-instance vpn-instance-name ]
View
User view
Default level
3: Manage level
Parameters
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 an output interface by its type and number. This parameter 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 the configuration of a link local address, see IPv6 basics configuration in the Layer 3—IP Services Configuration Guide.
get: Downloads a file.
put: Uploads a file.
source-file: Source filename.
destination-file: Destination filename. If it is not specified, this filename is the same as the source
filename.
vpn-instance vpn-instance-name: Specifies the MPLS L3 VPN that the TFTP server belongs to. The vpn-instance-name argument is a case-sensitive string of 1 to 31 characters.
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 in an IPv6 network.
Examples
# Download filetoget.txt from the TFTP server.
<Sysname> tftp ipv6 fe80::250:daff:fe91:e058 -i Vlan-interface 1 get filetoget.txt ... File will be transferred in binary mode
Downloading file from remote TFTP server, please wait....
TFTP: 411100 bytes received in 2 second(s) File downloaded successfully.
76

File management commands

NOTE:
In the following examples, the current working directory
For the qualified filename formats, see
cd
Syntax
cd { directory | .. | / }
View
User view
Default level
3: Manage level
Parameters
directory: Name of the target directory, in the format of [drive:/]path. For the detailed introduction to the drive and path arguments, see Fundamentals Configuration Guide. If no drive information is provided, the argument represents a folder or subfolder in the current directory.
..: Returns to an upper directory. If the current working directory is the root directory, or if no upper directory exists, the current working directory does not change when the cd .. command is executed. This argument does not support command online help.
the device.
is the root directory of the storage medium on
Fundamentals Configuration Guide
.
/: Returns to the root directory of the storage medium. This keyword does not support command line online help.
Description
Use the cd command to change the current working directory.
Examples
# Enter the test folder after logging in to the device.
<Sysname> cd test
# Return to the upper directory (Remember to enter a space after the keyword cd).
<Sysname> cd ..
# Return to the root directory.
<Sysname> cd /
After you change the current directory using the cd command, you can use the pwd command to view the path of the current working directory.
1. In standalone mode
# Enter the root directory of the flash on the standby MPU.
Display the slot number where the standby MPU resides.
77
<Sysname> display device Slot No. Brd Type Brd Status Subslot Num Sft Ver Patch Ver 0 LSQ1SRP1CB Master 0 A7500-6626 None 1 LSQ1SRP1CB Slave 0 A7500-6626 None 2 LSQ1GP48EB Normal 0 A7500-6626 None 3 LSQ1GV48SC Normal 0 A7500-6626 None 4 NONE Absent 0 NONE None
// The output shows that the slot number of the standby MPU is 1.
Enter the root directory of the flash on the standby MPU.
<Sysname> cd slot1#flash:/
# Change the current directory from the standby MPU to the test folder in the root directory of the active MPU.
<Sysname> cd flash:/test
2. In IRF mode
Display the member IDs and slot numbers of the member switches where the active MPU of the IRF fabric (the active MPU on the master) and the standby MPUs of the IRF fabric (including all the MPUs except the active MPU on the master) reside.
<Sysname> display irf Switch Slot Role Priority CPU-Mac 1 0 Slave 20 00e0-fc0f-8c0f 1 1 Slave 20 00e0-fc0f-8c1f *+2 0 Master 20 00e0-fc0f-8c22 2 1 Slave 20 00e0-fc0f-8c32
-------------------------------------------------­ * indicates the device is the master. + indicates the device through which the user logs in. The Bridge MAC of the IRF is: 00e0-fc00-0a00 Auto upgrade : yes Mac persistent : 6 min

copy

Syntax
View
// The output shows that MPU 0 on member switch 2 is the active MPU of the IRF fabric, and MPUs 0 and 1 on member switch 1 and MPU 1 on member switch 2 are the standby MPUs of the IRF fabric.
# Enter the test folder of the root directory of the flash on the active MPU of the IRF fabric.
<Sysname> cd flash:/test
# Enter the root directory of the flash on a standby MPU (the member ID and slot number of the member switch where the standby MPU resides are both 1) of the IRF fabric.
<Sysname> cd chassis1#slot1#flash:/
# Change the current directory to the test folder in the root directory of the active MPU of the IRF fabric.
<Sysname> cd flash:/
copy fileurl-source fileurl-dest
User view
78
Default level
3: Manage level
Parameters
fileurl-source: Name of the source file.
fileurl-dest: Name of the target file or folder.
Description
Use the copy command to copy a file.
If you specify a target folder, the system will copy the file to the specified folder and use the name of the source file as the file name.
Examples
# Copy file testcfg.cfg in the current folder and save it as testbackup.cfg.
<Sysname> copy testcfg.cfg testbackup.cfg Copy flash:/test.cfg to flash:/testbackup.cfg?[Y/N]:y
....
%Copy file flash:/test.cfg to flash:/testbackup.cfg...Done.
1. In standalone mode
# Copy the configuration file of the active MPU to the root directory of the standby MPU.
<Sysname> copy vrcfg.cfg slot1#flash:/ Copy flash:/vrcfg.cfg to slot1#flash:/vrcfg.cfg?[Y/N]:y
%Copy file flash:/vrcfg.cfg to slot1#flash:/vrcfg.cfg...Done.
2. In IRF mode
# Copy the configuration file of the active MPU of the IRF fabric to the root directory of a standby MPU (the member ID and the slot number of the member switch where the standby MPU resides are both 1) of the IRF fabric.
<Sysname> copy vrcfg.cfg chassis1#slot1#flash:/ Copy flash:/vrcfg.cfg to chassis1#slot1#flash:/vrcfg.cfg?[Y/N]:y
%Copy file flash:/vrcfg.cfg to chassis1#slot1#flash:/vrcfg.cfg...Done.
# Copy the configuration file of a standby MPU (the member ID and the slot number of the member switch where the standby MPU resides are both 1) of the IRF fabric to the root directory of another standby MPU (the member ID and the slot number of the member switch where the standby MPU resides are 2 and 1 respectively).
<Sysname> copy chassis1#slot1#flash:/vrcfg.cfg chassis2#slot1#flash:/ Copy flash:/vrcfg.cfg to chassis1#slot1#flash:/vrcfg.cfg?[Y/N]:y
%Copy file chassis1#slot1#flash:/vrcfg.cfg to chassis2#slot1#flash:/vrcfg.cfg...Done.

delete

Syntax
delete [ /unreserved ] file-url
79
View
User view
Default level
3: Manage level
Parameters
/unreserved: Permanently deletes the specified file, and the deleted file can never be restored.
file-url: Name of the file to be deleted. Asterisks (*) are acceptable as wildcards. For example, to remove files with the extension of .txt in the current directory, you may use the delete *.txt command.
Description
Use the delete file-url command to temporarily delete a file. The deleted file is saved in the recycle bin. To restore it, use the undelete command.
Use the dir /all command to display the files deleted from the directory and moved to the recycle bin. These files are enclosed in pairs of brackets [ ].
Use the reset recycle-bin command to remove the files from the recycle bin.
Use the delete /unreserved file-url command to permanently delete a file, and the deleted file cannot be restored. Use it with caution.
Examples
CAUTION:
If you delete two files with the same filename in different directories, only the last one is retained in the recycle bin.
1. In standalone mode
# Remove file tt.cfg from the root directory of the storage medium on the active MPU.
<Sysname> delete tt.cfg Delete flash:/tt.cfg? [Y/N]:y
%Delete file flash:/tt.cfg...Done.
# Remove file tt.cfg from the root directory of the storage medium on the standby MPU (in slot 1).
Approach 1
<Sysname> delete slot1#flash:/tt.cfg Delete slot1#flash:/hmr.cfg?[Y/N]:y
%Delete file slot1#flash:/tt.cfg...Done.
Approach 2
<Sysname> cd slot1#flash:/ <Sysname> delete tt.cfg Delete slot1#flash:/tt.cfg?[Y/N]:y %Delete file slot1#flash:/tt.cfg...Done.
2. In IRF mode
# Remove file tt.cfg from the root directory of the storage medium on the active MPU of the IRF fabric.
<Sysname> delete tt.cfg .
80
dir
Syntax
Delete flash:/tt.cfg?[Y/N]:y . %Delete file flash:/tt.cfg...Done.
# Remove file tt.cfg from the root directory of the storage medium on a standby MPU of the IRF fabric (the member ID and slot number of the member switch where the standby MPU resides are both 1).
Approach 1
<Sysname> delete chassis1#slot1#flash:/tt.cfg Delete chassis1#slot1#flash:/tt.cfg?[Y/N]:y %Delete file chassis1#slot1#flash:/tt.cfg...Done.
Approach 2
<Sysname> cd chassis1#slot1#flash:/ <Sysname> delete tt.cfg Delete chassis1#slot1#flash:/tt.cfg?[Y/N]:y %Delete file chassis1#slot1#flash:/tt.cfg...Done.
dir [ /all ] [ file-url | /all-filesystems ]
View
User view
Default level
3: Manage level
Parameters
/all: Displays all files and folders in the current directory, including hidden files, hidden folders, files
moved from the current directory to the recycle bin. Files in the recycle bin are enclosed in square brackets [ ].
file-url: Displays the specified file. Asterisks (*) are acceptable as wildcards. For example, to display files with the .txt extension in the current directory, you may use the dir *.txt command.
/all-filesystems: Displays files and folders in the root directory of all storage media on the device.
Description
Use the dir command to display files or folders.
If no parameter is specified, the command displays all visible files and folders in the current directory.
Examples
1. In standalone mode
# Display information about all files and folders in the storage medium of the active MPU. (The output depends on your switch model.)
<Sysname> dir /all Directory of flash:/
0 -rwh 716 Nov 19 2010 11:06:43 hostkey 1 -rwh 4744 Mar 31 2011 11:19:16 private-data.txt 2 -rw- 8198 Nov 19 2010 11:37:13 startup.cfg
81
3 -rwh 4 Apr 02 2011 07:52:40 snmpboots 4 -rwh 572 Nov 19 2010 11:06:50 serverkey 5 -rwh 864024 Jan 05 2010 16:12:09 io_mon.txt 6 -rw- 7228 Mar 31 2011 11:19:33 song.cfg 7 -rw- 151 Mar 31 2011 11:19:27 system.xml 8 drw- - May 05 2010 15:23:04 seclog 9 -rw- 438156 Jun 12 2010 09:17:31 empua1.btw 10 -rw- 27695177 Mar 22 2011 14:56:46 main.app 11 -rwh 548 Nov 19 2010 11:07:03 dsakey 12 drw- - Sep 03 2010 11:06:09 patch6613 13 -rw- 429516 Aug 20 2010 09:42:41 mpu.btw 14 -rw- 7228 Jan 06 2011 16:27:46 songg.cfg 15 -rw- 851984 Jun 13 2010 09:48:30 startup.app 16 -rw- 490 Sep 07 2010 15:37:22 patchstate 17 drw- - Sep 03 2010 14:10:54 patch6606 18 -rw- 28469537 Mar 31 2011 12:41:25 backup.app
64389 KB total (6965 KB free)
# Display files and folders in the root directory of all storage media on the device. (The output depends on your switch model.)
<Sysname> dir /all-filesystems Directory of flash:/
0 -rw- 8198 Nov 19 2010 11:37:13 startup.cfg 1 -rw- 7228 Mar 31 2011 11:19:33 song.cfg 2 -rw- 151 Mar 31 2011 11:19:27 system.xml 3 drw- - May 05 2010 15:23:04 seclog 4 -rw- 438156 Jun 12 2010 09:17:31 empua1.btw 5 -rw- 27695177 Mar 22 2011 14:56:46 main.app 6 drw- - Sep 03 2010 11:06:09 patch6613 7 -rw- 429516 Aug 20 2010 09:42:41 mpu.btw 8 -rw- 7228 Jan 06 2011 16:27:46 songg.cfg 9 -rw- 851984 Jun 13 2010 09:48:30 startup.app 10 -rw- 490 Sep 07 2010 15:37:22 patchstate 11 drw- - Sep 03 2010 14:10:54 patch6606 12 -rw- 28469537 Mar 31 2011 12:41:25 backup.app
64389 KB total (6965 KB free)
# Display information about all files and folders in the storage medium of the standby MPU (in slot 1).
<Sysname> cd slot1#flash:/ <Sysname> dir /all Directory of slot1#flash:/
0 -rwh 716 Nov 19 2010 11:06:43 hostkey 1 -rwh 4744 Mar 31 2011 11:19:16 private-data.txt 2 -rw- 8198 Nov 19 2010 11:37:13 startup.cfg 3 -rwh 4 Apr 02 2011 07:52:40 snmpboots 4 -rwh 572 Nov 19 2010 11:06:50 serverkey
82
5 -rwh 864024 Jan 05 2010 16:12:09 io_mon.txt 6 -rw- 7228 Mar 31 2011 11:19:33 song.cfg 7 -rw- 151 Mar 31 2011 11:19:27 system.xml 8 drw- - May 05 2010 15:23:04 seclog 9 -rw- 438156 Jun 12 2010 09:17:31 empua1.btw 10 -rw- 27695177 Mar 22 2011 14:56:46 main.app 11 -rwh 548 Nov 19 2010 11:07:03 dsakey 12 drw- - Sep 03 2010 11:06:09 patch6613 13 -rw- 429516 Aug 20 2010 09:42:41 mpu.btw 14 -rw- 7228 Jan 06 2011 16:27:46 songg.cfg 15 -rw- 851984 Jun 13 2010 09:48:30 startup.app 16 -rw- 490 Sep 07 2010 15:37:22 patchstate 17 drw- - Sep 03 2010 14:10:54 patch6606
64389 KB total (36015 KB free)
2. In IRF mode
# Display information about all files and folders in the storage medium of the active MPU of the IRF fabric. (The output depends on your switch model.)
<Sysname> dir /all Directory of flash:/
0 -rwh 4 Apr 26 2011 12:02:05 snmpboots 1 -rw- 10187730 Apr 26 2011 16:47:07 startup.app 2 -rwh 3144 Apr 26 2011 13:45:35 private-data.txt 3 -rw- 2161 Apr 26 2011 13:53:25 startup.cfg 4 -rw- 10058752 Sep 19 2011 17:41:46 startup_b.app 5 -rw- 10139143 Apr 26 2011 13:08:20 startup_backup.app 6 -rwh 716 Apr 26 2011 12:01:58 hostkey 7 -rwh 572 Apr 26 2011 12:02:11 serverkey 8 -rwh 548 Apr 26 2011 12:02:17 dsakey 9 -rw- 3035 Apr 26 2011 13:45:42 new-config.cfg 10 -rw- 2200 Apr 26 2011 14:58:35 [aa.cfg]
64389 KB total (11801 KB free)
# Display files and folders in the root directory of all storage media on the IRF fabric. (The output depends on your switch model.)
<Sysname> dir /all-filesystems Directory of flash:/
0 -rw- 1520300 Dec 01 2010 11:37:47 cmdtree.txt 1 drw- - Dec 01 2010 11:37:41 logfile 2 drw- - Dec 01 2010 15:07:15 diaglog 3 drw- - Dec 01 2010 15:07:15 seclog 4 drw- - Dec 03 2010 09:48:05 secl 5 -rw- 909 Dec 03 2010 09:48:38 secl.log 6 -rw- 302515 Dec 09 2010 15:18:09 default.diag
64389 KB total (12103 KB free)
83
Directory of chassis1#slot1#flash:/
0 -rw- 1520300 Dec 01 2010 11:37:47 cmdtree.txt 1 drw- - Dec 01 2010 11:37:41 logfile 2 drw- - Dec 01 2010 15:07:15 diaglog 3 drw- - Dec 01 2010 15:07:15 seclog 4 drw- - Dec 03 2010 09:48:05 secl 5 -rw- 909 Dec 03 2010 09:48:38 secl.log 6 -rw- 302515 Dec 09 2010 15:18:09 default.diag
64389 KB total (11963 KB free)
# Display information about all files and folders in the storage medium of a standby MPU of the IRF fabric (the member ID and the slot number of the member switch where the standby MPU resides are both 1).
Method 1
<Sysname> dir chassis1#slot1#flash:/ Directory of chassis1#slot1#flash:/
0 -rwh 3144 Apr 26 2011 13:45:28 private-data.txt 1 -rw- 2341 Apr 26 2011 16:36:18 startup.cfg 2 -rw- 124 Apr 26 2011 12:00:22 patchstate 3 -rwh 716 Apr 26 2011 14:31:36 hostkey 4 -rwh 4 Apr 26 2011 14:31:41 snmpboots 5 -rw- 10187730 Apr 26 2011 12:01:10 startup.app 6 -rwh 572 Apr 26 2011 14:31:47 serverkey 7 -rwh 548 Apr 26 2011 14:31:52 dsakey 8 -rw- 3035 Apr 26 2011 13:45:36 new-config.cfg 9 drw- - Apr 26 2011 12:11:53 oldver
64389 KB total (11839 KB free)
Method 2
<Sysname> cd chassis1#slot1#flash:/ <Sysname> dir /all Directory of chassis1#slot1#flash:/
0 -rwh 3144 Apr 26 2011 13:45:28 private-data.txt 1 -rw- 2341 Apr 26 2011 16:36:18 startup.cfg 2 -rw- 124 Apr 26 2011 12:00:22 patchstate 3 -rwh 716 Apr 26 2011 14:31:36 hostkey 4 -rwh 4 Apr 26 2011 14:31:41 snmpboots 5 -rw- 10187730 Apr 26 2011 12:01:10 startup.app 6 -rwh 572 Apr 26 2011 14:31:47 serverkey 7 -rwh 548 Apr 26 2011 14:31:52 dsakey 8 -rw- 3035 Apr 26 2011 13:45:36 new-config.cfg 9 drw- - Apr 26 2011 12:11:53 oldver
64389 KB total (11839 KB free)
84
Table 8 Output description
Field Description
Directory of The current working directory
d Indicates a directory. If this field does not exist, it indicates a file.
r Indicates that the file or directory is readable.
w Indicates that the file or directory is writable.
h Indicates that the file or directory is hidden.
[ ] Indicates that the file is in the recycle bin.

execute

Syntax
execute filename
View
System view
Default level
2: System level
Parameters
filename: Name of a batch file with a .bat extension. You can use the rename command to change the suffix of the configuration file to .bat to use it as a batch file.
Description
Examples
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.
Do 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 command will fail to be executed, and the system omits this command and goes to the next one.
The configuration generated after a batch file is executed will not be backed up to the standby MPU automatically.
Each configuration command in a batch file must be a standard configuration command, meaning that the valid configuration information can be displayed with the display current-configuration command.
# Execute the batch file test.bat in the root directory.
<Sysname> system-view [Sysname] execute test.bat
85

file prompt

Syntax
file prompt { alert | quiet }
View
System view
Default level
3: Manage level
Parameters
alert: Enables the system to warn you about operations that may bring undesirable results, including file
corruption or data loss.
quiet: Disables the system from warning 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, which is recommended to avoid mis-operations.
When the prompt mode is set to quiet, the system does not warn for any file operation.
Examples
# Set the file operation prompt mode to alert.
<Sysname> system-view [Sysname] file prompt alert

fixdisk

Syntax
fixdisk device
View
User view
Default level
3: Manage level
Parameters
device: Storage medium name.
Description
Use the fixdisk command to restore the space of a storage medium when it becomes unavailable because of an abnormal operation.
Examples
# Restore the space of the flash.
<Sysname> fixdisk flash: Fixdisk flash: may take some time to complete... %Fixdisk flash: completed.
86

format

Syntax
format device [ FAT16 | FAT32 ]
View
User view
Default level
3: Manage level
Parameters
device: Name of a storage medium (for example Flash).
FAT16: Formats a storage medium using the FAT16 format. FAT16 does not support Tab matching but needs to be input completely if used, and is not applicable to Flash.
FAT32: Formats a storage medium using the FAT32 format. FAT32 does not support Tab matching but needs to be input completely if used, and is not applicable to Flash.
Description
Use the format command to format a storage medium.
CAUTION:
Formatting a storage medium results in loss of all the files on the storage medium and these files cannot be restored. In particular, if a startup configuration file exists on a storage medium, formatting the storage medium results in loss of the startup configuration file.
Examples
# Format the flash.
<Sysname> format flash: All data on flash: will be lost, proceed with format? [Y/N]:y ./ %Format flash: completed.

mkdir

Syntax
mkdir directory
View
User view
Default level
3: Manage level
Parameters
directory: Name of a folder.
Description
Use the mkdir command to create a folder under a specified directory on the storage medium.
87
Examples
The name of the folder to be created must be unique in the specified directory. Otherwise, you will fail to create the folder in the directory.
To use this command to create a folder, the specified directory must exist. For example, to create folder flash:/test/mytest, the test folder must exist. Otherwise, you will fail to create the mytest folder.
# Create a folder named test in the current directory.
<Sysname> mkdir test
....
%Created dir flash:/test
# Create folder test/subtest in the current directory.
<Sysname> mkdir test/subtest
....
%Created dir flash:/test/subtest
1. In standalone mode
# Create folder test on the standby MPU (in slot 1).
<Sysname> mkdir slot1#flash:/test
....
%Created dir slot1#flash:/test.
2. In IRF mode
# Create folder test on the active MPU of the IRF fabric.
<Sysname> mkdir test
....
%Created dir flash:/test1.
# Create folder test on a standby MPU (the member ID and slot number of the member switch where the standby MPU resides are 2 and 1 respectively) of the IRF fabric.
<Sysname> mkdir chassis2#slot1#flash:/test
....
%Created dir chassis2#slot1#flash:/test.

more

Syntax
more file-url
View
User view
Default level
3: Manage level
Parameters
file-url: File name.
Description
Use the more command to display the contents of the specified file. It indicates that there are more lines than the screen can display.
Pressing Enter displays the next line.
88
Examples
Pressing Space displays the next screen.
Pressing Ctrl+C or any other key exits the display.
This command is valid only for text files.
# Display the contents of file test.txt.
<Sysname> more test.txt Welcome to HP.
# Display the contents of file testcfg.cfg.
<Sysname> more testcfg.cfg
# version 5.20, Beta 1201, Standard # sysname Sysname # vlan 2 # return <Sysname>
1. In standalone mode
# Display the contents of file testcfg.cfg on the standby MPU.
<Sysname> more slot1#flash:/testcfg.cfg
# version 5.20, Release 0000 # sysname Test #
---- More ----
2. In IRF mode
# Display the contents of file testcfg.cfg on the active MPU of the IRF fabric.
<Sysname> more testcfg.cfg
# version 5.20, Release 0000 # sysname Sysname #
---- More ----
# Display the contents of file testcfg.cfg on a standby MPU (the member ID and slot number of the member switch where the standby MPU resides are 2 and 1 respectively) of the IRF fabric.
<Sysname> more chassis2#slot1#flash:/testcfg.cfg
# version 5.20, Release 0000
89
# sysname Sysname #
---- More ----

mount

Syntax
mount device
View
User view
Default level
3: Manage level
Parameters
device: Name of a storage medium (for example flash or cf).
Description
Use the mount command to mount a hot swappable storage medium, such as a CF card (excluding flash). This command is effective only when the device is in unmounted state.
Examples
By default, a storage medium is automatically mounted and in the mounted state after connected to the device, which means you can use it without mounting it.
Do not remove the storage medium or swap a card when mounting or unmounting the device, or when you are processing files on the storage medium. Otherwise, the file system could be damaged.
When a storage medium is connected to a lower version system, the system may not be able to recognize the device automatically, and you need to use the mount command for the storage medium to function normally.
Before removing a mounted storage medium from the system, you should first unmount it to avoid damaging the device.
Related commands: umount.
1. In standalone mode
# Mount a CF card of the active MPU.
<Sysname> mount cf: % Mount cf: successfully. %Apr 23 01:50:00:628 2011 Sysname VFS/4/LOG: cf: mounted into slot 4.
# Mount a CF card of the standby MPU (in slot 1).
<Sysname> mount slot1#cf: % Mount slot1#cf: successfully. %Apr 23 01:50:00:628 2011 Sysname VFS/5/LOG: cf: mounted into slot 1.
2. In IRF mode
# Mount a CF card of the master.
90
<Sysname> mount cf: % Mount cf: successfully. %Apr 23 01:50:00:628 2011 Sysname VFS/4/LOG: cf: mounted into chassis 1 slot 4.
# Mount a CF card of a slave (with the member ID 2 and the local active MPU slot number 1).
<Sysname> mount chassis2#slot1#cf: % Mount chassis2#slot1#cf: successfully. %Apr 23 01:50:00:628 2011 Sysname VFS/5/LOG: cf: mounted into chassis 2 slot 1.

move

Syntax
move fileurl-source fileurl-dest
View
User view
Default level
3: Manage level
Parameters
fileurl-source: Name of the source file.
fileurl-dest: Name of the target file or folder.
Description
Use the move command to move a file.
If you specify a target folder, the system will move the source file to the specified folder, with the file name unchanged.
You cannot move files between storage media of different types.
Examples
# Move file flash:/test/sample.txt to flash:/, and save it as 1.txt.
<Sysname> move test/sample.txt 1.txt Move flash:/test/sample.txt to flash:/1.txt?[Y/N]:y ... % Moved file flash:/test/sample.txt to flash:/1.txt
# Move file b.cfg to the subfolder test2.
<Sysname> move b.cfg test2 Move flash:/b.cfg to flash:/test2/b.cfg?[Y/N]:y . %Moved file flash:/b.cfg to flash:/test2/b.cfg.
pwd
Syntax
pwd
91
View
User view
Default level
3: Manage level
Parameters
None
Description
Use the pwd command to display the current path.
Examples
# Display the current path.
<Sysname> pwd flash:

rename

Syntax
rename fileurl-source fileurl-dest
View
User view
Default level
3: Manage level
Parameters
fileurl-source: Name of the source file or folder.
fileurl-dest: Name of the target file or folder.
Description
Use the rename command to rename a file or folder. The target file name must be unique in the current path.
Examples
# Rename file sample.txt as sample.bat.
<Sysname> rename sample.txt sample.bat Rename flash:/sample.txt to flash:/sample.bat? [Y/N]:y
% Renamed file flash:/sample.txt to flash:/sample.bat

reset recycle-bin

Syntax
View
reset recycle-bin [ /force ]
User view
92
Default level
3: Manage level
Parameters
/force: Deletes all files in the recycle bin, including files that cannot be deleted by the command without the /force keyword.
Description
Use the reset recycle-bin command to permanently delete the files in the recycle bin in the current directory.
If a file is corrupted, you may not be able to delete the file using the reset recycle-bin command. Use the reset recycle-bin /force command to delete the corrupted file in the recycle bin forcibly.
The delete file-url command only moves a file to the recycle bin. To permanently delete the file in the recycle bin, use the reset recycle-bin command in the original directory of the file.
The reset recycle-bin command deletes files in the current directory and in the recycle bin. If the original path of the file to be deleted is not the current directory, use the cd command to enter the original directory of the file, and then execute the reset recycle-bin command.
Examples
# Delete file b.cfg in the current directory and in the recycle bin.
Display all the files in the recycle bin and in the current directory.
<Sysname> dir /all Directory of flash:/
0 -rwh 3080 Apr 26 2011 16:41:43 private-data.txt 1 -rw- 2416 Apr 26 2011 13:45:36 config.cfg 2 -rw- 8036197 May 14 2011 10:13:18 main.app 3 -rw- 2386 Apr 26 2011 13:30:30 back.cfg 4 drw- - May 08 2011 09:49:25 test 5 -rwh 716 Apr 24 2011 16:17:30 hostkey 6 -rwh 572 Apr 24 2011 16:17:44 serverkey 7 -rw- 2386 May 08 2011 11:14:20 [a.cfg] 8 -rw- 3608 Dec 03 2011 17:29:30 [b.cfg]
64389 KB total (16730 KB free)
//The output shows that the current directory is flash:, and there are two files a.cfg and b.cfg in the recycle bin.
Delete file b.cfg in the current directory and in the recycle bin.
<Sysname> reset recycle-bin Clear flash:/~/a.cfg ?[Y/N]:n Clear flash:/~/b.cfg ?[Y/N]:y Clearing files from flash may take a long time. Please wait...
......
%Cleared file flash:/~/b.cfg...
In directory flash:, check whether the file b.cfg in the recycle bin is deleted.
<Sysname> dir /all
93
Loading...