01-03 Basic Configurations Commands
01-03 Basic Configurations Commands
Switches
Command Reference 3 Basic Configurations Commands
Format
abort trial [ session session-id ]
Parameters
Parameter Description Value
session session-id Specifies the ID of a session for which the trial running -
of the configuration is to be disabled.
Views
All views (excluding the user view)
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Prerequisites
Configuration Impact
After the trial running of the configuration is disabled, the system configuration
rolls back to the configuration state before the trial running.
Precautions
The abort trial command must be run in the two-phase configuration validation
mode.
Example
# Disable the trial running of a configuration.
<HUAWEI> system-view
[~HUAWEI] sysname rollback
[*HUAWEI] commit trial 120
Info: The system enters the trial configuration mode.
The system will revert to previous configuration if the trial configuration is not confirmed in 120 seconds.
[~rollback] abort trial
Warning: The trial configuration will be rolled back. Continue? [Y/N]:y
Info: The trial configuration rollback succeeded.
[~HUAWEI]
3.1.2 alias
Function
The alias command creates an alias for a command.
Format
alias alias-string [ parameter parameter & <1-32> ] command command
Parameters
Parameter Description Value
Views
Command alias view
Level
3: Management level
cli write
Usage Guidelines
Usage Scenario
Precautions
Example
# Create an alias for a command.
<HUAWEI> system-view
[~HUAWEI] command alias
[*HUAWEI-cmdalias] alias show command display
Function
The clear configuration candidate command clears an uncommitted
configuration.
Format
clear configuration candidate
Parameters
None
Views
All views except the user view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
This command clears a configuration that has not been committed in the two-
stage mode.
Prerequisites
Precautions
Example
# Clear the configuration that has not been committed.
<HUAWEI> system-view
[~HUAWEI] clear configuration candidate
The undo command alias command deletes all alias configured on the device.
Format
command alias
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To enter the command alias view, run the command alias command.
The alias command can be used in the following scenarios:
● Configure an easy-to-remember string of characters as the alias for a
command. Then, you can just enter the alias string when you need to run the
command. For example, define the alias for display as show. You can enter
the alias show to substitute display.
● Change the order of parameters. For example, after you configure the alias
showif parameter $ifnum $iftype command "display interface $iftype
$ifnum" command, you can enter showif 1 Eth-Trunk to substitute display
interface Eth-Trunk 1.
Precautions
The undo command alias command deletes all alias configured on the device as
well as the command alias view.
Follow-up Procedure
Run the alias command to configure an alias for a command.
Example
# Enter the command alias view.
<HUAWEI> system-view
[~HUAWEI] command alias
[~HUAWEI-cmdalias]
Format
command-privilege level level view view-name command-key
undo command-privilege [ level level ] view view-name command-key
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The system divides commands into four levels and sets the command level in the
specified view. The device administrator can change the command level as
required, so that a lower-level user can use some high-level commands. The device
administrator can also change the command level to a larger value to improve
device security.
A login user can configure commands according to the configured privilege
corresponding to the user name (through the user privilege level command).
The command lines are classified into visit level (0), monitoring level (1),
configuration level (2), and management level (3) in an ascending order without
command-privilege level rearrange.
Precautions
You are not advised to change the default command level. If you need to change
it, consult with professional personnel to ensure that routine operation and
maintenance are not affected and security risk is avoided.
The command-key parameter specifies the command of which the level is to be
changed. The view view-name parameter specifies the view to which the
command belongs. The command matching rule is prefix-based matching. For
example, the command-privilege level 2 view shell display interface command
changes the level of all commands starting with display interface in the user view
to level 2.
In versions earlier than V100R006C00, the user level ranges from 0 to 15. If the
system software is upgraded to V100R006C00 or a later version, and the
command-privilege level command is not configured, the levels of level-0 and
level-1 users remain unchanged, and those of level-3 to level-15 users change to
3.
Example
# Set the privilege level of the save command to 5.
<HUAWEI> system-view
[~HUAWEI] command-privilege level 5 view shell save
Format
command-privilege level rearrange
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a command registers on the device, it is assigned with a default level–0,
level–1, level–2, or level–3, corresponding to the visit level, monitoring level,
configuration level, and management level respectively. You can run the
command-privilege level rearrange command to upgrade all the level-2 and
level-3 commands to level-10 and level-15 commands in batches. The levels of
level-0 and level-1 commands remain unchanged. Changing the command-
privilege level rearrange command configuration affects the value of level in the
user privilege, command-privilege level, adminuser-priority, and local-user
level commands. The command level and user level increase accordingly. For
details, see the "Parameters" table in the corresponding sections.
Precautions
● The command-privilege level command has a higher priority than the
command-privilege level rearrange command as follows:
– During batch command level upgrade, the levels of commands that are
separately changed using the command-privilege level command
remain unchanged.
– You can only restore the levels of the commands that are upgraded in
batches. The levels of commands that are separately changed using the
command-privilege level command remain unchanged.
● Before running the command-privilege level rearrange or undo command-
privilege level rearrange command, ensure that your level is the highest
(level 3 or 15); otherwise, you cannot run the command. For an AAA
authentication user, you can run the display aaa access-user self command
and view the User level field to check the user's level.
● After the levels of the commands are upgraded in batches and before the
levels of the commands are restored, the operation of upgrading the levels of
the commands is invalid and does not change the status of the commands.
Example
# Change the levels of the current commands in batches.
<HUAWEI> system-view
[~HUAWEI] command-privilege level rearrange
3.1.7 commit
Function
The commit command commits a configuration and generates a configuration
rollback point.
Format
commit [ trial [ time ] ] [ label label ] [ description description ]
Parameters
Parameter Description Value
label label Specifies the user label of The value is a string of 1 to 256
a configuration rollback case-sensitive characters without
point. spaces. It must start with a letter
and cannot be a hyphen (-).
Views
All views (excluding the user view)
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If you want to add descriptions about configuration rollback, run the commit
description description command in two-stage mode. Run the display
configuration commit list verbose command to view the descriptions.
To enable the trial running of a configuration, run the trial command. This
configuration enables the trial running of new functions and services without
interrupting the services running on the live network, which improves network
reliability. The time parameter specifies the timeout period for the trial running of
a configuration. When the trial running time expires, the configuration that has
been run in trial rolls back automatically. The system configuration restores to the
configuration status before the configuration is committed. To validate the
configuration that has been run in trial, reconfigure the function and commit the
configuration.
NOTE
During the trial running of a configuration, other users cannot perform any configuration
on the device, and if the local user performs an operation and runs the commit command
to commit the configuration, the configuration in trial running is also committed and the
system exits from the trial running status and enters the normal configuration mode.
You can run the display configuration trial status command to check whether a
system configuration is in the trial running status and the remaining time of the
trial running. If you want to end the trial running status in advance, run the abort
trial command to disable the trial running of a configuration.
Prerequisites
You can edit a configuration only after you have run the system-view command
to enter a system view in two-stage mode.
Precautions
You do not need to run the commit command to make the commands executed
in the user view to take effect.
In two-phase validation mode, you must run the commit command for the
configuration to take effect. However, you do not need to run the commit
command in the following cases:
● Query commands (such as display interface) are run.
● Maintenance commands (such as slave switchover, dual-active restore,
stack upgrade fast rollback-timer, switch mode, and reset keepalive
packets count) are run.
● Commands are run to enter the existing views (such as the stack view and
physical interface view) on a physical device. For example, the interface
10ge1/0/1 command is run.
● The existing configurations on a device are reconfigured.
Example
# Edit a configuration and commit it to make the change take effect.
<HUAWEI> system-view
[~HUAWEI] vlan 7
[*HUAWEI-vlan7] commit
<HUAWEI> system-view
[~HUAWEI] sysname ROLLBACK
[*HUAWEI] commit description This is a new name
[~ROLLBACK] display configuration commit list verbose
1) CommitId: 1000002027
Label: -
User: device
User-Intf: VTY 4
Type: CLI
TimeStamp: 2012-08-22 23:10:49+08:00
Description: This is a new name
3.1.8 diagnose
Function
The diagnose command enters the diagnostic view from the system view.
Format
diagnose
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Diagnostic commands are mainly used for fault diagnosis. However, running some
commands may cause device faults or service interruptions. Therefore, use these
commands under the instruction of technical support personnel.
Example
# Enter the diagnostic view.
<HUAWEI> system-view
[~HUAWEI] diagnose
[~HUAWEI-diagnose]
Function
The display command alias command displays configuration information of the
command alias.
Format
display command alias
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To view configuration information of command alias on a device, run the display
command alias command.
Example
# Display configuration information of the command alias.
<HUAWEI> display command alias
show = display
showif $ifnum $iftype = display interface $iftype $ifnum
Format
display configuration candidate [ merge ]
Parameters
Parameter Description Value
merge Displays all the configurations in the system, including –
committed configurations and uncommitted configurations.
If you do not specify this keyword, the command displays
only uncommitted configurations.
Views
All views in two-stage configuration mode
Default Level
2: Configuration level
NOTE
If the merge parameter is used, the default level of the command is the management level.
Usage Guidelines
Usage Scenario
You can run the display configuration candidate command to check whether a
configuration to be committed is correct and whether it conflicts with existing
configurations.
Prerequisites
Example
# Display uncommitted configurations.
<HUAWEI> system-view
[~HUAWEI] ftp server enable
[*HUAWEI] display configuration candidate
ftp server enable
Function
The display history-command command displays the historical commands stored
on the current device.
Format
display history-command [ all-users ]
Parameters
Parameter Description Value
all-users Displays information about all successfully matched -
commands the users executed.
If the parameter is not specified, successfully matched
historical commands the current user executed are displayed.
Views
All views
Default Level
0: Visit level
NOTE
If the all-users parameter is used, the default level of the command is the management
level.
Usage Guidelines
Usage Scenario
You can run this command to check historical commands the user has executed
recently. This command facilitates information search. Historical commands are
recorded in circular mode. The display history-command and display history-
command all-users commands display a maximum of 10 and 200 historical
commands, respectively.
Precautions
All the historical commands entered by a user are automatically saved on the
terminal, that is, any input that ends with Enter is saved as a historical command.
NOTE
● Historical commands are saved in the same format as that used in the input. If a
command that is entered by a user is in an incomplete format, the saved historical
command is also in the incomplete format.
● If a user runs a command several times, only the latest command is saved on the device.
If the command is entered in different formats, they are considered as different
commands.
● To view the previous historical command, press the Up arrow key or Ctrl+P.
If there is an earlier historical command, the earlier historical command is
displayed.
● To view the next historical command, press the Down arrow key or Ctrl+N.
If there is a new historical command, the new historical command is
displayed.
NOTE
Access to historical commands using the Up arrow key does not apply to Windows 9X. The
Up arrow key has different functions in Windows 9X and needs to be replaced by shortcut
keys Ctrl+P.
Example
# Display the historical commands that have been executed on the current
terminal.
<HUAWEI> display history-command
system-view
user-interface vty 0 4
user privilege level 15
quit
Format
display hotkey
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After you understand the defined, undefined, and system hotkeys in the system,
you can use hotkeys to quickly enter commands. To redefine hotkeys for a
command, run the hotkey command.
The system allows hotkeys in places where commands can be entered, and
displays the commands corresponding to hotkeys. You can run the display hotkey
command to view the commands corresponding to hotkeys.
Example
# Display defined, undefined, and system hotkeys.
<HUAWEI> display hotkey
----------------- HOTKEY -----------------
=Defined hotkeys=
Hotkeys Command
CTRL_G display current-configuration
CTRL_L display ip routing-table
CTRL_O undo debugging all
=Undefined hotkeys=
Hotkeys Command
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.
Item Description
Function
The display language character-set command displays the character set in the
system or Chinese character set supported on the terminal login software.
Format
display language character-set [ test ]
Parameters
Parameter Description Value
test Displays the character set in the system and Chinese -
character set supported on the terminal login software.
If this parameter is not specified, only the character set in the
system is displayed.
Views
All views
Default Level
0: Visit level
Usage Guidelines
The system and terminal login software must use the same character set;
otherwise, Chinese characters may be displayed as garbled characters. You can run
the display language character-set [ test ] command to view the character set in
the system and Chinese character set supported on the terminal login software.
Example
# Display the character set in the system.
<HUAWEI> display language character-set
Current language character set encode : GBK
Format
display sysname
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
The host name determines the command interface prompt. For example, if the
host name is HUAWEI, the user interface prompt is <HUAWEI>.
You can run this command to view the host name of the current device.
Example
# Display the device host name.
<HUAWEI> display sysname
HUAWEI
Format
display terminal command alias
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run the terminal command alias command to enable the command alias
function for the current terminal. To view whether the command alias function is
enabled for the current terminal, run the display terminal command alias
command.
Example
# After the command alias function is enabled, display the status of the current
terminal.
<HUAWEI> display terminal command alias
Info: Current terminal command alias feature is enable.
# After the command alias function is disabled, display the status of the current
terminal.
<HUAWEI> display terminal command alias
Info: Current terminal command alias feature is disable.
Format
display this [ include-default ]
Parameters
Parameter Description Value
include-default Displays both the configurations that users have -
performed and default configurations.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
After the configurations are complete in a certain view, run the display this
command to check the current configurations.
If include-default is not specified, the display this command displays only
configurations that users have performed. If include-default is specified, the
display this command displays both default configurations and configurations
that users have performed.
Precautions
● If a configuration parameter uses the default value, this parameter is not
displayed. The set parameters that do not be committed successfully are
neither displayed by display this.
● If you run the display this command in an interface view, configuration of the
interface view is displayed. If you run this command in a protocol view,
configuration of the protocol view is displayed.
● Configuration information marked with * in the front in the command output
indicates the offline configuration.
Example
# Display the running configuration in the current view.
<HUAWEI> system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] display this
#
interface 10GE1/0/1
port link-type trunk
#
return
# Display the configurations that take effect in the current view on the system
and default configurations. (The command output is not all listed.)
<HUAWEI> system-view
[~HUAWEI] display this include-default
#
sysname HUAWEI
#
undo command-privilege level rearrange
#
FTP server enable
FTP server port 21
...
Format
display configuration trial status
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To view the trial running status of a system configuration, run the display
configuration trial status command.
Trial running is initiated by NETCONF. If the trial running packets carry the
persistency mark, the trial running status information of a system configuration
contains the persistency mark.
Example
# Display the trial running status of a system configuration.
<HUAWEI> display configuration trial status
Trial status: ACTIVE
Trial time left (sec): 51
# Display the trial running status of a system configuration when trial running is
initiated by NETCONF and the trial running packets carry the persistency mark
whose value is IQ,d4668.
<HUAWEI> system-view
[~HUAWEI] display configuration trial status
Trial status: ACTIVE
3.1.18 header
Function
The header command configures header information displayed on a terminal
when users log in to a connected device.
The undo header command deletes header information displayed on a terminal
when users log in to a connected device.
By default, no header information is displayed on a terminal when users log in to
a connected device.
Format
header { login | shell } { information text | file file-name }
undo header { login | shell }
Parameters
Parameter Description Value
login Indicates header -
information displayed on a
terminal when a user logs
in to the device and a
connection between the
terminal and the device is
activated.
shell Indicates the header -
displayed on a terminal
when the session is set up
after the user logs in to
the connected device.
information Specifies the header The value is a string. The maximum
text information and content. length of the string that can be
entered at one time is 480
characters. The value can contain
spaces, and starts and ends with
the same character that is not
displayed.
file file-name Specifies the file name The value is a string. The maximum
that the header uses. length of the string is 64
characters. The file name must be
in the [drive] [path] [file name]
format, where [path] is the
absolute path of the file. The
maximum header file size is 2 KB. If
the file size is greater than 2 KB,
only the first 2 KB file information
can be displayed.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To provide some prompts or alarms to users, you can use the header command to
configure a title on the device. If a user logs in to the device, the title is displayed.
You can directly define header information by specifying the information text
parameter, or configure the content of a specified file as header information by
specifying the file file-name parameter.
● If the information parameter is specified, the header content must start and
end with the same case-insensitive letter. For example, the header content
abcda starts and ends with a, and header information displayed on the
terminal is bcd. You cannot press Enter to enter information in the next line.
● If the file file-name parameter is specified, all the header content is header
information displayed on the terminal without any start or end character, and
you can press Enter to enter information in the next line.
When a terminal connection is activated and you attempt to log in (for example,
before entering the user name and password), the terminal displays the content of
the title that is set using the header login command. After the successful login,
the terminal displays the content of the title that is configured using the header
shell command.
Precautions
● Before setting the login parameter, you must set login authentication
parameters; otherwise, no header information about authentication is
displayed.
● Before setting the file parameter, ensure that the file containing the header
exists; otherwise, the file name cannot be obtained.
● If the header command is configured several times, only the latest
configuration takes effect.
● After the login title is configured, any user that logs in to the system can view
the title.
Example
# Configure a shell header "Hello!".
<HUAWEI> system-view
[~HUAWEI] header shell information "Hello!"
[*HUAWEI] commit
[~HUAWEI] quit
<HUAWEI> quit // Log off.
# Press Enter. The shell header is displayed when the user logs in again.
Hello!
<HUAWEI>
3.1.19 hotkey
Function
The hotkey command sets a shortcut key for a command.
The undo hotkey restores the system shortcut keys to the default values.
By default, the system sets the default values for three shortcut keys CTRL+G,
CTRL+L, and CTRL+O, while does not set default value for CTRL+U.
Format
hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_U } command-text
undo hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_U }
Parameters
Parameter Description Value
CTRL_G Specifies the shortcut key Ctrl -
+G for a command.
CTRL_L Specifies the shortcut key Ctrl -
+L for a command.
CTRL_O Specifies the shortcut key Ctrl -
+O for a command.
CTRL_U Specifies the shortcut key Ctrl -
+U for a command.
command- Specifies the associated It is a string of 1 to 240 case-
text command line for shortcut sensitive characters, with spaces
keys. supported.
NOTE
When defining shortcut keys, mark
the command with double quotation
marks if the command consists of
several words or the command
includes spaces, and do not mark
the command with double quotation
marks if the command consists of
only one word or the command
includes no space.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can set a shortcut key for a command that is often used; you can also change
the default value of the shortcut key that is defined by the system according to
your requirements.
Four shortcut keys are customized by users: CTRL+G, CTRL+L, CTRL+O, and CTRL
+U.
● By default, the shortcut key CTRL+G corresponds to the display current-
configuration command which displays current configuration.
Example
# Assign the display tcp status command for the shortcut key CTRL+L.
<HUAWEI> system-view
[~HUAWEI] hotkey ctrl_l "display tcp status"
[*HUAWEI] commit
[~HUAWEI] display hotkey
----------------- HOTKEY -----------------
=Defined hotkeys=
Hotkeys Command
CTRL_G display current-configuration
CTRL_L display tcp status
CTRL_O undo debugging all
=Undefined hotkeys=
Hotkeys Command
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 when connecting.
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_T Kill outgoing connection.
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.
Format
language character-set character
undo language character-set
Parameters
Parameter Description Value
character Specifies the character set in Currently, the system supports the
the system. following character sets: GBK, UTF-8,
and ISO8859-1.
Views
System view
Default Level
3: Management level
Usage Guidelines
You can configure the character set so that the system supports Chinese or English
input. The character set facilitates device identification and management, for
example, configured Chinese device name and VLAN description.
Currently, the system supports the following character sets: GBK, UTF-8, and
ISO8859-1. GBK and UTF-8 support both English and Chinese input, whereas
ISO8859-1 supports only English input. To enter Chinese characters on the device,
configure GBK or UTF-8 according to the character set supported on the terminal
login software. You can run the display language character-set test command to
view the character sets in the system and on the terminal login software.
NOTE
If the character sets in the system and on the terminal login software are different, Chinese
characters may be displayed as garbled characters.
Example
# Configure GBK as the character set in the system.
<HUAWEI> system-view
[~HUAWEI] language character-set GBK
Change language character-set, confirm? [Y/N]:y
3.1.21 quit
Function
The quit command returns from the current view to a lower-level view. If the
current view is the user view, this command exits from the system.
Format
quit
Parameters
None
Views
All views
Default Level
0: Visit level
Usage Guidelines
Usage Scenario
Three types of views are available and they are listed as follows from a lower level
to a higher level:
● User view
● System view
● Service view, such as interface view
Run the quit command to return to a lower-level command view from the current
view. If you are in the user view currently, after you run the quit command, you
quit from the system.
Example
# Return to the system view from the AAA view, and then return to the user view.
After this, quit the system.
<HUAWEI> system-view
[~HUAWEI] aaa
[~HUAWEI-aaa] quit
[~HUAWEI] quit
<HUAWEI> quit
Format
reset history-command
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
This command can be used to delete history commands entered only by the
current user but not by other users. The deleted history commands cannot be
displayed.
Example
# Delete history commands entered by the current user.
<HUAWEI> reset history-command
Format
reset history-command all-users
Parameters
None
Views
User view
Level
3: Management level
Usage Guidelines
The reset history-command all-users command deletes only the query results of
the display history-command all-users command. Query results of the display
history-command command are not affected.
Example
# Delete the historical commands of all users.
<HUAWEI> reset history-command all-users
3.1.24 return
Function
The return command returns to the user view from other views except the user
view.
Format
return
Parameters
None
Views
All views
Default Level
0: Visit level
Usage Guidelines
In other views, you can use the return command to return to the user view.
● Run this command to return to the user view if the current view is another
view except the user view.
● If the current view is the user view, no change occurs after running this
command.
● The shortcut keys<Ctrl+Z> have the same function as the return command.
Example
# Return to the user view from the user interface view.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0
[~HUAWEI-ui-vty0] return
<HUAWEI>
3.1.25 system-view
Function
The system-view command enables you to enter the system view from the user
view.
Format
system-view [ immediately ]
Parameters
Parameter Description Value
immediately Indicates that the configuration takes effect immediately. -
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You must configure the device in the system view. Run this command in the user
view to enter the system view.
Precautions
In a command line prompt, HUAWEI is the default device name. The prompt
indicates the current view. <HUAWEI> indicates the user view. [HUAWEI] indicates
the immediate validation mode of the system view. [~HUAWEI] indicates the two-
phase validation mode of the system view.
Example
# Enter the system view.
<HUAWEI> system-view
Enter system view, return user view with return command.
[~HUAWEI]
Function
The terminal command alias command enables the command alias function for
the current terminal.
Format
terminal command alias
Parameters
None
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The alias configured by the alias command can take effect only when the
command alias function is enabled.
If you run the undo terminal command alias command to disable the command
alias function for the current terminal, the command alias function can still be
configured, and the configuration information of command alias is not deleted,
but the alias configured cannot take effect.
Precautions
The terminal command alias command takes effect only on the current terminal.
Example
# Disable the command alias function for the current terminal.
<HUAWEI> undo terminal command alias
Function
The terminal command forward matched upper-view command enables the
intelligent rollback function.
Format
terminal command forward matched upper-view
Parameters
None
Views
User view
Level
3: Management level
cli debug
Usage Guidelines
Usage Scenario
● Intelligent rollback enables the system to automatically return to the previous
view if a command fails to be run in the current view. The system performs
view return attempts until the system view is displayed. If the command is
matched, it is run in the current view and the matching view is displayed.
● When configuring services, you need to enter the view of the command to be
configured to complete the configuration. In this case, you need to run the
quit command repeatedly to exit the current view and enter the required
view. The intelligent rollback function allows you to run commands of other
views in the current view to reduce repeated quit operations.
● This command is valid only for sessions that run this command. That is, you
can enable or disable the intelligent rollback function only for the sessions
that run this command.
● If you do not need to automatically match a command in an upper-level view,
run the undo terminal command forward matched upper-view command
to disable the intelligent rollback function.
Precautions
● If command matching fails because an ambiguous command is entered in the
current view, no intelligent rollback can be performed.
● Intelligent rollback is not performed when a command fails to be matched.
● The undo commands do not support intelligent rollback.
● If the intelligent rollback function is enabled, commands may be executed in
unexpected views, and services may be interrupted. Before configuring a
command, check whether the command to be configured exists in the view. If
the command does not exist, run the command in the correct view.
Example
# Enable the intelligent rollback function.
<HUAWEI> terminal command forward matched upper-view
Format
timestamp enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
After the timestamp function is enabled, the system adds the query time to the
output of the display command.
Example
# Enable the timestamp function for the system.
<HUAWEI> system-view
[~HUAWEI] timestamp enable
[*HUAWEI] commit
[~HUAWEI] display this
2014-08-19 14:39:39.227
#
sysname HUAWEI
#
vlan batch 10
#
dldp enable
#
ip route-static 0.0.0.0 0.0.0.0 192.168.80.1
#
lldp enable
#
user-interface maximum-vty 15
#
timestamp enable
#
return
Only the CE6863, CE6863K, CE6881E, CE6881, CE6881K, and CE6820 support PKI
commands.
Format
display system ztp
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
None
Example
# Display whether the system has been deployed through ZTP.
<HUAWEI> display system ztp
---------------------------------------------------------
Slot Last startup ZTP status Next startup ZTP status
---------------------------------------------------------
1 disable enable
---------------------------------------------------------
Item Description
Last startup ZTP status Whether the ZTP process has been
executed upon the next startup with
only factory settings:
● enable: The ZTP process is executed
upon the next startup with only
factory settings.
● disable: The ZTP process is not
executed upon the next startup
with only factory settings.
Format
display pki certificate { ca | local } realm default
Parameters
Parameter Description Value
realm default Specifies the name of the PKI realm The value must be an
that a certificate belongs to as existing PKI realm name.
default. Currently, the device
supports only the default
PKI realm.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command displays information about the imported CA certificate, local
certificate, or root certificate on the device, including the signature algorithm,
issuer, validity period, subject, and subject public key.
Example
# Display the content of the local certificate.
<HUAWEI> display pki certificate local realm default
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
25:7d:69:6a:1c:39:a2:10
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=Huawei Enterprise Network Product CA,O=Huawei,C=CN
Validity
Not Before: Aug 5 02:43:26 2019 GMT
Not After: Aug 4 02:43:26 2020 GMT
Subject: CN=wwwhuaweicom,O=Huawei,C=CN
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit)
Modulus (2048 bit):
00:9f:b7:f9:d1:e2:07:4b:48:07:01:2f:87:bd:36:
91:e5:bb:96:bc:8d:f3:74:83:fa:70:da:ed:cc:9a:
83:44:48:b0:73:d6:36:d7:fc:f0:f7:ec:3f:be:1d:
94:61:3d:24:f7:8b:2c:e0:42:67:e4:da:bc:94:d4:
c9:b9:49:d3:c2:56:8d:ca:79:c5:22:e0:5e:06:cb:
4a:84:a3:b8:f8:62:b3:00:4f:c1:3a:3f:00:ad:7d:
4d:94:96:4a:10:80:38:ac:b7:be:13:1d:96:47:1c:
8b:5e:34:dc:e6:7f:2a:57:fd:65:4f:64:e1:cd:82:
37:07:e5:b3:59:63:ef:0f:56:34:ef:c8:02:a4:9b:
84:aa:99:f8:a8:99:13:e6:9a:64:6b:c6:b6:f4:70:
8c:70:f8:d3:a9:54:c0:cf:c3:b5:4b:2b:e7:f5:e7:
0c:2f:9f:23:02:14:bc:45:8a:40:8f:20:ff:62:93:
7e:95:b0:28:a6:d1:6d:3f:d9:be:33:f5:db:09:99:
1d:f1:50:0d:ea:ef:14:ff:b2:82:32:69:bd:dd:cf:
87:2f:d0:9c:54:ef:9c:bb:57:09:e2:04:b4:91:a8:
df:72:d1:bc:00:a2:b5:e3:67:19:d9:c3:3c:82:a0:
64:f7:27:08:88:1d:91:4f:3b:47:78:a6:bc:26:ec:
fc:6d
Exponent: 65537 (0x010001)
X509v3 extensions:
X509v3 Basic Constraints: non-critical
CA:0
X509v3 Key Usage: critical
Key Agreement, Data Encipherment, Key Encipherment (e0), Non-Re
pudiation, Digital Signature,
Item Description
Item Description
KeyID ID.
Format
display pki crl realm default
Parameters
Parameter Description Value
realm default Specifies the name of the PKI The value must be an existing
realm that a CRL belongs to as PKI realm name. Currently, the
default. device supports only the default
PKI realm.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command displays the CRL content, including signature algorithm, issuer,
update time, revoked certificate, CRL sequence number, and revocation time.
Example
# Display the CRL content in the PKI realm named default.
<HUAWEI> display pki crl realm default
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=Huawei Enterprise Network Product CA,O=Huawei,C=CN
Last Update: Aug 5 07:26:59 2019 GMT
Next Update: Aug 9 04:06:59 2019 GMT
CRL extensions:
X509v3 CRL Number(HEX): 00
X509v3 Authority Key Identifier:
KeyID=73:9F:C7:5F:E1:96:A8:0E:79:71:79:DC:69:CB:0A:F1:BC:E0:F4:E5
Item Description
KeyID ID.
Function
The display pki rsa local-key-pair command displays information about an RSA
key pair and the public key in the RSA key pair.
Format
display pki rsa local-key-pair public
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command displays information about an RSA key pair and the public key in
the RSA key pair, including the time the key pair was created, key pair name,
whether the key can be exported, and public key information.
Example
# Display information about all RSA key pairs.
<HUAWEI> display pki rsa local-key-pair public
=====================================================
Time of the key pair created:23:57:41 2019/08/26
Key name:test
Key Modules:2048 bit
Key type:RSA signature key
=====================================================
Key code:
30820109
02820100
9FB7F9D1 E2074B48 07012F87 BD3691E5 BB96BC8D
F37483FA 70DAEDCC 9A834448 B073D636 D7FCF0F7
EC3FBE1D 94613D24 F78B2CE0 4267E4DA BC94D4C9
B949D3C2 568DCA79 C522E05E 06CB4A84 A3B8F862
B3004FC1 3A3F00AD 7D4D9496 4A108038 ACB7BE13
1D96471C 8B5E34DC E67F2A57 FD654F64 E1CD8237
07E5B359 63EF0F56 34EFC802 A49B84AA 99F8A899
13E69A64 6BC6B6F4 708C70F8 D3A954C0 CFC3B54B
2BE7F5E7 0C2F9F23 0214BC45 8A408F20 FF62937E
95B028A6 D16D3FD9 BE33F5DB 09991DF1 500DEAEF
14FFB282 3269BDDD CF872FD0 9C54EF9C BB5709E2
04B491A8 DF72D1BC 00A2B5E3 6719D9C3 3C82A064
F7270888 1D914F3B 4778A6BC 26ECFC6D
0203
010001
Table 3-8 Description of the display pki rsa local-key-pair command output
Item Description
Time of the key pair created Time when the RSA key pair was
created.
Function
The pki delete-certificate command deletes a certificate from the memory.
Format
pki delete-certificate { ca | local } realm default
Parameters
Parameter Description Value
ca Deletes a CA certificate. -
realm default Specifies the name of the PKI The value must be an existing
realm that a certificate belongs to PKI realm name. Currently,
as default. the device supports only the
default PKI realm.
Views
System view
Default Level
3: Management level
Usage Guidelines
When a certificate expires or a new certificate needs to be imported, run the pki
delete-certificate command to delete the existing CA certificate, local certificate,
or root certificate from the memory. Running this command will not delete
certificate files from the flash memory.
Example
# Delete a local certificate from the memory.
<HUAWEI> system-view
[~HUAWEI] pki delete-certificate local realm default
Function
The pki delete-crl command deletes a CRL from the memory.
Format
pki delete-crl realm default
Parameters
Parameter Description Value
realm default Specifies the name of the PKI The value must be an existing
realm that a CRL belongs to as PKI realm name. Currently, the
default. device supports only the default
PKI realm.
Views
System view
Default Level
3: Management level
Usage Guidelines
When a CRL expires, run the pki delete-crl command to delete the existing CRL
file from the memory. This command will not delete the CRL file in the flash
memory.
Example
# Delete the CRL file of the PKI realm named default from the memory.
<HUAWEI> system-view
[~HUAWEI] pki delete-crl realm default
Format
pki import rsa-key-pair key-name [ realm default ] pem filename file-name
password password
Parameters
Parameter Description Value
realm default Specifies the name of the The value must be an existing PKI
PKI realm to which the RSA realm name. Currently, the device
key pair file is imported as supports only the default PKI
default. realm.
pem filename Indicates that the RSA key The value must be an existing file
file-name pair to be imported is in name.
PEM format and specifies
the file name to store the
RSA key pair.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To use the RSA key generated by another entity, run the pki import rsa-key-pair
command to import RSA key pair file to the memory. After the configuration, the
imported RSA key pair can be referenced by the PKI module for operations such as
signing.
Only one RSA key pair file can be imported to the device.
Prerequisites
The RSA key pair must already exist on the storage device.
Example
# Import the RSA key pair file abc.key in PEM format of the RSA key pair named
key-1 and set the decryption password to huaweiDC.
<HUAWEI> system-view
[~HUAWEI] pki import rsa-key-pair key-1 realm default pem filename abc.key password huaweiDC
Function
The pki import-certificate command imports a certificate to the device memory.
Format
pki import-certificate { ca | local } realm default pem filename filename
Parameters
ca Specifies a CA certificate to be -
imported. For example, when the
device works as an SSL proxy, you can
import the SSL proxy CA certificate and
use the private key in the certificate to
sign the SSL client certificate again.
realm default Specifies the name of the PKI realm The value must be an
that an imported certificate belongs to existing PKI realm
as default. name. Currently, the
device supports only
the default PKI realm.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After a certificate is downloaded and saved to the device's storage medium, run
the pki import-certificate command to import the certificate to the memory for
it to take effect.
The device supports the import of one CA certificate and one local certificate.
Prerequisites
Example
# Import a local certificate to the PKI realm default in file transfer mode.
<HUAWEI> system-view
[~HUAWEI] pki import-certificate local realm default pem filename local.cer
Function
The pki import-crl command imports a CRL to the memory.
Format
pki import-crl realm default filename file-name
Parameters
Parameter Description Value
realm default Specifies the name of the PKI The value must be an
realm that an imported CRL existing PKI realm name.
belongs to as default. Currently, the device
supports only the default
PKI realm.
filename file- Specifies the name of an The CRL file name must
name imported CRL file. Only the files exist.
in PEM format are supported.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After a CRL file is downloaded and saved to the device's storage medium, you
must run the pki import-crl command to import the CRL file to the device
memory to make it take effect.
Prerequisites
The CRL file already exists in the device's storage medium.
Example
# Import the CRL in the flash memory to the device memory.
<HUAWEI> system-view
[~HUAWEI] pki import-crl realm default filename abc.crl
Format
pki match-rsa-key certificate-filename { import_local.pem | default_local.pem
| packet_local.pem }
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
After an RSA key pair is imported, you can run the pki match-rsa-key command
to check whether the device certificate matches the RSA key pair.
Example
# Check whether an imported device certificate matches an RSA key pair.
<HUAWEI> system-view
[~HUAWEI] pki match-rsa-key certificate-filename import_local.pem
Info: Certificate from file matches RSA key default.
Function
The pki rsa local-key-pair destroy command destroys a specified RSA key pair.
Format
pki rsa local-key-pair destroy key-name
Parameters
Parameter Description Value
key-name Specifies the name of the RSA key The value must be an
pair to be destroyed. existing key pair name.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When an RSA key pair is leaked, damaged, unused, or lost, it is recommended that
you run the pki rsa local-key-pair destroy command to destroy the RSA key pair.
After this command is executed, the RSA key pair will be deleted from the active
and standby devices.
Prerequisites
The RSA key pair has been imported to the device memory using the pki import
rsa-key-pair command.
Example
# Destroy the RSA key pair test.
<HUAWEI> system-view
[~HUAWEI] pki rsa local-key-pair destroy test
Function
The pki validate-certificate command configures the device to check the validity
of a CA certificate or local certificate.
Format
pki validate-certificate { ca | local } realm default
Parameters
Parameter Description Value
realm default Specifies the name of the PKI realm The value must be an
that a certificate belongs to as existing PKI realm name.
default. Currently, the device
supports only the default
PKI realm.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before a certificate is used, its validity needs to be checked, for example, whether
its peer certificate has expired and whether it has been added to a certificate
blacklist.
Prerequisites
Example
# Check the validity of a local certificate.
<HUAWEI> system-view
[~HUAWEI] pki validate-certificate local realm default
Function
The set ztp enable command enables the ZTP function on the device.
The set ztp disable command disables the ZTP function on the device.
Format
set ztp enable
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
By default, the ZTP function is enabled so that an unconfigured device can start
the ZTP process during a startup. To disable an unconfigured device from starting
the ZTP process during a startup, disable the ZTP function on the device.
Example
# Disable the ZTP function.
<HUAWEI> set ztp disable
Format
set device usb-deployment disable
undo set device usb-deployment disable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
After the USB-based deployment function is enabled on a device, the device can
be upgraded once a qualified USB flash drive is connected to the device. After the
USB-based deployment function takes effect, to enhance device security and avoid
service interruption caused by unnecessary version upgrades, disable the USB-
based deployment function. After the USB-based deployment function is disabled,
the device cannot be upgraded using any qualified USB flash drive.
Example
# Enable the USB-based deployment function.
<HUAWEI> system-view
[~HUAWEI] undo set device usb-deployment disable
Format
set device usb-deployment password [ password ]
undo set device usb-deployment password
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
During USB-based deployment, you can check the HMAC of the configuration file
to be loaded to ensure validity of the configuration file. After an authentication
password is configured, the device uses the password as the key to calculate the
HMAC of the configuration file to be loaded based on the HMAC-SHA256
algorithm and compares the calculated HMAC with the value of the HMAC field in
the index file. If the two values are the same, the configuration file is valid and
loaded to the device for USB-based deployment. If the two values are different,
the configuration file is invalid and cannot be loaded for USB-based deployment.
Example
# Set the authentication password Pwd123456 for USB-based deployment.
<HUAWEI> system-view
[~HUAWEI] set device usb-deployment password Pwd123456
Function
The clock datetime command sets the current date and time on the switch.
Format
clock datetime [ utc ] HH:MM:SS YYYY-MM-DD
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
In the scenario where accurate absolute time is required, the current date and
time must be set on the switch.
Prerequisite
The time zone and daylight saving time have been configured using the clock
timezone and clock daylight-saving-time commands. If the time zone and
daylight saving time are not configured, the clock datetime command sets a UTC
time.
Precautions
● The specified time must be in 24-hour format. If you do not specify MM and
SS, their values are 0. You must enter at least one digit to specify HH. For
example, when you enter 0, the time is 00:00:00.
● The specified year must be a four-digit number and the specified month and
day can be a one-digit number. For example, when you enter 2012-9-1, the
time is 2012-09-01.
● If the device is configured to restart at a specified time and if the system time
is changed to be more than 10 minutes later than the specified restart time,
the scheduled restart function will be disabled.
Example
# Set the current time and date of the system to 0:0:0 2012-01-01.
<HUAWEI> clock datetime 0:0:0 2012-01-01
Format
clock date-format { MM-DD-YYYY | YYYY-MM-DD }
undo clock date-format
Parameters
Parameter Description Value
Views
All views
Default Level
3: Management level
system write
Usage Guidelines
To change the date format on a device, run the clock date-format command.
Example
# Set the date format to MM-DD-YYYY.
<HUAWEI> clock date-format MM-DD-YYYY
Function
The clock daylight-saving-time command sets the name, start time, and end
time of the daylight saving time (DST).
Format
clock daylight-saving-time time-zone-name one-year start-time start-date end-
time end-date offset
Parameters
Parameter Description Value
start-time Specifies the DST start The start time is in 24-hour format
time. hh:mm. hh specifies the hour, which is an
integer ranging from 0 to 23. mm
specifies the minute, which is an integer
ranging from 0 to 59. If mm is not
specified, DST starts on the hour. You
must enter at least one digit to specify
hh. For example, when you enter 0, the
start time is 00:00.
start-date Specifies the DST start The start date is in the format YYYY-MM-
date. DD. YYYY specifies the year, which is an
integer ranging from 2000 to 2037, MM
specifies the month, which is an integer
ranging from 1 to 12, and DD specifies
the day, which is an integer ranging from
1 to 31.
end-time Specifies the DST end The end time is in 24-hour format
time. hh:mm. hh specifies the hour, which is an
integer ranging from 0 to 23. mm
specifies the minute, which is an integer
ranging from 0 to 59. If mm is not
specified, DST starts on the hour. You
must enter at least one digit to specify
hh. For example, when you enter 0, the
start time is 00:00.
end-date Specifies the DST end The end date is in the format YYYY-MM-
date. DD. YYYY specifies the year, which is an
integer ranging from 2000 to 2037, MM
specifies the month, which is an integer
ranging from 1 to 12, and DD specifies
the day, which is an integer ranging from
1 to 31.
NOTE
The start and end months must be different,
and the value obtained by deducting the start
time from the end time must be greater than
the offset value.
weekday Specifies a day of the The value is Mon, Tue, Wed, Thu, Fri,
week. Sat, or Sun.
month Specifies a month. The value is Jan, Feb, Mar, Apr, May,
Jun, Jul, Aug, Sep, Oct, Nov, or Dec.
start-date1 Specifies the DST start The start date is in the format MM-DD.
date. MM specifies the month, which is an
integer ranging from 1 to 12, and DD
specifies the day, which is an integer
ranging from 1 to 31.
end-date1 Specifies the DST end The end date is in the format MM-DD.
date. MM specifies the month, which is an
integer ranging from 1 to 12, and DD
specifies the day, which is an integer
ranging from 1 to 31.
start-year Specifies the start The start year is in the format YYYY and
year. ranges from 2000 to 2037.
end-year Specifies the end year. The end year is in the format YYYY and
ranges from 2000 to 2037.
Views
User view, system view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Users can customize the DST zone according to their countries' or regions'
convention. In addition, users can set how far ahead clocks are adjusted forward,
usually an hour. With DST enabled, when it is time to start DST, the system time is
adjusted according to the user-specified DST. When it is time to end DST, the
system time automatically returns to the original time.
Configuration Impact
● The time in logs and debugging information uses the local time adjusted
based on the time zone and the configured DST.
● The time in the output of the display commands uses the local time adjusted
based on the time zone and the configured DST.
To remove configurations for DST, note the following:
● If DST has already taken effect when you remove the configurations, the
device will adjust its clock by subtracting the value of the offset parameter
from the current time.
● If DST has not taken effect, removing the configurations will not affect the
system time.
Precautions
● The DST is configured in the summer. The DST duration ranges from one day
to one year.
● You can configure the start time and end time for periodic DST in one of the
following modes: date+date and week+week.
Example
# Set periodic DST.
<HUAWEI> system-view
[~HUAWEI] clock daylight-saving-time bj repeating 0 first sun jan 0 first sun apr 2 2009 2009
Format
clock timezone time-zone-name { add | minus } offset
undo clock timezone
Parameters
Views
User view, System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The system clock is the time indicated by the system timestamp. Because the rules
governing local time differ in different regions, the system clock can be configured
to comply with the rules of any given region.
Precautions
● The specified time must be in 24-hour format. If you do not specify MM and
SS, their values are 0. You must enter at least one digit to specify HH. For
example, when you enter 0, the time is 00:00:00.
● After configuring the local time zone, run the display clock command to view
the configuration. The time in logs and diagnostic information uses the local
time adjusted based on the time zone and DST.
Example
# Set the local time zone name for Beijing China to BJ.
If the default UTC is London time 2012-12-01 00:00:00, Beijing time is London
time plus 08:00 because the offset from UTC is 8 hours.
<HUAWEI> clock datetime 0:0:0 2012-12-01
<HUAWEI> clock timezone BJ add 08:00:00
Function
The display clock command displays the current date and clock setting.
Format
display clock [ utc ]
Parameters
Parameter Description Value
utc Indicates that the clock is adjusted to the Coordinated -
Universal Time (UTC).
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
You can run the display clock command to view the system date and clock setting
and adjust the setting if necessary.
Precautions
The system clock is set using the clock datetime, clock timezone, and clock
daylight-saving-time commands.
● If the three commands are not used, the original system clock is displayed
after you run the display clock command.
● You can use any combination of the three commands to configure the system
time. Table 3-9 lists the formats of the configured time.
The table assumes that the original system time is 08:00:00 on January 1, 2010.
● 1: indicates that the clock datetime command is used, in which the current
time and date is date-time.
● 2: indicates that the clock timezone command is used, in which the time
zone parameter is set and the time offset is zone-offset.
● 3: indicates that the clock daylight-saving-time command is used, in which
the DST parameters are set and the time offset is offset.
● [1]: indicates that the clock datetime command is optional.
Example
# Display the current system date and time.
<HUAWEI> display clock
2011-01-01 03:00:05+10:00
Saturday
Time Zone(BJ) : UTC+08:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2011
End year : 2011
Start time : 2011-01-01 01:00:00
End time : 2011-09-01 01:00:00
Saving Time : 02:00:00
Item Description
3.4.6 sysname
Function
The sysname command sets the device host name.
The undo sysname command restores the default device host name.
Format
sysname host-name
undo sysname
Parameters
Parameter Description Value
host-name Specifies the The value is a string of 1 to 246 case-sensitive
host name. characters with spaces.
NOTE
When configuring a system name, do not use the
following special characters: \ " , ! @ [ ] ' If these
characters are used, the save-as function and NE explorer
of an NMS are opened slowly after the name is
synchronized to the NMS.
Views
System view
Default Level
3: Management level
Usage Guidelines
Changing the host name affects the command interface prompt. For example, if
the host name is HUAWEI, the user interface prompt is <HUAWEI>.
Example
# Set the host name to HUAWEIA.
<HUAWEI> system-view
[~HUAWEI] sysname HUAWEIA
[*HUAWEI] commit
[~HUAWEIA]
Format
acl [ ipv6 ] { acl-number | acl-name } { inbound | outbound }
Parameters
Parameter Description Value
Views
User interface view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
This command restricts the login rights of a user interface based on the source IP
address, destination IP address, source port, or destination port. You can use this
command to permit or deny access to a destination or from a source.
Prerequisites
Before running this command, run the acl (system view) in the system view and
run the rule (ACL view) command to configure an ACL.
If no rule is configured, login rights on the user interface are not restricted when
the acl command is executed.
Precautions
After the configurations of the ACL take effect, all users on the user interface are
restricted by the ACL.
You can configure all of the following ACL types: IPv4 inbound, IPv4 outbound,
IPv6 inbound, and IPv6 outbound on a user interface. Only one ACL of each type
can be configured on a user interface, and only the latest configuration of an ACL
takes effect.
Example
# Restrict the Telnet login rights on user interface VTY 0.
<HUAWEI> system-view
[~HUAWEI] acl 3001
[*HUAWEI-acl4-advance-3001] rule deny tcp source any destination-port eq telnet
[*HUAWEI-acl4-advance-3001] quit
[*HUAWEI] user-interface vty 0
[*HUAWEI-ui-vty0] acl 3001 outbound
# Remove the restriction on the Telnet login rights on user interface VTY 0.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0
[*HUAWEI-ui-vty0] undo acl outbound
Function
The activate vty ip-block ip-address command unlocks the IP address of a user
that fails the authentication through the VTY user interface.
Format
activate vty ip-block ip-address ip-address [ vpnname vpn-name ]
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
In the VTY user interface, if a user enters incorrect passwords for six consecutive
times in 5 minutes, the IP address of this user is locked for 5 minutes. To unlock
the IP address of this user in advance, run the activate vty ip-block ip-address
command.
Example
# Unlock the IP address 10.1.2.3.
<HUAWEI> activate vty ip-block ip-address 10.1.2.3
Function
The activate ssh server ip-block ip-address command unlocks the IP address of a
user that fails the SSH connection authentication.
Format
activate ssh server ip-block ip-address ip-address [ vpn-instance vpn-name ]
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
In an SSH connection, if a user enters incorrect passwords for six consecutive times
in 5 minutes, the IP address of this user will be blocked for 5 minutes. To unlock
the IP address of this user in advance, run the activate ssh server ip-block ip-
address command.
Example
# Unlock the IP address 10.1.2.3.
<HUAWEI> activate ssh server ip-block ip-address 10.1.2.3
Format
authentication-mode { aaa | password | none }
undo authentication-mode
Parameters
Parameter Description Value
Views
User interface view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a user logs in to the device using the console interface for the first time, the
system prompts the user to set the login password. After the user logs in to the
device, the user can run the authentication-mode command to change the
authentication mode. The none mode is not recommended because system
security is low. It is recommended that you configure AAA or password
authentication to enhance system security.
Before Telnet or SSH users log in to the device using VTY user interface, they must
run the authentication-mode command to configure the authentication mode.
If SSH is configured for the user interface using the protocol inbound ssh
command, you must configure the authentication-mode aaa authentication
mode to ensure successful logins. If the password authentication mode is
configured, the protocol inbound ssh command cannot be executed.
Precautions
The authentication mode must be configured for login through the VTY user
interface; otherwise, users cannot log in to the device.
For the users logging in to the VTY interface, an authentication method must be
configured; otherwise, users cannot log in.
● After you set the authentication mode for accessing a user interface to
password, run the set authentication password command to configure an
authentication password. Keep the password safe. You need to enter the
Example
# Configure the authentication mode for accessing the user interface.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0
[~HUAWEI-ui-vty0] authentication-mode aaa
3.5.5 databits
Function
The databits command sets the number of data bits of the user interface.
The undo databits command restores the default number of data bits.
Format
databits { 5 | 6 | 7 | 8 }
undo databits
Parameters
Parameter Description Value
5 Indicates that the number of data bits is 5. -
6 Indicates that the number of data bits is 6. -
7 Indicates that the number of data bits is 7. -
8 Indicates that the number of data bits is 8. -
Views
User interface view
Default Level
3: Management level
Usage Guidelines
Use this command only when necessary. If the number of data bits of a device's
user interface is changed, ensure that the same number of data bits is set on the
HyperTerminal used for login.
The setting is valid only when the serial port is configured to work in
asynchronous mode.
Example
# Set the number of data bits to 5.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[~HUAWEI-ui-console0] databits 5
Format
display ssh server ip-block all
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
To check information about the IP addresses of all the clients that fail to pass
authentication, run the display ssh server ip-block all command. The command
output includes the names of VPN instances to which the IP addresses belong, IP
address status, numbers of authentication failures, and the IP addresses that fails
to pass authentication will not be adopted to make invalid authentication.
If a user logs in using SSH, the user's IP address will be locked for 5 minutes upon
6 incorrect password attempts within 5 minutes. After the IP address is locked, the
IP address status displayed in the display ssh server ip-block all command output
changes from AUTH FAILED to BLOCKED.
Example
# Display information about the IP addresses of all the clients that fail to pass
authentication.
<HUAWEI> display ssh server ip-block all
-------------------------------------------------------------------------------------
IP Address VPN Name State Auth-fail Count
--------------------------------------------------------------------------------------
192.168.10.1 _public_ BLOCKED 6
--------------------------------------------------------------------------------------
Table 3-11 Description of the display ssh server ip-block all command output
Item Description
Function
The display ssh server ip-block list command displays information about client IP
addresses that are locked because of authentication failures.
Format
display ssh server ip-block list
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
To check information about client IP addresses that are locked because of
authentication failures, run the display ssh server ip-block list command. The
command output includes the names of VPN instances to which the locked client
IP addresses belong and the remaining locking period.
Example
# Display information about client IP addresses that are locked because of
authentication failures.
<HUAWEI> display ssh server ip-block list
-------------------------------------------------------------------------------------
IP Address VPN Name UnBlock Interval(Seconds)
-------------------------------------------------------------------------------------
192.168.10.1 _public_ 36
-------------------------------------------------------------------------------------
Table 3-12 Description of the display ssh server ip-block list command output
Item Description
Format
display user-interface [ ui-type ui-number1 | ui-number ] [ summary ]
Parameters
Parameter Description Value
ui-type Displays information about a The value can be Console, VTY,
specified user interface. RPC, or NCA.
ui-number1 Displays information about a The minimum value is 0. The
user interface with a specified maximum value is smaller by 1
relative number. than the number of user interfaces
the system supports.
ui-number Displays information about a The value is an integer ranging
user interface with a specified from 0 to 104. The value varies
absolute number. according to the device type.
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display user-interface command to view detailed configuration
information about all user interfaces or a specified user interface. To obtain the
relative number and absolute number of a user interface, run the display users
command and view the User-Intf field in the command output.
Example
# Display detailed information about the user interface with the absolute number
0.
<HUAWEI> display user-interface 0
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
+ 0 CON 0 9600 - 15 15 - 6
UI(s) not in async mode -or- with no hardware support:
20-32
+ : Current UI is active.
F : Current UI is active and work in async mode.
Idx : Absolute index of UIs.
Type : Type and relative index of UIs.
Privi: The privilege of UIs.
ActualPrivi: The actual privilege of user-interface.
Auth : The authentication mode of UIs.
A: Authenticate use AAA.
N: Current UI need not authentication.
P: Authenticate use current UI's password.
Int : The physical location of UIs.
Parameter Description
Function
The display user-interface maximum-vty command displays the maximum
number of VTY users.
Format
display user-interface maximum-vty
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display user-interface maximum-vty command to view the
maximum number of users who connect to the device using Telnet or SSH. By
default, the total number of Telnet users and SSH users is five maximum.
Example
# Display the maximum number of VTY users.
<HUAWEI> display user-interface maximum-vty
Maximum of VTY user : 5
Format
display users [ all ]
Parameters
Parameter Description Value
all Displays information about all users who log in to the device -
through user interfaces, including information about user
interfaces that are not used. If the all parameter is not used,
the command displays only information about user interfaces
that have been connected.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to view information about users who are connected to
the device. The information includes the user name, IP address, and authentication
and authorization information.
Example
# Run the display users command to view information about users who log in to
the device through the user interface.
<HUAWEI> display users
NOTE:
User-Intf: The absolute number and the relative number of user interface
Authen: Whether the authentication passes
Author: Command line authorization flag
--------------------------------------------------------------------------------
User-Intf Delay Type Network Address Authen Author Username
--------------------------------------------------------------------------------
34 VTY 0 16:07:36 TEL 10.135.34.246 pass yes root123
Delay Interval from the user's latest input to the current time, in
seconds.
Network ● Console user interface: The value is the slot ID of the main
Address control card.
● VTY user interface: The value is the IP address of the login
user.
Username User name for logging in to the device. If the user name is
not specified, Unspecified is displayed.
Item Description
Format
display vty ip-block vty-password-mode all
Parameters
None
Views
All views
Default Level
3: Management level
tty debug
Usage Guidelines
To check IP addresses that fail to be authenticated, run the display vty ip-block
vty-password-mode all command.
Example
# Display all IP addresses that fail to be authenticated.
<HUAWEI> display vty ip-block vty-password-mode all
-------------------------------------------------------------------------------------
IP Address VPN Name State Auth-fail Count
--------------------------------------------------------------------------------------
192.168.10.1 _public_ BLOCKED 6
--------------------------------------------------------------------------------------
Item Description
Function
The display vty ip-block vty-password-mode list command displays IP addresses
that are blocked due to authentication failures.
Format
display vty ip-block vty-password-mode list
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
To check information, such as the remaining block time, about IP addresses that
are blocked due to authentication failures, run the display vty ip-block vty-
password-mode list command.
Example
# Display IP addresses that are blocked due to authentication failures.
<HUAWEI> display vty ip-block vty-password-mode list
-------------------------------------------------------------------------------------
IP Address VPN Name UnBlock Interval(Seconds)
-------------------------------------------------------------------------------------
192.168.10.1 _public_ 36
-------------------------------------------------------------------------------------
Item Description
3.5.13 flow-control
Function
The flow-control command configures a flow control mode.
The undo flow-control command restores the default flow control mode.
By default, the flow control mode is set to none, indicating that traffic is not
controlled.
Format
flow-control { hardware | none | software }
undo flow-control
Parameters
Parameter Description Value
hardware Implements hardware-based flow control. -
none Implements no flow control. -
Views
Console user interface view
Default Level
2: Configuration level
Usage Guidelines
The configuration is valid only when the serial port works in the console user
interface view.
Example
# In the console user interface view, configure software-based flow control.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[*HUAWEI-ui-console0] flow-control software
Format
kill user-interface { ui-number | ui-type ui-number1 }
Parameters
Parameter Description Value
ui-type Specifies the type of The value can be RPC, NCA, Console, and
a user interface. VTY.
ui-number1 Specifies the relative ● If the ui-type is console, the value of ui-
number of a specified number is 0.
user interface. ● If the ui-type is vty, the value of ui-
number is 0 to 20.
● If the ui-type is nca, the value of ui-
number is 0 to 4.
● If the ui-type is rpc, the value of ui-
number is 0 to 14.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If a user logs in to the device and does not perform any operation or you want to
forbid a user from performing operations on the device, you can run the kill user-
interface command to delete a specified user. After the command is executed, the
user logs out from the device.
Precautions
The kill user-interface command cannot be executed on the current user
interface. If the current user interface is VTY 2, the kill user-interface vty 2 fails
to be executed.
Example
# Disconnect the VTY3 user's terminal from the device.
<HUAWEI> kill user-interface vty 3
Warning: User interface VTY3 will be freed. Do you want to continue? [Y/N]:y
Info: User interface VTY3 is free.
Format
history-command max-size size-value
Parameters
Parameter Description Value
size-value Specifies the size of the historical The value is an integer ranging
command buffer. from 0 to 256.
Views
User interface view
Default Level
3: Management level
Usage Guidelines
The CLI can automatically save the historical commands that you enter. This
function is similar to that of Doskey. You can invoke and run the historical
commands at any time.
Example
# Set the size of the historical command buffer to 20.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[~HUAWEI-ui-console0] history-command max-size 20
3.5.16 idle-timeout
Function
The idle-timeout command sets the timeout duration for disconnection from a
user interface.
By default, the timeout duration is 10 minutes in vty user interface view, and 5
minutes in console user interface view.
Format
idle-timeout minutes [ seconds ]
undo idle-timeout
Parameters
Parameter Description Value
minutes Specifies the idle The value is an integer that ranges from 0
timeout duration, in to 35791 in the VTY user interface view
minutes. and from 1 to 1440 in the console user
interface view, in minutes.
Views
User interface view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If a user logs in to the device and does not perform an operation, the user
interface is occupied unnecessarily. You can run the idle-timeout command to
disconnect the user's terminal from the device.
Precautions
● If you set the time to zero, then the line connection remains alive until you
close it.
● If the user interface disconnection function is not configured, other users may
fail to log in to the device.
● If the idle timeout interval is set to 0 or a large value, the terminal will remain
in the login state, resulting in security risks. You are advised to run the lock
command to lock the current connection.
● You are advised to set the timeout duration to 10-15 minutes.
● In versions earlier than V200R002C50, the timeout period configured using
the idle-timeout command for a user connection in the console user interface
view ranges from 0 to 35791. If the timeout period is set to 0 minutes or is
greater than 1440 minutes in a version earlier than V200R002C50, it is
automatically set to 1440 minutes after the system software is upgraded to
V200R002C50 or a later version.
Example
# Set the timeout duration to 1 minute and 30 seconds.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[~HUAWEI-ui-console0] idle-timeout 1 30
Format
ip-block vty-password-mode disable
undo ip-block vty-password-mode disable
Parameters
None
Views
Security password view
Default Level
3: Management level
Usage Guidelines
If the function of blocking IP addresses in VTY access scenarios is enabled, the
device blocks IP addresses that fail to be authenticated and rejects VTY access
requests that use the blocked IP addresses. The device also records the blocked IP
addresses in a list.
After the function is disabled, the device deletes the blocked IP addresses from the
list and does not record new IP addresses that fail to be authenticated. To disable
the function, run the ip-block vty-password-mode disable command.
Example
# Disable the function of blocking IP addresses in VTY access scenarios.
<HUAWEI> system-view
Function
The mmi-mode enable command enters the machine-to-machine mode.
Format
mmi-mode enable
Parameters
None
Views
User view
Default Level
1: Monitoring level
Usage Guidelines
After you enter the machine-to-machine mode using the mmi-mode enable
command, the command output is displayed in one screen.
After you enter the machine-to-machine mode using the mmi-mode enable
command, some important commands that you need to use with caution can be
used directly. In human-to-machine mode, use this command with caution.
Example
# Enter the machine-to-machine mode.
<HUAWEI> mmi-mode enable
3.5.19 parity
Function
The parity command sets the check bit of a user interface.
The undo parity command restores the default check bit of a user interface.
By default, no check is performed.
Format
parity { even | mark | none | odd | space }
undo parity
Parameters
Parameter Description Value
even Sets the transmission check bit to even parity. -
mark Sets the transmission check bit to mark check. -
none Sets the transmission check bit to no check. -
odd Sets the transmission check bit to odd parity. -
space Sets the transmission check bit to space check. -
Views
Console user interface view
Default Level
2: Configuration level
Usage Guidelines
By default, no transmission check is performed. To prevent transmission errors, run
the parity command to configure the check bit of the specified user interface to
improve data transmission correctness.
Example
# Set the transmission check bit on the console port to odd parity.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
Format
protocol inbound { all | ssh | telnet }
undo protocol inbound
Parameters
Parameter Description Value
all Indicates that all protocols including SSH and Telnet are -
supported.
Views
VTY user interface view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To manage and monitor login users, configure the VTY user interface for login
users and run the protocol inbound command to configure the protocols that the
VTY user interface supports.
Prerequisites
If SSH is configured for the user interface using the protocol inbound command,
you must configure the authentication-mode aaa authentication mode to ensure
successful logins. If the password authentication mode is configured, the protocol
inbound ssh command cannot be executed.
Precautions
To ensure high security, do not use the RSA algorithm whose length is less than 2048
digits.
Example
# Configure SSH for user interfaces VTY0 to VTY4.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0 4
[~HUAWEI-ui-vty0-4] authentication-mode aaa
[*HUAWEI-ui-vty0-4] protocol inbound ssh
3.5.21 screen-length
Function
The screen-length command sets the number of lines on each terminal screen
after you run a command.
Format
In the user interface view:
Parameters
Parameter Description Value
screen-length Specifies the number of lines The value is an integer that
displayed on a terminal screen. ranges from 0 to 512. The value
0 indicates that all command
output is displayed on one
screen.
Views
User interface view, user view
Default Level
3: Management level
Usage Guidelines
If you run a command and its output is displayed in more lines than you can see
on one screen, you can reduce the number of lines displayed on each screen.
In general, you do not need to change the number of lines displayed on each
screen. Setting the number of lines to 0 is not recommended. The configuration
takes effect after you log in to the system again.
NOTE
In the user view, the temporary parameter is mandatory and this command is at the
Management level.
Example
# Set the number of lines on each screen of the terminal to 30.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[~HUAWEI-ui-console0] screen-length 30
Function
The set authentication password command configures a local authentication
password.
By default, the local authentication password is not configured for the device.
Format
set authentication password [ cipher password ]
Parameters
Parameter Description Value
cipher Specifies the ● When cipher is not entered, password input is
password password for in man-machine interaction mode, and the
the user system does not display the entered password.
interface. The password is a string of 8 to 16 case-
sensitive characters. The password must contain
at least two of the following characters: upper-
case character, lower-case character, digit, and
special character.
Special character except the question mark (?)
and space. However, when double quotation
marks are used around the password, spaces
are allowed in the password.
– Double quotation marks cannot contain
double quotation marks if spaces are used in
a password.
– Double quotation marks can contain double
quotation marks if no space is used in a
password.
For example, the password "a123"45"" is valid,
but the password "a 123"45"" is invalid.
● When cipher is entered, the password is
displayed in either plaintext or ciphertext
during input.
– When being input in plaintext, the password
requirements are the same as those when
cipher is not entered. When you input a
password in simple text, the system displays
the password in simple text mode, which
brings risks.
– When being input in ciphertext, the
password must be a string of 48 to 128
consecutive characters.
The password is displayed in ciphertext in the
configuration file regardless of whether it is
input in plaintext or cipher text.
Views
User interface view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If password authentication is configured for users, you can run the set
authentication password command to change the password or set a password in
cipher text.
If you enter the plaintext password when specifying cipher password, security risks exist.
The interactive mode is recommended when users enter the password.
Pre-configuration Tasks
Precautions
Example
# Set the local authentication password for the user interfaces VTY 0-4.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0 4
[~HUAWEI-ui-vty0-4] set authentication password
Warning: The "password" authentication mode is not secure, and it is strongly recommended to use "aaa"
authentication mode.
Please configure the login password (8-16)
Enter Password:
Confirm Password:
[*HUAWEI-ui-vty0-4]
# Set the local authentication password for the user interfaces VTY 0-4.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0 4
[~HUAWEI-ui-vty0-4] set authentication password cipher Huawei@123
3.5.23 shell
Function
The shell command enables terminal services on a user interface.
Format
shell
undo shell
Parameters
None
Views
VTY user interface view
Default Level
3: Management level
Usage Guidelines
You can use the shell command on a user interface to enable terminal services.
This command enables users to enter commands through this interface to query
device information and configure the device.
You can use the undo shell command on the user interface to disable terminal
services. This command does not allow users to perform any operations through
this interface. After using the undo shell command in the VTY view, this user
interface does not provide Telnet and STelnet access.
NOTE
Example
# Disable terminal services on VTY 0 to VTY 4.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0 4
[~HUAWEI-ui-vty0-4] undo shell
Warning: ui-vty0-4 will be disabled. Do you want to continue? [Y/N]:y
Format
speed speed-value
undo speed
Parameters
Parameter Description Value
Views
Console user interface view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a user logs in to the switch through the console interface, the baud rate on
the HyperTerminal must be the same as that configured on the switch; otherwise,
the user cannot log in to the switch.
The setting is valid only when the serial port is configured to work in
asynchronous mode.
Precautions
In V200R003C00, this command does not take effect on all switches before the
V200R003SPH005 patch is loaded, and users log in to the switch through the
serial interface using the default baud rate 9600 bit/s. After the V200R003SPH005
patch is loaded, all baud rates can be configured on the CE6870-24S6CQ-EI and
CE6870-48S6CQ-EI, the speed 300 or speed 600 command does not take effect
on the CE8850-32CQ-EI, and you are advised to configure other baud rates on the
CE8850-32CQ-EI. For other switches excluding the preceding two models, this
command does not take effect, and users log in to the switch through the serial
interface using the default baud rate 9600 bit/s.
In V200R002C50:
● For switches excluding the CE6860EI, CE6870-48T6CQ-EI, CE8850-32CQ-EI,
CE6880EI, CE5810EI, and CE5850HI, this command does not take effect before
the V200R002C50SPH012 patch is loaded, and users log in to the switch
through the serial interface using the default baud rate 9600 bit/s; all baud
rates can be configured after the V200R002C50SPH012 patch is installed.
● For the CE6860EI, CE6870-48T6CQ-EI, and CE8850-32CQ-EI, this command
does not take effect before the V200R002C50SPH013 patch is loaded, and
users log in to the switch through the serial interface using the default baud
rate 9600 bit/s; after the V200R002C50SPH013 patch is loaded, the speed 300
or speed 600 command does not take effect, and you are advised to
configure other baud rates.
● For the CE6880EI, CE5810EI, and CE5850HI, this command does not take
effect and users log in to the switch through the serial interface using the
default baud rate 9600 bit/s.
In V200R001C00 and earlier versions, the speed 300 or speed 600 command does
not take effect on the CE5810EI and CE5850HI, and you are advised to use other
baud rates.
Example
# Set the baud rate of a user interface to 115200 bit/s.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[~HUAWEI-ui-console0] speed 115200
Format
ssh server ip-block disable
undo ssh server ip-block disable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
● If an SSH server is enabled to lock client IP addresses, locked client IP
addresses fail to pass authentication and are displayed in the display ssh
server ip-block list command output.
● If an SSH server is disabled from locking client IP addresses, the display ssh
server ip-block list command does not display any client IP address that is
locked because of authentication failures.
● The operation to disable an SSH server from locking client IP addresses poses
system risks and is thereby not recommended.
Example
# Disable an SSH server from locking client IP addresses.
<HUAWEI> system-view
[~HUAWEI] ssh server ip-block disable
Warning: It is not recommended to disable IP block feature. This operation may result in system becoming
vulnerable to security threats.
3.5.26 stopbits
Function
The stopbits command sets the stop bit of a user interface.
The undo stopbits command restores the default stop bit of a user interface.
By default, the stop bit is 1.
Format
stopbits { 1.5 | 1 | 2 }
undo stopbits
Parameters
Parameter Description Value
1.5 Sets the stop bit to 1.5. -
1 Sets the stop bit to 1. -
2 Sets the stop bit to 2. -
Views
Console user interface view
Default Level
3: Management level
Usage Guidelines
When a user logs in to the switch through the console interface, the stop bit on
the HyperTerminal must be the same as that configured on the switch; otherwise,
the user cannot log in to the switch.
The stop bit and the data bit configured using the databits command are related.
● If the stop bit is 1, the corresponding data bit is 8.
● If the stop bit is 1.5, the corresponding data bit is 5.
● If the stop bit is 2, the corresponding data bit is 6, 7, or 8.
The setting is valid only when the serial port is configured to work in
asynchronous mode.
Example
# Set the stop bit of a user interface to 2.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[~HUAWEI-ui-console0] stopbits 2
Function
The user privilege command configures the user level.
The undo user privilege command restores the default user level.
By default, the command level for the console port on the user interface is 15
when the command-privilege level rearrange command is run, while is 3 when
the command-privilege level rearrange command is not run, and other users are
at level 0.
Format
user privilege level level
Parameters
Views
User interface view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The system manages users at levels to control their access permissions. Users who
log in to the device can use only commands at the same or lower level than their
own levels.
Commands are classified into the visit level, monitoring level, configuration level,
and management level that map levels 0, 1, 2, and 3 without command-privilege
level rearrange, as listed in Table 3-18.
If the command level configured for a user interface conflicts with that of a user,
the command level of the user takes precedence. For example, if the user 001 can
use commands at level 3 and the command level configured for the user interface
VTY 0 is 2, the user 001 can use commands at level 3 and lower levels when
logging in to the system through the user interface VTY 0.
You can run the display user-interface command to view detailed information
about a user interface.
Precautions
If refined right management is required, run the command-privilege level
command to upgrade command levels.
In versions earlier than V100R006C00, the user level ranges from 0 to 15. If the
system software is upgraded to V100R006C00 or a later version, and the
command-privilege level command is not configured, the levels of level-0 and
level-1 users remain unchanged, and those of level-3 to level-15 users change to
3.
Example
# Set the user level on the VTY0 user interface to 2.
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0
[~HUAWEI-ui-vty0] user privilege level 2
[*HUAWEI-ui-vty0] commit
3.5.28 user-interface
Function
The user-interface command displays one or more user interface views.
Format
user-interface ui-type first-ui-number [ last-ui-number ]
Parameters
Parameter Description Value
ui-type The value can be console
Specifies the type of a user interface.
or vty.
first-ui- Specifies the number of the first user ● If ui-type is set to
number interface. console, the first-ui-
number value is 0.
● If ui-type is set to vty,
the first-ui-number
value ranges from 0
to the maximum
number of VTY user
interfaces.
Views
System view
Default Level
3: Management level
Usage Guidelines
When the network administrator logs in to the device using the console interface,
Telnet, or SSH, the system manages and monitors the session between the user
and the device on the corresponding user interface. Each user interface
corresponds a user interface view. The network administrator can set parameters
such as authentication and user level to manage sessions in a unified manner.
After you log in to the device, you can run the display user-interface command
to view the supported user interfaces and the corresponding relative.
Example
# Enter the Console 0 user interface.
<HUAWEI> system-view
[~HUAWEI] user-interface console 0
[~HUAWEI-ui-console0]
[~HUAWEI-ui-vty1-3]
Format
user-interface maximum-vty number
undo user-interface maximum-vty
Parameters
Parameter Description Value
number Specifies the maximum number of The value is an integer ranging
Telnet and SSH users. from 0 to 21.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The user-interface maximum-vty command configures the maximum number of
login users. If the VTY channels are fully occupied after the configuration is
committed, new connections are not allowed and the current users are not
terminated.
Precautions
● The maximum number of login users set by the user-interface maximum-vty
command is the total number of Telnet and SSH (STelnet) users.
● If the maximum number of login users is set to 0, no user is allowed to log in
to the device using Telnet or SSH.
Example
# Set the maximum number of Telnet users to 7.
<HUAWEI> system-view
[~HUAWEI] user-interface maximum-vty 7
Function
The user-interface vty security-policy disable command disables the VTY user
interface's security policy.
The undo user-interface vty security-policy disable command enables the VTY
user interface's security policy.
Format
user-interface vty security-policy disable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
The undo user-interface vty security-policy disable command clears a user
authentication request that has been pending for a long time to access the VTY
user interface. For example, if the number of existing user authentication requests
has already reached the upper limit but a new authentication request is received,
the system clears the authentication request of the user that fails to pass the
authentication within 15 seconds and starts authenticating the new user.
The user-interface vty security-policy disable command cannot clear any user
authentication request that has been pending for a long time to access the VTY
user interface.
NOTE
It is recommended that you enable the security policy to harden the VTY user interface's
security.
Example
# Disable the VTY user interface's security policy.
<HUAWEI> system-view
[~HUAWEI] user-interface vty security-policy disable
Format
configuration exclusive
undo configuration exclusive
Parameters
None
Views
All views
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The device allows simultaneous access and configuration by multiple users, which
may cause configuration conflicts and service exceptions. To prevent service
exceptions, run this command to lock and modify the configuration while allowing
other users to only query the configuration.
To unlock the configuration, do either of the following:
Example
# Lock the current system configuration.
<HUAWEI> configuration exclusive
Format
client ssl-policy policy-name
undo client ssl-policy
Parameters
Parameter Description Value
policy-name Specifies the name of an SSL The name of an SSL policy must
policy. already exist.
Views
HTTP view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Legacy HTTP does not have any security mechanism. It transmits data in simple
text and does not verify the identities of communicating parties. Therefore, data
transmitted over HTTP may be tampered with. In applications that require high
security, such as e-commerce and online banking, HTTP is inapplicable. To
enhance security, run the client ssl-policy command to configure an SSL policy for
an HTTP client.
Configuration Impact
HTTP security is enhanced with the SSL security mechanisms, such as data
encryption, identity verification, and message integrity check.
Prerequisites
1. An SSL policy has been created and the SSL policy view is displayed using the
ssl policy command in the system view.
2. A digital certificate or certificate chain has been loaded using the certificate
load command in the SSL policy view.
Precautions
An HTTP client can only have one SSL policy configured. If the client ssl-policy
command is run more than once, the latest configuration overrides the previous
one.
Example
# Configure an SSL policy named policy1 for an HTTP client.
<HUAWEI> system-view
[~HUAWEI] ssl policy policy1
[*HUAWEI-ssl-policy-policy1] certificate load pem-cert a_servercertchain2_pem_dsa.pem key-pair dsa
key-file a_serverkeychain2_pem_dsa.pem auth-code cipher 123456
[*HUAWEI-ssl-policy-policy1] commit
[~HUAWEI-ssl-policy-policy1] quit
[~HUAWEI] http
[*HUAWEI-http] client ssl-policy policy1
Format
client ssl-verify peer
undo client ssl-verify
Parameters
None
Views
HTTP view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To configure an HTTP client to perform SSL verification on HTTP servers, run the
client ssl-verify peer command. After the HTTP client is granted an SSL digital
certificate by a server, the client can verify the validity of the server. This prevents
the client from accessing invalid servers, enhancing security.
Precautions
This command takes effect only if the client ssl-policy command has also been
run to configure an SSL policy for the client.
Example
# Configure an HTTP client to perform SSL verification on HTTP servers.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] client ssl-verify peer
Format
configuration exclusive by-user-name user-name
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
config debug
Usage Guidelines
Usage Scenario
Multiple users can access a device and manage it. A user can be a controller or
another type of user. If the configuration of a forwarder is modified by a non-
controller user, the configurations of the controller and forwarder may be
inconsistent. The configuration exclusive by-user-name command can be used
to specify the controller to lock the system configuration of a forwarder to avoid
the inconsistency.
When multiple users manage a device at the same time, you can specify a user to
lock the device. Only this user can modify the device configuration, while others
cannot.
Configuration Impact
After the system configuration is locked by a user, only this user can perform
configuration operations. Other users can view, edit, maintain, and save the
configuration but cannot commit the configuration. If another user needs to
commit the configuration, run the undo configuration exclusive by-user-name
user-name command to unlock the configuration first.
When this command is run, ensure that the user-name value is that specified
when the configuration exclusive by-user-name command is run.
Precautions
Example
# Enable user root123 to lock the system configuration.
<HUAWEI> system-view
[~HUAWEI] configuration exclusive by-user-name root123
Function
The configuration exclusive timeout command sets the timeout period before
the system automatically unlocks the configuration set.
Format
configuration exclusive timeout timeout-value
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Running the configuration exclusive timeout command can set an allowable
maximum period when no commands are delivered by the user that locks the
configuration set. After the timeout period expires, the configuration set is
automatically unlocked and other users can normally run commands.
You can run the configuration exclusive timeout command in one of the
following scenarios:
● When a user without configuration access runs this command, the system
prompts an error message.
● If the configuration set is locked by another user, this command becomes
invalid, and the system prompts an error message when the command is run.
● If the configuration set is locked by the current user, the current user can run
this command.
NOTE
Example
# Set the timeout period before the system automatically unlocks the
configuration set to 120 seconds.
<HUAWEI> system-view
[~HUAWEI] configuration exclusive timeout 120
Function
The display configuration exclusive by-user-name command displays lock
information of the system configuration locked based on user name.
Format
display configuration exclusive by-user-name
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
To view system configuration lock information, run the display configuration
exclusive by-user-name command. The command output includes the name of a
user who locks or unlocks the system configuration, time when the system
configuration is locked or unlocked, and lock ID.
If no system configuration is locked, no command output is displayed after the
display configuration exclusive by-user-name command is run.
Example
# Display lock information after the system configuration is locked.
<HUAWEI> display configuration exclusive by-user-name
Lock User Name: root123
Lock Time: 2018-03-07 20:13:31+04:00 DST
Identifier: 13
Item Description
Function
The display configuration exclusive user command displays information about
the user that locks the configuration set.
Format
display configuration exclusive user
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display configuration exclusive user command to query the user
that obtains configuration access.
Example
# Display the user that locks the configuration set.
<HUAWEI> display configuration exclusive user
User Index: 34
User Session Name: VTY 0
User Name: root
IP Address: 10.135.38.234
Locked Time: 2013-03-06 21:09:36
Last Configuration Time: 2013-03-06 21:09:36
The configuration right was locked and timeout duration is: 30 second(s)
Item Description
Item Description
Last Configuration Time Time when the user runs the last
command
The configuration right was locked and Time when the configuration right is
timeout duration is locked
Format
display dsa key-pair [ brief | label label-name ]
Parameters
Parameter Description Value
brief Displays brief information about all DSA -
key pairs with labels.
label label-name Displays information about the DSA key Label name of the
pair with a specific label. key pair.
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display dsa key-pair command to check information about the
DSA key pair with a label. The information varies when you specify different
parameters in the command.
● If brief is specified, you can view brief information about all DSA key pairs
with labels.
● If label label-name is specified, you can view information about the DSA key
pair with a specific label.
● When neither label nor brief is specified, you can view information about all
DSA key pairs with labels.
Example
# Display information about all DSA key pairs with labels.
<HUAWEI> display dsa key-pair
=====================================
Label name: abc
Modulus: 2048
Time of Key pair created: 2014-01-13 07:41:46
=====================================
Key :
30820325
02820101
00DEDEBA 5C8244DC B8E69691 7CEFEBC0 B3E6FB60
BE8B9E36 D3E4EB9C D6EB7FD2 10219AC0 F41AD47B
F1EACD43 5D39AFA8 FACB6A78 19305EE1 47E42891
2E60452B 37CA17D6 11C2EE4C 46B4BC77 2654C268
56A99ECF A5D80036 7B31A905 22F13949 6F4182DB
FDAAB599 739AB021 85856A88 1F919736 8B92DBF6
849D1C74 6BA27E12 F98A28E4 B6D0587D 655979A7
505413E9 1EFC961C 3F792096 25CFA8D7 D469FA35
A39E37B6 14047D53 5DCD63AF 3058B3A2 5B79C714
B6326B7D B6067EBF 153CC1A7 20B0E1A7 E39C13FE
B3BA26E6 B052DC5B FFEE7C5C 52148FE6 C240738F
BB8F05D4 16B2B5DD 72E3629B B59244BF 9FA29C4F
CD4EA0EE 501FC669 5D03D68D 519324E4 93
0215
00C6C484 E1F0076B 8AFCAD30 2B98B50A 3A542ABE
BB
02820100
3AC11746 EE959CBD 30F669C5 7E290BC4 7CB5BBFD
96AE9215 7A29C723 72FE8A02 EBED3B76 BE810B42
21AD8D32 F7723F83 59F46B66 FF7805CC 3F86D5D6
5BD424BD 70677EFF 1ACF9B3C CE02CD40 46560DA4
2036205C 6EFAB148 66E6A106 0DF6258B EE31CFE7
4B6C59B4 6FE59A9F BE64F982 EC36A669 FF597FB7
9A56E32E C15A0659 3D17C407 29F587C7 74959017
62B08070 24564B2E E79C6E1D 86793548 76CC662A
1D3DE1D1 2C79E102 C0B10E5C 9C4428B3 AEB93278
26D4CDE5 189A93EA 531E0FF8 2199EF35 DF038976
4538434F F39924F0 5BF17AC8 8E340991 B5EA0A62
A915EE63 F660C092 360C5D2D 796AF230 DB7461F7
C15B6DBA 65C9EFAB 247DB13D 4942E2FF
02820101
00D34DAC 0A625592 F93D3107 E4CBD1BD 731B1EFD
A537588A 206E7B76 8826EE11 EBE93BA2 D2EF9211
32912326 3F274FAF 5953DFB3 19EF77DD 4AE1D3BB
90A2E56B AE20C8A5 37B5F1F8 0EE4609B D8AEB111
5AF138DF F044FEC8 E05DF127 875B228E 3347B0CE
A60B607C A4F16C2B 52D7A330 13F9FD2F EE24C90E
DC387478 3180115D A60BD22E 12E35B1B 1BFD1523
04C1013E CD2D3EAF D235E191 7DDADB79 824481FA
Item Description
Time of Key pair created Time when the key pair is generated.
Function
The display dsa local-key-pair public command displays the public key in the
local DSA key pair of the device.
Format
display dsa local-key-pair public
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
This command displays the public key in the local DSA key pair. You can copy the
public key in the command output to the DSA public key of the SSH server to
ensure that the public keys on the client and server are consistent and that the
client can be authenticated by the server.
Example
# Display the public key in the client DSA key pair.
<HUAWEI> display dsa local-key-pair public
========================================================
Time of key pair created : 2017-08-02 16:45:00
Key name : HUAWEI_Host_DSA
Key modulus : 2048
Key type : DSA encryption key
========================================================
Key code:
30820324
02820101
00DEDEBA 5C8244DC B8E69691 7CEFEBC0 B3E6FB60
BE8B9E36 D3E4EB9C D6EB7FD2 10219AC0 F41AD47B
F1EACD43 5D39AFA8 FACB6A78 19305EE1 47E42891
2E60452B 37CA17D6 11C2EE4C 46B4BC77 2654C268
56A99ECF A5D80036 7B31A905 22F13949 6F4182DB
FDAAB599 739AB021 85856A88 1F919736 8B92DBF6
849D1C74 6BA27E12 F98A28E4 B6D0587D 655979A7
505413E9 1EFC961C 3F792096 25CFA8D7 D469FA35
A39E37B6 14047D53 5DCD63AF 3058B3A2 5B79C714
B6326B7D B6067EBF 153CC1A7 20B0E1A7 E39C13FE
B3BA26E6 B052DC5B FFEE7C5C 52148FE6 C240738F
BB8F05D4 16B2B5DD 72E3629B B59244BF 9FA29C4F
CD4EA0EE 501FC669 5D03D68D 519324E4 93
0215
00C6C484 E1F0076B 8AFCAD30 2B98B50A 3A542ABE
BB
02820100
3AC11746 EE959CBD 30F669C5 7E290BC4 7CB5BBFD
96AE9215 7A29C723 72FE8A02 EBED3B76 BE810B42
21AD8D32 F7723F83 59F46B66 FF7805CC 3F86D5D6
5BD424BD 70677EFF 1ACF9B3C CE02CD40 46560DA4
2036205C 6EFAB148 66E6A106 0DF6258B EE31CFE7
4B6C59B4 6FE59A9F BE64F982 EC36A669 FF597FB7
9A56E32E C15A0659 3D17C407 29F587C7 74959017
62B08070 24564B2E E79C6E1D 86793548 76CC662A
1D3DE1D1 2C79E102 C0B10E5C 9C4428B3 AEB93278
26D4CDE5 189A93EA 531E0FF8 2199EF35 DF038976
4538434F F39924F0 5BF17AC8 8E340991 B5EA0A62
A915EE63 F660C092 360C5D2D 796AF230 DB7461F7
C15B6DBA 65C9EFAB 247DB13D 4942E2FF
02820100
067A64DE A6D47E2D 6D21BD8D C5C630D8 3FE16268
CAA42061 7D1A73E6 F6397EAF 1B0B88E9 035AFDE8
5F4387FA 364CD8E1 BD473BC4 7BE75D0A 8EA6A92E
5B763B53 B97019C0 EDA050B0 A832EC2C 62DB5718
265093E9 DF2C1F75 B8549280 89E496B4 1B2D1A83
07C04723 6ECE953F B51F4A31 8B9E9EED 5293E8AA
44C4E6F1 F6A36949 02350580 4BA4DA38 C8BFADD0
CBBDD72F 2E6681B1 FA7D7853 E1A3D191 6CA323C3
A6FF726F F1777D76 BB7C630A 5A4892A1 C78694CF
C17C07AD 6F640640 A65F22F4 AD2A4FE6 6C6232B1
FF354D22 8E77C44A E112196F 7FC60365 2B5C6793
4C132057 C69E2656 0E180446 AA7AE6AA 6D4FA2D8
18E431D6 ECA1502C 074D0C01 290B5FE2
XG76sUhm5qEGDfYli+4xz+dLbFm0b+Wan75k+YLsNqZp/1l/t5pW4y7BWgZZPRfE
Byn1h8d0lZAXYrCAcCRWSy7nnG4dhnk1SHbMZiodPeHRLHnhAsCxDlycRCizrrky
eCbUzeUYmpPqUx4P+CGZ7zXfA4l2RThDT/OZJPBb8XrIjjQJkbXqCmKpFe5j9mDA
kjYMXS15avIw23Rh98Fbbbplye+rJH2xPUlC4v8AAAEABnpk3qbUfi1tIb2NxcYw
2D/hYmjKpCBhfRpz5vY5fq8bC4jpA1r96F9Dh/o2TNjhvUc7xHvnXQqOpqkuW3Y7
U7lwGcDtoFCwqDLsLGLbVxgmUJPp3ywfdbhUkoCJ5Ja0Gy0agwfARyNuzpU/tR9K
MYuenu1Sk+iqRMTm8fajaUkCNQWAS6TaOMi/rdDLvdcvLmaBsfp9eFPho9GRbKMj
w6b/cm/xd312u3xjClpIkqHHhpTPwXwHrW9kBkCmXyL0rSpP5mxiMrH/NU0ijnfE
SuESGW9/xgNlK1xnk0wTIFfGniZWDhgERqp65qptT6LYGOQx1uyhUCwHTQwBKQtf
4g==
---- END SSH2 PUBLIC KEY ----
Table 3-22 Description of the display dsa local-key-pair public command output
Item Description
Time of key pair created Time when the public key is created.
Host public key for PEM format code PEM code of the public key.
Public key code for pasting into Public key format in the OpenSSH file.
OpenSSH authorized_keys file
Format
display dsa peer-public-key [ brief | name key-name ]
Parameters
Parameter Description Value
brief Displays the brief information. -
name key-name Displays the DSA public key with the The key-name must
specified name. already exist.
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
This command displays the DSA public key for you to check whether the local and
peer public keys are consistent.
Precautions
You must complete the DSA public key configuration before running this
command.
Example
# Display the DSA public key with the specified name.
<HUAWEI> display dsa peer-public-key name dsakey001
=====================================
Key name : dsakey001
Encoding type : DER
=====================================
Key code:
30820324
02820101
00DEDEBA 5C8244DC B8E69691 7CEFEBC0 B3E6FB60 BE8B9E36 D3E4EB9C D6EB7FD2
10219AC0 F41AD47B F1EACD43 5D39AFA8 FACB6A78 19305EE1 47E42891 2E60452B
37CA17D6 11C2EE4C 46B4BC77 2654C268 56A99ECF A5D80036 7B31A905 22F13949
6F4182DB FDAAB599 739AB021 85856A88 1F919736 8B92DBF6 849D1C74 6BA27E12
F98A28E4 B6D0587D 655979A7 505413E9 1EFC961C 3F792096 25CFA8D7 D469FA35
A39E37B6 14047D53 5DCD63AF 3058B3A2 5B79C714 B6326B7D B6067EBF 153CC1A7
20B0E1A7 E39C13FE B3BA26E6 B052DC5B FFEE7C5C 52148FE6 C240738F BB8F05D4
16B2B5DD 72E3629B B59244BF 9FA29C4F CD4EA0EE 501FC669 5D03D68D 519324E4
93
0215
00C6C484 E1F0076B 8AFCAD30 2B98B50A 3A542ABE BB
02820100
3AC11746 EE959CBD 30F669C5 7E290BC4 7CB5BBFD 96AE9215 7A29C723 72FE8A02
EBED3B76 BE810B42 21AD8D32 F7723F83 59F46B66 FF7805CC 3F86D5D6 5BD424BD
70677EFF 1ACF9B3C CE02CD40 46560DA4 2036205C 6EFAB148 66E6A106 0DF6258B
Item Description
Format
display ecc key-pair [ brief | label label-name ]
Parameters
Parameter Description Value
brief Displays brief information about all ECC -
key pairs with labels.
label label-name Displays information about the ECC key Label name of the
pair with a specific label. key pair.
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display ecc key-pair command to check information about the
ECC key pair with a label. The information varies when you specify different
parameters in the command.
● If brief is specified, you can view brief information about all ECC key pairs
with labels.
● If label label-name is specified, you can view information about the ECC key
pair with a specific label.
● When neither label nor brief is specified, you can view information about all
ECC key pairs with labels.
Example
# Display information about all ECC key pairs with labels.
<HUAWEI> display ecc key-pair
=====================================
Label name: abc123
Modulus: 521
Time of Key pair created: 2014-01-13 08:01:02
=====================================
Key :
0400B83D B5796B8F 28060F9E 6AA444C6 17F904D5 DE1D25D1 DF86CC94
5B30D58B A8BEA1D6 405D7928 AADCF587 ECCCFEE0 AE4235FE 3F78485C
BA72121D 5C76B902 34C0BC00 6815A445 F3EE1F36 9E7F9646 8E0EDA8D
51EF14B3 164C4742 970A158D 0807FBE6 FC9D9277 31CFF900 75600A8C
BA99BE37 366FFFFB 883C73EA 0970553C F2032738 3D
=====================================
Item Description
Time of Key pair created Time when the key pair is generated.
Function
The display ecc local-key-pair public command displays information about the
public key in the local ECC key pair.
Format
display ecc local-key-pair public
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display ecc local-key-pair public command to check information
about the public key in the local ECC key pair on a client and then copy the public
key to the server. The public key enables a server to authenticate users and
ensures the login of authorized users.
Example
# Display information about the public key in the local ECC key pair on a client.
<HUAWEI> display ecc local-key-pair public
========================================================
Time of key pair created : 2013-12-30 11:11:20
Key name : HUAWEI_Host_ECC
Key modulus : 521
Key type : ECC encryption key
========================================================
Key code:
04012998 DFDD74C4 3F58DF73 C9CED003 8BB308ED
8353FD26 BAF2F836 5EFDCC2A D26E185F 6F6E2E19
683FF161 9141A7C2 3EEA52E3 9801E245 D33079A2
B12DAF27 1DF59401 E5068456 C54FE0E0 5DD99CEB
98C527DB B3CE0707 7863DC59 34EE830C 8AACBDB3
5EA697C4 9A660DD8 1049A330 7DC7ED5A 905184AC
0F6D6022 07731458 4DC1CE84 D8
Table 3-25 Description of the display ecc local-key-pair public command output
Item Description
Time of key pair created Time when the public key in the local
ECC key pair is generated, in the format
of YYYY-MM-DD HH:MM:SS.
Item Description
Host public key for PEM format PEM code of the public key in the local
code ECC key pair.
Function
The display ecc peer-public-key command displays information about the ECC
public key configured on the remote end.
Format
display ecc peer-public-key [ brief | name key-name ]
Parameters
Parameter Description Value
brief Displays brief information about the ECC -
public key configured on the remote end.
name key-name Displays the ECC public key with the The key-name
specified name. must already exist.
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to check detailed information about the ECC public key
and whether the local and peer public keys are the same.
Precautions
You must complete the ECC public key configuration before running this
command.
Example
# Display brief information about all the ECC public keys.
<HUAWEI> display ecc peer-public-key brief
------------------------------------------
Bits Name
------------------------------------------
521 sat
------------------------------------------
# Display detailed information about the ECC public key named sat.
<HUAWEI> display ecc peer-public-key name sat
=====================================
Key name: sat
=====================================
Key code:
040020D4 5436AC31 BB1501EE 54CB84B6 AD9D5DB5 1B65EA59 9B5409A9 045D12A5
9133AF2C A7E9E80E 344E95DA D166E270 77B67702 72F9B94F FB78E487 1C2928C9
5437CE00 93AD2608 0D940547 8D6B84AB DDD30FE1 75B2C790 884B4F91 5DEE668F
08EE50CE 1CAE6D54 1A1DC28C 1936C451 ECBB7AB0 B7F2F09B 8F699940 CF81C7C7
906A40F4 7D
Format
display rsa key-pair [ brief | label label-name ]
Parameters
Parameter Description Value
brief Displays brief information about all RSA -
key pairs with labels.
label label-name Displays information about the RSA key Label name of the
pair with a specific label. key pair.
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display rsa key-pair command to check information about the
RSA key pair with a label. The information varies when you specify different
parameters in the command.
● If brief is specified, you can view brief information about all RSA key pairs
with labels.
● If label label-name is specified, you can view information about the RSA key
pair with a specific label.
● When neither label nor brief is specified, you can view information about all
RSA key pairs with labels.
Example
# Display information about all RSA key pairs with labels.
<HUAWEI> display rsa key-pair
=====================================
Label name : a01
Modulus : 2048
Time of key pair created : 2013-12-31 01:47:14
=====================================
Key :
3082010A 02820101 00E788C5 7BE23271 71E4ACFE 2AC67BD1 5B6F2B1B 98B9B530
8C3A5635 2CA667E9 685537FB 7CFC6F7E B6834F92 3EB55305 AC37A137 A797318B
164873EE 9E156132 9CE6B060 E737C8EC C6B7B4B8 D79885EB B3710E69 D6420B5A
554573B6 B381E159 162601B7 2CA4DFD0 16899329 79EC1DE4 A23B0232 496E3373
3408DC0F D4C84A71 7FC821B8 21AD254B 928C1003 FF549929 889FAFA1 AE8AC22E
F5BDAD25 ECA8D7C0 EE711AC7 CAB34583 325D1D58 4DBCDE86 BF3DA0C0 BA9D872E
6F745D72 0FD66EE0 56F35FB4 5F347405 3E7BDCAF 2F0EFE7E 990AD206 D9DA400E
2C380055 8462D6E0 B93B0C73 EB394D01 D83A6B6F 37B64FAF F7DFBAA4 F7073AE1
CC1B0C5E 8F735904 19020301 0001
=====================================
Time of key pair created Time when the key pair is generated.
Format
display rsa local-key-pair public
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run this command on the client and configure the client public key in the
command output to the SSH server, which ensures that the SSH client validity
check by the SSH server is successful and enables the secure data exchange
between the SSH server and client.
Example
# Display the public key in the local key pair.
<HUAWEI> display rsa local-key-pair public
======================Host key==========================
Time of key pair created : 2013-12-30 08:55:13
Key name : HUAWEI_Host
3082010A
02820101
00C4D569 631EC1E2 833E315D 5DED65F3 498F2ED0
9B04F901 DEC806AA 0941AC43 3BB7422B B1D6E754
26B36B48 9F40A1CE AAF31314 5B729DFB 931BDBD8
81EBF078 54D8570D B4BFDCF8 90091546 76CDED0A
5FAAA330 9F4D6186 DE41AFBE A2FA67D7 EB3FC5E9
FD80859D 4E7B1C12 21198FFA 231B8048 A6E6F0D3
205557D6 B0580D81 ADFD2B6D 3256FBAE 9E81ABA6
0E8FA794 5DB0AA13 FB4ACA36 E3D75918 C40E68C6
9F6CA0C8 7FAD471C AF7F0BD5 4469C4A7 CF8BC85B
EA735E02 5FAC972C 7BCD818C 3C8E3EAB DB830026
D6CDBA62 F00C8928 4A04A67C A597207E 23D91EF3
183E2466 F8D06754 CEE5EB2B 937E8516 AA1485D7
79B7CB6B 5AB299AB FFB1E1BF A0353DD3 97
0203
010001
======================Server key========================
Time of key pair created : 2013-12-30 08:55:14
Key name : HUAWEI_Server
Key type : RSA encryption key
========================================================
Key code:
3081B9
0281B1
00EA73D0 8787CAC7 01F5B1C3 BB526E42 18B4E740
C26250C8 E6453106 A22CC86D 9D702D5A A7192FFA
19ECBEAF C7AD3C56 89900E35 30D11766 4683E827
960AB080 6D1D5403 BB9553FC 57046006 D2A12AEA
086D0066 C7D81278 CC2720A9 7FF3F006 85EB945F
8306A451 D2795842 8FDAC528 0EAE9D23 8E7D0B28
BE4AA3BF 16F8282A 4C087B9E 87FBDF5D 7F2EB809
BC0F278C E5A1D14E C664FD67 C6C48430 ED371D0E
CD97BE6A 0BF06704 53817E6E 1690CEE3 45
0203
010001
Table 3-28 Description of the display rsa local-key-pair public command output
Item Description
Time of key pair created Time and date when the public key is
created.
Format
display rsa peer-public-key [ brief | name key-name ]
Parameters
Parameter Description Value
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to check detailed information about the RSA public key
and whether the local and peer public keys are the same.
Precautions
Before running the display rsa peer-public-key command, run the rsa peer-
public-key command to generate the peer public key.
Example
# Display the brief information about all RSA public keys.
<HUAWEI> display rsa peer-public-key brief
------------------------------------------
Bits Name
------------------------------------------
2048 rsakey001
------------------------------------------
Table 3-29 Description of the display rsa peer-public-key brief command output
Item Description
# Display the detailed information about the RSA public key named rsakey001.
<HUAWEI> display rsa peer-public-key name rsakey001
=====================================
Key name : rsakey001
Encoding type : DER
=====================================
Key code:
308188
028180
739A291A BDA704F5 D93DC8FD F84C4274 631991C1 64B0DF17 8C55FA83 3591C7D4
7D5381D0 9CE82913 D7EDF9C0 8511D83C A4ED2B30 B809808E B0D1F52D 045DE408
61B74A0E 135523CC D74CAC61 F8E58C45 2B2F3F2D A0DCC48E 3306367F E187BDD9
44018B3B 69F3CBB0 A573202C 16BB2FC1 ACF3EC8F 828D55A3 6F1CDDC4 BB45504F
0203
010001
Table 3-30 Description of the display rsa peer-public-key name command output
Item Description
Format
display ssh client session
Parameters
Parameter Description Value
Views
All views
Default Level
3: Management level
Usage Guidelines
To check the current session connection information of the SSH client, run the
display ssh client session command.
Example
# Display the current session status information of the SSH client.
<HUAWEI> display ssh client session
--------------------------------------------------------------------------
Session :1
Version : 2.0
CTOS Cipher : aes256-ctr
STOC Cipher : aes256-ctr
CTOS Hmac : hmac-sha2-256
STOC Hmac : hmac-sha2-256
CTOS Compress : none
STOC Compress : none
Total Packet Number : 152
Packet Number after Rekey : 152
Total Data(MB) :0
Data after Rekey(MB) :0
Time after Session Established(Minute) : 2
Time after Rekey(Minute) :2
--------------------------------------------------------------------------------
Table 3-31 Description of the display ssh client session command output
Item Description
Item Description
Packet Number after Total number of SSH session packets after key re-
Rekey negotiation.
Data after Rekey(MB) Total data volume of the SSH session connection after
key re-negotiation, in MB.
Time after Session Connection duration after the SSH session connection
Established(Minute) is activated, in minutes.
Function
The display ssh server command displays the SSH server information.
Format
display ssh server { status | session }
Parameters
Parameter Description Value
Views
All views
Default Level
3: Management level
Usage Guidelines
After configuring the SSH attributes, you can run this command to view the
configuration or session connection information on the SSH server to verify that
the SSH connection has been established.
Example
# Display the global configuration on the SSH server.
<HUAWEI> display ssh server status
SSH Version : 2.0
SSH authentication timeout (Seconds) : 60
SSH authentication retries (Times) :3
SSH server key generating interval (Hours) : 0
SSH version 1.x compatibility : Disable
SSH server keepalive : Enable
SFTP IPv4 server : Enable
SFTP IPv6 server : Enable
STELNET IPv4 server : Enable
STELNET IPv6 server : Enable
SNETCONF IPv4 server : Disable
SNETCONF IPv6 server : Disable
SNETCONF IPv4 server port(830) : Disable
SNETCONF IPv6 server port(830) : Disable
SCP IPv4 server : Enable
SCP IPv6 server : Enable
SSH server DES : Enable
SSH IPv4 server port : 22
SSH IPv6 server port : 22
SSH server source address : 0.0.0.0
SSH ipv6 server source address : 0::0
SSH ipv6 server source vpnName :
ACL name : --
ACL number : --
ACL6 name : --
ACL6 number : --
SSH server ip-block : Enable
Table 3-32 Description of the display ssh server status command output
Item Description
SSH Version Protocol version used for the SSH session connection.
Item Description
SSH version 1.x SSH 1.x version compatibility, and the value can be
compatibility Enable or Disable.
Run the ssh server compatible-ssh1x enable
command to set this item.
SSH server keepalive Keepalive state of the SSH server. The value can be
Enable or Disable.
Run the ssh server keepalive disable command to set
this item.
SFTP IPv4 server/SFTP Status of the SFTP server. The value can be Enable or
IPv6 server Disable.
Run the sftp server enable command to set this item.
STELNET IPv4 server/ Status of the STelnet server. The value can be Enable
STELNET IPv6 server or Disable.
Run the stelnet server enable command to set this
item.
SCP IPv4 server/SCP Status of the SCP server. The value can be Enable or
IPv6 server Disable.
Run the scp server enable command to set this item.
ACL name Name of the ACL rule bound to the SSH server.
Run the ssh server acl acl-name command to set this
item.
Item Description
ACL number Number of the ACL rule bound to the SSH server.
Run the ssh server acl acl-number command to set
this item.
ACL6 name Name of the ACL6 rule bound to the SSH server.
Run the ssh ipv6 server acl acl-number command to
set this item.
ACL6 number Number of the ACL6 rule bound to the SSH server.
Run the ssh ipv6 server acl acl-number command to
set this item.
SSH server ip-block Status of the SSH server from locking client IP
addresses. It can be any one of the following:
● Enable: SSH server is enabled to lock client IP
addresses.
● Disable: SSH server is disabled to lock client IP
addresses.
Table 3-33 Description of the display ssh server session command output
Item Description
Connect type Connection used by the SSH session. The options are
as follows:
● VTY: connection used by the STelnet user
● NCA: connection used by the SNetconf user
● SFTP: connection used by the SFTP user
Client to Server cipher Encryption algorithm name from the client to the
server.
Server to Client cipher Encryption algorithm name from the server to the
client.
Client to Server HMAC HMAC algorithm name from the client to the server.
Server to Client HMAC HMAC algorithm name from the server to the client.
Item Description
Service type Service type for an SSH user. The options are as
follows:
● sftp
● stelnet
● snetconf
Run the ssh user service-type command to set this
item.
Authentication type Authentication mode for an SSH user. The options are
as follows:
● password
● rsa
● dsa
● ecc
● x509v3-rsa
● password-x509v3-rsa
● password-rsa (password and RSA)
● password-dsa (password and DSA)
● password-ecc (password and ECC)
● all (password, pki, DSA, ECC, or RSA)
Run the ssh user authentication-type command to
set this item.
Packet Number after Total number of SSH session packets after key re-
Rekey negotiation.
Data after Rekey(MB) Total data volume of the SSH session connection after
key re-negotiation, in MB.
Time after Session Connection duration after the SSH session connection
Established(Minute) is activated, in minutes.
Format
display ssh server-info
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
When the SSH client needs to authenticate the server, the server public key saved
in the local host is used to authenticate the connected SSH server. If the
authentication fails, you can run the display ssh server-info command to verify
that the server public key is correct.
Example
# Display all bindings between the SSH server and public keys on the SSH client.
<HUAWEI> display ssh server-info
-----------------------------------------------------------------------------------------------------------------
Server Name(IP) Server public key name Server public key type
State
-----------------------------------------------------------------------------------------------------------------
Item Description
Server Public Key Type Type of the public key on the SSH server.
Server public key name Name of the public key on the SSH server.
Item Description
Format
display ssh user-information [ username ]
Parameters
Parameter Description Value
username Displays the SSH user name. The SSH must already exist.
Views
All views
Default Level
3: Management level
Usage Guidelines
This command displays the SSH user name, bound RSA, DSA, or ECC public key
name, and service type.
Example
# Display the configuration of all SSH users.
<HUAWEI> display ssh user-information
--------------------------------------------------------------------------------
User Name : client001
Authentication type : password
User public key name : --
User public key type : --
Sftp directory : flash:
Service type : sftp
Authentication type Authentication mode for an SSH user. The options are
as follows:
● password
● rsa
● dsa
● ecc
● x509v3-rsa
● password-x509v3-rsa
● password-rsa (password and RSA)
● password-dsa (password and DSA)
● password-ecc (password and ECC)
● all (password, pki, DSA, ECC, or RSA)
Run the ssh user authentication-type command to
set this item.
User public key name Peer RSA, DSA, or ECC public key assigned to an SSH
user.
Run the rsa peer-public-key, dsa peer-public-key, or
ecc peer-public-key command to set this item.
User public key type Type of the public key allocated to the SSH user:
● RSA: indicates that the type is RSA.
● DSA: indicates that the type is DSA.
● ECC: indicates that the type is ECC.
● --: indicates that no public key type is specified.
Item Description
Service type Service type for an SSH user. The options are as
follows:
● sftp: indicates that the service type is SFTP.
● stelnet: indicates that the service type is STelnet.
● snetconf: indicates that the service type is
SNetConf.
● --: indicates that no service type is specified.
Run the ssh user service-type command to set this
item.
Format
display telnet server
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
When you fail to log in to a server using Telnet, run the display telnet server
command to check the configuration of the Telnet server. The command output
can help you find the cause of the login failure.
Example
# Display the basic configuration of the Telnet server.
<HUAWEI> display telnet server
Telnet server : Enable
Telnet server port : 23
Telnet IPv6 server : Disable
Telnet IPv6 server port : 23
Telnet IPv6 server Status of the Telnet IPv6 server. The value can
be Enable or Disable.
Run the telnet ipv6 server disable command
to set this item.
Telnet IPv6 server port Port number of the Telnet IPv6 server.
Run the telnet server port command to set
this item.
TELNET ipv6 server source Source IP address of the Telnet IPv6 server.
address
TELNET ipv6 server source Source VPN instance name of the Telnet IPv6
vpnName server.
Item Description
Format
display telnet server status
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run this command to check the source IP address of the Telnet server and
the source address carried in a connection request.
If the Telnet connection does not exist, no information is displayed after you run
this command.
Example
# Display the status of the Telnet server.
<HUAWEI> display telnet server status
Session 1:
Source ip address : 192.168.1.3
VTY Index :0
Session 2:
Source ip address : 192.168.1.4
VTY Index :1
Session 3:
Source ip address : 192.168.1.5
VTY Index :2
Session 4:
Source ip address : 192.168.1.6
VTY Index :3
Current number of sessions : 4
Table 3-37 Description of the display telnet server status command output
Item Description
Function
The display telnet client command displays the number of current telnet
connections.
Format
display telnet client
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
An administrator can use the display telnet client command to check how many
users have logged in to a server through Telnet.
Example
# Display the number of current connections.
<HUAWEI> display telnet client
---------------------------------------
Current user count : 2
Source IPv4 address : 10.1.1.2
---------------------------------------
Item Description
Function
The dsa key-pair label command generates a DSA key pair with a label.
The undo dsa key-pair label command deletes a DSA key pair with a label.
Format
dsa key-pair label label-name [ modulus modulus-bits ]
Parameters
load private Specifies the private key The private-key must already exist.
private-key in the key pair.
public public-key Specifies the public key The public-key must already exist.
in the key pair.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to generate a DSA key pair for user authentication. The
DSA key pair improves authentication security. You can run the dsa key-pair label
command to generate multiple DSA key pairs, and the key pairs are identified by
different labels.
Precautions
You can run the dsa key-pair label command to generate multiple DSA key pairs
with labels. The maximum number of DSA key pairs is specified by the dsa key-
pair maximum command. By default, the device can generate a maximum of 20
DSA key pairs with labels.
Example
# Generate the DSA key pair with the label name ssh_host.
<HUAWEI> system-view
[~HUAWEI] dsa key-pair label ssh_host
Format
dsa key-pair maximum max-keys
undo dsa key-pair maximum
Parameters
Parameter Description Value
max-keys Specifies the maximum number of The value is an integer that
DSA key pairs with labels. ranges from 1 to 20.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Saving DSA key pairs consumes system memory and file resources. Therefore, you
can adjust the maximum number of DSA key pairs as required to ensure that they
do not occupy too many system resources.
Configuration Impact
The device fails to generate DSA key pairs with labels when the number of DSA
key pairs reaches the upper limit specified by this command.
Example
# Set the maximum number of DSA key pairs with labels to 15.
<HUAWEI> system-view
[~HUAWEI] dsa key-pair maximum 15
Format
dsa local-key-pair create
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Compared with RSA, Digital Signature Algorithm (DSA) has a wider application
range in the SSH protocol. According to the encryption principle of the asymmetric
encryption system, the public and private keys are generated to implement secure
key exchange. This ensures the secure session process.
The prerequisite for a user to successfully log in to the SSH server using DSA
authentication is to generate a local DSA key pair. A local DSA key pair can be
generated in the following two methods:
● Configuration: You can run the dsa local-key-pair create command to
generate a local DSA key pair.
● Automatic generation: If an SSH client logs in to a device and the SSH server
has no DSA key pair, the system automatically generates a DSA key pair.
Key pairs generated in the two methods are the same in terms of function,
security, query, and deletion. It is recommended that you run the dsa local-key-
pair create command to generate a local DSA key pair.
When you run this command, the system prompts you to confirm whether to
change the original key if the DSA key exists. The key in the new key pair is
named device name_Host_DSA, for example, HUAWEI_Host_DSA.
After you enter the command, the device prompts you to enter the number of bits
in the host key. The length of a host key pair is 2048.
After a successful login, run the save command to save configurations. The
generated key pair then is saved on the device and is not lost after the device
restarts.
Precautions
This command is not saved in a configuration file and can take effect immediately
after being executed. After the device restarts, you do not need to run the
command again.
Example
# Generate a local DSA key pair on the device.
<HUAWEI> system-view
[~HUAWEI] dsa local-key-pair create
Info: The key name will be: HUAWEI_Host_DSA
Info: The key modulus can be any one of the following : 2048.
Info: Key pair generation will take a short while.
Info: Generating keys...
Info: Succeeded in creating the DSA host keys.
Function
The dsa local-key-pair destroy command deletes local DSA host key pairs.
Format
dsa local-key-pair destroy
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Prerequisite
Precautions
After you run this command, it takes effect and is not saved in a configuration file.
Example
# Delete local DSA keys.
<HUAWEI> system-view
[~HUAWEI] dsa local-key-pair destroy
Info: The name of the key which will be destroyed is
HUAWEI_Host_DSA.
Warning: These keys will be destroyed. Continue? Please select [Y/
N]:y
Info: Succeeded in destroying the DSA host keys.
Function
The dsa local-key-pair load command loads the local DSA and server key pairs
from a specified file.
By default, the local DSA and server key pairs are not configured.
Format
dsa local-key-pair load hostkey file-name
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a user is upgraded from a low level to a high level and wants to use DSA
key configuration of the low level, run the dsa local-key-pair load command to
load the local DSA and server key pairs from a specified file.
Prerequisites
The file that contains the DSA key pair already exists.
Example
# Load the local DSA key pair.
<HUAWEI> system-view
[~HUAWEI] dsa local-key-pair load hostkey flash:/hostkey_dsa
Function
The dsa peer-public-key command configures an encoding format for a DSA
public key and displays the DSA public key view.
Format
dsa peer-public-key key-name encoding-type { der | openssh | pem }
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you use a DSA public key for authentication, you must specify the public
key of the corresponding client for an SSH user on the server. When the client logs
in to the server, the server uses the specified public key to authenticate the client.
You can also save the public key generated on the server to the client. Then the
client can be successfully authenticated by the server when it logs in to the server
for the first time.
Huawei data communications devices support the DER, OpenSSH and PEM
formats for DSA keys. If you use a DSA key in non-DER/OpenSSH/PEM format, use
a third-party tool to convert the key into a key in DER, OpenSSH or PEM format.
Because a third-party tool is not released with Huawei system software, DSA
usability is unsatisfactory. In addition to DER and PEM, DSA keys need to support
the OpenSSH format to improve DSA usability.
After you configure an encoding format for a DSA public key, Huawei data
communications device automatically generates a DSA public key in the
configured encoding format and enters the DSA public key view. Then you can run
the public-key-code begin command and manually copy the DSA public key
generated on the peer device to the local device.
Follow-up Procedure
After you copy the DSA public key generated on the peer device to the local
device, perform the following operations to exit the DSA public key view:
1. Run the public-key-code end command to return to the DSA public key view.
2. Run the peer-public-key end command to exit the DSA public key view and
return to the system view.
Precautions
If a DSA public key has assigned to an SSH client, release the binding relationship
between the public key and the SSH client. If you do not release the binding
relationship between them, the undo dsa peer-public-key command will fail to
delete the DSA public key.
If a DSA public key has been assigned to an SSH user, run the undo ssh user user-
name assign dsa-key command to delete the mapping between the DSA public
key and the SSH user. If you do not delete the mapping, the undo dsa peer-
public-key command cannot delete the DSA public key.
Example
# Configure an encoding format for a DSA public key and enter the DSA public
key view.
<HUAWEI> system-view
[~HUAWEI] dsa peer-public-key 23 encoding-type der
[*HUAWEI-dsa-public-key]
Format
ecc key-pair label label-name [ modulus modulus-bits ]
undo ecc key-pair label label-name
Parameters
Parameter Description Value
label-name Specifies the label The value is a string of 1 to 35 case-
name of an ECC key insensitive characters. It can contain
pair. digits, letters, and underscores (_) only.
modulus Specifies the modulus The value can be 256, 384, or 521, in
modulus-bits of the ECC key pair. bits. The default value is 521.
A larger modulus indicates higher
security. However, it takes a long time to
generate and use such a key pair.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to generate an ECC key pair for user authentication.
The ECC key pair improves authentication security. You can run the ecc key-pair
label command to generate multiple ECC key pairs, and the key pairs are
identified by different labels.
Precautions
You can run the ecc key-pair label command to generate multiple ECC key pairs
with labels. The maximum number of ECC key pairs is specified by the ecc key-
pair maximum command. By default, the device can generate a maximum of 20
ECC key pairs with labels.
Example
# Generate an ECC key pair with a label named ecc_key_pair.
<HUAWEI> system-view
[~HUAWEI] ecc key-pair label ecc_key_pair
Format
ecc key-pair maximum max-keys
undo ecc key-pair maximum
Parameters
Parameter Description Value
max-keys Specifies the maximum number of The value is an integer that
ECC key pairs with labels. ranges from 1 to 20.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Saving ECC key pairs consumes system memory and file resources. Therefore, you
can adjust the maximum number of ECC key pairs as required to ensure that they
do not occupy too many system resources.
Configuration Impact
The device fails to generate ECC key pairs with labels when the number of ECC key
pairs reaches the upper limit specified by this command.
Example
# Set the maximum number of ECC key pairs with labels to 15.
<HUAWEI> system-view
[~HUAWEI] ecc key-pair maximum 15
Format
ecc local-key-pair create
ecc local-key-pair destroy
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
A local key pair is a prerequisite to a successful SSH login. Compared with the RSA
algorithm used by the rsa local-key-pair create command, the ECC algorithm
shortens the key length, accelerates the encryption, and improves the security. The
length of the server key pair can be 256 bits, 384 bits, and 521 bits. By default, the
length of the key pair is 521 bits.
If you no longer need the local ECC key pairs, run the ecc local-key-pair destroy
command to delete them.
The prerequisite for a user to successfully log in to the SSH server using ECC
authentication is to generate a local ECC key pair. A local ECC key pair can be
generated in the following two methods:
● Configuration: You can run the ecc local-key-pair create command to
generate a local ECC key pair.
● Automatic generation: If an SSH client logs in to a device and the SSH server
has no ECC key pair, the system automatically generates an ECC key pair.
Key pairs generated in the two methods are the same in terms of function,
security, query, and deletion. It is recommended that you run the ecc local-key-
pair create command to generate a local ECC key pair.
After a successful login, run the save command to save configurations. The
generated key pair then is saved on the device and is not lost after the device
restarts.
Precautions
● The generated ECC host key pair is named in the format of switch
name_Host_ECC, such as HUAWEI_Host_ECC.
● The ecc local-key-pair create and ecc local-key-pair destroy commands are
not saved in the configuration file. They only need to be run once and take
effect even after the switch restarts.
● Do not delete the ECC key file from the switch.
Example
# Generate a local ECC key pair.
<HUAWEI> system-view
[~HUAWEI] ecc local-key-pair create
Info: The key name will be: HUAWEI_Host_ECC
Info: The key modulus can be any one of the following: 256, 384, 521.
Info: Key pair generation will take a short while.
Please input the modulus [default=521]:
Format
ecc peer-public-key key-name [ encoding-type enc-type ]
undo ecc peer-public-key key-name
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you use an ECC public key for authentication, specify the public key on the
server for the client of SSH users. When the client logs in to the server, the server
uses the specified public key to authenticate the client.
After you enter the ECC public key view, run the public-key-code begin
command, and copy the ECC public key to the server.
NOTE
Follow-up Procedure
After you copy the ECC public key generated on the client to the server, perform
the following operations to exit the ECC public key view:
1. Run the public-key-code end command to return to the ECC public key view.
2. Run the peer-public-key end command to exit the ECC public key view and
return to the system view.
Precautions
The public key on the client is randomly generated by the client software.
If an ECC public key has been assigned to an SSH user, run the undo ssh user
user-name assign ecc-key command to delete the mapping between the ECC
public key and the SSH user. If you do not delete the mapping, the undo ecc peer-
public-key command cannot delete the ECC public key.
Example
# Create an ECC public key and enter the ECC public key view.
<HUAWEI> system-view
[~HUAWEI] ecc peer-public-key ecckey001
[*HUAWEI-ecc-public-key]
Function
The ftp server login-failed threshold-alarmcommand configures alarm
generation and clearance thresholds for FTP server login failures within a specified
period.
The undo ftp server login-failed threshold-alarm command restores the default
alarm generation and clearance thresholds.
Format
ftp server login-failed threshold-alarm upper-limit report-times lower-limit
resume-times period period-time
undo ftp server login-failed threshold-alarm [ upper-limit report-times lower-
limit resume-times period period-time ]
Parameters
Parameter Description Value
upper-limit Specifies the number of times The value is an
report-times authentication failure alarms are integer ranging from
reported. If the value is 0, no 0 to 100.
authentication failure alarm is
reported. The default value is 30.
lower-limit Specifies the number of times The value is an
resume-times authentication failure clear alarms are integer ranging from
reported. The default value is 20. 0 to 45.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If an FTP management user frequently fails to log in within a short period, the
device generates a management security alarm and reports it to administrators for
their intervention. To configure alarm reporting and clearance thresholds within a
specified period, run the ftp server login-failed threshold-alarm command.
The command takes effect for both ipv4 and ipv6 FTP servers.
Example
# Configure 40 as the alarm reporting threshold and 25 as the alarm clearance
threshold within 10 minutes.
<HUAWEI> system-view
[*HUAWEI] ftp server login-failed threshold-alarm upper-limit 40 lower-limit 25 period 10
3.6.35 http
Function
The http command displays the HTTP view.
The undo http command deletes the HTTP view and all configurations in this
view.
Format
http
undo http
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
HTTP is an application-layer protocol that transports hypertext from WWW servers
to local browsers. HTTP uses the client/server model in which requests and replies
are exchanged.
Before configuring HTTP, run the http command to enter the HTTP view.
Example
# Display the HTTP view.
<HUAWEI> system-view
[~HUAWEI] http
3.6.36 lock
Function
The lock command locks the current user interface to prevent unauthorized users
from operating the interface.
By default, the system does not automatically lock the current user interface.
Format
lock
Parameters
None
Views
User view
Default Level
0: Visit level
Usage Guidelines
Usage Scenario
Lock the current user interface using this command to prevent other users from
operating the interface. The user interfaces consist of console ports, and Virtual
Type Terminals (VTYs).
After using the lock command, you are prompted to input the password twice. If
you input the correct password for twice, the user interface is locked.
Precautions
● The passwords must meet the specified requirements.
– When password complexity check is supported, the requirements are as
follows:
Example
# Lock the current user interface after logging in through the console port.
<HUAWEI> lock
Enter Password:
Confirm Password:
Info: The terminal is locked.
# To log in to the system after the system is locked, you must press Enter. The
following information is displayed:
Enter Password:
Format
peer-public-key end
Parameters
None
Views
Public key view
Default Level
3: Management level
Usage Guidelines
You must save the public key generated on the remote host to the local host,
which ensures that the validity check on the remote end is successful. After editing
a public key in the public key view, you can run this command to return to the
system view.
Example
# Return to the system view from the public key view.
<HUAWEI> system-view
[~HUAWEI] dsa peer-public-key dsakey001 encoding-type der
[*HUAWEI-dsa-public-key] public-key-code begin
[*HUAWEI-dsa-public-key-dsa-key-code] 308188
[*HUAWEI-dsa-public-key-dsa-key-code] 028180
[*HUAWEI-dsa-public-key-dsa-key-code] B21315DD 859AD7E4 A6D0D9B8 121F23F0 006BB1BB
[*HUAWEI-dsa-public-key-dsa-key-code] A443130F 7CDB95D8 4A4AE2F3 D94A73D7 36FDFD5F
[*HUAWEI-dsa-public-key-dsa-key-code] 411B8B73 3CDD494A 236F35AB 9BBFE19A 7336150B
[*HUAWEI-dsa-public-key-dsa-key-code] 40A35DE6 2C6A82D7 5C5F2C36 67FBC275 2DF7E4C5
[*HUAWEI-dsa-public-key-dsa-key-code] 1987178B 8C364D57 DD0AA24A A0C2F87F 474C7931
[*HUAWEI-dsa-public-key-dsa-key-code] A9F7E8FE E0D5A1B5 092F7112 660BD153 7FB7D5B2
[*HUAWEI-dsa-public-key-dsa-key-code] 171896FB 1FFC38CD
[*HUAWEI-dsa-public-key-dsa-key-code] 0203
[*HUAWEI-dsa-public-key-dsa-key-code] 010001
[*HUAWEI-dsa-public-key-dsa-key-code] public-key-code end
[*HUAWEI-dsa-public-key] peer-public-key end
[*HUAWEI]
Format
public-key-code begin
Parameters
None
Views
Public key view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You must save the public key generated on the remote host to the local host,
which ensures that the validity check on the remote end is successful. Run the
public-key-code begin command to display the public key editing view, and enter
the key data. The key characters can contain spaces. You can press Enter to enter
data in another line.
Prerequisite
A key name has been specified by running the rsa peer-public-key, dsa peer-
public-key, or ecc peer-public-key command.
NOTICE
For security purposes, it is not recommended that you use RSA as the public key.
Precautions
● The content of a key does not support Chinese characters.
● The public key must be a hexadecimal character string in the public key
encoding format, and generated by the client or server that supports SSH.
● The public keys displayed by running the display rsa local-key-pair public,
display dsa local-key-pair public, or display ecc local-key-pair public
command can be used as the key data to enter.
● You can successfully edit the public key in a public key pair by entering the
public key in the server key pair or client key pair. In SSH application, only the
public key in the client key pair can be entered as key data. If you enter the
public key in the server key pair, authentication fails during SSH login.
Example
# Display the public key editing view and enter the key data.
<HUAWEI> system-view
Format
public-key-code end
Parameters
None
Views
Public key editing view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After this command is run, the process of editing the public key ends. Before
saving the public key, the system will check the validity of the key.
● If there are illegal characters in the public key character string configured by
the user, the system will display a relevant error prompt. The public key
previously configured by the user is discarded. As a result, the configuration
fails.
● If the public key configured is valid, it is saved in the public key chain table of
the client.
Precautions
● Generally, in the public key view, only the public-key-code end command can
be used to exit. Thus, in this instance the quit command cannot be used.
● If the legal key coding is not input, the key cannot be generated after the
public-key-code end command is used. The system prompts that generating
the incorrect key fails.
● If the key is deleted in another window, the system prompts that the key does
not exist and returns to the system view directly after you run the public-key-
code end command.
Example
# Exit from the RSA public key editing view and saves the RSA key configuration.
<HUAWEI> system-view
[~HUAWEI] dsa peer-public-key dsakey001 encoding-type der
[*HUAWEI-dsa-public-key] public-key-code begin
[*HUAWEI-dsa-public-key-dsa-key-code] 308188
[*HUAWEI-dsa-public-key-dsa-key-code] 028180
[*HUAWEI-dsa-public-key-dsa-key-code] B21315DD 859AD7E4 A6D0D9B8 121F23F0 006BB1BB
[*HUAWEI-dsa-public-key-dsa-key-code] A443130F 7CDB95D8 4A4AE2F3 D94A73D7 36FDFD5F
[*HUAWEI-dsa-public-key-dsa-key-code] 411B8B73 3CDD494A 236F35AB 9BBFE19A 7336150B
[*HUAWEI-dsa-public-key-dsa-key-code] 40A35DE6 2C6A82D7 5C5F2C36 67FBC275 2DF7E4C5
[*HUAWEI-dsa-public-key-dsa-key-code] 1987178B 8C364D57 DD0AA24A A0C2F87F 474C7931
[*HUAWEI-dsa-public-key-dsa-key-code] A9F7E8FE E0D5A1B5 092F7112 660BD153 7FB7D5B2
[*HUAWEI-dsa-public-key-dsa-key-code] 171896FB 1FFC38CD
[*HUAWEI-dsa-public-key-dsa-key-code] 0203
[*HUAWEI-dsa-public-key-dsa-key-code] 010001
[*HUAWEI-dsa-public-key-dsa-key-code] public-key-code end
[*HUAWEI-dsa-public-key] peer-public-key end
[*HUAWEI]
Function
The rsa key-pair label command generates an RSA key pair with a label.
The undo rsa key-pair label command deletes an RSA key pair with a label.
Format
rsa key-pair label label-name [ modulus modulus-bits ]
Parameters
modulus modulus- Specifies the modulus of The value are 2048 and 3072,
bits the RSA key pair. in bits. The default value is
3072.
load private Specifies the private key in The private-key must already
private-key the key pair. exist.
public public-key Specifies the public key in The public-key must already
the key pair. exist.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The RSA key-pair is an algorithm for authenticating users in the SSH and ensures
security of user authentication. You can run the rsa key-pair label command to
generate multiple RSA key pairs, and the key pairs are identified by different
labels.
Precautions
You can run the rsa key-pair label command to generate multiple RSA key pairs
with labels. The maximum number of RSA key pairs is specified by the rsa key-
pair maximum command. By default, the device can generate a maximum of 20
RSA key pairs with labels.
NOTE
To ensure high security, using the 3072-bit RSA key pair is recommended.
Example
# Generate an RSA key pair with a label named as ssh_host.
<HUAWEI> system-view
[~HUAWEI] rsa key-pair label ssh_host
The undo rsa key-pair maximum command restores the maximum number of
RSA key pairs with labels to the default value.
By default, the device can generate a maximum of 20 RSA key pairs with labels.
Format
rsa key-pair maximum max-keys
Parameters
Parameter Description Value
max-keys Specifies the maximum number of The value is an integer that
RSA key pairs with labels. ranges from 1 to 20.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Saving RSA key pairs consumes system memory and file resources. Therefore, you
can adjust the maximum number of RSA key pairs as required to ensure that they
do not occupy too many system resources.
Configuration Impact
The device fails to generate RSA key pairs with labels when the number of RSA
key pairs reaches the upper limit specified by this command.
Example
# Set the maximum number of RSA key pairs with labels to 15.
<HUAWEI> system-view
[~HUAWEI] rsa key-pair maximum 15
Function
The rsa local-key-pair create command generates a local RSA key pair.
Format
rsa local-key-pair create
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To implement secure data exchange between the server and client, run this
command to generate a local key pair.
The prerequisite for a user to successfully log in to the SSH server using RSA
authentication is to generate a local RSA key pair. A local RSA key pair can be
generated in the following two methods:
● Configuration: You can run the rsa local-key-pair create command to
generate a local RSA key pair.
● Automatic generation: If an SSH client logs in to a device and the SSH server
has no RSA key pair, the system automatically generates an RSA key pair.
Key pairs generated in the two methods are the same in terms of function,
security, query, and deletion. It is recommended that you run the rsa local-key-
pair create command to generate a local RSA key pair.
After a successful login, run the save command to save configurations. The
generated key pair then is saved on the device and is not lost after the device
restarts.
Precautions
If the RSA key pair exists, the system prompts you to confirm whether to replace
the original key pair. The keys in the new key pair are named device name_server
and device name_host, for example, HUAWEI_host and HUAWEI_server.
After inputting this command, you are prompted to enter the digit of the host key.
The length of the server key pair and the host key pair is 2048 or 3072 digits. If
there has been a key pair, you should confirm whether to change it.
This command is not saved in a configuration file.
Example
# Generate a local RSA key pair.
<HUAWEI> system-view
Function
The rsa local-key-pair destroy command deletes all local RSA host and server key
pairs.
Format
rsa local-key-pair destroy
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To delete the local key pair, run rsa local-key-pair destroy command. If the host
key pair and the service key pair of an SSH server are deleted, run the rsa local-
key-pair create command to create the host key pair and service key pair for the
SSH server.
After you run this command, verify that all local RSA keys are deleted. This
command is not saved in a configuration file.
Prerequisite
Example
# Delete all RSA server keys.
<HUAWEI> system-view
[~HUAWEI] rsa local-key-pair destroy
% The name for the keys which will be destroyed is HUAWEI_Host.
% Confirm to destroy these keys? Please select [Y/N]: y
Function
The rsa local-key-pair load command loads the local RSA and server key pairs
from a specified file.
By default, the local RSA and server key pairs are not configured.
Format
rsa local-key-pair load { hostkey | serverkey } file-name
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a user is upgraded from a low level to a high level and wants to use RSA
key configuration of the low level, run the rsa local-key-pair load command to
load the local RSA and server key pairs from a specified file.
Prerequisites
The file that contains the RSA key pair already exists.
Example
# Load the local RSA key pair.
<HUAWEI> system-view
[~HUAWEI] rsa local-key-pair load hostkey flash:/rsahostkey.dat
Function
The rsa peer-public-key command configures an encoding format for RSA public
key and enters the RSA public key view.
Format
rsa peer-public-key key-name [ encoding-type { der | openssh | pem } ]
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Run this command to display the public key view, and save the public key on the
remote host to the local host. This ensures that the remote device validity is
checked in connection.
After you configure an encoding format for an RSA public key, Huawei data
communications device automatically generates an RSA public key in the
configured encoding format and enters the RSA public key view. Then you can run
the public-key-code begin command and manually copy the RSA public key
generated on the peer device to the local device.
NOTE
A maximum of 20 RSA public keys can be configured. To ensure high security, do not use
the RSA key pair whose length is less than 2048 digits.
Prerequisite
The public key in hexadecimal notation on the remote host has been obtained and
recorded.
Follow-up Procedure
After you copy the RSA public key generated on the peer device to the local
device, perform the following operations to exit the RSA public key view:
1. Run the public-key-code end command to return to the RSA public key view.
2. Run the peer-public-key end command to exit the RSA public key view and
return to the system view.
Precautions
If an RSA public key has been assigned to an SSH user, run the undo ssh user
user-name assign rsa-key command to delete the mapping between the RSA
public key and the SSH user. If you do not delete the mapping, the undo rsa peer-
public-key command cannot delete the RSA public key.
Example
# Display the public key view.
<HUAWEI> system-view
[~HUAWEI] rsa peer-public-key rsakey001
[*HUAWEI-rsa-public-key]
3.6.46 run
Function
The run command executes a user view command in the system view.
Format
run command-line
Parameters
Parameter Description Value
Views
System view
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
To run commands, which can be run only in the user view, in the system view, you
must return to the user view. After completing this configuration task, you can run
the run command to run such commands in the system view without returning to
the user view.
Precautions
● The command specified in the run command must be able to be run in the
user view.
● When you run the run command, the association help function is unavailable.
● When you check the command history on the device using the display
history-command command, only the commands that you enter are
recorded. The command format is run command-line.
● When you check log information using the CLI/5/CMDRECORD command,
only the commands that are actually executed are recorded in logs. The
command format is run command-line.
● run cannot be used to execute commands that involve configuration rollback
or system software behavior change, such as switch virtual-system vs-name,
rollback configuration to { commit-id commit-id | label label | file file-
name } | last number-of-commits }, quit, and patch load.
Example
# View .cfg files in the system view.
<HUAWEI> system-view
[~HUAWEI] run dir *.cfg
Directory of flash:/
Idx Attr Size(Byte) Date Time FileName
0 -rw- 11,970 Mar 14 2012 19:11:22 31.cfg
1 -rw- 12,033 Apr 22 2012 17:10:30 31_new.cfg
509,256 KB total (118,784 KB free)
Format
ssh authentication-type default password
undo ssh authentication-type default password
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When there are multiple SSH users in the system, the preset password
authentication mode is used to simplify the configuration.
When users request to log in to a device using SSH, if no SSH user is created using
the ssh user, ssh user authentication-type, and ssh user service-type
commands, successful user login depends on whether the ssh authentication-
type default password command is run.
● If the ssh authentication-type default password command is run, users log
in through AAA authentication.
Example
# Configure the password authentication mode for an SSH user.
<HUAWEI> system-view
[~HUAWEI] ssh authentication-type default password
Format
ssh authorization-type default { aaa | root }
undo ssh authorization-type default
Parameters
Parameter Description Value
aaa Sets the authorization method for an SSH session as AAA. -
Views
System view
Default Level
3: Management level
Usage Guidelines
If the authorization type for an SSH connection is AAA, the privilege level of SSH
user is that configured in the AAA view.
If the authorization type for an SSH connection is root, the privilege level of SSH
user is different from that configured in the AAA view. In this situation, the
privilege level is the maximum value, 15 or 3.
This command takes effect for both ipv4 and ipv6 connections.
Example
# Set the authorization method for SSH session as AAA.
<HUAWEI> system-view
[~HUAWEI] ssh authorization-type default aaa
Function
The ssh client peer assign command specifies the host public key of the SSH
server to connect on the SSH client.
The undo ssh client peer assign command cancels the specified host public key
of the SSH server to connect on the SSH client.
By default, the host public key of the server to connect is not specified on the
client.
Format
ssh client peer server-ip-address assign { rsa-key | dsa-key | ecc-key } key-name
Parameters
Parameter Description Value
key-name Specifies the SSH server public key The SSH server
name that has been configured on the public key name
SSH client. must already exist.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the SSH client connects to the SSH server for the first time and the first login is
not enabled on the SSH client using the ssh client first-time enable command,
the SSH client rejects the access from unauthorized SSH servers. You need to
specify the host public key of the SSH server and the mapping between the key
and SSH server on the SSH client. After that, the client will determine whether the
server is reliable using the correct public key based on the mapping.
NOTICE
For security purposes, it is not recommended that you use RSA as the public key.
Precautions
The RSA, DSA, or ECC public key to be assigned to the SSH server must have been
configured on the SSH client using the rsa peer-public-key, dsa peer-public-key,
or ecc peer-public-key command. If the key has not been configured, the
verification for the RSA, DSA, or ECC public key of the SSH server on the SSH
client fails.
Example
# Assign the DSA public key to the SSH server.
<HUAWEI> system-view
[~HUAWEI] ssh client peer 10.164.39.120 assign dsa-key sshdsakey01
Function
The ssh client cipher command configures encryption algorithms on an SSH
client.
The undo ssh client cipher command restores the default encryption algorithms
on an SSH client.
Format
ssh client cipher { des_cbc | 3des_cbc | aes128_cbc | aes192_cbc | aes256_cbc |
aes128_ctr | aes192_ctr | aes256_ctr | arcfour128 | arcfour256 | aes128_gcm |
aes256_gcm } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
ssh-client write
Usage Guidelines
Usage Scenario
To configure encryption algorithms on an SSH client, run the ssh client cipher
command. The SSH client and server negotiate encryption algorithms for the
packets exchanged between them. During negotiation, the client sends its
encryption algorithms to the server. After comparing the received encryption
algorithms with local ones, the server selects the first matching encryption
algorithm received for packet transmission. If no matching encryption algorithm is
found, the negotiation fails.
Precautions
For security purposes, you are advised to use secure algorithms such as
AES128_CTR, AES256_CTR, AES192_CTR, AES128_GCM, and AES256_GCM.
If the device loads a configuration file for startup (for example, the device loads a
configuration file using ZTP for initial configuration) and the configuration file
does not contain the ssh client cipher command configuration, the encryption
algorithms supported by the SSH client are AES256_GCM, AES128_GCM,
AES256_CTR, AES192_CTR, AES128_CTR, AES256_CBC, AES128_CBC, and
3DES_CBC.
Example
# Configure encryption algorithms in CTR mode on an SSH client.
<HUAWEI> system-view
[~HUAWEI] ssh client cipher aes128_ctr aes256_ctr
Function
The ssh client first-time enable command enables the first login on the SSH
client.
The undo ssh client first-time enable command disables the first login on the
SSH client.
Format
ssh client first-time enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When the SSH client accesses the SSH server for the first time and the public key
of the SSH server is not configured on the SSH client, you can enable the first
login for the SSH client to access the SSH server and save the public key on the
SSH client. When the SSH client accesses the SSH server next time, the saved
public key is used to authenticate the SSH server.
Precautions
You can run the ssh client peer assign command to pre-assign a public key to the
SSH server. In this manner, you can log in to the SSH server successfully at the first
time.
This command takes effect for both ipv4 and ipv6 SSH clients.
Example
# Enable the first login on the SSH client.
<HUAWEI> system-view
[~HUAWEI] ssh client first-time enable
Format
ssh client hmac { md5 | md5_96 | sha1 | sha1_96 | sha2_256 | sha2_256_96 |
sha2_512 } *
undo ssh client hmac
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
ssh-client write
Usage Guidelines
Usage Scenario
To configure HMAC authentication algorithms on an SSH client, run the ssh client
hmac command. During negotiation, the client sends its authentication algorithms
to the server. After comparing the received authentication algorithms with the
local ones on the server, the server selects the first matching authentication
algorithm received for packet transmission. If no matching authentication
algorithm is found, the negotiation fails.
Precautions
For security purposes, you are advised to use a secure algorithm (SHA2_256 or
SHA2_512.)
If the device loads a configuration file for startup (for example, the device loads a
configuration file using ZTP for initial configuration) and the configuration file
does not contain the ssh client hmac command configuration, the HMAC
authentication algorithms supported by the SSH client are SHA2_512,
SHA2_256_96, SHA2_256, SHA1, SHA1_96, MD5, and MD5_96.
Example
# Configure the SHA2_256 HMAC authentication algorithm.
<HUAWEI> system-view
[~HUAWEI] ssh client hmac sha2_256
Function
The ssh client keepalive-interval command sets the interval for sending
keepalive packets on the SSH client.
The undo ssh client keepalive-interval command restores the default interval for
sending keepalive packets on the SSH client.
The default interval for sending keepalive packets on the SSH client is 0.
Format
ssh client keepalive-interval seconds
Parameters
Parameter Description Value
seconds Specifies the interval for The value is an integer ranging from 0 to
sending keepalive 3600, in seconds. The value 0 indicates
packets. that keepalive packets are not sent.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the SSH client does not receive any data packet from the SSH server within a
period, the client sends keepalive packets to the server. If the client does not
receive any keepalive response packet from the server, the client disconnects from
the server.
Precautions
If the interval is restored to 0, the client does not send any keepalive packet to the
server.
This command takes effect for both ipv4 and ipv6 SSH clients.
Example
# Set the interval for sending keepalive packets on the SSH client to 30 seconds.
<HUAWEI> system-view
[~HUAWEI] ssh client keepalive-interval 30
Format
ssh client keepalive-maxcount count
Parameters
Parameter Description Value
count Specifies the maximum number The value is an integer that ranges
of keepalive packets. from 1 to 30.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the SSH client does not receive any data packet from the server within a period,
the client sends the maximum number of keepalive packets to the server. If the
client does not receive any keepalive response packet from the server, the client
disconnects from the server.
Precautions
The interval for sending keepalive packets on the client must be greater than the
interval that is set using the ssh client keepalive-interval command. If the client
does not send any keepalive packet (the interval is 0), the maximum number of
keepalive packets does not take effect.
This command takes effect for both ipv4 and ipv6 SSH clients.
Example
# Set the maximum number of keepalive packets on the SSH client to 5.
<HUAWEI> system-view
[~HUAWEI] ssh client keepalive-maxcount 5
Function
The ssh client key-exchange command adds a key exchange algorithm to the key
exchange algorithm list for an SSH client.
The undo ssh client key-exchange command restores the default configuration.
Format
ssh client key-exchange { dh_group14_sha1 | dh_group1_sha1 |
dh_group_exchange_sha1 | dh_group_exchange_sha256 | ecdh_sha2_nistp256 |
ecdh_sha2_nistp384 | ecdh_sha2_nistp521 | sm2_kep } *
undo ssh client key-exchange
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
ssh-client write
Usage Guidelines
Usage Scenario
The SSH client and server negotiate the key exchange algorithm for packet
transmission. To configure a key exchange algorithm list for the SSH client, run the
ssh client key-exchange command. After the server receives a packet from the
client, the server matches the key exchange algorithm list of the client against its
local list and selects the first matching key exchange algorithm. If no matching
key exchange algorithms exist, the negotiation fails.
Precautions
When the device loads a configuration file for startup (for example, the device
loads a configuration file using ZTP for initial configuration), and the
configuration file does not contain the ssh client key-exchange command
configuration, the SSH client uses dh_group_exchange_sha256,
dh_group_exchange_sha1, dh_group14_sha1, dh_group1_sha1,
ecdh_sha2_nistp256, ecdh_sha2_nistp384, ecdh_sha2_nistp521, and sm2_kep key
exchange algorithms.
Example
# Add the dh_group_exchange_sha256 algorithm to the key exchange algorithm
list for the SSH client.
<HUAWEI> system-view
[~HUAWEI] ssh client key-exchange dh_group_exchange_sha256
Function
The ssh client publickey command enables public key algorithms for an SSH
client.
The undo ssh client publickey command restores the default configuration.
Format
ssh client publickey { dsa | ecc | rsa } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
ssh-client write
Usage Guidelines
Usage Scenario
To enable public key algorithms for an SSH client, run the ssh client publickey
command. If only one public key algorithm is specified in the command, the client
can use only this algorithm to log in to the server. For example, if the ssh client
publickey dsa command is run, only the DSA algorithm can be used for login, and
the ECCand RSA algorithms cannot be used for login. If this command is run more
than once, the latest configuration overrides the previous one.
NOTE
For security purposes, do not use RSA keys whose length is less than 2048 bits.
Precautions
● A public key algorithm can be used for login only after it is enabled on both
the client and server.
● To restore the default configuration, you can run the undo ssh client
publickey command specified with the algorithms that are the same as those
configured in the ssh client publickey command. Alternatively, you can run
the undo ssh client publickey command with no algorithms specified.
● If the ssh client first-time enable command is run, a message is displayed
asking you to save the server public key when you use the client to log in to
the server. During the saving process, the SSH client automatically selects a
public key algorithm that can ensure successful negotiation and allocates the
algorithm to the SSH server based on the ssh client publickey command
configuration.
● If the ssh client first-time enable command is not run, you must run the ssh
client peer assign command to allocate a public key to the SSH server. In
addition, the SSH server must be able to use the public key algorithm
corresponding to the allocated public key to successfully negotiate with the
SSH client with the ssh client publickey command configured. Otherwise, the
SSH server's public key fails to be authenticated by the SSH client.
● When the device loads a configuration file for startup (for example, the device
loads a configuration file using ZTP for initial configuration), and the
configuration file does not contain the ssh client publickey command
configuration, the DSA, ECC, and RSA public key algorithms are enabled.
● This command can be run on an IPv4 or IPv6 SSH client.
Example
# Enable the ECC algorithm.
<HUAWEI> system-view
[~HUAWEI] ssh client publickey ecc
Function
The ssh client rekey command sets the criteria that trigger SSH client key re-
negotiation.
The undo ssh client rekey command restores the default values of criteria that
trigger SSH client key re-negotiation.
By default, key re-negotiation is triggered on the SSH client when one of the
following conditions is met:
● The total size of sent and received packets reaches 1000 MB.
● The total number of sent and received packets reaches 2147483648.
● The online duration reaches 60 minutes.
Format
ssh client rekey { data-limit data-limit | max-packet max-packet | time
minutes } *
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
When an SSH session meets one or more of the following criteria, the system re-
negotiates a key and uses the new key to establish SSH session connections,
improving system security.
● The number of interaction packets meets the configured key re-negotiation
criterion.
● The accumulated packet data volume meets the configured key re-
negotiation criterion.
● The session duration meets the configured key re-negotiation criterion.
● This command takes effect for both IPv4 and IPv6 SSH clients.
NOTE
A key re-negotiation request is initiated when either the SSH client or server meets the key
re-negotiation criteria, and the other party responds.
Example
# Configure key re-negotiation to be triggered on the SSH client when the total
size of sent and received packets reaches 10000 MB, the total number of sent and
received packets reaches 268435456, or the online duration reaches 1440 minutes.
<HUAWEI> system-view
[~HUAWEI] ssh client rekey data-limit 10000 max-packet 268435456 time 1440
Function
The ssh dscp command sets the DSCP priority of STelnet packets.
The undo ssh dscp command restores the default setting.
By default, the DSCP priority of STelnet packets is 48.
Format
ssh { client | server } dscp dscp-number
undo ssh { client | server } dscp [ dscp-number ]
Parameters
Parameter Description Value
dscp-number Specifies the DSCP priority. The value is an integer that ranges
from 0 to 63. A greater DSCP value
indicates a higher priority.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to set the DSCP priority of STelnet packets. The DSCP
priority of STelnet packets sent by the switch is then changed to the configured
value. When network congestion occurs, you can appropriately reduce the DSCP
priority of STelnet packets to ensure proper forwarding of data packets.
The priority of this command is higher than that of the set priority dscp
command. If a DSCP value is configured using this command, the configured value
takes effect. If a DSCP value is configured using the set priority dscp command
rather than this command, the value configured using the set priority dscp
command takes effect. If no DSCP value is configured using the preceding
commands, the default DSCP value is used.
When you run the undo ssh { client | server } dscp [ dscp-number ] command:
● If dscp-number is not specified, the DSCP field is restored to the default value.
● If dscp-number is 48, the DSCP field is restored to the default value.
● If dscp-number is set to non-48 value, the value must be the same as ssh
{ client | server } dscp dscp-number command. Otherwise, the command
execution fails.
Precautions
Example
# Set the DSCP priority of STelnet packets sent by the client to 40.
<HUAWEI> system-view
[~HUAWEI] ssh client dscp 40
Function
The ssh server acl command configures the ACL that the SSH server uses to
control the access permission of the SSH client.
The undo ssh server acl command cancels the configured ACL of the SSH server.
Format
ssh [ ipv6 ] server acl { acl-number | acl-name }
Parameters
Parameter Description Value
acl-number Specifies the ACL The value is an integer that ranges from 2000
number. to 3999.
acl-name Specifies the ACL The value is a string of 1 to 32 case-sensitive
name. characters except spaces. The value must
start with a letter or digit, and cannot contain
only digits.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Configure the ACL for the following servers for access control:
● STelnet server: controls which clients can log in to this server through STelnet.
● SFTP server: controls which clients can log in to this server through SFTP.
● SNetconf server: controls which clients can log in to this server through
SNetconf.
Prerequisites
Before running this command, run the acl (system view) in the system view and
run the rule (ACL view) command to configure an ACL.
Precautions
A basic ACL is configured to restrict source addresses and an advanced ACL is
configured to restrict source and destination addresses.
The command ssh server acl { acl-number | acl-name } only takes effect for ipv4
client.
Example
# Configure the ACL numbered 2000 on the SSH server.
<HUAWEI> system-view
[~HUAWEI] acl 2000
[*HUAWEI-acl4-basic-2000] rule permit source 10.10.10.10 0
[*HUAWEI-acl4-basic-2000] quit
[*HUAWEI] ssh server acl 2000
Format
ssh server assign { rsa-host-key | dsa-host-key | ecc-host-key | pki } label-name
undo ssh server assign { rsa-server-key | rsa-host-key | dsa-host-key | ecc-host-
key | pki }
Parameters
Parameter Description Value
label-name Specifies the name of the key The label name must
assigned to an SSH server. already exist.
If a PKI certificate will be
assigned to an SSH server,
label-name can only be
set to default.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To ensure the security of an SSH server, run the ssh server assign command to
reference the generated RSA, DSA, or ECC key with a label or assign a PKI
certificate to the SSH server.
NOTE
For security purposes, you are advised not to use an RSA key.
Table 3-39 describes the usage scenarios for different authentication modes.
Prerequisites
RSA, DSA, or ECC key pair with a label has been generated using the rsa key-pair
label, dsa key-pair label, or ecc key-pair label command before you run this
command.
Configuration Impact
The RSA, DSA, or ECC key pair with a label assigned to the SSH server has a
higher priority than the key pair generated using the rsa local-key-pair create,
dsa local-key-pair create, or ecc local-key-pair create command. If this
command is not configured, the SSH server uses the key pair generated using the
rsa local-key-pair create, dsa local-key-pair create, or ecc local-key-pair create
command for encryption.
Precautions
● After you delete the RSA, DSA, or ECC key pair with a label, the key pair
assigned to the SSH server is deleted simultaneously.
● This command takes effect for both IPv4 and IPv6 SSH servers.
Example
# Assign the ECC host key named ecckey to the SSH server.
<HUAWEI> system-view
[~HUAWEI] ecc key-pair label ecckey
[*HUAWEI] ssh server assign ecc-host-key ecckey
Function
The ssh server authentication-retries command sets the maximum number of
authentication retries for an SSH connection.
Format
ssh server authentication-retries times
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to configure the maximum number of authentication
retries for an SSH connection, which prevents server overload due to malicious
access. When the number of authentication retries exceeds the maximum number,
the device instructs the remote host to tear down the connection.
Precautions
The configured number of retries takes effect upon the next login.
The total number of RSA, DSA, ECC, and password authentication retries on the
SSH client cannot exceed the maximum number that is set using this command.
This command takes effect for both IPv4 and IPv6 connections.
Example
# Set the maximum number of times for retrying login authentication to 4.
<HUAWEI> system-view
[~HUAWEI] ssh server authentication-retries 4
Format
ssh server authentication-type keyboard-interactive enable
undo ssh server authentication-type keyboard-interactive enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Keyboard interaction authentication is also called password card authentication. If
you need to log in to an SSH server in keyboard interactive authentication mode,
run the ssh server authentication-type keyboard-interactive enable command.
Its function implementation process is as follows: An SSH user enters the user
name to log in to a device. After detecting that the user is a password card
authentication user, the TACACS server sends the user name to the password card
authentication server. The password card authentication server generates a
challenge code based on the user name and sends the challenge code to the
TACACS server. The TACACS server displays the challenge code on the device. The
user enters the user password and the received challenge code in the password
card. The password card computes a challenge response code. The user sends the
challenge response code to the password card authentication server using the
device and TACACS server. The password card authentication server checks
whether the challenge response code is correct and returns the authentication
result to the user.
After this function is enabled, the system prompts the user to enter the challenge
response code.
If you need to log in to the SSH server in password authentication mode, run the
undo ssh server authentication-type keyboard-interactive enable command to
disable keyboard interactive authentication as required.
Example
# Enable keyboard interactive authentication on an SSH server.
<~HUAWEI> system-view
[~HUAWEI] ssh server authentication-type keyboard-interactive enable
Function
The ssh server compatible-ssh1x enable command enables the earlier version-
compatible function on an SSH server.
The undo ssh server compatible-ssh1x enable command disables the earlier
version-compatible function on the SSH server.
Format
ssh server compatible-ssh1x enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Scenario
By comparing the protocol versions, the server determines whether to work with
the client.
● If the client runs a protocol version that is earlier than 1.3 or later than 2.0,
version negotiation fails and the server terminates the TCP connection with
the client.
● If the client runs a protocol version that is between 1.3 and 1.99 (including
V1.3), the SSH1.5 server module is established when the "compatibility
configuration option" of SSH is SSH1.x-compatible. The system then proceeds
with the SSH1.x process. The server terminates the TCP connection with the
client when the "compatibility configuration option" of SSH is SSH1.x-
incompatible.
● That is 1.99 or 2.0, the SSH2.0 server module is established. The system then
proceeds with the SSH2.0 process.
Precaution
● All the connections from the SSH 1.x client are dropped, if the compatibility
with SSH 1.3 and 1.5 is disabled.
● If the SSH server is enabled to be compatible with earlier SSH versions, the
system prompts a security risk.
● SSHv1 is not secure, and SSHv2 is recommended.
● The configuration takes effect upon the next login.
Example
# Enable the compatibility with SSH 1.x version.
<HUAWEI> system-view
[~HUAWEI] ssh server compatible-ssh1x enable
Function
The ssh server cipher command configures an encryption algorithm list for an
SSH server.
The undo ssh server cipher command restores the default encryption algorithm
list of an SSH server.
Format
ssh server cipher { des_cbc | 3des_cbc | aes128_cbc | aes256_cbc | aes128_ctr |
aes256_ctr | arcfour128 | arcfour256 | aes192_cbc | aes192_ctr | aes128_gcm |
aes256_gcm | blowfish_cbc } *
undo ssh server cipher
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
An SSH server and a client need to negotiate an encryption algorithm for the
packets exchanged between them. You can run the ssh server cipher command to
configure an encryption algorithm list for the SSH server. After the list is
configured, the server matches the encryption algorithm list of a client against the
local list after receiving a packet from the client and selects the first encryption
algorithm that matches the local list. If no encryption algorithms in the list of the
client match the local list, the negotiation fails.
Precautions
If a device starts with a loaded configuration file (for example, a configuration file
is loaded to the device using ZTP for initial configuration), and no encryption
algorithm list is configured for the SSH server in the configuration file using the
ssh server cipher command, the encryption algorithms supported by the SSH
server are AES256_GCM, AES128_GCM, AES256_CTR, AES192_CTR, AES128_CTR,
AES256_CBC, AES128_CBC and 3DES_CBC.
This command takes effect for both IPv4 and IPv6 SSH servers.
Example
# Configure CTR encryption algorithms for an SSH server.
<HUAWEI> system-view
[~HUAWEI] ssh server cipher aes256_ctr aes128_ctr
Function
The ssh server dh-exchange min-len min-len command sets the minimum length
of keys used in Diffie-hellman-group-exchange between the SSH server and client.
The undo ssh server dh-exchange min-len command restores the default
minimum length of keys used in Diffie-hellman-group-exchange between the SSH
server and client.
Format
ssh server dh-exchange min-len min-len
Parameters
Parameter Description Value
min-len Specifies the minimum length of keys The value is an integer that
used in Diffie-hellman-group- can only be 1024 or 2048, in
exchange between the SSH server and bits.
client.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the SSH client supports the Diffie-hellman-group-exchange key of more than
1024 bits, for security purposes, run the ssh server dh-exchange min-len
command to set the minimum key length to 2048 bits or more.
Precautions
Security risks exist if the minimum length of keys used in Diffie-hellman-group-
exchange is less than 2048 bits. You are advised to set the minimum key length to
2048 bits or more.
When the device loads the configuration file for startup (for example, the device
loads the configuration file using ZTP for initial configuration), and the
configuration file does not contain the ssh server dh-exchange min-len
command configuration, the minimum key length is 1024 bits.
This command applies to both IPv4 and IPv6 SSH servers.
Example
# Set the minimum length of keys used in Diffie-hellman-group-exchange
between the SSH server and client to 2048 bits.
<HUAWEI> system-view
[~HUAWEI] ssh server dh-exchange min-len 2048
Format
ssh server hmac { md5 | md5_96 | sha1 | sha1_96 | sha2_256 | sha2_256_96 |
sha2_512 } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Precautions
For security purposes, you are advised to use a secure encryption algorithm
(SHA2_256 or SHA2_512.)
If a device starts with a loaded configuration file (for example, a configuration file
is loaded to the device using ZTP for initial configuration), and no HMAC
authentication algorithm list is configured for the SSH server in the configuration
file using the ssh server hmac command, the HMAC authentication algorithms
supported by the SSH server are SHA2_512, SHA2_256_96, SHA2_256, SHA1,
SHA1_96, MD5 and MD5_96.
This command takes effect for both IPv4 and IPv6 SSH servers.
Example
# Configure the SHA2_256 HMAC authentication algorithm for an SSH server.
<HUAWEI> system-view
[~HUAWEI] ssh server hmac sha2_256
Format
ssh server keepalive disable
undo ssh server keepalive disable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
If the keepalive function is disabled on the SSH server, the server will disconnect
from the SSH client when there is no data exchange, which causes server resource
waste due to reconnections. After the keepalive function is enabled on the SSH
server, the server responds when receiving keepalive packets from the SSH client.
If the function is disabled, the SSH server discards the received keepalive packets.
When the SSH client does not receive any keepalive response packet, the client
disconnects from the server.
Example
# Enable the keepalive function on the SSH server.
<HUAWEI> system-view
[~HUAWEI] undo ssh server keepalive disable
Function
The ssh server key-exchange command configures a key exchange algorithm list
on an SSH server.
The undo ssh server key-exchange command restores the default configuration.
Format
ssh server key-exchange { dh_group14_sha1 | dh_group1_sha1 |
dh_group_exchange_sha1 | dh_group_exchange_sha256 | ecdh_sha2_nistp256 |
ecdh_sha2_nistp384 | ecdh_sha2_nistp521 | sm2_kep } *
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
An SSH server and a client need to negotiate a key exchange algorithm for the
packets exchanged between them. You can run the ssh server key-exchange
command to configure a key exchange algorithm list for the SSH server. After the
list is configured, the server matches the key exchange algorithm list of a client
against the local list after receiving a packet from the client and selects the first
key exchange algorithm that matches the local list. If no key exchange algorithms
in the list of the client match the local list, the negotiation fails.
Precautions
If a device starts with a loaded configuration file (for example, a configuration file
is loaded to the device using ZTP for initial configuration), and the ssh server key-
exchange command configuration does not exist in the configuration file, the SSH
server supports these key exchange algorithms: dh_group_exchange_sha256,
dh_group_exchange_sha1, dh_group14_sha1, dh_group1_sha1,
ecdh_sha2_nistp256, ecdh_sha2_nistp384, ecdh_sha2_nistp521, and sm2_kep.
Example
# Configure key exchange algorithm lists dh_group_exchange_sha256 on the SSH
server.
Function
The ssh server login-failed threshold-alarm command configures alarm
generation and clearance thresholds for SSH server login failures within a specified
period.
The undo ssh server login-failed threshold-alarm command restores the default
alarm generation and clearance thresholds.
Format
ssh server login-failed threshold-alarm upper-limit report-times lower-limit
resume-times period period-time
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
ssh-server write
Usage Guidelines
Usage Scenario
To manage frequent SSH server login failures within a specified period, run the ssh
server login-failed threshold-alarm command to configure alarm generation
and clearance thresholds for the login failures.
This command takes effect for both IPv4 and IPv6 SSH servers.
Precautions
The alarm generation threshold specified using report-times must be greater than
or equal to the alarm clearance threshold specified using resume-times.
Example
# Configure the device to generate an alarm when the number of SSH server login
failures within 3 minutes reaches 20 and clear the alarm when the number of SSH
server login failures within 3 minutes is less than 10.
<HUAWEI> system-view
[~HUAWEI] ssh server login-failed threshold-alarm upper-limit 20 lower-limit 10 period 3
Function
The ssh server port command changes the listening port number of the SSH
server.
The undo ssh server port command restores the default listening port number of
the SSH server.
The default listening port number of the SSH server is 22.
Format
ssh [ ipv4 | ipv6 ] server port port-number
undo ssh [ ipv4 | ipv6 ] server port
Parameters
Parameter Description Value
ipv4 Specifies the IPv4 server port. -
ipv6 Specifies the IPv6 server port. -
port-number Specifies the listening port number of The value is 22 or an
the SSH server. integer ranging from 1025
to 65535.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Configure the listening port number of the SSH server to prevent from malicious
access to the SSH service standard port and ensure security.
Run ssh server port command can enable both IPv4 and IPv6 SSH server. Run ssh
ipv4 server port command to enable IPv4 SSH server. Run ssh ipv6 server port
command to enable IPv6 SSH server.
Precautions
The SSH client can log in successfully with no port specified only when the server
is listening on port 22. If the server is listening on another port, the port number
must be specified upon login.
Before changing the current port number, disconnect all devices from the port.
After the port number is changed, the server starts to listen on the new port.
Example
# Set the listening port number of the SSH server is 1025.
<HUAWEI> system-view
Function
The ssh server publickey command enables or disables the public key algorithm
function of the SSH server.
The undo ssh server publickey command restores public key algorithms of the
SSH server to default values.
Format
ssh server publickey { dsa | ecc | rsa | x509v3-ssh-rsa } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To allow a public key algorithm and reject other public key algorithms, run the ssh
server publickey command and specify the specific public key algorithm in the
command. For example, after the ssh server publickey dsa command is run, the
DSA algorithm is allowed but other algorithms are not. If this command is run
more than once, the latest configuration overrides the previous one.
NOTE
For security purposes, do not use the RSA algorithm with the key length less than 2048
bits..
Precautions
● A public key algorithm can be used for login only after it is enabled on both
the client and server.
● When you run the undo ssh server publickey command with an algorithm
specified, ensure that the algorithm is the same as that configured using the
ssh server publickey command. Alternatively, you run the undo ssh server
publickey command with no algorithm specified. Otherwise, the
configuration restoration function does not take effect.
● If the ssh user authentication-type { password | rsa | dsa | ecc | password-
rsa | password-dsa | password-ecc | all } command is run to configure public
key authentication for SSH users, the involved public key algorithm must be
consistent with that enabled in the ssh server publickey { dsa | ecc | rsa } *
command. Otherwise, device login fails. For example, if the ssh server
publickey ecc command is run, run the ssh user authentication-type { ecc |
password-ecc | all } command to set the authentication type of SSH users to
ECC, password-ECC, or All.
● When a device loads the configuration file for startup (for example, the device
loads the configuration file using ZTP for initial configuration), and the ssh
server publickey command configuration does not exist in the configuration
file, the DSA, ECC, and RSA public key algorithms are enabled.
● This command takes effect for both IPv4 and IPv6 SSH servers.
Example
# Allow using the ECC algorithm and deny other algorithms.
<HUAWEI> system-view
[~HUAWEI] ssh server publickey ecc
Function
The ssh server rekey command sets the criteria that trigger SSH server key re-
negotiation.
The undo ssh server rekey command restores the default values of criteria that
trigger SSH server key re-negotiation.
By default, key re-negotiation is triggered on the SSH server when one of the
following conditions is met:
● The total size of sent and received packets reaches 1000 MB.
Format
ssh server rekey { data-limit data-limit | max-packet max-packet | time
minutes } *
undo ssh server rekey { data-limit [ data-limit ] | max-packet [ max-packet ] |
time [ minutes ] } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
ssh-server write
Usage Guidelines
Usage Scenario
When an SSH session meets one or more of the following criteria, the system re-
negotiates a key and uses the new key to establish SSH session connections,
improving system security.
● The number of interaction packets meets the configured key re-negotiation
criterion.
● The accumulated packet data volume meets the configured key re-
negotiation criterion.
● The session duration meets the configured key re-negotiation criterion.
● This command takes effect for both IPv4 and IPv6 SSH clients.
NOTE
A key re-negotiation request is initiated when either the SSH client or server meets the key
re-negotiation criteria, and the other party responds.
Precautions
Example
# Configure key re-negotiation to be triggered on the SSH server when the total
size of sent and received packets reaches 10000 MB, the total number of sent and
received packets reaches 268435456, or the online duration reaches 1440 minutes.
<HUAWEI> system-view
[~HUAWEI] ssh server rekey data-limit 10000 max-packet 268435456 time 1440
Function
The ssh server rekey-interval command sets the interval for updating the SSH
server key pair.
The undo ssh server rekey-interval command restores the default interval for
updating the SSH server key pair.
The default interval for updating the SSH server key pair is 0, indicating that the
key pair is never updated.
Format
ssh server rekey-interval hours
Parameters
Parameter Description Value
hours Specifies the interval for The value is an integer that ranges
updating the server key pair. from 0 to 24, in hours.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the server key pair is not updated for a long time, the key is easy to decrypt and
the server is insecure. After the interval for updating the SSH server key pair is set
using this command, the system will automatically update the key pair at
intervals.
Precautions
● This command applies only to the SSHv1 protocol.
● If the client is connected to the server, the server public key on the client is
not updated immediately. This key is updated only when the client is
reconnected to the server.
Example
# Set the interval for updating the SSH server key pair to 2 hours.
<HUAWEI> system-view
[~HUAWEI] ssh server rekey-interval 2
Format
ssh server security-banner disable
undo ssh server security-banner disable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
When an SSH client attempts to log in to an SSH server, but the negotiated
algorithm is an insecure one, the SSH server generates a risk warning message
and sends the message to the SSH client. However, if the SSH client cannot parse
this type of message, it fails to interact with the server, leading to a login failure.
To prevent this problem, you can run the ssh server security-banner disable
command to disable the risk warning function triggered by the SSH server when
an insecure algorithm is used between the SSH server and client.
Example
# Disable the risk warning function triggered by an SSH server when an insecure
algorithm is used between the SSH server and client.
<HUAWEI> system-view
[~HUAWEI] ssh server security-banner disable
Function
The ssh server timeout command sets the timeout interval for SSH connection
authentication.
The undo ssh server timeout restores the default timeout interval for SSH
connection authentication.
Format
ssh server timeout seconds
Parameters
Parameter Description Value
seconds Specifies the timeout interval for The value is an integer ranging
SSH connection authentication. from 1 to 120, in seconds.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If you have not logged in successfully at the timeout interval for SSH connection
authentication, the current connection is terminated to ensure security. You can
run the display ssh server command to query the current timeout interval.
Precautions
The setting for the timeout interval takes effect upon next login.
This command takes effect for both IPv4 and IPv6 connections.
Example
# Set the SSH connection authentication timeout interval to 90 seconds.
<HUAWEI> system-view
[~HUAWEI] ssh server timeout 90
Function
The ssh server-source command specifies a source interface or source IPv6
address for an SSH server.
The undo ssh server-source command cancels the specified source interface or
source IPv6 address of an SSH server.
Format
ssh server-source -i interface-type interface-number
Parameters
Parameter Description Value
-a ipv6-address Specifies the source The value contains 128 bits, which
IPv6 address for an SSH are divided into eight groups. Each
server. group contains 4 hexadecimal
numbers. The groups are separated
by colons (:), in the format of
X:X:X:X:X:X:X:X.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
An SSH server receives login requests from all interfaces and addresses, leading to
low system security. To improve system security, you can run the ssh server-
source command to specify a source interface or source IPv6 address for the SSH
server. Then only authorized users can log in to the SSH server.
● After a bound VPN instance is deleted, the VPN configuration specified using
the ssh server-source command will not be cleared and does not take effect.
In this case, the SSH server uses a public IP address. If the VPN instance with
the same name as the deleted one is reconfigured, the VPN function will be
restored.
● After the bound source interface is deleted, the interface configuration in the
ssh server-source command will not be deleted and does not take effect.
After the source interface with the same name is reconfigured, the function
will be restored.
● For an IPv6 SSH server, you can run the ssh ipv6 server-source -a ipv6-
address [ -vpn-instance vpn-instance-name ] command to configure a user
to log in to the server through a specified IPv6 source address.
● After the ssh server-source all-interface command is run, no source interface
will be specified for the SSH server. Users can log in to the SSH server from all
valid interfaces, which increases system security risks. Therefore, you are
advised to cancel the command configuration.
Example
# Specify Loopback0 as the source interface of the SSH server.
<HUAWEI> system-view
[~HUAWEI] interface loopback 0
[*HUAWEI-LoopBack0] ip address 10.1.1.1 24
[*HUAWEI-LoopBack0] quit
[*HUAWEI] ssh server-source -i loopback 0
Warning: SSH server source configuration will take effect in the next login. Do you want to continue? [Y/
N]:y
# Set the source IPv6 address of the SSH server to 2001:db8::1 and the VPN
instance name to vpn1.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpn1
[*HUAWEI-vpn-instance-vpn1] ipv6-family
[*HUAWEI-vpn-instance-vpn1-af-ipv6] commit
[~HUAWEI-vpn-instance-vpn1-af-ipv6] quit
[~HUAWEI-vpn-instance-vpn1] quit
[~HUAWEI] ssh ipv6 server-source -a 2001:db8::1 -vpn-instance vpn1
Warning: SSH server source configuration will take effect in the next login. Do you want to continue? [Y/
N]:y
# Specify all IPv4 interfaces on the device as the source interface of the SSH
server.
<HUAWEI> system-view
[~HUAWEI] ssh server-source all-interface
Warning: SSH server source configuration will take effect in the next login. Do you want to continue? [Y/
N]:y
# Specify all IPv6 interfaces on the device as the source interface of the SSH
server.
<HUAWEI> system-view
[~HUAWEI] ssh ipv6 server-source all-interface
Warning: SSH server source configuration will take effect in the next login. Do you want to continue? [Y/
N]:y
Format
ssh user user-name
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
You can create a user using either of the following methods:
Example
# Create an SSH user named testuser.
<HUAWEI> system-view
[~HUAWEI] ssh user testuser
Format
ssh user user-name assign { rsa-key | dsa-key | ecc-key } key-name
undo ssh user user-name assign { rsa-key | dsa-key | ecc-key }
Parameters
Parameter Description Value
user-name Specifies the SSH user name. The SSH must already exist.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When an SSH client needs to log in to the SSH server in RSA, DSA, or ECC mode,
run this command to assign a public key to the client. If the client has been
assigned keys, the latest assigned key takes effect.
NOTICE
For security purposes, it is not recommended that you use RSA as the public key.
Precautions
The newly configured public key takes effect upon next login.
If the user named user-name to whom a public key is assigned does not exist, the
system automatically creates an SSH user named user-name and performs the
configured authentication for the SSH user.
Example
# Assign key1 to a user named John.
<HUAWEI> system-view
[~HUAWEI] ssh user john assign rsa-key key1
Format
ssh user user-name assign pki pki-name
undo ssh user assign pki
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
When x509v3-ssh-rsa authentication is used for user authentication, you need to
bind a PKI certificate to an SSH server and SSH user. To provide secure
environment for user logins, run the ssh user assign pki command to bind a PKI
certificate to the SSH user.
Example
# Bind the PKI certificate in the PKI realm named default to the SSH user
root@123.
<HUAWEI> system-view
[~HUAWEI] ssh user root@123 assign pki default
Function
The ssh user authentication-type command configures the authentication mode
for an SSH user.
Format
ssh user user-name authentication-type { password | rsa | password-rsa | dsa |
password-dsa | ecc | password-ecc | x509v3-rsa | password-x509v3-rsa | all }
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you configure the authentication mode for an SSH user, the system
automatically creates an SSH user named user-name if the user-name user does
not exist.
NOTICE
For security purposes, you are advised not use the RSA algorithm whose length is
less than 2048 digits as the authentication type for the SSH user.
Table 3-40 describes the usage scenarios for different authentication modes.
Precautions
A new SSH user cannot log in to the SSH server unless being configured with an
authentication mode. The newly configured authentication mode takes effect
upon next login.
Example
# Set the authentication mode to password authentication for the SSH user john.
<HUAWEI> system-view
[~HUAWEI] ssh user john authentication-type password
# Set the authentication mode to ECC authentication for the SSH user
ssh_user1@dom1.
<HUAWEI> system-view
[~HUAWEI] ssh user ssh_user1@dom1 authentication-type ecc
Format
ssh user user-name service-type { { sftp | stelnet | snetconf } * | all }
undo ssh user user-name service-type
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to determine the service type for connecting to devices.
If the user-name user does not exist, the system creates an SSH user named user-
name and uses the configured service type for the SSH user.
Precautions
If the SFTP service type is configured for an SSH user, you need to set the
authorized directory for the user. By default, the SFTP service authorized directory
is flash: for the SSH user. You can run the ssh user sftp-directory command to set
the authorized directory.
If you run the ssh user user-name service-type sftp stelnet snetconf command,
the ssh user user-name service-type all command is saved in the configuration
file.
Example
# Configure the service type for SSH users.
<HUAWEI> system-view
[~HUAWEI] ssh user john service-type all
3.6.82 stelnet
Function
The stelnet command enables you to use the STelnet protocol to log in to another
device from the current device.
Format
# IPv4 address
# IPv6 address
Parameters
Parameter Description Value
-vpn-instance vpn- Specifies the name of The VPN must already exist.
instance-name the VPN instance.
Views
User view, System view
Default Level
0: Visit level
Usage Guidelines
Usage Scenario
Logins through Telnet bring security risks because Telnet does not provide any
authentication mechanism and data is transmitted using TCP in plain text.
Compared with Telnet, SSH guarantees secure file transfer on a traditional
insecure network by authenticating clients and encrypting data in bidirectional
mode. The SSH protocol supports STelnet. You can run this command to use
STelnet to log in to another device from the current device.
STelnet is a secure Telnet service. SSH users can use the STelnet service in the
same way as the Telnet service.
When a fault occurs in the connection between the client and server, the client
needs to detect the fault in real time and proactively release the connection. You
need to set the interval for sending keepalive packets and the maximum number
of times on the client that logs in to the server through STelnet.
● Interval for sending keepalive packets: If a client does not receive any packet
within the specified interval, the client sends a keepalive packet to the server.
● Maximum number of times the server has no response: If the number of
times that the server does not respond exceeds the specified value, the client
proactively releases the connection.
Precautions
● Enable the STelnet service on the SSH server by stelnet server enable
command, before connecting the SSH server by using the STelnet command.
● The SSH client can log in to the SSH server with no port specified only when
the server is listening on port 22. If the server is listening on another port, the
port number must be specified upon login.
Example
# Set keepalive parameters when the client logs in to the server through STelnet.
<HUAWEI> stelnet 10.164.39.209 -ki 10 -kc 4
Function
The stelnet server enable command enables the STelnet service on the SSH
server.
The undo stelnet server enable command disables the STelnet service on the
SSH server.
Format
stelnet [ ipv4 | ipv6 ] server enable
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To connect a client to the SSH server through STelnet, you must enable the
STelnet service on the SSH server.
Run the command stelnet server enable can enable both IPv4 and IPv6 STelnet
server. Run stelnet ipv4 server enable command to enable IPv4 STelnet server.
Run stelnet ipv6 server enable command to enable IPv6 STelnet server.
Precautions
After you disable the STelnet service on the SSH server, all clients that have logged
in through STelnet are disconnected.
In V200R002C50 and V200R003C00, you can run the stelnet [ ipv4 | ipv6 ] server
enable command to enable the STELNET function. If the current version is
downgraded to V200R001C00 or an earlier version, this configuration will be lost,
so you need to run the stelnet server enable command again. In V200R005C00,
you can run the stelnet ipv4 server enable command to enable the IPv4 STELNET
function, or run the stelnet ipv6 server enable command to enable the IPv6
STELNET function (IPv4 STELNET and IPv6 STELNET functions are not enabled
simultaneously). If the current version is downgraded to V200R001C00 or an
earlier version, this configuration will be lost, so you need to run the stelnet
server enable command again.
Example
# Enable the STelnet service.
<HUAWEI> system-view
[~HUAWEI] stelnet server enable
3.6.84 telnet
Function
The telnet command enables a user to log in to another device from the current
device through Telnet.
Format
# Log in to another device from the current device through Telnet based on IPv4.
# Log in to another device from the current device through Telnet based on IPv6.
Parameters
vpn-instance Specifies the name of the VPN The VPN must exist.
vpn-instance- instance to which the device to be
name logged in through Telnet belongs.
If vpn-instance vpn-instance-name is
used to specify a VPN instance, the -i
interface-type interface-number
parameter is not supported.
Views
User view
Default Level
0: Visit level
Usage Guidelines
Usage Scenario
If one or more devices need to be configured and managed, you do not need to
connect your terminal to each of the devices for local maintenance. If you have
obtained the IP address of a device, run the telnet command to log in to the
device from your terminal through Telnet to remotely configure the device. This
method allows you to maintain multiple devices using a single user terminal,
greatly facilitating operations.
During the connection process, you can press Ctrl+K to terminate the connection
between the local and remote devices.
Prerequisites
The user terminal communicates with the remote device using their IP addresses
and the Telnet server function is enabled on the remote device.
Precautions
● Before you run the telnet command to connect to the Telnet server, the
Telnet client and server must be able to communicate at Layer 3 and the
Telnet service must be enabled on the Telnet server.
● A Telnet login may bring security risks because Telnet does not provide any
secure authentication mechanism and data is transmitted using TCP in plain
text. STelnet is recommended for networks that require high security.
Example
# Establish a Telnet connection with a remote device.
<HUAWEI> telnet 192.168.1.6
Function
The telnet client source command specifies a source IP address and source
interface for a Telnet client.
The undo telnet client source command restores the default configuration.
By default, the source IP address of a Telnet client is 0.0.0.0, and there is no source
interface.
Format
telnet client source { -a source-ip-address | -i interface-type interface-number }
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
If no source IP address is specified in the telnet command, the source IP address
specified using the telnet client source command is used. If a source IP address is
specified in the telnet command, the specified source IP address is used. Check
the current Telnet connection on the server. The displayed IP address is the
specified source IP address or the primary IP address of the specified interface.
After the bound source interface is deleted, the interface configuration in the ssh
server-source command will not be deleted and does not take effect. After the
source interface with the same name is reconfigured, the function will be restored.
If the specified source interface is bound to a VPN instance, the client is also
bound to the VPN instance.
Example
# Set the source IP address of the Telnet client to 10.1.1.1.
<HUAWEI> system-view
[~HUAWEI] telnet client source -a 10.1.1.1
Function
The telnet dscp command sets the DSCP priority of Telnet packets.
The undo telnet dscp command restores the default setting.
By default, the DSCP priority of Telnet packets is 48.
Format
telnet { client | server } dscp dscp-number
undo telnet { client | server } dscp [ dscp-number ]
Parameters
Parameter Description Value
dscp-number Specifies the DSCP priority. The value is an integer that ranges
from 0 to 63. A greater DSCP value
indicates a higher priority.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to set the DSCP priority of Telnet packets. The DSCP
priority of Telnet packets sent by the switch is then changed to the configured
value. When network congestion occurs, you can appropriately reduce the DSCP
priority of Telnet packets to ensure proper forwarding of data packets.
The priority of this command is higher than that of the set priority dscp
command. If a DSCP value is configured using this command, the configured value
takes effect. If a DSCP value is configured using the set priority dscp command
rather than this command, the value configured using the set priority dscp
command takes effect. If no DSCP value is configured using the preceding
commands, the default DSCP value is used.
When you run the undo telnet { client | server } dscp [ dscp-number ] command:
● If dscp-number is not specified, the DSCP field is restored to the default value.
● If dscp-number is 48, the DSCP field is restored to the default value.
● If dscp-number is set to non-48 value, the value must be the same as telnet
{ client | server } dscp dscp-number command. Otherwise, the command
execution fails.
Precautions
Example
# Set the DSCP priority of Telnet packets sent by the client to 40.
<HUAWEI> system-view
[~HUAWEI] telnet client dscp 40
Function
The telnet server acl command configures the ACL to control the access of clients
to the Telnet server.
The undo telnet server acl command cancels the configuration of the ACL.
Format
telnet [ ipv6 ] server acl { acl-number | acl-name }
Parameters
Parameter Description Value
ipv6 Specifies a Telnet IPv6 -
server.
acl-number Specifies the basic ACL The value is an integer that ranges from
number. 2000 to 3999.
acl-name Specifies the ACL name. The value is a string of 1 to 32 case-
sensitive characters except spaces. The
value must start with a letter or digit, and
cannot contain only digits.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a device functions as the Telnet server, you can configure the ACL on the
device to control the login of the clients to the device.
Prerequisites
Before running this command, run the acl (system view) in the system view and
run the rule (ACL view) command to configure an ACL.
Precautions
● If no rule is configured, the incoming and outgoing calls are not restricted
after the command telnet server acl is run.
● A basic ACL is configured to restrict source addresses and an advanced ACL is
configured to restrict source and destination addresses.
● If the access control right for a network segment is permit or deny, the access
control right for the other network segments is deny. For example, if an ACL
allows access from clients on a network segment, clients on the other
network segments cannot log in to the device. If an ACL rejects access from
clients on a network segment, clients on all the network segments cannot log
in to the device by default.
● The command telnet server acl { acl-number | acl-name } takes effect for
ipv4 function.
Example
# Configure the ACL numbered 2000 on the Telnet server.
<HUAWEI> system-view
[~HUAWEI] acl 2000
[*HUAWEI-acl4-basic-2000] rule permit source 10.1.1.1 0
[*HUAWEI-acl4-basic-2000] quit
[*HUAWEI] telnet server acl 2000
Format
telnet server login-failed threshold-alarm upper-limit report-times lower-limit
resume-times period period-time
undo telnet server login-failed threshold-alarm [ upper-limit report-times
lower-limit resume-times period period-time ]
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
telnet-server write
Usage Guidelines
Usage Scenario
To manage frequent Telnet server login failures within a specified period, run the
telnet server login-failed threshold-alarm command to configure alarm
generation and clearance thresholds for the login failures.
This command takes effect for both ipv4 and ipv6 Telnet servers.
Precautions
The alarm generation threshold specified using report-times must be greater than
or equal to the alarm clearance threshold specified using resume-times.
Example
# Configure the device to generate an alarm when the number of Telnet server
login failures within 3 minutes reaches 20 and clear the alarm when the number
of Telnet server login failures within 3 minutes is less than 10.
<HUAWEI> system-view
[~HUAWEI] telnet server login-failed threshold-alarm upper-limit 20 lower-limit 10 period 3
Format
telnet server-source -i interface-type interface-number
undo telnet server-source -i interface-type interface-number
telnet server-source all-interface
undo telnet server-source all-interface
telnet ipv6 server-source -a ipv6-address [ -vpn-instance vpn-instance-name ]
undo telnet ipv6 server-source -a ipv6-address [ -vpn-instance vpn-instance-
name ]
telnet ipv6 server-source all-interface
undo telnet ipv6 server-source all-interface
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Guidelines
Usage Scenario
After a restart with non-base configuration, a Telnet server receives login requests
from all interfaces and addresses, leading to low system security. To improve
system security, you can run the telnet server-source command to specify a
source interface or source IPv6 address for the SSH server. Then only authorized
users can log in to the Telnet server.
Example
# Specify Loopback0 as the source interface of the Telnet server.
<HUAWEI> system-view
[~HUAWEI] interface loopback 0
[*HUAWEI-LoopBack0] ip address 10.1.1.1 24
[*HUAWEI-LoopBack0] quit
[*HUAWEI] telnet server-source -i loopback 0
# Allow any IPv4 interface on the Telnet server to be used as the source interface
of the server.
<HUAWEI> system-view
# Allow any IPv6 interface address on the Telnet server to be used as the source
IPv6 address of the server.
<HUAWEI> system-view
[~HUAWEI] telnet ipv6 server-source all-interface
Function
The telnet server disable command disables the Telnet server.
The undo telnet server disable command enables the Telnet server.
Format
telnet [ ipv6 ] server disable
Parameters
Parameter Description Value
ipv6 Specifies a Telnet IPv6 server. -
Views
System view
Default Level
3: Management level
Usage Guidelines
You can run this command to enable and disable the Telnet server. A Telnet server
can be connected only when it is enabled.
If the Telnet server is disabled using the telnet [ ipv6 ] server disable command,
new Telnet connections are not allowed and existing Telnet connections are
disconnected.
When a Telnet server stops, you can log in to the device only through the console
port or SSH.
NOTICE
Example
# Enable a Telnet server.
<HUAWEI> system-view
[~HUAWEI] undo telnet server disable
Function
The telnet server port command configures the listening port number of a Telnet
server.
The undo telnet server port command restores the default listening port of a
Telnet server.
The default listening port of a Telnet server is 23.
Format
telnet [ ipv6 ] server port port-number
undo telnet [ ipv6 ] server port
Parameters
Parameter Description Value
ipv6 Specifies a Telnet IPv6 -
server.
port-number Specifies the listening port The value is an integer that is 23 or
number of a Telnet server. ranges from 1025 to 65535. The
default value 23 is the standard
Telnet server port number.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To protect the Telnet standard port against attacks and ensure network security,
configure the listening port number of the Telnet server.
The command telnet server port port-number takes effect for ipv4 Telnet servers.
Precautions
A Telnet client can log in to the server with no port specified only when the server
is listening on port 23. If the server is listening on another port, the port number
must be specified upon login.
Before changing the current port number, disconnect all devices from the port.
After the port number is changed, the server starts to listen on the new port.
Example
# Configure the listening port number to 1026.
<HUAWEI> system-view
[~HUAWEI] telnet server port 1026
<HUAWEI> system-view
[~HUAWEI] undo telnet server port
Format
activate ftp server ip-block ip-address ip-address [ vpn-instance vpn-name ]
Parameters
Parameter Description Value
ip-address Specifies a locked ● For IPv4 address, the value is in the
IP address. decimal format.
● For IPv6 address, the value is a 32-digit
hexadecimal number, in the format of
X:X:X:X:X:X:X:X.
vpn-instance Specifies the name The value is a string of 1 to 31 case-
vpn-name of a VPN to which sensitive characters, spaces and question
the locked user marks are not supported. In addition, the
belongs. VPN instance name must not be _public_.
When double quotation marks are used
around the string, spaces are allowed in the
string.
Views
User view
Default Level
3: Management level
Usage Guidelines
In an FTP connection, if a user enters incorrect passwords for the consecutive
times in specified minutes, the IP address of this user will be locked. Run the ftp
server ip-block reactive command to set lock period. To unlock the IP address of
this user in advance, run activate ftp server ip-block ip-address command.
Example
# Unlock the IP address 10.1.2.3.
<HUAWEI> activate ftp server ip-block ip-address 10.1.2.3
3.7.2 append
Function
The append command adds local file data to the end of a file on the FTP server.
Format
append local-filename [ remote-filename ]
Parameters
Parameter Description Value
local-filename Specifies the local file name. The value is a string of 1
to 128 characters.
remote- Specifies the name of a file on the The value is a string of 1
filename FTP server. If the specified file does to 128 characters.
not exist on the FTP server, create
the file.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
If the file specified in the remote-filename parameter does not exist when you
run the append command, create the file and add local file data to the end of the
created file.
Example
# Add the data of local file sample2.txt to the end of file sample1.txt on the FTP
server.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] append sample2.txt sample1.txt
200 Port command okay.
150 Opening ASCII mode data connection for /sample1.txt.
226 Transfer complete.
\ 100% [***********]
FTP: 35 byte(s) send in 1.443522666 second(s) 23byte(s)/sec.
# Add the data of local file a.txt to the end of file a.txt on the FTP server.
[ftp] append a.txt
200 Port command okay.
150 Opening ASCII mode data connection for /a.txt.
226 Transfer complete.
\ 100% [***********]
FTP: 35 byte(s) send in 1.443522666 second(s) 23byte(s)/sec.
3.7.3 ascii
Function
The ascii command sets the file transfer mode to ASCII on an FTP client.
The default file transfer mode is ASCII.
Format
ascii
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Files can be transferred in ASCII or binary mode.
ASCII mode is used to transfer plain text files, and binary mode is used to transfer
application files, such as system software, images, video files, compressed files,
and database files.
Example
# Set the file transfer mode to ASCII.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] ascii
200 Type set to A.
3.7.4 binary
Function
The binary command sets the file transmission mode to binary on an FTP client.
The default file transfer mode is ASCII.
Format
binary
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Files can be transferred in ASCII or binary mode.
ASCII mode is used to transfer plain text files, and binary mode is used to transfer
application files, such as system software, images, video files, compressed files,
and database files.
NOTE
The binary mode can be set to transfer ASCII and binary files.
Example
# Set the file transmission mode to binary.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] binary
200 Type set to I
3.7.5 bye
Function
The bye command terminates the connection with the remote FTP server and
enters the user view.
Format
bye
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
This command is equivalent to the quit command.
You can use the close and disconnect commands to terminate the connection
with the remote FTP server and retain the FTP client view.
Example
# Terminate the connection with the remote FTP server and enter the user view.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] bye
221 server closing.
<HUAWEI>
3.7.6 bye/exit
Function
The bye/exit command enables the system to disconnect from the remote SFTP
server and return to the SFTP client view.
Format
bye
exit
Parameters
None
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
You can use this command to return to the system view from the SFTP client view.
Example
# Disconnect from SFTP server using bye command.
<HUAWEI> system-view
[~HUAWEI] sftp 10.1.1.1
sftp 10.1.1.1
Trying 10.1.1.1 ...
Press CTRL+K to abort
Connected to 10.1.1.1 ...
Please input the username: sftp
sftp-client> bye
[~HUAWEI]
Function
The cd command changes the working directory of the FTP server.
Format
cd remote-directory
Parameters
Parameter Description Value
remote- Specifies the name of a The value is a string of 1 to 128
directory working directory on the FTP case-insensitive characters
server. without spaces.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
The FTP server authorizes users to access files in certain directories and their
subdirectories.
Example
# Change the working directory to d:/temp.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] cd d:/temp
250 "D:/temp" is current directory.
Format
cd [ remote-directory ]
Parameters
Parameter Description Value
remote- Specifies the name of a The value is a string of 1 to 128
directory directory on the SFTP server. case-insensitive characters
without spaces.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
● The SFTP server authorizes users to access files in certain directories and their
subdirectories.
● The specified working directory must exist on the SFTP server. If the remote-
directory parameter is not included in the cd command, only the current
working directory of an SSH user is displayed as the command output.
Example
# Change the current working directory of the SFTP server to /bill.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> cd bill
Current directory is:
/bill
Format
cd [ directory ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as flash:.
● If devices are stacked, drive can be named as:
– flash: root directory of the flash memory of the master switch in the
stack.
– chassis ID#flash: root directory of the flash memory on a device in the
stack.
For example, slot2#flash: indicates the flash memory in slot 2.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
For example, if you change the current working directory flash:/selftest/ to the
logfile directory in flash, the absolute path is flash:/logfile/, and the relative path
is /logfile/. The logfile directory is not logfile/ because it is not in the current
working directory selftest.
Precautions
● The directory specified in the cd command must exist; otherwise, the error
messages will be displayed:
You can perform the following operations to rectify faults:
a. Run the pwd command to view the current working directory.
b. Run the dir command to view the current working directory and verify
that the directory specified in the cd command exists.
● If you run the cd command without specifying the directory parameter, the
system returns to the root directory.
Example
# Change the current working directory from flash:/temp to flash:.
<HUAWEI> pwd
flash:/temp/
<HUAWEI> cd flash:
<HUAWEI> pwd
flash:/
Function
The cdup command changes the current working directory of an SSH user to its
parent directory.
Format
cdup
Parameters
None
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
You can run the cdup command to change the current working directory to its
parent directory.
Example
# Change the current working directory to its parent directory.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> cd dhcp
Current directory is:
/dhcp
sftp-client> cdup
Current directory is:
/
sftp-client>
Format
cdup
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To exit from the current directory and return to the upper-level directory, run the
cdup command.
Precautions
The directories accessible to an FTP user are restricted by the authorized
directories configured for the user.
Example
# Exit from the current directory and return to the upper-level directory.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] cd security
250 CWD command successful.
[ftp] cdup
200 CDUP command successful.
3.7.12 close
Function
The close command terminates the connection with the remote FTP server and
retains the FTP client view.
Format
close
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
This command is equivalent to the disconnect command.
You can run the bye and quit commands to terminate the connection with the
remote FTP server and enter the user view.
Precautions
To enter the user view from the FTP client view, you can run the bye or quit
command.
Example
# Terminate the connection with the remote FTP server and enter the FTP client
view.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] close
221 Server closing.
[ftp]
3.7.13 copy
Function
The copy command copies a file.
Format
copy source-filename destination-filename [ all ]
Parameters
Parameter Description Settings
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as flash:.
● If devices are stacked, drive can be named as:
– flash: root directory of the flash memory of the master switch in the
stack.
Example
# Copy the newbasicsoft.cc file from the master device in a stack to other
member devices.
<HUAWEI> copy newbasicsoft.cc 1#flash:/newbasicsoft.cc
Info: Are you sure to copy flash:/newbasicsoft.cc to 1#flash:/newbasicsoft.cc? [Y/N]:y
100% complete
Info: Copying file flash:/newbasicsoft.cc to 1#flash:/newbasicsoft.cc...Done.
# Copy the file config.cfg from the root directory of the flash card to flash:/temp.
The destination file name is temp.cfg.
<HUAWEI> copy flash:/config.cfg flash:/temp/temp.cfg
Info: copy flash:/config.cfg to flash:/temp/temp.cfg?[Y/N]:y
100% complete
Info: Copied file flash:/config.cfg to flash:/temp/temp.cfg...Done.
# If the current directory is the root directory of the flash card, you can perform
the preceding configuration using the relative path.
<HUAWEI> pwd
flash:/
<HUAWEI> dir
Directory of flash:/
# Copy the file config.cfg from the root directory of the flash card to flash:/temp.
The destination file name is config.cfg.
<HUAWEI> pwd
flash:/
<HUAWEI> dir
Directory of flash:/
# Copy the file backup.zip to backup1.zip in the test directory from the current
working directory flash:/test/.
<HUAWEI> pwd
flash:/test/
<HUAWEI> copy backup.zip backup1.zip
Info: copy flash:/test/backup.zip to flash:/test/backup1.zip?[Y/N]:y
100% complete
Info: Copied file flash:/test/backup.zip to flash:/test/backup1.zip...Done.
Function
The compare configuration compares whether the current configurations are
identical with the next startup configuration file.
Format
compare configuration [ configuration-file ]
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After completing a series of operations, you can compare whether the current
configurations are the same as the configurations in the next startup
configuration file or a specified configuration file starting from the first line of the
current configurations. You can determine whether to save the current
configurations based on the comparison result and specify the current
configurations as the next startup configuration file.
After you run this command to compare the current configurations with the next
startup configuration file or a specified configuration file, the system displays the
different content starting from the first different line to the ninth different line. If
the different content contains fewer than nine lines, the system displays only the
content from the first different line to the end of the file.
NOTE
You can run this command to compare whether the current configurations are the same as
the configurations in the next startup configuration file or a specified configuration file in
service VS.
Precautions
The file name extension of the configuration file must be .cfg or .zip.
After this command is run once, only the first difference between the two
configuration files is displayed. To compare all differences, modify the difference
recognized to be the same and run the compare configuration command
repeatedly.
Example
# Compare whether the current configurations are identical with the next startup
configuration file.
<HUAWEI> compare configuration
Building configuration...
Warning: The current configuration is not the same as the next startup configuration file. There may be
several differences, and the
following are some configurations beginning from the first:
====== Current configuration line 9 ======
drop-profile default
#
vlan batch 10
#
dldp enable
#
lldp enable
Format
delete remote-filename
Parameters
Parameter Description Value
remote- Specifies the name of a file The value is a string of 1 to 128
filename to be deleted. case-insensitive characters
without spaces.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
The permission to delete the file completely depends on the access rights
configuration on the remote server system. By executing the dir command
displays the list of directories and files in the specified directory.
A file deleted in the FTP client view cannot be restored.
Example
# Delete the file temp.c.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] delete temp.c
Warning: File temp.c will be deleted. Continue? [Y/N]:y
250 File deleted from remote host.
Format
delete [ /unreserved ] [ /quiet ] { filename | devicename } [ all ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as flash:.
● If devices are stacked, drive can be named as:
– flash: root directory of the flash memory of the master switch in the
stack.
– chassis ID#flash: root directory of the flash memory on a device in the
stack.
For example, slot2#flash: indicates the flash memory in slot 2.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● The wildcard (*) character can be used in the delete command.
● If the parameter /unreserved is not included, the file is stored in the recycle
bin. To display all files including deleted files that are displayed in square
brackets ([ ]), run the dir /all command. To restore these files that are
displayed in square brackets ([ ]), run the undelete command. To clear these
files from the recycle bin, run the reset recycle-bin command.
NOTICE
If you delete a file using the /unreserved parameter, the file cannot be
restored.
● If the recycle bin is full, files cannot be deleted using the delete command
without the parameter /unreserved configured. In this case, delete
unnecessary files permanently using the delete command with the
parameter /unreserved configured.
● If you delete two files with the same name from different directories, the last
file deleted is kept in the recycle bin.
● If you attempt to delete a protected file, such as a configuration file or patch
file, a system prompt is displayed.
● You cannot delete a directory by running the delete command. To delete a
directory, run the rmdir (user view) command.
● After the system is restarted, if a failure message is displayed when you delete
a software package or configuration file before service processes become
stable, perform the deletion only when the processes become stable.
Example
# Delete the file test.txt from the current working directory flash:/selftest.
<HUAWEI> delete test.txt
Info: Are you sure to delete flash:/selftest/test.txt? [Y/N]:y
Format
dir [ /all ] [ filename | directory | /all-filesystems ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
The wildcard character (*) can be used in this command. If no parameter is
specified, this command displays information about files and directories in the
current directory.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
You can run the dir /all command to view information about all files and
directories of the storage medium, including those moved to the recycle bin. The
name of a file in the recycle bin is placed in square brackets ([]), for example,
[test.txt].
Table 3-41 lists information about some files queried through the dir command.
Item Description
Example
# Display information about all files and directories in the current directory.
<HUAWEI> dir /all
Directory of flash:/
Item Description
Function
The dir and ls commands display all files or specified files that are stored on the
FTP server, and save them to a local disk.
Format
dir [ remote-filename [ local-filename ] ]
ls [ remote-filename [ local-filename ] ]
Parameters
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The following describes differences between the dir and ls commands.
● When you run the dir command, detailed file information is displayed,
including the file size, date when the file was created, whether the file is a
directory, and whether the file can be modified. When you run the ls
command, only the file name is displayed.
● The dir command is used to save detailed file information, while the ls
command is used to save only the file name even if the file is specified and
saved in a local directory.
Precautions
The wildcard (*) character can be used in commands dir and ls.
Example
# Display the name or detailed information about a file that is saved in the test
directory.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] cd test
250 CWD command successful.
[ftp] dir
200 Port command okay.
150 Opening ASCII mode data connection for /test.
drwxrwxrwx 1 noone nogroup 0 Mar 23 16:04 yourtest
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 10:38 backup.txt
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 10:38 backup1.txt
226 Transfer complete.
[ftp] ls
200 Port command okay.
150 Opening ASCII mode data connection for /test.
yourtest
backup.txt
backup1.txt
226 Transfer complete.
# Display the detailed information for the file temp.c, and save the displayed
information in file temp1.
[ftp] dir temp.c temp1
200 Port command okay.
150 Opening ASCII mode data connection for /temp.c.
[ftp] quit
# Display the name of file test.bat, and save the displayed information in file test.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] ls test.bat test
200 Port command okay.
150 Opening ASCII mode data connection for /test.bat.
[ftp] quit
Format
dir [ -l | -a ] [ remote-directory ]
ls [ -l | -a ] [ remote-directory ]
Parameters
Parameter Description Value
-l Displays detailed information about -
all files and directories in a specified
directory.
-a Displays names of all files and -
directories in a specified directory.
remote-directory Specifies the name of a directory on The value is a string of
the SFTP server. 1 to 128 case-sensitive
characters without
spaces.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
The dir and ls commands are equivalent.
● If -l and -a parameters are not specified, detailed information about all files
and directories in a specified directory is displayed when you run the dir or ls
command. The effect is the same as the dir -l command output.
● By default, if the remote-directory parameter is not specified, the list of
current directory files is displayed when you run the dir or ls command.
Example
# Display a list of files in the test directory of the SFTP server.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> dir test
-rwxrwxrwx 1 noone nogroup 0 Mar 24 00:04 yourtest
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup.txt
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup1.txt
sftp-client> dir -a test
yourtest
backup.txt
backup1.txt
sftp-client> ls test
-rwxrwxrwx 1 noone nogroup 0 Mar 24 00:04 yourtest
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup.txt
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup1.txt
sftp-client> ls -a test
yourtest
backup.txt
backup1.txt
3.7.20 disconnect
Function
The disconnect command terminates the connection with the remote FTP server
and displays the FTP client view.
Format
disconnect
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
This command is equivalent to the close command.
You can run the bye and quit commands to terminate the connection with the
remote FTP server and enter the user view.
To enter the user view from the FTP client view, you can run the bye or quit
command.
Example
# Terminate the connection with the remote FTP server and enter the FTP client
view.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] disconnect
[ftp]
Function
The display ftp client command displays the source IP address configured for the
FTP client.
Format
display ftp client
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
The default source IP address 0.0.0.0 is used if ftp client source is not configured.
Example
# Display the source IP address of the FTP client.
<HUAWEI> display ftp client
SrcIPv4Addr : 10.18.26.233
Item Description
Format
display ftp server
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run this command to display FTP server parameter settings.
Example
# Display FTP server parameter settings.
<HUAWEI> display ftp server
Server state : Disabled
IPv6 server state : Disabled
Timeout value (mins) : 10
IPv6 Timeout value (mins) : 10
Listen port : 21
IPv6 listen port : 21
ACL name :
IPv6 ACL name :
ACL number :
IPv6 ACL number :
Current user count :0
Max user number : 15
Source IPv4 address : 0.0.0.0
Source IPv6 Address : ::
Source IPv6 VpnName :
IPv6 listen Number of the listening port on the FTP IPv6 server.
port The default value is 21.
If the value is not 21, you can run the ftp ipv6 server port
command to configure the listening port number.
Parameter Description
Current user Number of current users who has logged in to the FTP server.
count
Max user Maximum number of users allowed to log in to the FTP server.
number The default value is 15.
Format
display ftp server ip auth-fail information
Parameters
None
Views
All view
Default Level
3: Management level
Usage Guidelines
The display ftp server ip auth-fail information command displays the
information of the FTP auth–failed IP addresses. The command output includes
the names of VPN instances to which the IP addresses belong, IP address status,
numbers of authentication failures, and the IP addresses that fails to pass FTP
authentication will not be adopted to make invalid authentication.
Example
# Display information about the IP addresses of all the clients that fail to pass FTP
authentication.
<HUAWEI> display ftp server ip auth-fail information
------------------------------------------------------------------------------------------------------------------------------
--
IP Address VPN Name First Time Auth-fail Auth-fail Count
------------------------------------------------------------------------------------------------------------------------------
--
10.0.0.1 _public_ 2016-09-05 11:19:28 1
------------------------------------------------------------------------------------------------------------------------------
--
Table 3-46 Description of the display ftp server ip-block all command output
Item Description
Format
display ftp server ip-block list
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
To check information about client IP addresses that are locked because of FTP
authentication failures, run the display ftp server ip-block list command. The
command output includes the names of VPN instances to which the locked client
IP addresses belong and the remaining locking period.
Example
# Display information about client IP addresses that are locked because of FTP
authentication failures.
<HUAWEI> display ftp server ip-block list
----------------------------------------------------------------------------------------------------------
IP Address VPN Name UnBlock Interval (Seconds)
----------------------------------------------------------------------------------------------------------
10.0.0.1 _public_ 294
----------------------------------------------------------------------------------------------------------
Table 3-47 Description of the display ftp server ip-block list command output
Item Description
Item Description
Format
display ftp server users
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can check FTP user parameters on the FTP server, such as the FTP user name,
IP address of the client host, port number, idle duration, and the authorized
directories.
Example
# Display FTP user parameters.
<HUAWEI> display ftp server users
User Name : root
Host Address : 10.18.26.139
Control Port : 20465
Idle Time (mins) : 1
Root Directory : flash:
Item Description
Item Description
Function
The display scp client command displays source parameters of the current SCP
client.
Format
display scp client
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display scp client command to check source parameters of the
SCP client.
Example
# Display source parameters of the SCP client.
<HUAWEI> display scp client
The source address of SCP client is 10.1.1.1.
The source address of SCP client is The source address of the SCPclient. By
10.1.1.1. default, the source address of the SCP
client is 0.0.0.0.
Format
display sftp client
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display sftp client command to display the source IP address of
the SFTP client. The default source IP address 0.0.0.0 is used if sftp client-source
is not configured.
Example
# Display the source IP address configured for the SFTP client.
<HUAWEI> display sftp client
The source address of SFTP client is 10.1.1.1.
The source address of SFTP client is 10.1.1.1 is the source IP address of the
10.1.1.1. SFTP client.
You can run the sftp client-source
command to configure the source IP
address for the SFTP client.
If an IP address has been configured
for the source port, the message "The
source interface of SFTP client is
LoopBack0" is displayed.
Format
display tftp client
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run the display tftp client command to query source IP address of the
TFTP client. The default source IP address is 0.0.0.0 if tftp client source is not
configured.
Example
# Display the source IP address configured for the TFTP client.
<HUAWEI> display tftp client
--------------------------------------------------------------------------------
ACL name :
ACL number :
IPv6 ACL name :
Item Description
IPv6 ACL name Name of the ACL that specifies the IPv6
address the TFTP client can access.
IPv6 ACL number Number of the ACL that specifies the IPv6
address the TFTP client can access.
3.7.29 execute
Function
The execute command executes a specified batch file or VRP Shell Languages
(VSL) script.
Format
execute batch-filename [ parameter&<1-8> ]
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The commands in a batch file are run one by one. A batch file cannot contain any
invisible character. If an invisible character is detected, the execute command exits
from the current process and no rollback is performed.
NOTE
Whether a character is invisible is determined based on the ASCII character table.
Characters whose ASCII character value ranges from 32 to 126 are visible (the ASCII
character value 32 indicates spaces). Other characters are invisible.
The execute command does not ensure that all commands can be run. The
execute command is not hot backed up, and no restriction is on the format or
contents of the command.
Running the execute command functions the same as running the commands one
by one manually.
Precautions
● The commands in a batch file are run one by one. A batch file cannot contain
invisible characters (control characters or escape characters, such as \r, \n, and
\b). If any invisible character is detected, the execute command exits from the
current process and no rollback is performed.
● The execute command does not ensure that all commands can be run. If the
system runs a wrong or immature command, it displays the error and goes to
next command. The execute command does not perform the hot backup
operation, and the command format or content is not restricted.
● When a .bat file is a VSL script, the execute command configures services
automatically and commands in the batch file as well as performs
configurations for services specified by parameter at a time.
Example
# Execute the test.bat file in the directory flash:/. The test.bat file contains four
commands: system-view, aaa, local-user switch password irreversible-cipher
Helloworld@6789, and commit.
<HUAWEI> system-view
[~HUAWEI] execute test.bat
[*HUAWEI] system-view
^
Error: Unrecognized command found at '^' position.
[*HUAWEI] aaa
[*HUAWEI-aaa] local-user switch password irreversible-cipher Helloworld@6789
[*HUAWEI-aaa] commit
[~HUAWEI-aaa]
When the system runs the first command system-view in current system view, it
displays an error and continues to run the following commands.
3.7.30 ftp
Function
The ftp command connects the FTP client to the FTP server and enters the FTP
client view.
Format
# Connect the FTP client to the FTP server based on the IPv4 address.
# Connect the FTP client to the FTP server based on the IPv6 address.
Parameters
port-number Specifies the port number of the FTP The value is an integer
server. that ranges from 1 to
65535. The default
value is the standard
port number 21.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before accessing the FTP server on the FTP client, you must first run the ftp
command to connect the FTP client to the FTP server.
On an IPv4 network, the source IP address specified using the ftp command takes
precedence over that specified using the ftp client-source command. If the ftp
command is run after a source IP address has been specified using the ftp client-
source command, the source IP address specified using the ftp command is used
for communication.
The source IP address specified using the ftp client-source command applies to all
FTP connections; the source IP address specified using the ftp command applies
only to the current FTP connection.
Prerequisites
Precautions
● You can set the source IP address to the source or destination IP address in
the ACL rule when the -a or -i parameter is specified on the IPv4 network.
This shields the IP address differences and interface status impact, filters
incoming and outgoing packets, and implements security authentication.
● You can run the set net-manager vpn-instance command to configure the
NMS management VPN instance before running the open command to
connect the FTP client and server.
– If public-net or vpn-instance is not specified, the FTP client accesses the
FTP server in the VPN instance managed by the NMS.
– If public-net is specified, the FTP client accesses the FTP server on the
public network.
– If vpn-instance vpn-instance-name is specified, the FTP client accesses
the FTP server in a specified VPN instance.
● If no parameter is set in the ftp command, only the FTP view is displayed, and
no connection is set up between the FTP server and client.
● If the port number that the FTP server uses is non-standard, you must specify
a standard port number; otherwise, the FTP server and client cannot be
connected.
● When you run the ftp command, the system prompts you to enter the user
name and password for logging in to the FTP server. You can log in to the FTP
server if the user name and password are correct.
● If the number of login users exceeds the maximum value that the FTP server
allows, other authorized users cannot log in to the FTP server. To allow news
authorized users to log in to the FTP server, users who have performed FTP
services must disconnect their clients from the FTP server. You can run the bye
or quit command to disconnect the FTP client from the FTP server and return
to the user view, or run the close or disconnect command to disconnect the
FTP client from the FTP server and retain in the FTP client view.
Example
# Connect to the FTP server whose IP address is 10.137.217.201.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp]
Format
ftp client source { -a source-ip-address | -i interface-type interface-number }
undo ftp client source
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If no source IP address is specified, the client uses the source IP address that the
router specifies to send packets. The source IP address must be configured for an
interface with stable performance. The loopback interface is recommended. Using
the loopback interface as the source interface simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
impact, filters incoming and outgoing packets, and implements security
authentication.
Precautions
● You can also run the ftp command to configure the source IP address whose
priority is higher than that of the source IP address specified by the ftp client
source command. If the ftp command is run after a source IP address has
been specified using the ftp client-source command, the source IP address
specified using the ftp command is used for communication. The source
address specified in the ftp client source command applies to all FTP
connections; the source address specified in the ftp command applies only to
the current FTP connection.
● The IP address that a user displays on the FTP server is the specified source IP
address or source interface IP address.
● After the bound source interface is deleted, the interface configuration in the
ssh server-source command will not be deleted and does not take effect.
After the source interface with the same name is reconfigured, the function
will be restored.
● This command takes effect only in IPv4.
● If the specified source interface has been bound to a VPN instance, the client
is automatically bound to the same VPN instance.
Example
# Set the source IP address of the FTP client to 10.1.1.1.
<HUAWEI> system-view
[~HUAWEI] ftp client source -a 10.1.1.1
Format
# IPv4 address
Parameters
Parameter Description Value
port portnumber Specifies the port number of The value is an integer that
the FTP server. ranges from 1 to 65535.
The default value is 21.
vpn-instance vpn- Specifies the name of a VPN The VPN must already exist.
instance-name instance.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the device only needs to upload files to or download files from the FTP server,
you can use this command to complete a file transfer at one time.
Prerequisites
Ensure that the VPN has been configured when you specify vpn-instance vpn-
instance-name in the command.
Precautions
Example
# Upload the source file sample.txt to the FTP server.
<HUAWEI> ftp put -a 10.1.1.10 host-ip 10.1.1.1 username switch sourcefile sample.txt
Trying 10.1.1.1 ...
Press CTRL + K to abort
Connected to 10.1.1.1.
220 FTP service ready.
331 Password required for switch.
Enter password:
200 Type set to I.
200 Port command okay.
150 Opening BINARY mode data connection for /sample.txt.
/ 100% [***********]
226 Transfer complete.
# Upload the source file sample.txt to the FTP server 10.1.1.1 through an
interface.
<HUAWEI> ftp put -i 10ge 1/0/1 host-ip 10.1.1.1 username switch sourcefile sample.txt
Trying 10.1.1.1 ...
Press CTRL + K to abort
Connected to 10.1.1.1.
220 FTP service ready.
331 Password required for switch.
Enter password:
200 Type set to I.
200 Port command okay.
150 Opening BINARY mode data connection for /sample.txt.
/ 100% [***********]
226 Transfer complete.
Format
ftp [ ipv6 ] server acl { acl-number | acl-name }
undo ftp [ ipv6 ] server acl
Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP -
server.
acl-number Specifies the number of The value is an integer that ranges from
the ACL. 2000 to 3999.
acl-name Specifies the ACL name. The value is a string of 1 to 32 case-
sensitive characters except spaces. The
value must start with a letter or digit,
and cannot contain only digits.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To ensure the security of an FTP server, you need to configure an ACL for it to
specify FTP clients that can access the current FTP server.
Precautions
If no rule is configured, the incoming and outgoing calls are not restricted after
the command ftp server acl is run.
The ftp server acl command takes effect only after you run the rule command to
configure the ACL rule.
The command ftp server acl { acl-number | acl-name } only takes effect for ipv4
client.
Example
# Allow the client whose ACL number is 2000 to log in to the FTP server.
<HUAWEI> system-view
[~HUAWEI] acl 2000
[*HUAWEI-acl4-basic-2000] rule permit source 10.10.10.1 0
[*HUAWEI-acl4-basic-2000] quit
[*HUAWEI] ftp server acl 2000
The undo ftp server default-directory command disables the default FTP
working directory.
Format
ftp server default-directory directory
Parameters
Parameter Description Value
directory Specify the default The value is a string of 1 to 255 case-sensitive
FTP working characters without spaces. When double
directory. quotation marks are used around the string,
spaces are allowed in the string.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the set default ftp-directory command to configure a default FTP
working directory for all FTP users at one time.
The command takes effect for both ipv4 and ipv6 users.
Precautions
● The ftp server default-directory command takes effect only when the device
functions as an FTP server and the user function as an FTP client.
● You can run the local-user ftp-directory command to configure an
authorized working directory for a local user.
● If you have configured the FTP working directory by running the local-user
ftp-directory command, you must use this FTP working directory.
● You can run the lcd command to view the working directory of FTP users.
● If no FTP working directory is specified on the device, FTP users cannot log in
to the device, and are prompted that the working directory is unauthorized.
Example
# Set the default FTP working directory to flash:/.
<HUAWEI> system-view
[~HUAWEI] ftp server default-directory flash:/
Format
ftp [ ipv6 ] server enable
undo ftp [ ipv6 ] server [ enable ]
Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP server. -
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To manage FTP server files on a client, you must run the ftp server enable
command to enable the FTP server function to allow FTP users to log in to the
FTP server.
Precautions
If the FTP server function is disabled, no user can log in to the FTP server, and
users who have logged in to the FTP server cannot perform any operation except
logout.
The ftp server enable command can enable IPv4 function. However, the ftp ipv6
server enable command enables only the IPv6 function.
NOTICE
Example
# Enable the FTP server function.
<HUAWEI> system-view
[~HUAWEI] ftp server enable
Format
ftp server ip-block disable
undo ftp server ip-block disable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
If an FTP server is enabled to lock client ipv4 and ipv6 addresses, a client IP
address is locked when the number of FTP authentication failures reaches the
upper limit in a specific period of time. Client IP addresses being locked fail the
authentication and are displayed in the display ftp server ip-block list command
output.
If an FTP server is disabled from locking client IP addresses, the display ftp server
ip-block list command does not display any client IP address that is locked
because of authentication failures.
IP addresses being locked are unlocked immediately after the FTP server is
disabled from locking client IP addresses.
You are advised to enable the FTP server to lock client IP addresses to ensure
security.
Example
# Disable an FTP server from locking client IP addresses.
<HUAWEI> system-view
[~HUAWEI] ftp server ip-block disable
Function
The ftp server ip-block failed-times command sets the maximum number of
consecutive FTP authentication failures within a specified period. If the number is
reached, the system locks out the IP address of user.
The undo ftp server ip-block failed-times command restores the maximum
number of consecutive FTP authentication failures and the period in which
consecutive authentication failures are counted to default values.
Format
ftp server ip-block failed-times failed-times period period
Parameters
Parameter Description Value
failed-times Specifies the maximum number of The value is an integer
consecutive FTP authentication ranging from 1 to 10.
failures before the IP address of user
lockout.
period period Specifies a period in which The value is an integer
consecutive FTP authentication ranging from 1 to 120, in
failures are counted. minutes.
Views
System view
Default Level
3: Management level
Usage Guidelines
To set the maximum number of consecutive authentication failures within a
specified period, run the ftp server ip-block failed-times command. If the
number is reached, the system locks out the IP address of user, which prevents the
user from accessing the device through FTP. The system automatically unlocks the
IP address of user until the unlocking period expires. This improves device security.
To manually unlock the IP address of user, run the activate ftp server ip-block ip-
address command.
Example
# Set the maximum number of consecutive authentication failures before the IP
address of user lockout to 3 and the period in which consecutive FTP
authentication failures are counted to 6 minutes.
<HUAWEI> system-view
[~HUAWEI] ftp server ip-block failed-times 3 period 6
Format
ftp server ip-block reactive reactive-period
undo ftp server ip-block reactive [ reactive-period ]
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
ftp-server write
Usage Guidelines
To set a period after which the system automatically unlocks an IP address of user,
run the ftp server ip-block reactive command. A locked IP address of user cannot
access the device through FTP. The system automatically unlocks the IP address of
user until the unlocking period expires. This improves device security.
To manually unlock the IP address of user, run the activate ftp server ip-block ip-
address command.
Example
# Set the period after which the system automatically unlocks the IP address of
user to 50 minutes.
<HUAWEI> system-view
[~HUAWEI] ftp server ip-block reactive 50
Function
The ftp server port command specifies the listening port number of the FTP
server.
The undo ftp server port command restores the default value of the listening
port number.
Format
ftp [ ipv6 ] server port port-number
Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP server. -
port port-number Specifies the listening port The value is 21 or an
number of the FTP server. integer that ranges from
1025 to 65535.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
By default, the listening port number of the FTP server is 21. Attackers may
frequently access the default listening port, which wastes bandwidth, deteriorates
server performance, and prevents authorized users from accessing the FTP server
through the listening port. You can run the ftp [ ipv6 ] server port command to
specify another listening port number to prevent attackers from accessing the
listening port.
The command ftp server port port-number sets the FTP server ipv4 listen port.
Prerequisites
Before running the ftp [ ipv6 ] server port command to specify the listening port
number, you must first run the undo ftp server command to disable FTP services.
Precautions
● After the listening port number is changed, the FTP server disconnects all FTP
connections and uses the new listening port.
● If the current listening port number is 21, FTP client users do not need to
specify the port number for logging in to the FTP server. If the current
listening port number is not 21, FTP client users must use the FTP server's
listening port number to log in to the FTP server.
● After the listening port number is changed, you must run the ftp server
enable command to enable FTP services to make the configuration take
effect.
Example
# Change the port number of the FTP server to 1028.
<HUAWEI> system-view
[~HUAWEI] undo ftp server
[*HUAWEI] ftp server port 1028
Format
ftp server source { -a source-ip-address | -i interface-type interface-number }
undo ftp server source { -a ip-address | -i interface-type interface-number }
ftp server source all-interface
undo ftp server source all-interface
ftp ipv6 server source -a ipv6-address [ -vpn-instance vpn-instance-name ]
undo ftp ipv6 server source -a ipv6-address [ -vpn-instance vpn-instance-name ]
ftp ipv6 server source all-interface
undo ftp ipv6 server source all-interface
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After a restart with non-base configuration, an FTP server receives login requests
from all interfaces and addresses, leading to low system security. To improve
system security, you can run the ftp server source command to specify a source
interface or source IPv6 address for the FTP server so that only authorized users
can log in to the FTP server.
● If the ftp server source { -a | -i } or ftp ipv6 server source -a command is
run and the ftp server source all-interface or ftp ipv6 server source all-
interface command is not, the specified interface is used as the source
interface, or the specified IPv6 address is used as the source IPv6 address.
● If the ftp server source all-interface or ftp ipv6 server source all-interface
command is run and the ftp server source { -a | -i } or ftp ipv6 server source
-a command is not, any valid interface on the device can be used as the
source interface, including any physical interface with an IP address
configured and any created logical interface with an IP address configured.
● If both the ftp server source { -a | -i } and ftp server source all-interface
commands are run, the interface specified in the ftp server source -i
command is preferentially used as the source interface of the FTP server.
● If both the ftp ipv6 server source -a and ftp ipv6 server source all-interface
commands are run, the interface whose IPv6 address is specified in the ftp
ipv6 server source -a command is preferentially used as the source interface
of the FTP server.
● The ftp server source { -a | -i } and ftp server source all-interface
commands take effect only in IPv4 scenarios.
● If no source interface is specified using the ftp server source command after
the system starts with base configuration, users cannot log in to the FTP
server.
Prerequisites
A loopback interface has been created if you want to specify it as the source
interface for an FTP server. Otherwise, the command cannot be executed.
A VPN instance has been created before you specify it for an FTP server.
Otherwise, the command cannot be executed.
Configuration Impact
If a source interface or source IPv6 address is specified for an FTP server, FTP users
can log in only through the specified source interface or source IPv6 address.
Precautions
● If a source interface or source IPv6 address is specified for an FTP server, FTP
users can log in only through the specified source interface or source IPv6
address. After a source interface or source IPv6 address is specified for an FTP
server, you need to restart the FTP service to activate the configuration.
● If the specified source interface is bound to a VPN instance, the VPN instance
is automatically bound to the FTP server. If the interface whose IPv6 address
is specified as the source IPv6 address is bound to a VPN instance, the -vpn-
instance parameter must be specified when you specify the IPv6 address for
the client.
● If the specified source interface is bound to a VPN instance (vpn1 for
example) and another VPN instance (vpn2 for example) is specified in the ftp
ipv6 server source -a ipv6-address [ -vpn-instance vpn-instance-name ]
command, vpn1 is used for IPv4 users, and vpn2 is used for IPv6 users.
● If the VPN instance bound to the specified source interface is deleted, the VPN
configuration specified in the ftp ipv6 server source -a ipv6-address [ -vpn-
instance vpn-instance-name ] command is not cleared but does not take
effect. In this case, the FTP server uses the public network instance instead. If
the VPN instance with the same name as the deleted one is reconfigured, the
VPN function will be restored.
● If the specified source interface is deleted, the interface configuration in the
ftp server source command is not deleted but does not take effect. If the
source interface with the same name as the deleted one is reconfigured, the
function will be restored.
● For an IPv6 FTP server, you can run the ftp ipv6 server source -a ipv6-address
[ -vpn-instance vpn-instance-name ] command to configure a user to log in
to the server through a specified IPv6 source address.
● If the ftp server source all-interface command is run, users can log in to the
FTP server through any valid IPv4 interface, which increases system security
risks. Therefore, running this command is not recommended.
● If the ftp ipv6 server source all-interface command is run, users can log in
to the FTP server through any valid IPv6 interface address, which increases
system security risks. Therefore, running this command is not recommended.
Example
# Set the source IP address of the FTP server to Loopback0.
<HUAWEI> system-view
[~HUAWEI] ftp server source -i loopback0
Warning: To make the server source configuration take effect, the FTP server will be restarted. Continue? [Y/
N]: y
Info: Succeeded in setting the source interface of the FTP server to LoopBack0.
Info: Succeeded in starting the FTP server.
Function
The ftp server timeout command configures the idle timeout duration of the FTP
server.
The undo ftp server timeout command restores the default idle timeout duration.
Format
ftp [ ipv6 ] server timeout minutes
Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP server. -
Views
System view
Default Level
3: Management level
Usage Guidelines
After a user logs in to the FTP server, a connection is set up between the FTP
server and the user's client. The idle timeout duration is configured to release the
connection when the connection is interrupted or when the user performs no
operation for a specified time.
The command ftp server timeout minutes only takes effect for ipv4 connection.
Example
# Set the idle timeout duration to 36 minutes.
<HUAWEI> system-view
[~HUAWEI] ftp server timeout 36
Function
The get command downloads a file from the SFTP server and saves the file to the
local device.
Format
get remote-filename [ local-filename ]
Parameters
Parameter Description Value
remote- Specifies the name of the file The value is a string of 1 to 128
filename to be downloaded from the case-sensitive characters without
SFTP server. spaces. The remote-filename
must already exist.
local-filename Specifies the name of a The value is a string of 1 to 128
downloaded file to be saved case-sensitive characters without
to the local device. spaces.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the get command to download files from the FTP server to upgrade
devices.
Precautions
● If local-filename is not specified on the local device, the original file name is
used.
● If the name of the downloaded file is the same as that of an existing local
file, the system prompts you whether to overwrite the existing file.
Example
# Download a file from the SFTP server.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> get test.txt
Remote file: / test.txt ---> Local file: test.txt
Downloading the file. Please wait.../
Downloading file successfully ended.
File download is completed in 1 seconds.
Format
get remote-filename [ local-filename ]
Parameters
Parameter Description Value
remote- Specifies the name of the file The value is a string of 1 to 128
filename to be downloaded from the case-sensitive characters without
FTP server. spaces. The remote-filename
must already exist.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the get command to download system software, backup
configuration files, and patch files from the FTP server to upgrade devices.
Precautions
● If the downloaded file name is not specified on the local device, the original
file name is used.
● If the name of the downloaded file is the same as that of an existing local
file, the system prompts you whether to overwrite the existing file.
Example
# Download the system software devicesoft.cc from the FTP server.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] get devicesoft.cc
Warning: The file may not transfer correctly in ASCII mode.
213 267329908
200 Port command successful
150 Opening data channel for file download from server of "/
devicesoft.cc"
/ 100% [***********]
226 Successfully transferred "/devicesoft.cc"
Function
The help command displays the help information in the SFTP client view.
Format
help [ command-name ]
Parameters
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the help command to obtain the help information and display all
commands or a command format in the SFTP client view.
Precautions
If you specify no parameter when running the help command, all commands in
the SFTP client view are displayed.
Example
# Display the format of the command get.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> help get
get Remote file name STRING<1-128> [Local file name STRING<1-128>] Download file
Default local file name is the same with remote file.
3.7.45 lcd
Function
The lcd command displays and changes the local working directory of the FTP
client in the FTP client view.
Format
lcd [ local-directory ]
Parameters
Parameter Description Value
local-directory Specifies the local working The value is a string of 1 to 128
directory of the FTP client. case-sensitive characters without
spaces.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the lcd command to display the local working directory of the FTP
client when uploading or downloading files, and set the upload or download path
to the path of the local working directory.
Precautions
The lcd command displays the local working directory of the FTP client, while the
pwd command displays the working directory of the FTP server. If you specify the
parameter local-directory in the lcd command, you can directly change the local
working directory in the FTP client view.
Example
# Change the local working directory to flash:/test.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] lcd
The current local directory is flash:/.
[ftp] lcd flash:/test/
The current local directory is flash:/test/.
3.7.46 mget
Function
The mget command downloads multiple files from the remote FTP server to the
local device.
Format
mget remote-filenames
Parameters
Parameter Description Value
remote- Specifies multiple files to download The value is a string of 1
filenames to the local device. File names are to 254 characters.
separated using spaces, and the
wildcard (*) is supported.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the mget command to download multiple files at the same time.
Precautions
● The command cannot download all files in a directory or subdirectory.
● If the name of the downloaded file is the same as that of an existing local
file, the system prompts you whether to overwrite the existing file.
Example
# Download files 1.txt, 2.txt, and vrp221.cfg from the remote FTP server.
<HUAWEI> ftp 10.10.10.1
Trying 10.10.10.1 ...
Press CTRL+K to abort
Connected to 10.10.10.1.
220 FTP service ready.
User(10.10.10.1:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp]
Format
mkdir remote-directory
Parameters
Parameter Description Value
remote- Specifies the directory The value is a string of case-sensitive
directory to be created. characters without spaces. The
absolute path length ranges from 1 to
128.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
● You can run the mkdir command to create a subdirectory in a specified
directory, and the subdirectory name must be unique.
● If no path is specified when you create a subdirectory, the subdirectory is
created in the current directory.
Example
# Create a directory test on the remote FTP server.
<HUAWEI> ftp 172.16.104.110
Trying 172.16.104.110 ...
Press CTRL+K to abort
Connected to 172.16.104.110.
220 FTP service ready.
User(172.16.104.110:(none)):switch
331 Password required for switch
Enter password:
230 User logged in.
[ftp] mkdir test
257 "test" new directory created.
Format
mkdir remote-directory
Parameters
Parameter Description Value
remote- Specifies the directory The value is a string of case-sensitive
directory to be created. characters without spaces. The
absolute path length ranges from 1 to
128.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
● You can run the mkdir command to create a subdirectory in a specified
directory, and the subdirectory name must be unique.
● If no path is specified when you create a subdirectory, the subdirectory is
created in the current directory.
● The created directory is stored on the SFTP server.
● After a directory is created, you can run the dir/ls (SFTP client view)
command to view the directory.
Example
# Create a directory on the SFTP server.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> mkdir ssh
Info: Succeeded in creating a directory.
Function
The mkdir command creates a directory in the current storage device.
Format
mkdir directory
Parameters
Parameter Description Settings
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
Example
# Create the subdirectory new in the flash card.
<HUAWEI> mkdir flash:/new
Info: Create directory flash:/new......Done.
3.7.50 more
Function
The more command displays the content of a specified file.
Format
more filename [ offset ]
Parameters
Parameter Description Value
filename Specifies the An absolute path name is a string of 1 to 255
file name. characters. A relative path name is a string of 1 to
128 case-sensitive characters without spaces in the
[ drive ] [ path ] file name format. Up to 8 levels
of directories are supported. When quotation marks
are used around the string, spaces are allowed in
the string.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the storage
device name and directory. Characters ? ~ * / \ : ' " |
< > [ ] cannot be used in the directory name.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the more command to display the file content directly on a device.
● The following describes the drive name.
– drive is the storage device and is named as flash:.
– If devices are stacked, drive can be named as:
▪ flash: root directory of the flash memory of the master switch in the
stack.
directory. A relative path beginning with a slash (/) is a path relative to the
root directory.
– flash:/my/test/ is an absolute path.
– /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
– selftest/ is a path relative to the current working directory and indicates
the selftest directory in the current working directory.
Precautions
● You are not advised to use this command to display non-text files; otherwise,
the terminal is shut down or displays garbled characters, which is harmless to
the system.
● Files are displayed in text format.
● You can display the file content flexibly by specifying parameters before
running the more command:
– You can run the more filename command to view a specified text file.
The content of the specified text file is displayed on multiple screens. You
can press the spacebar consecutively on the current session GUI to
display all content of the file.
To display the file content on multiple screens, you must ensure that:
▪ The total number of file lines is greater than the number of lines
that can be displayed on a terminal screen. (The number of lines that
can be displayed on a terminal screen is set by running the screen-
length command.)
– You can run the more filename offset command to view a specified file.
The content of the specified text file starting from offset is displayed on
multiple screens. You can press the spacebar consecutively on the current
session GUI to display all content of the file.
To display the file content on multiple screens, you must ensure that:
▪ The number of lines starting from offset in the file is greater than
the number of lines that can be displayed on a terminal screen. (The
number of lines that can be displayed on a terminal screen is set by
running the screen-length command.)
Example
# Display the content of the file test.bat.
<HUAWEI> more test.bat
rsa local-key-pair create
user-interface vty 12 14
authentication-mode aaa
protocol inbound ssh
# Display the content of the file log.txt and set the offset to 100.
<HUAWEI> more log.txt 100
: CHINA HUAWEI TECHNOLOGY LIMITTED CO.,LTD
# FILE NAME: Product Adapter File(PAF)
# PURPOSE: MAKE VRPV5 SUITABLE FOR DIFFERENT PRODUCT IN LIB
# SOFTWARE PLATFORM: V6R2C00
# DETAIL VERSION: B283
# DEVELOPING GROUP: 8090 SYSTEM MAINTAIN GROUP
# HARDWARE PLATFORM: 8090 (512M Memory)
# CREATED DATE: 2003/05/10
# AUTH: RAINBOW
# Updation History: Kelvin dengqiulin update for 8090(2004.08.18)
# lmg update for R3(2006.11.7)
# fsr update for R5 (2008.1.18)
# qj update for R6 (2008.08.08)
# COPYRIGHT: 2003---2008
#----------------------------------------------------------------------------------
3.7.51 move
Function
The move command moves the source file from a specified directory to a
destination directory.
Format
move source-filename destination-filename
Parameters
Parameter Description Settings
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as flash:.
● If devices are stacked, drive can be named as:
– flash: root directory of the flash memory of the master switch in the
stack.
– chassis ID#flash: root directory of the flash memory on a device in the
stack.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
Example
# Move the file test from the root directory to the directory new.
<HUAWEI> move test new/
Warning: Move file flash:/test to flash:/new/test? [Y/N]:y
100% complete
Info: Move file flash:/test to flash:/new/test...Done.
3.7.52 mput
Function
The mput command uploads multiple files from the local device to the remote
FTP server.
Format
mput local-filenames
Parameters
Parameter Description Value
local-filenames Specifies files to be uploaded. File The value is a string of 1
names are separated using spaces, to 256 characters.
and the wildcard (*) is supported.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the mput command to upload multiple files to the remote FTP server
at the same time, especially in the upgrade scenario.
System prompts a confirmation message to the user before file transfer. You can
disable the prompt message using undo prompt command.
Precautions
If the name of the uploaded file is the same as that of an existing file on the FTP
server, the system overwrites the existing file.
Example
# Upload two local files 111.text and vrp222.cfg to the remote FTP server.
<HUAWEI> ftp 10.10.10.1
Trying 10.10.10.1 ...
Press CTRL+K to abort
Connected to 10.10.10.1.
220 FTP service ready.
User(10.10.10.1:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp]
3.7.53 open
Function
The open command connects the FTP client and server.
Format
# Connect the FTP client to the FTP server based on the IPv4 address.
# Connect the FTP client to the FTP server based on the IPv6 address.
Parameters
Parameter Description Value
port-number Specifies the port number of the The value is an integer that
FTP server. ranges from 1 to 65535.
The default value is the
standard port number 21.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the open command in the FTP client view to connect the FTP client to
the server to transmit files and manage files and directories of the FTP server.
Precautions
● You can run the ftp command in the user view to connect the FTP client and
server and enter the FTP client view.
● You can set the source IP address to the source or destination IP address in
the ACL rule when the -a or -i parameter is specified on the IPv4 network.
This shields the IP address differences and interface status impact, filters
incoming and outgoing packets, and implements security authentication.
● You can run the set net-manager vpn-instance command to configure the
NMS management VPN instance before running the open command to
connect the FTP client and server.
– If public-net or vpn-instance is not specified, the FTP client accesses the
FTP server in the VPN instance managed by the NMS.
– If public-net is specified, the FTP client accesses the FTP server on the
public network.
Example
# Connect the FTP client with the FTP server whose IP address is 10.137.217.204.
<HUAWEI> ftp
[ftp] open 10.137.217.204
Trying 10.137.217.204 ...
Press CTRL + K to abort
Connected to 10.137.217.204.
220 FTP service ready.
User(10.137.217.204:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp]
# Connect the FTP client with the FTP server whose IP address is 2001:db8:1::1.
<HUAWEI> ftp
[ftp] open ipv6 2001:db8:1::1
Trying 2001:db8:1::1 ...
Press CTRL + K to abort
Connected to 2001:db8:1::1
220 FTP service ready.
User(2001:db8:1::1:(none)):switch
331 Password required for switch
Enter Password:
230 User logged in.
[ftp]
3.7.54 passive
Function
The passive command sets the data transmission mode to passive.
The undo passive command sets the data transmission mode to active.
By default, the data transmission mode is active.
Format
passive
undo passive
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
The device supports the active and passive data transmission modes. In active
mode, the server initiates a connection request, and the client and server need to
enable and monitor a port to establish a connection. In passive mode, the client
initiates a connection request, and only the server needs to monitor the
corresponding port. This command is used together with the firewall function.
When the client is configured with the firewall function, FTP connections are
restricted between internal clients and external FTP servers if the FTP transmission
mode is active. If the FTP transmission mode is passive, FTP connections between
internal clients and external FTP servers are not restricted.
Example
# Set the data transmission mode to passive.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] passive
Info: Succeeded in switching passive on.
3.7.55 prompt
Function
The prompt command enables the prompt function when files are transmitted
between the FTP client and server.
Format
prompt
undo prompt
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can enable the prompt function as required when transmitting files between
the FTP client and server.
Precautions
● The prompt command can be used when you run the put, mput, get, and
mget commands.
● The prompt function can be enabled only for confirming service upload and
download.
– When you run the put or mput command, the system always overwrites
the existing file if the name of the uploaded file is the same as that of an
existing file on the FTP server.
– When you run the get or mget command, the system always prompts
you whether to overwrite the existing file if the name of the uploaded file
is the same as an existing file name in the specified directory.
Example
# Enable the FTP message prompt function.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] prompt
Info: Succeeded in switching prompt on.
Format
put local-filename [ remote-filename ]
Parameters
Parameter Description Value
local-filename Specifies the local file name The value is a string of 1 to 128
of the FTP client. case-sensitive characters without
spaces. The local-filename must
already exist.
remote- Specifies the name of the The value is a string of 1 to 128
filename file to be uploaded to the case-sensitive characters without
remote FTP server. spaces.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the put command to upload a local file to the remote FTP server for
further check and backup. For example, you can upload the local log file to the
FTP server for other users to check, and upload the configuration file to the FTP
server as a backup before upgrading the device.
Precautions
● If the file name is not specified on the remote FTP server, the local file name
is used.
● If the name of the uploaded file is the same as that of an existing file on the
FTP server, the system overwrites the existing file.
Example
# Upload the configuration file vrpcfg.zip to the remote FTP server as a backup,
and save it as backup.zip.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] put vrpcfg.zip backup.zip
200 Port command okay.
150 Opening ASCII mode data connection for /backup.zip.
/ 100% [***********]
226 Transfer complete.
FTP: 1098 byte(s) sent in 0.131 second(s) 8.38Kbyte(s)/sec.
Format
put local-filename [ remote-filename ]
Parameters
Parameter Description Value
local-filename Specifies a local file The value is a case-sensitive character
name on the SFTP string without spaces. The file name
client. (including the absolute path) contains
1 to 128 characters. The local-filename
must already exist.
remote- Specifies the name of The value is a case-sensitive character
filename the file uploaded to the string without spaces. The file name
remote SFTP server. (including the absolute path) contains
1 to 128 characters.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
This command enables you to upload files from the local device to a remote SFTP
server to view the file contents or back up the files. For example, you can upload
log files of a device to an SFTP server and view the logs in the server. During an
upgrade, you can upload the configuration file of the device to the SFTP server for
backup.
Precautions
● If remote-filename is not specified, the uploaded file is saved on the remote
SFTP server with the original file name.
● If the specified remote-filename is the same as an existing file name on the
SFTP server, the uploaded file overwrites the existing file on the server.
Example
# Upload a file to the SFTP server.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> put wm.cfg
Local file: wm.cfg ---> Remote file: /wm.cfg
Uploading the file. Please wait...\
Uploading file successfully ended.
File upload is completed in 0 seconds.
Format
pwd
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
After logging in to the FTP server, you can run the pwd command to display the
FTP client's working directory on the remote FTP server.
If the displayed working directory is incorrect, you can run the cd command to
change the FTP client's working directory on the remote FTP server.
Example
# Display the FTP client's working directory on the remote FTP server.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] pwd
257 "/" is current directory.
Format
pwd
Parameters
None
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
After logging in to the SFTP server, you can run the pwd command to display the
SFTP client's working directory on the remote SFTP server.
If the displayed working directory is incorrect, you can run the cd command to
change the SFTP client's working directory on the remote SFTP server.
Example
# Display the SFTP client's working directory on the remote SFTP server.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> pwd
Current directory is:
/
sftp-client> cd test
Current directory is:
/test
sftp-client> pwd
Current directory is:
/test
Format
pwd
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
You can run the pwd command in any directory to display the current working
directory. To change the current working directory, you can run the cd command.
Example
# Display the current working directory.
<HUAWEI> pwd
flash:/test/
3.7.61 remotehelp
Function
The remotehelp command displays the help information about an FTP command
when the FTP client and server are connected.
Format
remotehelp [ command ]
Parameters
Parameter Description Value
command Specifies the FTP The value is a string of 1 to 16
command. characters.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
You can run the remotehelp command to display the help information about an
FTP command.
NOTE
Example
# Display the syntax of the command cdup.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
Format
remove remote-filename &<1-10>
Parameters
Parameter Description Value
remote- Specifies the name of the file The value is a string of 1 to
filename to be deleted from the remote 128 case-sensitive characters
SFTP server. without spaces.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
● You can configure a maximum of 10 file names in the command and separate
them using spaces and delete them at one time.
● If the file to be deleted is not in the current directory, you must specify the file
path.
Example
# Delete the file 3.txt from the server and backup1.txt from the test directory.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Format
rename old-name new-name
Parameters
Parameter Description Value
old-name The value is a string of 1 to 128 case-
Specifies the name of a file
sensitive characters without spaces. The
or directory.
old-name must already exist.
new-name Specifies the new name of The value is a string of 1 to 128 case-
the file or directory. sensitive characters without spaces.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
You can run the rename command to rename a file or directory.
Example
# Rename the directory yourtest on the SFTP server.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Please input the username:admin
Enter password:
sftp-client> rename test/yourtest test/test
Warning: Rename /test/yourtest to /test/test? [Y/N]:y
Info: Succeeded in renaming file.
sftp-client> cd test
Current directory is:
/test
sftp-client> dir
drwxrwxrwx 1 noone nogroup 0 Mar 29 22:44 .
drwxrwxrwx 1 noone nogroup 0 Mar 29 22:39 ..
drwxrwxrwx 1 noone nogroup 0 Mar 24 00:04 test
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup.txt
Format
rename old-name new-name
Parameters
Parameter Description Settings
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The following describes the drive name:
● drive is the storage device and is named as flash:.
● If devices are stacked, drive can be named as:
– flash: root directory of the flash memory of the master switch in the
stack.
– chassis ID#flash: root directory of the flash memory on a device in the
stack.
For example, slot2#flash: indicates the flash memory in slot 2.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
Example
# Rename the directory mytest to yourtest in the directory flash:/test/.
<HUAWEI> pwd
flash:/test
<HUAWEI> rename mytest yourtest
Info: Rename file flash:/test/mytest to flash:/test/yourtest ?[Y/N]:y
Info: Rename file flash:/test/mytest to flash:/test/yourtest ......Done.
Format
reset recycle-bin [ /f | filename | devicename ]
Parameters
Parameter Description Value
/f Directly deletes all -
files from the
recycle bin.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If you run the delete command without specifying the /unreserved parameter,
the file is moved to the recycle bin and still occupies the memory. To free up the
space, you can run the reset recycle-bin command to permanently delete the file
from the recycle bin.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● You can run the dir /all command to display all files that are moved to the
recycle bin from the current directory, and file names are displayed in square
brackets ([ ]).
● If you delete a specified storage device, all files in the root directory of the
storage device are deleted.
● If you run the reset recycle-bin command directly, all files that are moved to
the recycle bin from the current directory are permanently deleted.
Example
# Delete the file test.txt that is moved to the recycle bin from the directory test.
<HUAWEI> reset recycle-bin flash:/test/test.txt
Info: Are you sure to clear flash:/test/test.txt?[Y/N]:y
Info: Clearing file flash:/test/test.txt......Done.
# Delete files that are moved to the recycle bin from the current directory.
<HUAWEI> pwd
flash:/test
<HUAWEI> reset recycle-bin
Info: Are you sure to clear flash:/test/aa.txt?[Yes/All/No/Cancel]:y
Info: Clearing file flash:/test/aa.txt......Done.
Info: Are you sure to clear flash:/test/abc.txt?[Yes/All/No/Cancel]:y
Info: Clearing file flash:/test/abc.txt......Done.
Info: Are you sure to clear flash:/test/1.bat?[Yes/All/No/Cancel]:y
Info: Clearing file flash:/test/1.bat......Done.
Format
rmdir remote-directory
Parameters
Parameter Description Value
remote- Specifies a directory or The value is a string of 1 to 128
directory path on the FTP server. case-sensitive characters without
spaces.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the rmdir command to delete a specified directory from the remote
FTP server.
Precautions
● Before running the rmdir command to delete a directory, you must delete all
files and subdirectories from the directory.
● If no path is specified when you delete a subdirectory, the subdirectory is
deleted from the current directory.
● The directory is deleted from the FTP server rather than the FTP client.
Example
# Delete the directory d:/temp1 from the remote FTP server.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] rmdir d:/temp1
250 'D:\temp1': directory removed.
Format
rmdir directory
Parameters
Parameter Description Value
directory Specifies a The value is a string of case-sensitive characters in
directory or the [ drive ] [ path ] directory format. The
directory and its absolute path length ranges from 1 to 255, while
path. the directory name length ranges from 1 to 128.
Up to 8 levels of directories are supported.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
Characters such as ~, *, /, \, :, ', " cannot be used
in the directory name.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● Before running the rmdir command to delete a directory, you must delete all
files and subdirectories from the directory.
● A deleted directory and its files cannot be restored from the recycle bin.
Example
# Delete the directory test from the current directory.
<HUAWEI> rmdir test
Info: Are you sure to remove directory flash:/test?[Y/N]:y
Info: Removing directory flash:/test/.......Done.
Format
rmdir remote-directory &<1-10>
Parameters
Parameter Description Value
remote- Specifies the name of a file The value is a string of 1 to 128
directory on the SFTP server. case-sensitive characters without
spaces.
Views
SFTP client view
Default Level
3: Management level
Usage Guidelines
● You can configure a maximum of 10 file names in the command and separate
them using spaces and delete them at one time.
● Before running the rmdir command to delete a directory, you must delete all
files and subdirectories from the directory.
● If the directory to be deleted is not in the current directory, you must specify
the file path.
Example
# Delete the directory 1 from the current directory, and the directory 2 from the
test directory.
<HUAWEI> system-view
[~HUAWEI] sftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
3.7.69 scp
Function
The scp command uploads a local file to the remote SCP server or downloads a
file from the remote SCP server to a local directory.
Format
# Transfer a file between the local client and the remote SCP server based on IPv4.
scp [ -a source-ip-address | -i interface-type interface-number ] [ -force-receive-
pubkey ] [ [ -port port-number ] | [ public-net | vpn-instance vpn-instance-
name ] | -c | [ -cipher cipher-type ] | [ -prefer-kex kex-type ] | -r | [ identity-key
{ dsa | ecc | rsa | pki } ] | [ user-identity-key { dsa | ecc | rsa | pki } ] ] * source-
filename destination-filename
# Transfer a file between the local client and the remote SCP server based on IPv6.
scp ipv6 [ -a source-ipv6-address | -oi interface-type interface-number ] [ public-
net | vpn-instance vpn-instance-name ] [ -force-receive-pubkey ] [ [ -port port-
number ] | -c | [ -cipher cipher-type ] | [ -prefer-kex kex-type ] | -r | [ identity-
key { dsa | ecc | rsa | pki} ] | [ user-identity-key { dsa | ecc | rsa | pki } ] ] *
source-filename destination-filename
Parameters
Parameter Description Value
-port port- Specifies the port number The value is an integer that ranges
number of the SCP server. from 1 to 65535. The default value
is 22.
vpn-instance Specifies the name of the The name of the VPN instance
vpn-instance- VPN instance where the must already exist.
name SCP server is located.
identity-key Specifies the public key The public key algorithm can be
algorithm for server one of the following:
authentication.
● dsa
● ecc
● rsa
● pki
The default public key algorithm is
ecc.
NOTE
Public key algorithm supported
depend on the ssh client publickey
command configured by the user.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
SCP file transfer mode is based on SSH2.0 Compared with the SFTP file transfer
mode, the SCP file transfer mode allows you to upload or download files when the
connection is set up between the SCP client and server.
● You are advised to set the source IP address to the loopback address, or set
the outbound interface to the loopback interface using -a and -i, to improve
security.
● When -r is specified, you can use the wildcard (*) to upload or download files
in batches, for example, *.txt and switch.*.
● When -c is specified, files are compressed before being transmitted. File
compression takes a long time and affects file transfer speed; therefore, you
are not advised to compress files before transferring them.
Precautions
● The format of uploaded and downloaded files of the SCP server is
username@hostname:[path]filename.
– username is the user name for logging in to the SCP server.
– hostname is the name or IP address of the SCP server.
– path is the working directory on the SCP server.
Example
# Log in through DSA authentication and copy the xxxx.txt file to the flash
memory of remote SCP server at 10.10.0.114.
<HUAWEI> system-view
[~HUAWEI] scp identity-key dsa flash:/xxxx.txt [email protected]:flash:/xxxx.txt
Trying 10.10.0.114...
Press CTRL+K to abort
Connected to 10.10.0.114...
The server is not authenticated. Continue to access it? [Y/N]:y
Save the server's public key? [Y/N]:y
The server's public key will be saved with the name 10.10.0.114. Please wait...
Please select public key type for user authentication [R for RSA/D for DSA/E for ECC] Please select [R/D/E]:
d
Enter password:
xxxx.txt 100% 261Bytes 1Kb/s
Format
scp client-source { -a source-ip-address [ public-net | -vpn-instance vpn-
instance-name ] | -i interface-type interface-number }
undo scp client-source
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If no source IP address is specified, the client uses the source IP address that the
router specifies to send packets. The source IP address must be configured for an
interface with stable performance. The loopback interface is recommended. Using
the loopback interface as the source interface simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
If you use -i to specify a logical interface as the source interface, ensure that the
logical interface has been created successfully.
Prerequisites
VPN configuration must be successful, to configure the vpn instance using this
command.
Precautions
● The scp command also configures the source IP address whose priority is
higher than that of the source IP address specified in the scp client-source
command. If you specify source addresses in the scp client-source and scp
commands, the source IP address specified in the scp command is used for
data communication. The source address specified in the scp client-source
command applies to all SCP connections. The source address specified in the
scp command applies only to the current SCP connection.
● If the specified source interface has been bound to a VPN instance, the client
is automatically bound to the same VPN instance.
● After a bound VPN instance is deleted, the VPN configuration specified using
the scp client-source command will not be cleared but does not take effect.
In this case, the SCP server uses a public IP address. If you configure the VPN
instance with the same name again, the VPN function restores.
● After the bound source interface is deleted, the interface configuration in the
ssh server-source command will not be deleted and does not take effect.
After the source interface with the same name is reconfigured, the function
will be restored.
Example
# Set the source IP address of the SCP client to the loopback interface IP address
10.1.1.1.
<HUAWEI> system-view
[~HUAWEI] scp client-source -a 10.1.1.1
Function
The scp max-sessions command sets the maximum number of SCP clients
allowed to connect to an SCP server concurrently.
The undo scp max-sessions command restores the default number of SCP clients
allowed to connect to an SCP server concurrently.
Format
scp max-sessions max-session-count
undo scp max-sessions
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
This command limits the number of SCP clients connecting to an SCP server.
This command takes effect for both ipv4 and ipv6 connections.
NOTE
If the configured limit is smaller than the number of currently connected SCP clients, the SCP
clients are not disconnected, but new SCP clients cannot be connect to the SCP server.
Example
# Set the number of SCP clients allowed to connect to an SCP server to 5.
<HUAWEI> system-view
[~HUAWEI] scp max-sessions 5
Format
scp [ ipv4 | ipv6 ] server enable
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
SCP is used to copy, upload, and download files based on the SSH remote copy
function. The SCP file copy command is easy to use, improving network
maintenance efficiency.
Run scp server enable command can enable both IPv4 and IPv6 SCP server. Run
scp ipv4 server enable command to enable IPv4 SCP server. Run scp ipv6 server
enable command to enable IPv6 SCP server.
To connect the client to the SSH server to transfer files in SCP mode, you must
first enable the SCP server on the SSH server.
In V200R002C50 and V200R003C00, you can run the scp [ ipv4 | ipv6 ] server
enable command to enable the SCP function. If the current version is downgraded
to V200R001C00 or an earlier version, this configuration will be lost, so you need
to run the scp server enable command again. In V200R005C00, you can run the
scp ipv4 server enable command to enable the IPv4 SCP function, or run the scp
ipv6 server enable command to enable the IPv6 SCP function (IPv4 SCP and IPv6
SCP functions are not enabled simultaneously). If the current version is
downgraded to V200R001C00 or an earlier version, this configuration will be lost,
so you need to run the scp server enable command again.
Example
# Enable the SCP service.
<HUAWEI> system-view
[~HUAWEI] scp server enable
Format
set configuration appdata auto-check enable
undo set configuration appdata auto-check enable
Parameters
none
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The device data is saved in the central database and service process databases.
Each service process database needs to synchronize data from the central
database. If the data in a service process database is inconsistent with that in the
central database, the host behaviors may not meet operator expectations, causing
service function exceptions. Therefore, automatic data verification needs to be
enabled to periodically check data consistency between service process databases
and the central database. If any inconsistency is detected, an alarm is reported
immediately, notifying you of analyzing the impact on services timely. You can
restart the board or device to rectify the fault.
To enable or disable the automatic data verification function, run this command.
Example
# Disable the function to automatically check whether data in the service process
database is the same as that in the central database.
<HUAWEI> system-view
[~HUAWEI] undo set configuration appdata auto-check enable
Format
set net-manager [ ipv6 ] vpn-instance vpn-instance-name
undo set net-manager [ ipv6 ] vpn-instance
Parameters
Parameter Description Value
ipv6 Specifies the IPv6 -
VPN instance.
vpn-instance Specifies the name of The value is a string of 1 to 31 case-
vpn-instance- the default VPN sensitive characters except spaces.
name instance. When double quotation marks are used
to include the string, spaces are
allowed in the string. The value
_public_ is reserved and cannot be used
as the VPN instance name.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the NMS manages devices on the VPN network, you need to send the device
information to the NMS using the VPN instance.
You can run the set net-manager vpn-instance command to configure the
default VPN instance for the NMS to manage the device so that the device can
use this VPN instance to communicate with the NMS.
Precautions
● Before running the set net-manager vpn-instance command, you must
create VPN instances.
● If the host has been configured as a log host, the NMS can receive device logs
from the default VPN instance.
● The VPN configured using the set net-manager vpn-instance command
affects the following service modules: TFTP client, FTP client, SFTP client, SCP
client, Info Center module, SNMP module, TACACS module, IP FPM module,
PM module, Callhome module of the SSH server.
● After a bound VPN instance is deleted, the VPN configuration specified using
the set net-manager command will not be cleared but does not take effect.
In this case, the server uses a public IP address. If you configure the VPN
instance with the same name again, the VPN function restores.
Example
# Set the default VPN instance to v1.
<HUAWEI> system-view
[~HUAWEI] set net-manager vpn-instance v1
3.7.75 sftp
Function
The sftp command connects the device to the SSH server so that you can manage
files that are stored on the SFTP server.
Format
# Connect the SFTP client to the SFTP server based on IPv4.
sftp [ -a source-address | -i interface-type interface-number | -force-receive-
pubkey ] host-ip [ port ] [ [ public-net | -vpn-instance vpn-instance-name ] |
prefer_kex kex-type | prefer_ctos_cipher cipher-type | prefer_stoc_cipher cipher-
type | prefer_ctos_hmac hmac-type | prefer_stoc_hmac hmac-type |
prefer_ctos_compress compress-type | prefer_stoc_compress compress-type | -ki
aliveinterval | -kc alivecountmax | identity-key { dsa | ecc | rsa | pki } | user-
identity-key { dsa | ecc | rsa | pki } ] *
# Connect the SFTP client to the SFTP server based on IPv6.
sftp ipv6 [ -force-receive-pubkey ] [ -a source-address ] host-ipv6 [ [ public-net |
-vpn-instance vpn-instance-name ] [ -oi interface-type interface-number ]
[ port ] [ prefer_kex kex-type | prefer_ctos_cipher cipher-type |
prefer_stoc_cipher cipher-type | prefer_ctos_hmac hmac-type | prefer_stoc_hmac
hmac-type | prefer_ctos_compress compress-type | prefer_stoc_compress
compress-type | -ki aliveinterval | -kc alivecountmax | identity-key { dsa | ecc | rsa
| pki } | user-identity-key { dsa | ecc | rsa | pki } ] ] *
Parameters
Parameter Description Value
-vpn-instance vpn- Name of the VPN The VPN must already exist.
instance-name instance where the SFTP
server is located.
-ki aliveinterval Specifies the interval for The value is an integer that
sending keepalive ranges from 1 to 3600, in
packets when no packet seconds.
is received in reply.
-kc alivecountmax Specifies the times for The value is an integer that
sending keepalive ranges from 1 to 30. The
packets when no packet default value is 3.
is received in reply.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
SFTP is short for SSH FTP that is a secure FTP protocol. SFTP is on the basis of
SSH. It ensures that users can log in to a remote device securely for file
management and transmission, and enhances the security in data transmission. In
addition, you can log in to a remote SSH server from the device that functions as
an SFTP client.
When the connection between the SFTP server and client fails, the SFTP client
must detect the fault in time and disconnect from the SFTP server. To ensure this,
before being connected to the server in SFTP mode, the client must be configured
with the interval and times for sending the keepalive packet when no packet is
received in reply. If the client receives no packet in reply within the specified
interval, the client sends the keepalive packet to the server again. If the maximum
number of times that the client sends keepalive packets exceeds the specified
value, the client releases the connection. By default, when no packet is received,
the function for sending keepalive packets is not enabled.
Precautions
● You can set the source IP address to the source or destination IP address in
the ACL rule when the -a or -i parameter is specified. This shields the IP
address differences and interface status impact, filters incoming and outgoing
packets, and implements security authentication.
● The SSH client can log in to the SSH server with no port number specified
only when the port number of the SSH server is 22. If the SSH server uses
another port, the port number must be specified when SSH clients log in to
the SSH server.
● If you cannot run the sftp command successfully when you configured the
ACL on the SFTP client, or when the TCP connection fails, an error message is
displayed indicating that the SFTP client cannot be connected to the server.
NOTE
To ensure high security, do not use the des algorithm, 3des algorithm, and rsa algorithm
whose length is less than 2048 digits.
Example
# Set the current listening port number of the SSH server to 1025, and specify the
SFTP client on the public network and the SSH server on the private network.
<HUAWEI> system-view
[~HUAWEI] sftp 10.164.39.223 1025 -vpn-instance ssh
Trying 10.164.39.223 ...
Press CTRL+K to abort
Connected to 10.164.39.223 ...
Please input the username: client001
Please select public key type for user authentication [R for RSA/D for DSA/E for ECC] Please select [R/D/E]:
d
Enter password:
sftp-client>
# Set keepalive parameters when the client is connected to the server in SFTP
mode.
<HUAWEI> system-view
[~HUAWEI] sftp 10.164.39.223 -ki 10 -kc 4
Trying 10.164.39.223 ...
Press CTRL+K to abort
Connected to 10.164.39.223 ...
Please input the username: client001
Please select public key type for user authentication [R for RSA/D for DSA/E for ECC] Please select [R/D/E]:
d
Enter password:
sftp-client>
Format
sftp client-source { -a source-ip-address [ public-net | -vpn-instance vpn-
instance-name ] | -i interface-type interface-number }
undo sftp client-source
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If no source IP address is specified, the client uses the source IP address that the
router specifies to send packets. The source IP address must be configured for an
interface with stable performance. The loopback interface is recommended. Using
the loopback interface as the source interface simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
impact, filters incoming and outgoing packets, and implements security
authentication.
Precautions
● If the specified source interface has been bound to a VPN instance, the client
is automatically bound to the same VPN instance.
● If the specified source interface has been bound to a VPN instance, for
example, vpn1, but a different VPN instance, for example, vpn2, is specified in
the sftp client-source{ -a source-ip-address-vpn-instance vpn-instance-
name } command, the VPN instance vpn2 takes effect.
● You can query the source IP address or primary IP address of the source
interface for the SFTP connection on the SFTP server.
● The sftp command also configures the source IP address whose priority is
higher than that of the source IP address specified in the sftp client-source
command. If the sftp command is run after a source IP address has been
specified using the sftp client-source command, the source IP address
specified using the sftp command is used for communication. The source
address specified in the sftp client-source command applies to all SFTP
connections; the source address specified in the sftp command applies only to
the current SFTP connection.
● After the bound source interface is deleted, the interface configuration in the
ssh server-source command will not be deleted and does not take effect.
After the source interface with the same name is reconfigured, the function
will be restored.
Example
# Set the source IP address of the SFTP client to 10.1.1.1.
<HUAWEI> system-view
[~HUAWEI] sftp client-source -a 10.1.1.1
Info: Succeeded in setting the source address of the SFTP client to 10.1.1.1.
Format
# Establish an IPv4 SFTP connection and upload or download files.
sftp client-transfile { get | put } [ -a source-address | -i interface-type interface-
number ] host-ip host-ipv4 [ port ] [ [ public-net | -vpn-instance vpn-instance-
name | prefer_kex prefer_kex | identity-key { rsa | dsa | ecc | pki } |
prefer_ctos_cipher prefer_ctos_cipher | prefer_stoc_cipher prefer_stoc_cipher |
prefer_ctos_hmac prefer_ctos_hmac | prefer_stoc_hmac prefer_stoc_hmac | -ki
interval | -kc count ] ] * username user-name password password sourcefile
source-file [ destination destination ]
# Establish an IPv6 SFTP connection and upload or download files.
sftp client-transfile { get | put } ipv6 [ -a source-ipv6-address ] host-ip host-ipv6
[ -oi interface-type interface-number ] [ port ] [ [ public-net | -vpn-instance vpn-
instance-name | prefer_kex prefer_kex | identity-key { rsa | dsa | ecc } |
prefer_ctos_cipher prefer_ctos_cipher | prefer_stoc_cipher prefer_stoc_cipher |
prefer_ctos_hmac prefer_ctos_hmac | prefer_stoc_hmac prefer_stoc_hmac | -ki
interval | -kc count ] ] * username user-name password password sourcefile
source-file [ destination destination ]
Parameters
Parameter Description Value
identity-key { rsa | dsa Specifies public key Currently, PKI, RSA, DSA
| ecc | pki } algorithms for server and ECC algorithms are
authentication. supported. The default
public key algorithm is
ECC.
NOTE
For security purposes, do
not use the RSA algorithm
whose modulus bit value is
less than 2048. You are
advised to use the ECC
algorithm instead.
Views
System view
Default Level
3: Management level
ssh-client debug
Usage Guidelines
Usage Scenario
To upload files from an SFTP client to an SFTP server or download files from an
SFTP server to an SFTP client, run the sftp client-transfile command. This
command can be run only on an SFTP client.
If you run the sftp command for file transfer, you need to enter the user name
and password as prompted first. Files can be transferred only after the
authentication succeeds. The sftp client-transfile command supports one-click
file transfer. Specifically, file transfer requires that the command be run only once.
Prerequisites
● There are reachable routes between the SSH client and server.
● The SSH server IP address and SSH user information used for login are
obtained.
● The SFTP service is enabled on the server; the service types configured for the
server include SFTP; password authentication is configured for the SSH user.
Precautions
Example
# Configure an SFTP user to download the source file sample.txt from the server
at 10.1.1.2 to the SFTP client.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance ssh
[*HUAWEI-vpn-instance-ssh] ipv4-family
[*HUAWEI-vpn-instance-ssh-af-ipv4] commit
[~HUAWEI-vpn-instance-ssh-af-ipv4] quit
[~HUAWEI-vpn-instance-ssh] quit
[~HUAWEI] sftp client-transfile get host-ip 10.1.1.2 1025 -vpn-instance ssh username switch password
Huawei-123 sourcefile sample.txt
# Configure an SFTP user to download the source file sample.txt from the server
at 10.1.1.3 to the SFTP client. Set the -ki interval and -kc count to 10s and 4,
respectively.
<HUAWEI> system-view
[~HUAWEI] sftp client-transfile get host-ip 10.1.1.3 -ki 10 -kc 4 username switch password
Huawei-123 sourcefile sample.txt
# Configure an SFTP user to download the source file sample.txt from the server
at 10.1.1.4 to the SFTP client, and log in to the SFTP server in DSA authentication
mode.
<HUAWEI> system-view
[~HUAWEI] sftp client-transfile get host-ip 10.1.1.4 identity-key dsa username switch password
Huawei-123 sourcefile sample.txt
# Configure an SFTP user to upload the sample.txt file to the SFTP server whose
IPv6 address is 2001:db8::1, and log in to the SFTP server in DSA authentication
mode.
<HUAWEI> system-view
[~HUAWEI] sftp client-transfile put ipv6 host-ip 2001:db8::1 identity-key dsa username switch
password Huawei-123 sourcefile sample.txt
Function
The sftp idle-timeout command configures the idle timeout duration for
disconnecting to the SFTP client from the SSH server.
The undo sftp idle-timeout command restores the default idle timeout duration.
Format
sftp idle-timeout minutes [ seconds ]
Parameters
Parameter Description Value
minutes Specifies the idle timeout The value is an integer that ranges
minutes. from 0 to 35791.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the undo sftp idle-timeout command to configure the idle timeout
duration to disconnect the SFTP client from the SSH server when an SFTP user
does not perform any operation within the specified duration.
Precautions
If you run the sftp idle-timeout 0 0 command, the idle timeout function is
disabled.
This command takes effect for both ipv4 and ipv6 connections.
Example
# Set the idle timeout duration to 1 minute and 30 seconds.
<HUAWEI> system-view
[~HUAWEI] sftp idle-timeout 1 30
Function
The sftp max-sessions command configures the maximum number of server
connections in SFTP mode.
The undo sftp max-sessions command restores the maximum number of server
connections in SFTP mode to the default value.
Format
sftp max-sessions max-session-count
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the sftp max-sessions command to configure the maximum number
of SSH server connections in SFTP mode to prevent the heavy load resulting from
excessive accesses, and it takes effect for both IPv4 and IPv6 connections.
Precautions
If the maximum number is smaller than that of the current value, the current
connection persists and no connection can be set up.
Example
# Set the maximum number of server connections to 10.
<HUAWEI> system-view
[~HUAWEI] sftp max-sessions 10
Function
The sftp server enable command enables the SFTP service on the SSH server.
The undo sftp server enable command disables the SFTP service on the SSH
server.
Format
sftp [ ipv4 | ipv6 ] server enable
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
To connect the client to the SSH server to transfer files in SFTP mode, you must
first enable the SFTP server on the SSH server.
Run sftp server enable command can enable both IPv4 and IPv6 SFTP server. Run
sftp ipv4 server enable command to enable IPv4 SFTP server. Run sftp ipv6
server enable command to enable IPv6 SFTP server.
NOTICE
Disabling the SFTP service on the server disconnects all the clients connected
through SFTP.
In V200R002C50 and V200R003C00, you can run the sftp [ ipv4 | ipv6 ] server
enable command to enable the SFTP function. If the current version is
downgraded to V200R001C00 or an earlier version, this configuration will be lost,
so you need to run the sftp server enable command again. In V200R005C00, you
can run the sftp ipv4 server enable command to enable the IPv4 SFTP function,
or run the sftp ipv6 server enable command to enable the IPv6 SFTP function
(IPv4 SFTP and IPv6 SFTP functions are not enabled simultaneously). If the current
version is downgraded to V200R001C00 or an earlier version, this configuration
will be lost, so you need to run the sftp server enable command again.
Example
# Enable the SFTP service.
<HUAWEI> system-view
[~HUAWEI] sftp server enable
Info: Succeeded in starting the SFTP server.
Format
sftp server default-directory sftpdir
undo sftp server default-directory [ sftpdir ]
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When accessing the server using SFTP, you can only access the authorized
directory of the SFTP server. You can use any of the following methods to
configure the authorized directory of the SFTP server. The three methods are in
descending order of priorities.
● Run the ssh user username sftp-directory directoryname command in the
system view to configure the authorized directory of the SFTP server for a
specified user.
● Run the local-user user-name ftp-directory directory command in the AAA
view to configure the authorized directory of the FTP server for a specified
user.
● Run the sftp server default-directory sftpdir command in the system view to
configure the global and default authorized directory of the SFTP server.
The authorized directory configured using the ssh user sftp-directory command
has the highest priority and takes effect only for specified SSH users. The
Precautions
This command takes effect for both ipv4 and ipv6 SFTP servers.
In versions earlier than V200R001C00, the default access path of the device is
flash:/. In V200R001C00 and later versions, the SFTP access path is empty by
default. Therefore, if you perform file operations using SFTP on a device running a
version earlier than V200R001C00 and the authorized directory of the SFTP server
is not configured, the default access path flash:/ is used.
● When the device is upgraded to V200R001C00 or V200R002C50, you need to
manually configure the ssh user username sftp-directory flash: command.
● When the device is upgraded to V200R003C00 or a later version, the sftp
server default-directory flash: command is automatically configured in the
system to ensure that users can properly access the device using SFTP after
the upgrade, which requires no attention.
Example
# Set the default authorized directory of the SFTP server for SSH users to flash:.
<HUAWEI> system-view
[~HUAWEI] sftp server default-directory flash:
Function
The ssh user sftp-directory command configures the SFTP service authorized
directory for an SSH user.
The undo ssh user sftp-directory command cancels the SFTP service authorized
directory for an SSH user.
By default, the authorized directory of the SFTP service for the SSH user is not
configured.
Format
ssh user username sftp-directory directoryname
Parameters
Parameter Description Value
username Specifies the SSH user The value is a string of 1 to 253 case-
name. insensitive characters without spaces.
When double quotation marks are
used around the string, spaces are
allowed in the string.
Views
System view
Default Level
3: Management level
Usage Guidelines
Users can only access the specified directory on the SFTP server. If the username
user does not exist, the system creates an SSH user named username and uses the
SFTP service authorized directory configured for the user. If the configured
directory does not exist, the SFTP client fails to connect to the SSH server using
this SSH user.
The command takes effect for both ipv4 and ipv6 functions.
In versions earlier than V200R001C00, the default access path of the device is
flash:/. In V200R001C00 and later versions, the SFTP access path is empty by
default. Therefore, if you perform file operations using SFTP on a device running a
version earlier than V200R001C00 and the authorized directory of the SFTP server
is not configured, the default access path flash:/ is used.
● When the device is upgraded to V200R001C00 or V200R002C50, you need to
manually configure the ssh user username sftp-directory flash: command.
● When the device is upgraded to V200R003C00 or a later version, the sftp
server default-directory flash: command is automatically configured in the
system to ensure that users can properly access the device using SFTP after
the upgrade, which requires no attention.
Example
# Configure the SFTP service authorized directory flash:/ssh for the SSH user
admin.
<HUAWEI> system-view
[~HUAWEI] ssh user admin sftp-directory flash:/ssh
3.7.83 tail
Function
The tail command displays information in a file.
Format
tail file-name [ line ]
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
You can run the tail command to view information in a file or in the last several
lines of the file.
Example
# Display information in the last two lines of the rpm.log file.
<HUAWEI> tail rpm.log 2
[140808-07:52:26] [RPM][SIGN] RPM ReqAppDBRspHandle RequestType:2, RequestId:10001, RcvTransNo:
655458744,SndTransNo:655458744,Session:655458744
[140808-07:52:27] [RPM][ERR] File:autoconfig.py does exist in the filelist in node /opt/svrp/router1/1-17/
vrpv8/home/$_system for osnode:273 when add file [PID(25786): LinuxError(0)]
3.7.84 tftp
Function
The tftp command uploads a file to the TFTP server or downloads a file to the
local device.
Format
# Upload a file to the TFTP server or download a file to the local device based on
the IPv4 address
tftp [ -a source-ip-address | -i interface-type interface-number ] tftp-server [ vpn-
instance vpn-instance-name | public-net ] { get | put } source-filename
[ destination-filename ]
# Upload a file to the TFTP server or download a file to the local device based on
the IPv6 address
tftp ipv6 [ -a source-ipv6-address ] tftp-server-ipv6 [ vpn-instance vpn-instance-
name | public-net ] [ -oi interface-type interface-number ] { get | put } source-
filename [ destination-filename ]
Parameters
Parameter Description Value
-a source-ip- Specifies the source IP address for -
address connecting to the TFTP client. You
are advised to use the loopback
interface IPv4 address.
-a source-ipv6- Specifies the source IPv6 address -
address for connecting to the TFTP client.
You are advised to use the
loopback interface IP address.
-i interface-type Specifies the source interface used -
interface- by the TFTP client to set up
number connections. It consists of the
interface type and number. It is
recommended that you specify a
loopback interface.
The IP address configured for this
interface is the source IP address
for sending packets. If no IP
address is configured for the
source interface, the TFTP
connection cannot be set up.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When upgrading the system, you can run the tftp command to upload an
important file to the TFTP server or download a system software to the local
device.
Precautions
● When you run the tftp command to upload a file to the TFTP server in TFTP
mode, files are transferred in binary mode by default. The tftp does not
support the ASCII mode for file transfer.
● After specifying a source IP address, you can use this IP address to
communicate with the server and implement packet filtering to ensure data
security.
Example
# Download file vrpcfg.txt from the root directory of the TFTP server to the local
device. The IP address of the TFTP server is 10.1.1.1. Save the downloaded file to
the local device as file vrpcfg.bak.
<HUAWEI> tftp 10.1.1.1 get vrpcfg.txt flash:/vrpcfg.bak
# Upload file vrpcfg.txt from the root directory of the storage device to the
default directory of the TFTP server. The IP address of the TFTP server is 10.1.1.1.
Save file vrpcfg.txt on the TFTP server as file vrpcfg.bak.
<HUAWEI> tftp 10.1.1.1 put flash:/vrpcfg.txt vrpcfg.bak
Function
The tftp client source command specifies the source IP address for the TFTP client
to send packets.
The undo tftp client source command restores the default source IP address for
the TFTP client to send packets.
The default source IP address for the TFTP client to send packets is 0.0.0.0.
Format
tftp client source { -a source-ip-address | -i interface-type interface-number }
Parameters
Parameter Description Value
-a source-ip- The value is
Specifies the source IP address of the TFTP
address in dotted
client. You are advised to use the loopback
decimal
interface IP address.
notation.
-i interface-type Specifies the source interface type and -
interface-number interface number to establish the connection
with the server.
The IP address configured for this interface is
the source IP address for sending packets. If
no IP address is configured for the source
interface, the TFTP connection cannot be set
up.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If no source IP address is specified, the client uses the source IP address that the
router specifies to send packets. The source IP address must be configured for an
interface with stable performance. The loopback interface is recommended. Using
the loopback interface as the source interface simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
impact, filters incoming and outgoing packets, and implements security
authentication.
Precautions
● The tftp command also configures the source IP address whose priority is
higher than that of the source IP address specified in the tftp client source
command. If you specify source addresses in the tftp client source and tftp
commands, the source IP address specified in the tftp command is used for
data communication. The source address specified in the tftp client source
command applies to all TFTP connections. The source address specified in the
tftp command applies only to the current TFTP connection.
● You can query the source IP address or source interface IP address specified in
the TFTP connection on the TFTP server.
● After the bound source interface is deleted, the interface configuration in the
ssh server-source command will not be deleted and does not take effect.
After the source interface with the same name is reconfigured, the function
will be restored.
Example
# Set the source IP address of the TFTP client to 10.1.1.1.
<HUAWEI> system-view
[~HUAWEI] tftp client source -a 10.1.1.1
Info: Succeeded in setting the source address of the TFTP client to 10.1.1.1.
Function
The tftp server acl command specifies the ACL number or ACL name for the local
device so that the device can access TFTP servers with the same ACL number or
ACL name.
The undo tftp server acl command deletes the ACL number or ACL name from
the local device.
Format
tftp server [ ipv6 ] acl { acl-number | acl-name }
Parameters
Parameter Description Value
acl-number Specifies the number of The value is an integer that ranges from
the ACL. 2000 to 2999.
acl-name Specifies the ACL name. The value is a string of 1 to 32 case-
sensitive characters except spaces. The
value must start with a letter or digit,
and cannot contain only digits.
ipv6 Specifies the IPv6 address -
of a specific server.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To ensure the security of the local device, you need to run the tftp-server acl
command to specify an ACL to specify TFTP servers that the local device can
access.
Precautions
The tftp-server acl command takes effect only after you run the rule (ACL view)
or rule (ACL6 view) command to configure the rule. If no rule is configured, the
local device can access a specified TFTP server in TFTP mode.
If no rule is configured, the incoming and outgoing calls are not restricted after
the command tftp-server acl is run.
Example
# Allow the local device to the access the TFTP server whose ACL number is 2000.
<HUAWEI> system-view
[~HUAWEI] acl 2000
[*HUAWEI-acl4-basic-2000] rule permit source 10.10.10.1 0
[*HUAWEI-acl4-basic-2000] quit
[*HUAWEI] tftp server acl 2000
3.7.87 undelete
Function
The undelete command restores a file that has been temporally deleted and
moved to the recycle bin.
Format
undelete { filename | devicename }
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the undelete command to restore a file that has been temporally
deleted and moved to the recycle bin. However, files that are permanently deleted
by running the delete or reset recycle-bin command with the /unreserved
parameter cannot be restored.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Like devicename, drive specifies the storage device name.
Precautions
● To display information about a temporally deleted file, run the dir /all
command. The file name is displayed in square brackets ([ ]).
Example
# Restore file sample.bak from the recycle bin.
<HUAWEI> undelete sample.bak
Info: Are you sure to undelete flash:/sample.bak ?[Y/N]:y
Info: Undeleting file flash:/sample.bak......Done.
# Restore a file that has been moved from the root directory to the recycle bin.
<HUAWEI> undelete flash:
Info: Are you sure to undelete flash:/test.txt?[Y/N] :y
Info: Undeleting file flash:/test.txt......Done.
Info: Are you sure to undelete flash:/rr.bak?[Y/N]:y
Info: Undeleting file flash:/rr.bak......Done.
3.7.88 unzip
Function
The unzip command decompresses a file.
Format
unzip source-filename destination-filename [ password password ]
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can decompress files, especially log files that are stored on the storage device
and run the more command to query the file.
If the target file requires high security, you are advised to encrypt the file. unzip
can decompress compressed files encrypted in AES-256 mode.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
● flash:/my/test/ is an absolute path.
● /selftest/ is a path relative to the root directory and indicates the selftest
directory in the root directory.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● If the destination file path is specified while the file name is not specified, the
designation file name is the same as the source file name.
● The source file persists after being decompressed.
● The compressed file must be a .zip file. If a file to be decompressed is not a
zip file, the system displays an error message during decompression.
● The source file must be a single file. If you attempt to decompress a directory
or multiple files, the decompression cannot succeed.
Example
# Decompress log file syslogfile-2012-02-27-17-47-50.zip that are stored in the
syslogfile directory and save it to the root directory as file log.txt.
<HUAWEI> pwd
flash:/syslogfile
<HUAWEI> unzip syslogfile-2012-02-27-17-47-50.zip flash:/log.txt
Info: Extract flash:/syslogfile/syslogfile-2012-02-27-17-47-50.zip to flash:/log.txt?[Y/N]:y
100% complete
Info: Decompressed file flash:/syslogfile/syslogfile-2012-02-27-17-47-50.zip to flash
:/log.txt...Done
3.7.89 user
Function
The user command changes the current FTP user when the local device is
connected to the FTP server.
Format
user user-name
Parameters
Parameter Description Value
user-name Specifies the name of a The value is a string of 1 to 255 case-
login user. insensitive characters.
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the user command to change the current user on the FTP server.
Precautions
After you run the user command to change the current user, a new FTP
connection is set up, which is the same as that you specify in the ftp command.
Example
# Log in to the FTP server using the user name tom.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] user tom
331 Password required for tom.
Enter password:
230 User logged in.
3.7.90 verbose
Function
The verbose command enables the verbose function on the FTP client.
The undo verbose command disables the verbose function.
By default, the verbose function is enabled.
Format
verbose
undo verbose
Parameters
None
Views
FTP client view
Default Level
3: Management level
Usage Guidelines
After the verbose function is enabled, all FTP response messages are displayed on
the FTP client.
Example
# Enable the verbose function.
<HUAWEI> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL + K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):switch
331 Password required for switch.
Enter password:
230 User logged in.
[ftp] verbose
Info: Succeeded in switching verbose on.
[ftp] get h1.txt
200 Port command okay.
150 Opening ASCII mode data connection for h1.txt.
3.7.91 zip
Function
The zip command compresses a file.
The unzip command decompresses a file.
Format
zip source-filename destination-filename [ password password ]
unzip source-filename destination-filename [ password password ]
Parameters
Parameter Description Value
source- Specifies the An absolute path name is a string of 1 to 255
filename name of a characters. A relative path name is a string of 1
source file to be to 128 case-sensitive characters without spaces
compressed. in the [ drive ] [ path ] file name format. Up
to 8 levels of directories are supported. When
quotation marks are used around the string,
spaces are allowed in the string.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters ?
~ * / \ : ' " | < > [ ] cannot be used in the
directory name.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the target file requires high security, you are advised to encrypt the file. Specify
the password parameter, the target file will be encrypted in AES-256 mode.
The path can be an absolute path or relative path. A relative path can be
designated relative to either the root directory or the current working directory. A
relative path beginning with a slash (/) is a path relative to the root directory.
Precautions
● If the destination file path is specified while the file name is not specified, the
designation file name is the same as the source file name.
● The source file persists after being compressed.
● Directories cannot be compressed.
Example
# Compress file log.txt that is stored in the root directory and save it to the test
directory as file log.zip.
<HUAWEI> dir
Directory of flash:/
Function
The clear configuration commit command deletes the label of a configuration
rollback point specified in the system or the earliest configuration rollback point
generated in the system.
Format
clear configuration commit { commit-id label | oldest number-of-commits }
Parameters
Parameter Description Value
commit-id label Deletes the label of a The value is an integer that the
specified configuration system generates automatically.
rollback point.
Run the display configuration
commit list command to check the
configuration rollback points.
oldest number- Specifies the number of The value is an integer that ranges
of-commits the earliest configuration from 1 to 80.
rollback points to be
deleted.
Views
User view
Default Level
2: Configuration level
NOTE
Usage Guidelines
Usage Scenario
To reduce the information amount in the system buffer, run this command to
delete one or more earliest configuration rollback points that are generated.
Configuration rollback points in the system can be classified into those with labels
and those without any label.
● You can run the clear configuration commit commit-id label command to
delete the label of a specified configuration rollback point.
● You can run the clear configuration commit oldest number-of-commits
command to delete a configuration rollback point without any label. After the
clear configuration commit oldest number-of-commits command is run,
configuration rollback points with labels become discontinuous configuration
rollback points. If you run the display configuration commit list command
to check the configuration rollback points, values of the CommitId fields of
these discontinuous configuration rollback points in the command output are
marked with an asterisk (*).
In normal cases, you do not need to run this command to delete the earliest
rollback points from the list. The system will automatically delete the earliest
rollback points before generating new points if the number of rollback points in
the list reaches the upper limit (80).
Prerequisites
Make sure that the configuration rollback point can be deleted by running the
display configuration commit list or display configuration commit changes
command to check the system configuration change in the rollback point.
Follow-up Procedure
Run the display configuration commit list command to check whether the
configuration rollback point has been deleted.
Example
# Delete the configuration rollback point numbered 1000000265.
<HUAWEI> clear configuration commit 1000000265 label
Format
clear configuration commit label label-name
Parameters
Parameter Description Value
label-name Specifies a user The value is a string of 1 to 256 case-sensitive
label for a characters. It can be any visible ASCII character
configuration except for the space. However, the string can
rollback point. contain spaces if it is enclosed with double
quotation marks (" "). The string cannot start
with a digit or be a hyphen (-).
NOTE
The value of this parameter must be an existing
configuration rollback point on the device. Otherwise,
the command cannot be executed.
Views
User interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To delete a useless configuration rollback point with a specified label, run the
clear configuration commit command. The system can generate a maximum of
20 configuration rollback points with labels, 10 periodic configuration rollback
points, and five historical periodic configuration rollback points. If a configuration
rollback point is no longer useful, run this command to clear it to reduce the
system cache information.
Precautions
Run the display configuration commit list and display configuration changes
commands to display information about the configuration rollback point. Checking
the command output helps prevent misoperations.
Example
# Delete the configuration rollback point with the label named new_label.
<HUAWEI> clear configuration commit label new_label
Warning: The current operation will delete the rollback checkpoint. Continue? [Y/N]: y
Format
check module { file-name | startup }
Parameters
Parameter Description Value
file-name Specifies the name of the patch The value is a string of 5 to 127
package to be checked. case-sensitive characters without
spaces. The value of the patch
name is a string of 5 to 63
characters.
Views
User view
Default Level
3: Management level
patch execute
Usage Guidelines
Before you load a module package, run the check module command to check
whether the package is damaged. If the module package is not damaged, a
message is displayed indicating that the package is complete. Otherwise, a
message is displayed indicating that the package is incomplete. If the specified
module package name does not exist, a message is displayed indicating that the
package does not exist. If you specify the startup parameter without setting any
next-startup module package, a message is displayed indicating that the required
module package does not exist. In this case, run the install-module file-name
[ next-startup ] command to specify the next-startup module package.
Example
# Check module package integrity when no module package exists.
<HUAWEI> check module startup
Error: No module exists.
# Check the integrity of the next-startup module package with digital signatures.
<HUAWEI> check module startup
Warning: Package verification consumes system CPU resources. Continue? [Y/N]: Y
Info: Prepare to check file flash:/$_install_mod/TEST.MOD, please wait…done.
Info: Digital signature verification of the system module succeeded.
Format
check patch { file-name | startup }
Parameters
Parameter Description Value
file-name Specifies the name of the The name of the patch must
patch package to be checked. already exist. It is in the format of
[ drive ] [ path ] filename. If
[ drive ] is not specified, the name
of the default storage device is
used.
Views
User view
Default Level
3: Management level
Usage Guidelines
To check whether the patch package is damaged before installing it, run the check
patch command. If the patch package is not damaged, a message indicating that
the patch package is complete is displayed. Otherwise, a message indicating that
the patch package is incomplete is displayed. If the specified patch package does
not exist, a message indicating that the patch package does not exist is displayed.
If you specify the startup parameter without setting any next-startup patch file, a
message is displayed indicating that the required patch file does not exist. In this
case, run the startup patch file-name all command to specify a next-startup
patch package.
Example
# Check the integrity of the patch package named CE-V200R003SPH001.PAT.
<HUAWEI> check patch CE-V200R003SPH001.PAT
Warning: Patch package verification consumes system CPU resources. Continue? [Y/N]: y
# Check the integrity of the patch package used for the next startup.
<HUAWEI> check patch startup
Warning: Patch package verification consumes system CPU resources. Continue? [Y/N]: y
Function
The check system-software command checks the integrity of the system software
package.
Format
check system-software system-file
Parameters
Parameter Description Value
system-file Specifies the name of the The name of the system software
system software package package must already exist. It is in the
on which an integrity format of [ drive ] [ path ] filename. If
check is performed. [ drive ] is not specified, the name of
the default storage device is used.
Views
User view
Default Level
3: Management level
Usage Guidelines
Before switching the system software package, you can run this command to
check whether the system software package is destroyed. If the system software
package is not destroyed, the system prompts that the system software package
passes the check. Otherwise, the system prompts that the system software
package is incomplete. If the entered name of the system software package does
not exist, the system prompts that the check is mistaken. Make sure that the
system software package has existed on the device before running this command.
Example
# Check the integrity of the system software package CE-V200R003C00.cc.
<HUAWEI> check system-software CE-V200R003C00.cc
Format
clear inactive-configuration { slot slot-id [ card card-card-number ] | all |
chassis chassis-id }
Parameters
Parameter Description Value
chassis chassis- Specifies the stack ID of the device. The value range depends
id on the device
NOTE
configuration.
This parameter takes effect only on a
stacked device.
card card- Clears the inactive configuration The value range depends
number information about the specified on the device
subcard. configuration.
NOTE
This parameter is supported only on the
device on which subcards can be
installed.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a device or subcard is replaced, if you do not want to save the current
configuration information, run this command to clear the inactive configuration
information about the device or subcard that is not in position.
Precautions
For a device on which no subcard can be installed, this command can be used only
in a stack.
After this command is run, the inactive configuration information about the device
or subcard will be cleared. The system will display an error message when you
commit other uncommitted configurations that depend on the inactive
configuration information, and the commit operation fails.
Example
# Clear the inactive configuration information about the device that is not in
position.
<HUAWEI> system-view
[~HUAWEI] clear inactive-configuration slot 1
Warning: The inactive configuration of slot 1 will be deleted and can't be restored.
Are you sure to continue?[Y/N] y
The command will takes a few minutes, please wait..
Info: Succeeding in clearing the inactive configuration.
Function
The configuration checkpoint auto-save disable command disables a device
from automatically generating a configuration rollback point.
Format
configuration checkpoint auto-save disable
Parameters
None
Views
System view
Default Level
3: Management level
config write
Usage Guidelines
After configurations are committed on a device, the device automatically
generates a configuration rollback point and allocates an ID to identify the
rollback point. If you find that configurations are incorrect or a fault caused by
configurations affects network running, you can roll the configurations back to a
specified configuration rollback point in batches.
If you run the configuration checkpoint auto-save disable command and then
the commit command, no configuration rollback point is automatically generated.
However, if you run the undo configuration checkpoint auto-save disable
command and then the commit command, a configuration rollback point is
automatically generated.
Example
# Disable a device from automatically generating a configuration rollback point.
<HUAWEI> system-view
[~HUAWEI] configuration checkpoint auto-save disable
Format
configuration current backup-to-server monthly date date-value [ time time-
value ]
Parameters
Parameter Description Value
date date-value Specifies a date. The value is an integer ranging from 1 to
31.
time time-value Specifies a time The value is expressed in the format of
point. HH:MM:SS, where HH:MM:SS indicates a
second-specific time point. HH ranges from
0 to 23, and MM and SS both range from 0
to 59. The default value is 00:00:00.
Views
System view
Default Level
3: Management level
Usage Guidelines
To upload a configuration file to the server on a specific date and time every
month, run the configuration current backup-to-server monthly command.
The configuration file generated after this command is a .dat file, and the
generated time is local time.
Example
# Upload a configuration file to the server at 12:12:12 on the first day every
month.
<HUAWEI> system-view
[~HUAWEI] configuration current backup-to-server monthly date 1 time 12:12:12
Format
configuration file auto-save [ interval interval | cpu-limit cpu-usage | delay
delay-interval ] *
configuration file auto-save { interval | cpu-limit | delay } default
undo configuration file auto-save
Parameters
Parameter Description Value
interval interval Specifies the interval for The value is an integer that
saving configurations. ranges from 30 to 43200, in
minutes. The default value is
30.
cpu-limit cpu- Specifies the threshold of the The value is an integer that
usage CPU usage during the ranges from 1 to 100. The
periodic save operation. default value is 50.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After this command enables the function of saving system configurations
periodically, the configuration file will not be lost if the device is powered off or
restarts.
If the configuration file auto-save command is not executed, the system does
not enable the function of saving system configurations periodically. In this case,
Example
# Set the automatic save interval to 60 minutes.
<HUAWEI> system-view
[~HUAWEI] configuration file auto-save interval 60
# Configure the system to save the new configuration 3 minutes after the
configuration changes at an interval of 10 hours when the upper limit of the CPU
usage is 60%.
<HUAWEI> system-view
[~HUAWEI] configuration file auto-save interval 600 delay 3 cpu-limit 60
Format
copy source-filename startup destination-filename [ slot slot-id | all ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To specify a configuration file as the next startup file, run this command to copy
the configuration file and set the file copy as the configuration file for next
startup. In this case, when configurations on the device are modified again, the
configuration file for next startup is not affected.
Follow-up Procedure
Precautions
● When using a .dat file, do not manually modify the content of the file;
otherwise, the file may fail to be loaded during the startup and the device is
started without any configuration file.
● You must store the source file in the flash directory.
● When this command and the startup saved-configuration command are
configured, the later configuration takes effect.
Example
# Copy the oldvrp.cfg file and specify the file copy as the configuration file for
next startup.
<HUAWEI> copy oldvrp.cfg startup newvrp.cfg all
Are you sure to copy flash:/oldvrp.cfg to flash:/newvrp.cfg and specify newvrp.cfg as the configuration file
for next startup? [Y/N]: y
Info: Operating, please wait for a moment....
Info: Copying file flash:/oldvrp.cfg to flash:/newvrp.cfg...Done.
Info: Succeeded in setting the configuration for booting system.
Function
The configuration file auto-save backup-to-server command specifies the server
where the system periodically saves the configuration file.
By default, the system does not periodically save configurations to the server.
Format
configuration file auto-save backup-to-server server server-ip [ vpn-instance
vpn-instance-name ] transport-type { { ftp | sftp } [ port port-value ] user user-
name password password | tftp } [ path folder ]
undo configuration file auto-save backup-to-server server [ server-ip | server-ip
vpn-instance vpn-instance-name [ port port-value ] ]
Parameters
Parameter Description Value
transport-type Specifies the mode in which The value can be ftp, sftp, or
the configuration file is tftp. To ensure file transfer
transmitted to the server. security, use the SFTP method.
port port-value Specifies the port number The value is an integer ranging
used to send a configuration from 1 to 65535.
file to a server.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Run this command to periodically save the configuration file to the server.
The configuration file generated after this command is run is in the same format
as the configuration file for the next startup. If the configuration file for the next
startup is a .dat file, the configuration file generated is also a .dat file. If the
configuration file for the next startup is a .cfg or .zip file, the configuration file
generated is a .zip file.
You can configure multiple servers running the configuration file auto-save
command several times.
The periodic saving interval depends on the interval configured using the
configuration file auto-save command.
Precautions
● Before using this command, run the configuration file auto-save command;
and enable FTP, SFTP, or TFTP on the server, otherwise, the configuration file
auto-save backup-to-server command does not take effect. The system
cancels the operation of periodically saving the configuration file in the
following scenarios:
– The configuration file is being written.
– The LPU is recovering the configuration.
– The CPU usage is high.
● The system supports a maximum of five servers. The servers are independent
of each other. If the system fails to save configuration files to a server, the
system reports traps to the NMS and records logs.
● When configuration files are being uploaded, the system does not save
configurations to a server until the configuration files are uploaded.
● The user name and password must be the same as those used in FTP or SFTP
login mode.
● The time of the configuration file generated after this command is run is the
UTC.
● After a bound VPN instance is deleted, the VPN configuration specified using
the configuration file auto-save backup-to-server command will not be
cleared but does not take effect. If you configure the VPN instance with the
same name again, the VPN function restores.
● When you run this command to save configuration files to a server, the
system supports only the binary transmission mode. Therefore, the server
must support the binary transmission mode.
Example
# Specify the server to which the system periodically sends the configuration file,
and set the transmission mode to SFTP.
<HUAWEI> system-view
[~HUAWEI] configuration file auto-save
[*HUAWEI] configuration file auto-save backup-to-server server 10.1.1.1 transport-type sftp user
admin1234 password Helloworld@6789
Function
The display configuration command displays the configuration in a specified
configuration file.
Format
display configuration configuration-file
Parameters
Parameter Description Value
configuration-file Specifies the name of The value is a string of 5 to 64 case-
an existing sensitive characters without spaces.
configuration file. The file name extension can
be .zip, .dat, or .cfg.
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After a configuration file is saved using the save command, run the display
configuration command to view the configuration file.
The command output is relevant to user configuration. The command does not
display the default configuration.
Prerequisites
The specified configuration file exists.
Example
# Display the configuration file named vrpcfg.zip.
<HUAWEI> display configuration vrpcfg.zip
#
FTP server enable
#
...
aaa
local-user ftp password irreversible-cipher `xy$!D3>a#Oc5/Js:mGN*Ii8AZtE4Kb!0h*QS7J<wD(j-9oN^.5%!
@OKp,.5*YKuR
local-user ftp ftp-directory flash:/
local-user ftp service-type ftp
#
...
interface 10GE1/0/1
undo shutdown
ip address 10.1.1.200 255.255.255.0
#
...
interface LoopBack0
ip address 10.10.1.1 255.255.255.255
#
...
user-interface con 0
set authentication password cipher %$%$~^Mg.QBcGS^}H.Q*w~#*,JA8%$%$
history-command max-size 30
#
user-interface vty 0 14
Format
To display the difference based on the configuration file names, run:
display configuration changes [ running file file-name | file file-name running ]
To display the difference based on the user labels, run:
display configuration changes [ running label label | label label running ]
Parameters
Parameter Description Value
file file-name The name is a string of 5 to
Displays the difference between a
64 characters in the format
configuration file and the current
of *.zip, *.cfg, or *.dat. The
running configuration file.
file-name must already exist.
label label Displays the difference between The label must already exist.
the current running configuration
file and the configuration file
based on a specific user label.
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the display configuration changes running file file-name command
to check the difference between the current running configuration file and a
specified configuration file.
You can run the display configuration changes file file-name running command
to check the difference between a specified configuration file and the current
running configuration file.
The display configuration changes running label label command displays the
difference between the current configuration and the configuration of a specified
user label.
The display configuration changes label label running command displays the
difference between the configuration of a specified user label and the current
configuration.
This command can only compare the current running configuration file with a
configuration file. When you run this command, the first specified configuration
file is called source configuration, and the later specified configuration file is
called target configuration. If the target configuration is different from the source
configuration, the difference is displayed based on the following rules:
● An added command is displayed in the format of prefix+.
● A deleted command is displayed in the format of prefix-.
● If a command is modified, the original command is displayed in the format of
prefix-, and the new command is displayed in the format of prefix+.
Precautions
The specified configuration file specified by file-name must exist on the device.
Example
# Display the difference between the current running configuration file and the
configuration file a.cfg.
<HUAWEI> display configuration changes running file a.cfg
Building configuration
Warning: The specified configuration file is not the same as the current configuration. There are several
differences as follow:
#
+ sysname China
Function
The display configuration commit at command displays all configurations of a
device at a specific configuration rollback point.
Format
display configuration commit at commit-id
Parameters
Parameter Description Value
commit-id Displays all configurations The value is an integer ranging from
of a device at a specific 1000000001 to 1999999999. A commit
configuration rollback ID is automatically generated by a
point. device and cannot be manually
modified.
Views
All views
Default Level
3: Management level
Usage Guidelines
After a user commits a command to a device, the device automatically generates
a configuration rollback point, which records the configuration changes and all
configurations at this point. You can run the display configuration commit at
command to view all configurations of the device at this point. So that if the
device has a fault, run the rollback configuration command to roll the device
back to the configurations before the fault occurs.
Example
# Display all configurations of a device at the 1000000481 configuration rollback
point.
<HUAWEI> display configuration commit at 1000000481
#
sysname HUAWEI
#
drop-profile default
#
diffserv domain default
#
aaa
#
authentication-scheme default
#
authorization-scheme default
#
accounting-scheme default
#
domain default
#
domain default_admin
#
stack
#
stack member 1 domain 10
#
---- More ----
Format
display configuration commit changes [ at commit-id | since commit-id | last
number-of-commits ]
Parameters
Parameter Description Value
at commit-id Displays the configuration The value is an integer that the
change at a specified system generates automatically.
configuration rollback
point. Run the display configuration
commit list command to check the
configuration rollback points.
since commit-id Displays the configuration The value is an integer that the
changes from the system generates automatically.
specified configuration
rollback point to the Run the display configuration
current state. commit list command to check the
configuration rollback points.
last number-of- Displays the changes at The value is an integer that ranges
commits the specified number of from 1 to 80.
latest configuration
rollback points.
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Run this command to check the configuration changes when you need to restore
the system to a historical state because incorrect operations are performed on the
device or some configurations fail due to some faults.
Prerequisites
Configuration has been performed and the configuration rollback point has been
generated.
Follow-up Procedure
Recover or roll back the configuration after checking the configuration change.
Example
# Display the configuration change saved at the configuration rollback point
numbered 1000002001.
<HUAWEI> display configuration commit changes at 1000002001
Building configuration
#
+ interface Vlanif89
+ ip address 192.168.89.1 255.255.255.0
#
Item Description
- Deleted configuration.
For the modified configuration, - indicates
the old configuration and + indicates the
new configuration.
+ Added configuration.
For the modified configuration, - indicates
the old configuration and + indicates the
new configuration.
Function
The display configuration candidate changes command displays the difference
between the candidate configuration and current running configuration.
Format
display configuration candidate changes
Parameters
None
Views
All views except the user view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Precautions
Example
# Display the difference between the candidate configuration and current running
configuration.
<HUAWEI> system-view
[~HUAWEI] display configuration candidate changes
Building configuration
#
interface Tunnel1
- mtu 1400
+ mtu 1300
#
+ interface Tunnel3
#
Item Description
- Deleted configuration.
+ Added configuration.
Function
The display configuration commit list command displays the configuration
rollback points that are generated in the system.
Format
display configuration commit list [ verbose ] [ number-of-commits | label ]
Parameters
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After configuring the system, run this command to check historical configuration
rollback points.
Follow-up Procedure
Example
# Display all configuration rollback points.
<HUAWEI> system-view
[~HUAWEI] sysname ROLLBACK
[*HUAWEI] commit description This is a test
[~ROLLBACK] display configuration commit list
------------------------------------------------------------------------------------
No. CommitId Label User TimeStamp
------------------------------------------------------------------------------------
1 1000002002 - - 2012-08-22 17:55:49+08:00
2 1000002001 - huawei 2012-08-22 17:12:04+08:00
3 1000002000 - - 2012-08-22 17:11:09+08:00
2) CommitId: 1000002001
Label: -
User: huawei
User-Intf: VTY 0
Type: CLI
TimeStamp: 2012-08-22 17:12:04+08:00
Description:
3) CommitId: 1000002000
Label: -
User: -
User-Intf: VTY 0
Type: CLI
TimeStamp: 2012-08-22 17:11:09+08:00
Description:
Table 3-54 Description of the display configuration commit list command output
Item Description
Item Description
Format
display configuration recover-result
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
After you run the startup saved-configuration or copy startup command to
specify the configuration file for the next startup and restart the device, run this
command to check the configuration recovery result (success, failure, or partial
failure) and failure cause.
Example
# Display the configuration result after an upgrade.
<HUAWEI> display configuration recover-result
Info: The current startup saved-configuration file is flash:/vrpcfg.zip.
The number of failed commands is 1.
--------------------------------------------------------------------------------
Command : vm-manager
View : system
Line : 204
Reason : Execute failed
Time : 2013-06-25 09:13:09
--------------------------------------------------------------------------------
Item Description
Function
The display configuration rollback result command displays the configurations
that fail to roll back and the messages that are generated during the
configuration rollback.
Format
display configuration rollback result
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
During the configuration rollback, some configurations fail to roll back or
messages are generated during configuration rollback. Run this command to
check the failed configurations and messages.
Example
# Display the latest configuration rollback failure and the messages generated
during configuration rollback.
<HUAWEI> display configuration rollback result
!warning information
interface 10GE1/0/5
+ pim bfd enable
Warning: The configuration is successful. Enable global BFD to validate the configuration.
!There are still several differences as follow:
#
interface 10GE1/0/2
- ip address 10.3.3.3 255.255.255.0
+ ip address 10.4.4.4 255.255.255.0
#
Item Description
- Deleted configuration.
For the modified configuration, - indicates the old
configuration and + indicates the new configuration.
+ Added configuration.
For the modified configuration, - indicates the old
configuration and + indicates the new configuration.
Function
The display configuration sessions command displays session status.
Format
display configuration sessions [ verbose ]
Parameters
Parameter Description Value
verbose Indicates detailed information about session status. -
Views
All views
Default Level
3: Management level
Usage Guidelines
To query information about users who have logged in to the device, you can run
the display configuration sessions command to view session status.
Example
# Display session status.
<HUAWEI> display configuration sessions
--------------------------------------------------------------------------------
Session User-Intf User Date Lock
--------------------------------------------------------------------------------
285 _SYSTEM_ 2014-09-23 15:07:52 -
--------------------------------------------------------------------------------
Session : 286
User-Intf : SNMP_User
User :
Date : 2014-09-23 15:07:54
Lock-Type : -
Cfg-Mode : 1-stage
Client : SNMP
Elapsed-Time : 1 days, 22:36:55
Session : 514 *
User-Intf : VTY 0
User :
Date : 2014-09-25 13:39:11
Lock-Type : -
Cfg-Mode :-
Client : CLI
Elapsed-Time : 0 days, 0:05:38
--------------------------------------------------------------------------------
Item Description
Function
The display current-configuration command displays the currently running
configuration.
This command does not display parameters that use default settings.
Format
display current-configuration [ configuration [ configuration-type
[ configuration-instance ] ] | interface [ interface-type [ interface-number ] ] | all
| inactive ] [ include-default ]
Parameters
Parameter Description Value
configuration Specifies the The value is determined by the
configuration-type configuration type. current system configurations.
configuration- Specifies a configuration The value is a string of 1 to
instance instance. 200 case-insensitive characters
without spaces. When double
quotation marks are used
around the string, spaces are
allowed in the string.
Views
All views
Default Level
3: Management level
Usage Guidelines
To check whether the configured parameters take effect, run the display current-
configuration command. The parameters that do not take effect are not
displayed.
The command output is relevant to user configuration. If the include-default
parameter is specified, the command output includes the default system
configuration starting with a tilde (~).
You can use a regular expression to filter the command output. For the regular
expression rules, see "Filtering Command Outputs" in the CloudEngine 8800, 7800,
6800, and 5800 Series SwitchesConfiguration Guide - Basic Configuration.
After you run the display current-configuration all or display current-
configuration inactive command, * in the command output indicates offline
configuration.
NOTE
Example
# Display all configurations that include vlan.
<HUAWEI> display current-configuration | include vlan
vlan batch 10 77 88
port trunk allow-pass vlan 10
Function
The display module-information command displays information about
dynamically installed modules in the system.
Format
display module-information [ verbose | next-startup ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To view information about dynamically installed modules in the system, run the
display module-information command. The information helps to monitor
whether modules are successfully installed or uninstalled.
Example
# Display details about dynamically installed modules in the system.
<HUAWEI> display module-information verbose
Module Information
----------------------------------------------------------------------------------------
Module Version InstallTime PackageName
----------------------------------------------------------------------------------------
LI V200R005MOD001 2019-08-15 10:31:26 CE-V200R005MOD001.MOD
----------------------------------------------------------------------------------------
Total = 1
Board Info :
----------------------------------------------------------------------------------------
Slot-id ProcId Type FileName EffectiveTime Module
----------------------------------------------------------------------------------------
1 11 C HM800000.mod 2019-08-15 10:29:32.100 LI
----------------------------------------------------------------------------------------
Total = 1
Item Description
Slot-id Board ID
ProcId Process ID
Function
The display saved-configuration command displays the configuration file to be
used for the next startup.
Format
display saved-configuration [ last | time | configuration ]
Parameters
Parameter Description Value
last Displays the system configurations saved last time. -
time Displays the recent time when the configurations are -
saved manually or automatically.
configuration Displays the parameters of the automatic save function. -
Views
All views
Default Level
3: Management level
Usage Guidelines
If the device has been started and is not working properly, run the display saved-
configuration command to check the device startup configuration in the file
specified by running the startup saved-configuration or copy startup command.
Run the display saved-configuration time command to check the last time when
the system configurations are saved.
The command output is relevant to user configuration. The command does not
display the default configuration.
Example
# Display the configuration file for the next startup.
<HUAWEI> display saved-configuration
#
sysname Switch
...
#
vlan batch 10 20
#
interface Vlanif10
ip address 192.168.1.3 255.255.255.0
#
interface Vlanif20
ip address 192.168.4.3 255.255.255.0
...
#
interface MEth0/0/0
ip address 192.168.200.8 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
...
#
user-interface maximum-vty 15
user-interface con 0
user-interface vty 0 14
idle-timeout 0 0
#
return
Function
The display schedule reboot command displays the configuration of the
scheduled restart of the device.
Format
display schedule reboot
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
After using the schedule reboot command to configure a scheduled restart, you
can use this command to view the configuration of the scheduled restart.
Example
# Display the configuration of the scheduled restart of the device.
<HUAWEI> display schedule reboot
Info: System will reboot at 22:00:00 2013/09/17 UTC(in 1 hours and 36 minutes).
Item Description
in hours and minutes Time span between the restart time and the current
time.
Format
display software crl
Parameters
None
Views
ALL views
Default Level
1: Monitoring level
Usage Guidelines
If an issued digital signature certificate needs to be revoked due to key disclosure
or other reasons, a third-party tool can be used to mark the certificate invalid and
add the certificate to a digital certificate CRL. To check information about the
digital signature CRL file, run the display software crl command.
Example
# Display information about a digital signature CRL file that has been loaded to
the main control board.
<HUAWEI> display software crl
CRL file information:
------------------------------------------------------------------------------------------------------------------------------
-----------
Slot-id Publisher Issue date Status
------------------------------------------------------------------------------------------------------------------------------
-----------
1 C=CN,O=Huawei,CN=Huawei Root CA 2015-10-19
15:38:25+08:00 Valid
1 C=CN,O=Huawei,CN=Huawei Code Signing Certificate Authority 2016-04-05
16:27:05+08:00 Valid
1 C=CN,O=Huawei,CN=Huawei Timestamp Certificate Authority 2016-03-01
16:56:22+08:00 Valid
2 C=CN,O=Huawei,CN=Huawei Root CA 2015-10-19
15:38:25+08:00 Valid
2 C=CN,O=Huawei,CN=Huawei Code Signing Certificate Authority 2016-04-05
16:27:05+08:00 Valid
2 C=CN,O=Huawei,CN=Huawei Timestamp Certificate Authority 2016-03-01
16:56:22+08:00 Valid
------------------------------------------------------------------------------------------------------------------------------
-----------
Package digital signature verification failure list:
---------------------------------------------------------------------------------
Slot ID Package Name
---------------------------------------------------------------------------------
1 VRPV800R019C10B130D0921_ne5ke.cc
1 VRPV800R019C10B130D0920_ne5ke.cc
2 VRPV800R019C10B130D0921_ne5ke.cc
2 VRPV800R019C10B130D0920_ne5ke.cc
---------------------------------------------------------------------------------
Item Description
CRL status:
Status ● Valid
● InValid
Item Description
Format
display startup [ slot slot-id ]
Parameters
Parameter Description Value
slot slot-id The value is an integer. The range of
Specifies a member device
the integer is dependent on the specific
in a stack.
device.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before upgrading or degrading a device, run this command to check whether the
files for next startup have been loaded. If the files have been loaded, the device
can be upgraded or degraded successfully after it is restarted. You can also run the
command to view the system software and files for current startup.
Example
# Display the names of system software for current and next startup.
<HUAWEI> display startup
MainBoard:
Configured startup system software: flash:/basicsoftware.cc
Startup system software: flash:/basicsoftware.cc
Next startup system software: flash:/basicsoftware.cc
Startup saved-configuration file: flash:/vrpcfg.zip
Next startup saved-configuration file: flash:/vrpcfg.zip
Startup paf file: default
Next startup paf file PAF file that is configured for the next
startup.
If no PAF file is configured, default is
displayed.
Item Description
Next startup patch package Patch package file that is configured for
the next startup by running the startup
patch command.
If no patch package file is configured,
NULL is displayed.
3.8.27 install-module
Function
The install-module command dynamically loads a specified module file.
Format
install-module file-name [ next-startup ]
Parameters
Parameter Description Value
file-name Specifies the name of the module file to The name of the
be loaded. module file must
already exist.
next-startup Specifies the name of the module file to -
be loaded at the next startup.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Guideline
To install a module in the current system by loading the module file, run the
install-module command. The extension of a module file name must be *.MOD
or *.mod.
To view information about successfully loaded module files, run the display
module-information command.
Precautions
Loaded module files must be stored in the $_install_mod directory.
Example
# Load the SwitchV200R001MOD501.MOD file to the $_install_mod directory.
<HUAWEI> install-module SwitchV200R001MOD501.MOD
3.8.28 reboot
Function
The reboot command restarts the device.
Format
reboot [ fast | save diagnostic-information ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
This command functions in the same way as a power recycle operation (power off
and then restart the device). The command enables you to restart the device
remotely.
● After the reboot or reboot save diagnostic-information command is run, the
system displays a message asking you whether to save the configuration. If
you choose to save the configuration, the current configuration is written into
the configuration file to prevent configuration loss after the reboot. If you
choose not to save the configuration, the device reboots using the
configuration in the configuration file, leading to the loss of unsaved
configuration.
● After the reboot fast command is run, the device reboots without prompting
you to save the configuration.
● After the reboot save diagnostic-information command is run, if a
diagnostic information file already exists, the system displays a message
asking you whether to overwrite the file before the reboot. If you choose to
overwrite the file, the system saves current diagnostic information to the root
directory of the Flash card and overwrites the original diagnostic information
file. If you choose not to overwrite the file, the system does not collect
diagnostic information. Diagnostic information does not affect device
configuration.
Precautions
● If you do not respond to the displayed message within the timeout period
after running this command, the system will return to the user view and the
device will not be restarted.
● To avoid loss of diagnostic information after a restart, configure the device to
save the diagnostic information before restarting.
● This command interrupts services on the entire device. Therefore, do not use
this command when the device is running properly.
● Before restarting the device, ensure that the configuration file has been saved.
Example
# Restart the device.
<HUAWEI> reboot
Function
The refresh configuration candidate command re-executes candidate
configuration to resolve configuration conflicts.
Format
refresh configuration candidate
Parameters
None
Views
All views except the user view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the system displays a message indicating that the current running configuration
is changed when you run the display configuration candidate changes
command to view the difference between the candidate configuration and current
running configuration, run the refresh configuration candidate command to
resolve the configuration conflict so that you can continue to view the
configuration difference.
If a configuration conflict occurs before you commit the configuration, you can
resolve the configuration conflict and then run the commit command to commit
the configuration. Alternatively, run the commit command to commit the
configuration directly, without resolving the configuration conflict.
Precautions
This command applies only to the two-phase validation mode.
Example
# Update the candidate configuration based on the current running configuration
to resolve configuration conflicts.
<HUAWEI> system-view
[~HUAWEI] refresh configuration candidate
Format
reset boot password [ slot slot-id ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
If you forget the BIOS or BootLoader password and cannot access the BIOS or
BootLoader menu, run the reset boot password command to reset the password
to default password. Then you can use this password to access the BIOS or
BootLoader menu.
Example
# Reset the BootLoader password.
<HUAWEI> reset boot password
Warning: The password used to access the boot menu by pressing Ctrl+B will be cleared, continue? [Y/N]: y
Info: The password used to access the boot menu by pressing Ctrl+B is cleared successfully.
Function
The reset saved-configuration command cancels the configuration file used for
next startup.
Format
reset saved-configuration
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After the device software is upgraded or the device in use is applied to another
scenario, you can run the reset saved-configuration command to cancel the
configuration file used for next startup so that the device starts with empty
configurations.
Precautions
● After this command is run and the device restarts, enter N when the system
asks you whether to save the current configuration file as the next startup
configuration file. Then configuration of canceling the configuration file for
next startup then takes effect.
● After the device starts with the default configuration, you need to log in to
the device through the console port. Remote login is not supported.
● If the next startup configuration file is empty, the device displays a message
indicating that the file does not exist.
● Exercise caution when you run the reset saved-configuration command.
Example
# Cancel the configuration file used for next startup.
<HUAWEI> reset saved-configuration
The action will delete the saved configuration on the device.
The configuration will be erased to reconfigure.Continue? [Y/N]: y
Warning: Now the configuration on the device is being deleted.
..........
Info: Succeeded in clearing the configuration in the device.
<HUAWEI> reboot
slot 1:
Next startup system software: flash:/basicsoftware.cc
Next startup saved-configuration file: NULL
Next startup paf file: default
Next startup patch package: NULL
Warning: The current configuration will be saved to the next startup saved-confi
guration file. Continue? [Y/N]: n
Warning: The system will reboot. Continue? [Y/N]: y
Function
The rollback configuration command rolls back the system from the current
configuration state to a historical configuration state.
Format
rollback configuration { to { commit-id commit-id | label label | file file-name }
| last number-of-commits }
Parameters
Parameter Description Value
commit-id Specifies the label of the The value is an integer that the
commit-id configuration rollback point to system generates automatically.
which system configurations
are expected to roll back. Run the display configuration
commit list command to check
the configuration rollback
points.
label label Specifies a user label for a The value is a string of 1 to 256
configuration rollback point. A case-sensitive ASCII characters,
specified user label indicates spaces not supported. The value
the historical configuration must start with a letter and
state to which the system cannot be presented in a single
configuration is expected to hyphen (-). The label must
roll back. already exist.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the configuration is incorrect, the service is not running properly, or an
unexpected configuration result occurs on the network, run this command to roll
back the system to the specified historical configuration state.
For example, a user performs four configuration operations and submits these
configurations and four consecutive rollback points a, b, c, and d are generated.
The user finds that the configuration at b is incorrect and wants to roll back the
system to the configuration state before b. After the user rolls back the system
configuration to a, a new rollback point e is generated and marked with Rollback.
If an error occurs in the configuration rollback, you can recover the configuration
to the state before the rollback, and a new rollback point is generated and marked
with Rollback.
Prerequisites
Follow-up Procedure
Example
# Roll back the system to the historical configuration state at rollback point
1000000001.
<HUAWEI> rollback configuration to commit-id 1000000001
# Roll back the system to the historical configuration state at the rollback point
before the last two rollback points.
<HUAWEI> rollback configuration last 2
3.8.33 save
Function
The save command saves the configurations to the configuration file.
Format
save [ configuration-file ]
Parameters
Parameter Description Value
configuration-file Specifies the name of a The value is a string of 5 to 64
configuration file. case-sensitive characters without
spaces.
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can run commands to modify the current configuration of the device, but the
modified configuration will be lost after the device restarts. To enable the new
configuration to take effect after a restart, save the current configuration in the
configuration file before restarting the device.
When a series of configurations are complete and take effect, you must save the
current configuration file to the storage device.
If you do not specify configuration-file when saving the configuration file for the
first time, the system displays the file name extension of the configuration file. If
you directly press Enter, the configuration file is saved as vrpcfg.zip. The
vrpcfg.zip file is the default system configuration file and does not contain any
configuration in the initial state.
Precautions
● If the configuration file to be saved using this command has the same name
with the existing configuration file, the existing configuration file is rewritten.
● The configuration file name extension must be .zip, .dat or .cfg.
– .cfg: The file is saved in plain text mode. After the file is specified as the
configuration file, all commands in the file are recovered one by one
during startup.
– .zip: The .cfg file is compressed to a .zip file that occupies less space. After
being specified as the configuration file, the .zip file is decompressed to
the .cfg file and all commands in the .cfg file are recovered one by one
during startup.
– .dat: A .dat file is a binary file. If the startup software version and the .dat
file version are the same, the system restores all configurations in
the .dat file in batches when the device starts. This speeds up the system
startup.
Example
# Save the current configuration file to the default storage medium when the
switch starts with configuration.
<HUAWEI> save
Warning: The current configuration will be written to the device. Continue? [Y/N]:y
Now saving the current configuration to the slot 1
Info: Save the configuration successfully.
# Save the current configuration file to the default storage medium for the first
time when the switch starts without configuration.
<HUAWEI> save
Warning: The current configuration will be written to the device. Continue? [Y/N]: y
Info: Please input the file name(*.cfg, *.zip, *.dat)[vrpcfg.zip]:
Now saving the current configuration to the slot 2 ..
Info: Save the configuration successfully.
Format
schedule reboot { at time | delay interval [ force ] }
undo schedule reboot
Parameters
Parameter Description Value
at time Specifies the The format of time is hh:mm YYYY/MM/DD. The
device restart restart time must be later than the current
time. device time by less than 720
hours.YYYY/MM/DD indicates year, month, and
date and is optional.
● hh indicates hour and the value ranges from
0 to 23.
● mm indicates minute and the value ranges
from 0 to 59.
● YYYY indicates year and the value ranges
from 2000 to 2037.
● MM indicates month and the value ranges
from 1 to 12.
● DD indicates date and the value ranges from
1 to 31.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When upgrading or restarting the device, you can configure the device to restart
at time when few services are running to minimize the impact on services.
Precautions
● If the schedule reboot at command is used to set a specific date
(YYYY/MM/DD) and the date is a future date, the device restarts at the
specified time, with an error within 1 minute. If no date is set, two situations
occur: If the specified time is later than the current time, the device restarts at
the specified time of the day. If the specified time is earlier than the current
time, the device restarts at the set time next day.
● Note that the gap between the specified date and current date must be
shorter than or equal to 720 hours. If the scheduled restart has been
configured, the latest configuration overrides the previous one.
● Run the schedule reboot delay interval command to set the delay time
before the device restarts. If the force parameter is not specified, the system
compares the configuration file with the current configuration. If the current
configuration is different from the configuration file, the system asks you
whether to save the current configuration. After you complete the selection,
the system prompts you to confirm the configured restart time. Enter Y or y
to make the configured restart time take effect. If the force parameter is
specified, the system does not display any message, and the restart time takes
effect directly. The current configuration is not compared or saved.
● The scheduled restart function becomes invalid when you use the clock
datetime command to set the system time to over 10 minutes later than the
restart time set by the schedule reboot command. If the time difference is
equal to or less than ten minutes, the device immediately restarts and does
not save the configuration.
● This command restarts the device at the specified time, interrupting all
services on the device. Therefore, do not use this command when the device is
running properly.
● Before restarting the device, ensure that the configuration file has been saved.
Example
# Configure the device to restart at 22:00.
<HUAWEI> schedule reboot at 22:00
Warning: The current configuration will be saved to the next startup saved-configuration file. Continue?
[Y/N]:y
Now saving the current configuration....
Save the configuration successfully.
Info: Reboot system at 22:00:00 2017/08/07 UTC (in 11 hours and 19 minutes).
Confirm? [Y/N]:y
Function
The set configuration commit command sets a user label for a configuration
rollback point.
Format
set configuration commit commit-id label label-string
Parameters
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can specify a user label when a configuration rollback point is generated
using the commit command. If a configuration rollback point has been generated,
you can run the set configuration commit command to add a user label for the
configuration rollback point. For continuous configuration rollback points with
labels, you cannot directly modify the labels. You must run the clear
configuration commit commit-id label command to delete the labels of the
configuration rollback points first and then run the set configuration commit
command to specify user labels for the configuration rollback points.
NOTE
For discontinuous configuration rollback points with labels (values of the CommitId fields
of the configuration rollback points in the display configuration commit list command
output are marked with an asterisk [*]), exercise caution when running the clear
configuration commit commit-id label command because this command will
simultaneously delete the configuration rollback points and their labels.
You can run the clear configuration commit commit-id label command to delete
label information of a configuration rollback point.
You can run the display configuration commit list command to check label
information of a configuration rollback point.
Precautions
Example
# Set the label new_label for configuration commit ID 1000000002.
<HUAWEI> set configuration commit 1000000002 label new_label
Function
The set flow-control-message reliability disable command to set message
congestion more than 30 minutes, the veneer will not reset.
Format
set flow-control-message reliability disable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Message congestion detected by the single board for more than 30 minutes will
reset the single board by default.
Example
# Configuration veneer detected message congestion for more than 30 minutes.
Reset veneer by default.
<HUAWEI> system-view
[~HUAWEI] set flow-control-message reliability disable
Format
software crl load crl-name
Parameters
Parameter Description Value
crl-name Specifies a CRL name. The value is a string of 5 to 63 case-
insensitive characters, spaces not
The CRL file must be in the supported.
flash directory of the main
control board. The file name is determined by the
uploaded file and must be the same as
the name of the uploaded file.
Views
User view
Default Level
3: Management level
Usage Guidelines
The lifetime of a certificate is limited. A certificate authority (CA) can revoke a
certificate to shorten its lifetime. A CRL is a list of certificates that have been
revoked, and therefore should not be relied upon. The CRL is issued by a CA. If a
CA revokes a certificate, the key pair defined in the certificate can no longer be
used even if the certificate does not expire. After a certificate in a CRL expires, the
certificate is deleted from the CRL to shorten the CRL.
Example
# Load a CRL file to the main control board.
<HUAWEI> software crl load crldata-new.crl
Format
startup saved-configuration configuration-file [ slot slot-id ]
Parameters
Parameter Description Value
configuration-file Specifies the name of a The name of a configuration file
configuration file. Make must already exist. The file name
sure that the file exists. extension can be .zip, .dat, or .cfg.
slot slot-id Specifies a member device The value is an integer. The range
in a stack. of the integer is dependent on the
specific device.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When the original configuration file cannot be used due to the software upgrade,
run the startup saved-configuration command to specify another configuration
file for next startup. The startup configuration file must be saved in the root
directory of the storage device.
Follow-up Procedure
Example
# Specify the system configuration file for the next startup.
<HUAWEI> startup saved-configuration vrpcfg.cfg
Info: Succeeded in setting the configuration for booting system.
Format
startup system-software system-file [ all | slave-board | slot slot-id ]
Parameters
Parameter Description Value
system-file Specifies the name of the The value must be the name of an
system software file. existing system software file. The
format is [ drive-name ][ file-name ].
If drive-name is not specified, the
value is the name of the default
storage device.
slot slot-id Specifies the stack device. The value is an integer. The value
range depends on the specific device.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Follow-up Procedure
Precautions
● The system software must use .cc as the file name extension and be saved to
the root directory of the storage device.
● The system software set for next startup cannot be deleted.
● In a stack, the specified system software must be saved to the root directory
of the flash memory of all member devices in the stack.
Example
# Specify the system software for next startup.
<HUAWEI> startup system-software basicsoft.cc
Function
The startup patch command specifies the patch file for next startup.
Format
startup patch patch-name { all | slot slot-id }
Parameters
Parameter Description Value
patch-name Specifies the name of the The name of the patch file must already
patch file for next exist. It is in the format of [ drive-
startup. name ] [ path ] [ file-name ]. If drive-
name is not specified, the name of the
default storage device is used.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To make the patch file take effect after the device restarts, run this command to
specify the patch file for next startup.
Prerequisites
The desired patch file has been uploaded to the Flash:/ of the device.
Follow-up Procedure
Run the reboot command to restart the device.
Precautions
● A patch file uses .pat as the file name extension and must be saved in the
root directory.
● If you use this command to specify another patch for next startup, the
previous patch will be overridden.
● After the patch file is specified for next startup, run the display patch-
information command to view the patch file.
– If the patch file for next startup is not empty, the device load the patch
automatically after next startup.
– If the patch file for next startup is empty, the device cannot load the
patch after next startup.
● After the device restarts, the system loads and runs the patch. If you do not
want the system to load the patch file after startup, use either of the
following methods to delete the patch file:
– Run the patch delete all command to delete the current patch.
– Run the reset patch-configure next-startup command to delete the
patch file already loaded on the system after startup.
Example
# Specify the patch file for next startup.
<HUAWEI> startup patch patch.pat all
3.8.41 uninstall-module
Function
The uninstall-module command uninstalls a specified module file.
Format
uninstall-module { file-name [ next-startup ] | all }
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
The uninstall-module command can be used to uninstall in-use modules from
the system.
Example
# Uninstall module 123.MOD from the system.
<HUAWEI> uninstall-module 123.MOD
This will uninstall the module. Are you sure? [Y/N]:y
Info: Succeeded in uninstalling the module.
NOTE
Function
The display fei frame backup-time command displays the backup time of each
service module during an ISSU upgrade.
NOTE
Format
display fei frame backup-time slot slot-id component fei
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to check the backup time of each service module
during an ISSU upgrade, including the backup start time and end time.
Example
# Display the backup time of each service module during an ISSU upgrade.
<HUAWEI> display fei frame backup-time slot 1 component fei
The details of service backup time as follows:
--------------------------------------------------------------------------------------------
Service BeginTime EndTime UsedTime (s) ThresholdTime (s)
--------------------------------------------------------------------------------------------
ACL 15:24:30 15:24:32 2 20
CPU_DEFEND 15:24:32 15:24:36 4 250
VLAN 15:24:36 15:24:39 3 150
TRUNK 15:24:39 15:24:41 2 20
MAC 15:24:41 15:24:43 2 100
ARP 15:24:43 15:24:57 14 1000
MSTP 15:24:57 15:24:59 2 10
LLDP 15:24:59 15:25:01 2 10
DLDP 15:25:01 15:25:03 2 10
SMARTLINK 15:25:03 15:25:05 2 10
EFM 15:25:05 15:25:07 2 10
DAD 15:25:07 15:25:09 2 10
L2PT 15:25:09 15:25:11 2 200
LDT 15:25:11 15:25:13 2 10
ERPS 15:25:13 15:25:15 2 10
TRILL 15:25:15 15:25:17 2 50
QOS 15:25:17 15:25:20 3 1500
MQC 15:25:20 15:25:22 2 100
FCOE 15:25:22 15:25:24 2 100
DCB 15:25:24 15:25:26 2 20
SECURITY 15:25:26 15:25:29 3 250
NS_FLOW 15:25:29 15:25:29 0 200
MC 15:25:29 15:25:31 2 50
MIRR 15:25:31 15:25:33 2 50
------------------------------------------------------------------------------------
Table 3-62 Description of the display fei frame backup-time command output
Item Description
ThresholdTime (s) Upper threshold for the time taken for backup.
Format
display issu check-result
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
After you use the issu check command to perform ISSU check, you can use the
display issu check-result command to view the check result.
Example
# Display the result of system upgrade check.
<HUAWEI> display issu check-result
------------------------------ISSU CHECK RESULT-------------------------------
Check Date : 2015/03/07 15:57:01
Check Result : success
Upgrade type : lossy
Base package : CE6850EI-V100R005C00SPC300.cc
Upgrade package : CE6850EI-V100R005C10SPC200.cc
Base patch : CE6850EI-V100R005SPH001.PAT
Base paf : default
Upgrade paf : default
------------------------------------------------------------------------------
Info: The upgrade procedure is:
Reboot the slave board with the upgrade system software.
Create standby process with the upgrade system software, and detailed process groups are as follows:
process group: 10003 slot: 1
process group: 10005 slot: 3
process group: 10004 slot: 1
process group: 10006 slot: 3
Upgrade process with the upgrade system software, and detailed process groups are as follows:
process group: 10003 slot: 1
process group: 10005 slot: 3
process group: 10004 slot: 1
process group: 10006 slot: 3
process group: 3 slot: 1
process group: 1000 slot: 1
process group: 10001 slot: 1
process group: 1002 slot: 1
process group: 1001 slot: 1
process group: 2 slot: 1
process group: 10002 slot: 1
Reboot group with the upgrade system software, The detail groups is below:
board group: 1 slot: 3
Reboot the master board with the upgrade system software.
------------------------------------------------------------------------------
Item Description
Function
The display issu group command displays information about device groups.
Format
display issu group
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
You can run the command to check information about device groups during ISSU.
Example
# Display current information about board groups.
<HUAWEI> display issu group
Grouping Information
-----------------------------------
GroupId SlotId BoardType
-----------------------------------
1 1 MPU
-----------------------------------
Item Description
SlotId ID of a device.
Function
The display issu report command displays detailed information about the ISSU
process.
Format
display issu report
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
After you use the issu start command to start ISSU, you can use the display issu
report command to view detailed information about the ISSU process.
Example
# Display detailed information about the ISSU progress.
<HUAWEI> display issu report
-----------------------------ISSU REPORT-----------------------------------
Upgrade number : 20150815164424
Upgrade type : lossy
Upgrade result : success
Base package : CE6850EI-V100R005C00SPC300.cc
Upgrade package : CE6850EI-V100R005C10SPC200.cc
Base patch : CE6850EI-V100R005SPH001.PAT
Base paf : default
Upgrade paf : default
Upgrade rollback time(min) : 120
---------------------------------------------------------------------------
Upgrade procedure details:
slot: 1 [reboot]
begin time: 2015/08/15 16:46:07
end time: 2015/08/15 16:54:26
duration: 0 Hours 8 Minutes 19 Seconds
slot: 2 [upgrade process]
process group: 10003
begin time: 2015/08/15 16:54:32
end time: 2015/08/15 16:56:04
duration: 0 Hours 1 Minutes 32 Seconds
slot: 2 [upgrade process]
process group: 10004
begin time: 2015/08/15 16:54:33
end time: 2015/08/15 16:56:04
duration: 0 Hours 1 Minutes 31 Seconds
slot: 2 [reset process]
process group: 3
begin time: 2015/08/15 16:54:59
end time: 2015/08/15 16:55:52
duration: 0 Hours 0 Minutes 53 Seconds
slot: 2 [reset process]
process group: 1000
begin time: 2015/08/15 16:54:59
end time: 2015/08/15 16:55:53
duration: 0 Hours 0 Minutes 54 Seconds
slot: 2 [reset process]
process group: 10001
begin time: 2015/08/15 16:54:59
Item Description
Upgrade start begin time Date and time when the ISSU start
phase begins.
Upgrade start end time Date and time when the ISSU start
phase ends.
Upgrade start total duration Duration for the ISSU start phase.
Function
The display issu rollback-timer command displays the remaining time of the
ISSU rollback timer.
Format
display issu rollback-timer
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the issu start [ rollback-timer [ time ] ] system-file [ patch patch-name ]
command sets the ISSU rollback timer value, you can use the display issu
rollback-timer command to view the remaining time of the ISSU rollback timer.
Prerequisites
The rollback-timer parameter has been specified in the issu start [ rollback-
timer [ time ] ] system-file [ patch patch-name ] command in ISSU start phase.
Example
# Display the remaining time of the ISSU rollback timer during ISSU.
<HUAWEI> display issu rollback-timer
-----------------------------------------
Timer Timeleft(min)
-----------------------------------------
rollback 50
-----------------------------------------
Format
display issu state
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
You can use the display issu state command to check which ISSU phase the
system enters, which can be ISSU check, ISSU start, or ISSU confirm.
Example
# Display the ISSU phase.
<HUAWEI> display issu state
--------------------------------------------------------------------------------
Phase State Progress
--------------------------------------------------------------------------------
1.issu check : finished 100%
2.issu start : processing 90%
3.issu confirm : - 0%
--------------------------------------------------------------------------------
Item Description
Function
The issu abort command aborts ISSU.
Format
issu abort
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
While the ISSU is in progress, run the issu abort command to abort the ISSU if
necessary after the ISSU start phase is over (you can run the display issu state
command to check it, and the issu start is finished). The system then restarts and
rolls back to the previous software version.
Prerequisites
The rollback-timer parameter has been specified in the issu start command in
the ISSU start phase.
Example
# Abort ISSU.
<HUAWEI> issu abort
Warning: The upgrade operation will be aborted, and the system will reboot to old version. Continue?
Function
The issu check command configures the system to perform ISSU check.
Format
issu check system-file [ patch patch-name ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before performing ISSU, you need to check whether the system meets ISSU
requirements using the issu check command. ISSU check includes checking the
system running environment, new version integrity and validity, hardware
compatibility, and software compatibility.
Prerequisites
The system software to be upgraded has been uploaded to all stack member
switches.
Follow-up Procedure
If no error information is displayed in the output of the issu check command, the
check result is success. You can also run the display issu check-result command
to view the ISSU check result.
Example
# Perform ISSU check.
<HUAWEI> issu check CE6800-V100R006C00SPC600.cc
Format
issu confirm
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you run the issu start command and specify the rollback-timer parameter
to start ISSU, you need to run the issu confirm command to confirm ISSU before
the rollback timer expires or run the issu abort command to abort ISSU to enable
the system to roll back to the old version.
Prerequisites
The issu confirm command can be run to confirm the upgrade result only when
the rollback-timer parameter is specified in the issu start command.
Configuration Impact
After the issu confirm command is executed, the new system software is specified
as the software for the next startup. The ISSU is complete.
Example
# Confirm the upgrade result.
<HUAWEI> issu confirm
Function
The issu reset rollback-timer command resets the ISSU rollback timer value in an
ISSU upgrade.
Format
issu reset rollback-timer [ time | limitless ]
Parameters
Parameter Description Value
time Specifies the ISSU rollback timer The value is an integer that
value. ranges from 1 to 2880, in
minutes.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After the system enters the ISSU start phase, the ISSU rollback timer is
automatically activated. If the ISSU rollback timer expires before the ISSU confirm
phase, the system rolls back to the old version. You can reset the ISSU rollback
timer value according to service requirements.
Prerequisites
The rollback-timer parameter has been specified in the issu start command.
Precautions
If you use the issu reset rollback-timer command to reset the ISSU rollback timer
value, the new configuration takes effect immediately and the old configuration
becomes invalid.
Example
# Reset the ISSU rollback timer to 100 minutes.
<HUAWEI> issu reset rollback-timer 100
Function
The issu start command starts ISSU.
Format
issu start [ rollback-timer [ time ] ] system-file [ patch patch-name ]
Parameters
Parameter Description Value
system-file Specifies the path for storing The value is a string of 4 to 127
the system upgrade file and case-sensitive characters
file name. without spaces. The default
directory is flash:/.
patch patch- Specifies the path for storing The value is a string of 5 to 63
name the patch file and file name. case-sensitive characters
without spaces. The default
directory is flash:/.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After you run the issu start command to start ISSU, the system enters the ISSU
start phase. All stack member switches upgrade from the old version to new
version.
Precautions
When you run the issu start command without specifying the rollback-timer
parameter to start ISSU, the system confirms ISSU after the ISSU start phase ends.
In this situation, you do not need to run the issu confirm command to confirm
ISSU. If you specify the rollback-timer parameter, you need to run the issu
confirm command before the rollback timer expires or run the issu abort
command to abort ISSU to enable the system to roll back to the old version.
Example
# Start ISSU and set the ISSU rollback timer to 120 minutes.
Format
display license [ verbose ]
display license [ verbose ] slot slot-id
Parameters
Parameter Description Value
slot slot-id Specifies a stack member. The value is an integer, and the
value range varies according to the
device configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
A license file determines whether some product features are available. To view
information about an active license file, run the display license command. The
information includes the name, version, valid time, and configuration items of the
license file.
Example
# Display information about the license file on the device.
<HUAWEI> display license
MainBoard:
License state: Demo. The license for the current configuration will expire in 86 day(s).
Apply for authentic license before the current license expires.
-------------------------------------------------------------
Feature name : CELIC
Authorize type : demo
Expired date : 2020-06-15
Trial days : --
Item name : CE-LIC-FCF-ALL
Item type : Function
Control value :1
Used value :1
Item state : Normal
Item expired date : 2020-06-15
Item trial days : 60
Description : CE-LIC-FCF-ALL
Item Description
Item Description
Item Description
Item Description
Item Description
Function
The display license revoke-ticket command displays the revocation code of the
current license file of the device.
Format
display license revoke-ticket [ slot slot-id ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
The display license revoke-ticket command enables you to check the revocation
code of a license file that has become invalid on the device. This code proves that
the current license file is invalid and is used to apply for a new license.
Precautions
This command displays information only when the license file in current device
system is invalid.
Example
# Display the revocation code of the current invalid license file.
<HUAWEI> display license revoke-ticket
MainBoard:
Info: The revoke ticket is: LIC20121103006100:27C1B773ED11D9F877855CDAEE74ABFE60E07126.
Function
The display license state command displays the license status on the device.
Format
display license state [ trial ]
Parameters
Parameter Description Value
trial Displays the number of days before a -
license in Trial state expires.
If the current license is not in Trial state,
the system displays no information
when this parameter is configured.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To check the status of the running license, run this command. The command
displays the status of the license and the number of days before the license in this
status will expire.
This command helps you locate license problems and verify the license status on
the device.
Example
# Display the status of the license on the device.
<HUAWEI> display license state
MainBoard:
Info: Current license state is Demo. The license for the current configuration will expire in 22 day(s).
Function
The display paf command displays information about the product adaptive file
(PAF) in the system.
Format
display paf [ verbose ]
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
A PAF file provides only required resources and features. This command can
display all the specification information about the PAF file.
Example
# View details about the PAF file.
<HUAWEI> display paf verbose
SPEC_FUNC_RAAS_ENABLED
Value :0
Default value: 0
Min value : 0
Max value : 1
Description : Raas funcation switch(1: enable, 0: disable)
SPEC_FUNC_LVRM_LRSPEC
Value :0
Default value: 0
Min value : 0
Max value : 1
Description : Logic system funcationswitch(1: enable, 0: disable)
SPEC_FUNC_LVRM_VSSPEC
Value :1
Default value: 1
Min value : 0
Max value : 1
Description : Virtual system funcationswitch(1: enable, 0: disable)
Item Description
Format
display patch-information [ verbose | history ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
After a patch is loaded or deleted, run this command to view information about
the patch, including its version, name, and status.
Precautions
If the system has no patch loaded, the patch version, name, and status displayed
by this command are "-".
Example
# Display detailed information about the patch in the current system.
<HUAWEI> display patch-information verbose
Patch Package Name :flash:/PATCH.PAT
Patch Package Version :V100R006SPH001
Patch Package State :Running
Patch Package Run Time:2014-11-14 14:02:43
****************************************************************************
* Information about patch errors is as follows: *
****************************************************************************
SlotId CurrentVersion
----------------------------------------------------------------------------
No patch error occurs on any board
Board Info :
----------------------------------------------------------------------------------------------
SlotId ProcId State PatchType Valid PatchEffectiveTime PatchFileName
----------------------------------------------------------------------------------------------
1 1049 Running C YES 2014-11-14 14:02:09.297 HP000012.pat
1 1049 Running C YES 2014-11-14 14:02:09.308 HP000028.pat
----------------------------------------------------------------------------------------------
Total = 2
Item Description
Function
The display upgrade rollback-timer command displays the status of the rollback
function in the current version.
Format
display upgrade rollback-timer
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
If an error occurs during an upgrade (for example, the new startup files are
damaged), cancel the current upgrade and restore the previous version used
before the upgrade.
To check whether the version rollback function is enabled, run this command.
Example
# Display the status of the rollback function in the current version (the version
rollback function is enabled).
<HUAWEI> display upgrade rollback-timer
Info:The state of upgrade rollback is enable. Limit time is 10 minutes.
# Display the status of the rollback function in the current version (the version
rollback function is disabled).
<HUAWEI> display upgrade rollback-timer
Info:The state of upgrade rollback is disable.
3.10.7 license
Function
The license command creates a license view and enters the view.
NOTE
The CE6850EI, CE6810EI, CE6810LI, CE5855EI, CE5850HI, CE5850EI and CE5810EI do not support
this command.
Format
license
Parameters
None
Views
System view
Level
3: Management level
license execute
Usage Guidelines
To create and enter a license view, run the license command.
Example
# Create and enter a license view.
<HUAWEI> system-view
[~HUAWEI] license
[~HUAWEI-license]
Function
The license active command activates the license file saved in the storage
medium of the device.
Format
license active file-name
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The license active command can be used to activate a license file in the following
situations:
NOTICE
If the configuration items of the new license file are lower than those of the
current license file, check whether the configuration items required by services
exist in the new license file. If not, apply for a correct license file and activate
it. Otherwise, services may be interrupted due to lack of dependent license
configuration items after the device is restarted.
Prerequisites
Precautions
● The license file must use .dat or .zip as the file name extension and be saved
to the default root directory in the storage medium of the device.
● In a stack with multiple switches, if a license file is applied for each stack
member, you need to compress multiple .dat license files into a .zip file,
upload the .zip file to the stack master, and then load the file.
● Before activating a license file, you can run the license verify command to
verify the license file.
Example
# Activate License.dat in the storage medium of the device.
<HUAWEI> license active license.dat
Now activing the license.................................done.
MainBoard:
Info: Succeeded in activating the license file.
Function
The license backup command backs up license information in the license partition
to the specified file.
NOTE
The CE5800 series switches (excluding CE5880EI) do not support this command.
Format
license backup flash file-name
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
To check whether the activated license is the same as the loaded license, run the
license backup flash command to back up the activated license in specified files
and then compare it with the loaded license file. The license file can be opened in
text mode.
After you run this command, the system backs up two files using the file name
extensions .master.zip and .slave.zip, and saves the files to the root directory on
the default storage of the device. The backup license file in the primary license
partition uses the file name extension .master.zip, and that in the secondary
license partition uses the file name extension .slave.zip.
Example
# Back up license information in the license partition to the files
switch.master.zip and switch.slave.zip.
<HUAWEI> license backup flash switchInfo: Succeeded in backing up the license file to hswitchmaster.zip
and hswitchslave.zip.
Format
license delete file-name
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
After a license file is activated using the license active command, the system
automatically backs up the license file in the $_license directory. After you
upgrade the license file, the expired license file backed up in the $_license
directory still exists and occupies system resources. To delete redundant license
files in the $_license directory, run the license delete command.
To view files in the $_license directory, run the dir command.
<HUAWEI> cd $_license
<HUAWEI> dir
Directory of flash:/$_license/
Example
# Delete the license file named license.dat in the $_license directory.
<HUAWEI> license delete license.dat
Warning: The file license.dat cannot be recycled. Continue? [Y/N]:y
Format
license export file-name
Parameters
Parameter Description Value
file-name Specifies the name of the The value is a string of 5 to 127
license file to be saved to the case-sensitive characters without
root directory. spaces. The extension of a file is
".zip".
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run this command to save the license file to the root directory on the
storage of the device.
Precautions
The saved license file must use .zip as the file name extension.
Example
# Save the license file to the root directory on the storage of the device.
Format
license revoke [ slot slot-id ]
Parameters
Parameter Description Value
slot slot-id The value is an integer, and the value
Specifies a stacked
range depends on the device
device.
configuration.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can upgrade a license file to:
● Add new features.
● Optimizes device performance.
● Fix bugs in the current version.
Before updating a license file, run the license revoke command to revoke the
existing license. The system then returns a license revocation code. This code is the
evidence for license invalidation and is used to apply for a new license.
NOTE
A license revocation code is a character string generated after a license file becomes invalid.
You can determine that a license file is invalid based on the corresponding revocation code.
Precautions
After you run the license revoke command, the license file enters the Trial state
and cannot be activated again regardless of how long the license file will expire. A
license file in Trial state can be used only for 60 days. After the license file in Trial
state expires, the successfully delivered features controlled by the license are still
valid. The features can be deleted, but cannot be added. To add functions
controlled by the license, re-apply for a license file and activate it.
Please apply for a new license and activate it before the original license expires so
that services are not affected.
Example
# Revoke the current license file.
<HUAWEI> license revoke
Warning: The license will switch to trial state. Continue? [Y/N]:y
MainBoard:
Info: Succeeded in revoking the license. The revoke ticket is
LIC201411261KSC50:87CE09A70A7401C7D0E1853B7931E3FA755AC88D.
Function
The license verify command verifies the license file of a device.
Format
license verify file-name
Parameters
Parameter Description Value
file-name Specifies the name of the license The value must be the name of
file to be verified. an existing license file.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before running the license active command to activate a license file, verify the
license file.
You can run the license verify command to verify the license file on the MPU. The
verification result can be the following:
● Major error
The license file cannot be activated.
● Minor error
The license file may fail to be activated.
● Success
The license file can be activated.
Prerequisites
The license file has been saved on the device.
Example
# Verify the license file named license.dat on the device.
<HUAWEI> license verify license.dat
MainBoard:
Info: Verify license succeeded.
Format
patch active all
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If you do not specify the active or run keyword when running the patch load
command, run the patch active all command to activate all the loaded patches to
make them effect.
Prerequisites
Patches have been loaded using the patch load command.
Configuration Impact
● After a non-incremental patch is loaded and the patch active all command is
run, the patches in the current system are activated.
Example
# Activate all patches.
<HUAWEI> patch active all
Format
patch configuration-synchronize
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
After you replace or add a member switch in a stack and start the new member
switch, run this command to synchronize the patch configuration and patch file
from the master switch if the patch file of the new member switch is incorrect.
Example
# Run the following commands on the new member switch to synchronize the
patch configurations and patch files to the new member switch.
Format
patch deactive all
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If you find errors in some patches after using the patch active all command to
activate the loaded patches, run the patch deactive all command to deactivate
patches on the current system to prevent them from taking effect.
Prerequisites
Active patches exist on the current system.
Precautions
After the patch deactive all command is run, patches in the active state are
deactivated.
The patch deactive all command makes patches on the current system
ineffective. To make the loaded patches take effect again, run the patch active all
command.
Example
# Deactivate patches on the current system.
<HUAWEI> patch deactive all
Format
patch delete all
Parameters
Parameter Description Value
all Deletes all patches on all the boards. -
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before installing a non-incremental patch, you need to run the patch delete all
command to delete existing patches from the current system and then install a
new patch package.
Configuration Impact
After the patch delete all command is run, patches on the system are deleted
regardless of their status.
Precautions
● The patch delete all command may affect the performance of the system.
So, confirm the action before you use this command.
● When the patch delete all command is run to delete patches from the
current system, the system prompts you whether to delete patches.
● After the patch delete all command is run to delete existing patches from
the current system, the deleted patches cannot be restored. So, confirm the
action before you use this command.
Example
# Delete all hot patches from the current system.
<HUAWEI> patch delete all
This will delete the patch. Are you sure? [Y/N]:y
Info: Operating, please wait for a moment....done.
Info:Succeeded in deleting the patch.
****************************************************************************
* Warning: Perform the following operations to deal with the cold patch. *
****************************************************************************
----------------------------------------
Device Type Upgrade mode
----------------------------------------
10 MPU reset board
----------------------------------------
Info: Succeeded in deleting the patch.
Format
patch load file-name all [ active | run ]
Parameters
Parameter Description Value
file-name The value is a string of 5 to
Specifies the storage path and file
127 case-sensitive characters
name of a patch package. The path
without spaces. The value of
name is an absolute path name or a
the patch name is a string of
relative path name.
5 to 63 characters.
all Installs patches on all boards. -
active Activates a patch after the patch is -
loaded.
run Runs a patch after the patch is -
loaded.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before loading a patch, the system resolves the patch package to check the
validity of patch files and obtain the attributes of patch files.
When loading a patch to the current system, the system searches the patch
package for a matching patch file according to the attributes of the patch file.
● If a matching patch file is found in the patch package, the system loads the
patch.
● If no matching patch file is found in the patch package, the system does not
load the patch.
Prerequisites
The desired patch file has been uploaded to the master main control board of the
device.
Configuration Impact
After the patch load command is run, the system loads all types of patches in the
patch package.
● If the parameter active is used in the patch load command, the system
activates the patch file after loading it. Then, you can run the patch run all
command to run the patch file.
● If the parameter run is used in the patch load command, the system runs the
patch file after loading it.
Precautions
Example
# Load and run the cold patch package on the current system.
<HUAWEI> patch load CloudEngineV200R003SPH001.PAT all run
Info: Operating, please wait for a moment...
****************************************************************************
* Warning: Perform the following operations to deal with the cold patch. *
****************************************************************************
----------------------------------------
Device Type Upgrade mode
----------------------------------------
11 MPU reset board
12 MPU reset board
----------------------------------------
Info: Succeeded in running the patch.
Format
patch run all
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When the device is restarted, the active patches become deactivated and need to
be activated again. To enable the active patches to retain in running start after a
device restart, use this command to run these active patches.
Prerequisites
Patches have been loaded and activated on the system.
Configuration Impact
After you run this command to run patches on the current system, the patches
remain in the running state if a device restart occurs.
After the patch run all command is run, the patches enter running state and
cannot be restored to the previous state. Confirm the action before you run the
command.
Example
# Run active patches in the current system.
<HUAWEI> patch run all
Format
reset patch-configure next-startup
Parameters
Parameter Description Value
next-startup Deletes the configuration of the patch file for next startup. -
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After you run the startup patch command to specify the patch file for next
startup, you can use the reset patch-configure command to delete the
configuration.
Precautions
If you run the reset patch-configure command, the patch file for next startup is
empty. When the device restarts, the system does not load and run the patch file.
Example
# Delete the configuration of the patch file for next startup.
<HUAWEI> reset patch-configure next-startup
Info: Succeeded in clearing startup the patch.
Format
upgrade rollback rollback-timer time-value
undo upgrade rollback
Parameters
Parameter Description Value
rollback-timer time- Specifies the value of the The value is an integer that
value rollback timer. ranges from 10 to 360, in
minutes.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If an error occurs during an upgrade (for example, the new startup files are
damaged), cancel the current upgrade and restore the previous version used
before the upgrade.
After the version rollback function is enabled and the system package is restarted,
the system will perform a version rollback to roll back the system package and
patch if no users successfully log in to the device in a specified period of time.
After the version rollback function is disabled, the system version does not roll
back regardless whether any user is authenticated and logs in to the system
within the specified period.
By default, the version rollback function is disabled. After each version rollback
completes, the version rollback function is disabled again.
Precautions
If any user successfully logs in to the device, the rollback timer is canceled.
After you run this command, the current system resets the rollback timer.
Example
# Configure the rollback timer for the current system upgrade.
<HUAWEI> upgrade rollback rollback-timer 300
Info:The state of upgrade rollback is enable. Limit time is 300 minutes.
If no User cancels the function, the main MPU will restart by the bootfile flash:/software.cc.
Function
The acl command configures an HTTP access control list (ACL).
Format
acl { acl-name | acl-number }
undo acl
Parameters
Parameter Description Value
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
Usage Scenario
To configure an HTTP ACL, run the acl command. An ACL limits clients that access
the server, improving server security.
Prerequisites
Create an ACL of a specified type.
● Run acl { name basic-acl-name { basic | [ number ] basic-acl-number } |
[ number ] basic-acl-number } command, create an basic ACL.
● Run acl { name advance-acl-name [ advance ] | [ number ] advance-acl-
number } command, create an advanced ACL.
Precautions
If the ACL configured in this command has not been created in the system view,
no client is allowed to access the HTTP server.
Example
# Configure an HTTP ACL named policy1.
<HUAWEI> system-view
[~HUAWEI] acl policy1
[*HUAWEI-acl4-advance-policy1] quit
[*HUAWEI] http
[*HUAWEI-http] service restconf
[*HUAWEI-http-service-restconf] acl policy1
Format
idle-timeout minutes
undo idle-timeout
Parameters
Parameter Description Value
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
Before a client transmits HTTP services, it logs in to an HTTP server and
establishes a TCP connection with the server. However, if the connection is torn
down unexpectedly, the HTTP server cannot detect the disconnection and still
retains the connection, which wastes resources. To resolve this problem, run the
idle-timeout command to configure a timeout period for an idle HTTP
connection. If the client does not send any packet during the timeout period, the
HTTP server considers the connection invalid and tears down the TCP connection
with the client after the timeout period elapses.
Example
# Set the timeout period to 30 minutes for an idle HTTP connection.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service restconf
[*HUAWEI-http-service-restconf] idle-timeout 30
Function
The secure-server enable command enables the HTTPS listening function.
The undo secure-server enable command disables the HTTPS listening function.
Format
secure-server enable
Parameters
None
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
Usage Scenario
To enable the HTTPS listening service, run the secure server enable command.
HTTPS encrypts data before transmitting it, enhancing security.
Precautions
HTTPS has a higher security than HTTP, and therefore using HTTPS is
recommended.
Example
# Enable the HTTPS listening function.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service restconf
[*HUAWEI-http-service-restconf] secure-server enable
Format
secure-server port port-number
undo secure-server port
Parameters
Parameter Description Value
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
● When the default HTTP service listening port is being used, run the secure-
server port command to configure an HTTP service listening port so that the
firewall can filter packets on this port. This enhances network security.
● Currently, the HTTPS service listening port supports only IPv4.
● A port number that is being used cannot be specified.
Example
# Configure port 1028 for HTTPS listening.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service restconf
[*HUAWEI-http-service-restconf] secure-server port 1028
Format
server enable
undo server enable
Parameters
None
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
HTTP is an application-layer protocol that transports hypertext from WWW servers
to local browsers. HTTP uses the client/server model in which requests and replies
are exchanged.
To enable the HTTP listening service so that the HTTP server can identify the
connection requests from clients, run the server enable command.
Currently, the HTTP listening service supports only IPv4.
Example
# Enable the HTTP listening service.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service restconf
[*HUAWEI-http-service-restconf] server enable
Format
server port port-number
undo server port
Parameters
Parameter Description Value
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
● When the default HTTP service listening port is being used, run the server
port command to configure an HTTP service listening port so that the firewall
can filter packets on this port. This enhances network security.
● Currently, the HTTP service listening port supports only IPv4.
● A port number that is being used cannot be specified.
Example
# Configure port 1028 for HTTP service listening.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service restconf
[*HUAWEI-http-service-restconf] server port 1028
Function
The service restconf command creates the Service-Restconf view and displays it,
or displays the Service-Restconf view that has been created.
The undo service restconf command deletes the Service-Restconf view and all
configurations in this view.
Format
service restconf
Parameters
None
Views
HTTP view
Default Level
3: Management level
https write
Usage Guidelines
Before you perform HTTP configurations, run the service restconf command to
enter the Service-Restconf view.
Example
# Display the Service-Restconf view.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service restconf
Format
ssl-policy policy-name
undo ssl-policy
Parameters
Parameter Description Value
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
Usage Scenario
Conventional HTTP does not have any security mechanism. It transmits data in
plaintext and does not verify the identities of communications parties. Therefore,
data transmitted over HTTP may be tampered with. In applications that require
high security, such as e-commerce and online banking, HTTP is inapplicable. To
enhance security, run the ssl-policy command to specify an SSL policy for an
HTTP server.
Configuration Impact
HTTP security is enhanced with the SSL security mechanisms, such as data
encryption, identity verification, and message integrity check.
Prerequisites
The following configurations must have been complete before you run the ssl-
policy command.
1. An SSL policy has been created and the SSL policy view is displayed using the
ssl policy policy-name command in the system view.
2. A digital certificate or certificate chain has been loaded using the certificate
load command in the SSL policy view.
3. The HTTPS listening function has been enabled using the secure-server
enable command in the Service-Restconf view.
Precautions
An HTTP server can only have one SSL policy configured. If the ssl-policy
command is run more than once, the latest configuration overrides the previous
one.
Example
# Configure an SSL policy named policy1 for an HTTP server.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service-restconf
[*HUAWEI-http-service-restconf] secure-server enable
[*HUAWEI-http-service-restconf] ssl-policy policy1
Format
ssl-verify peer
undo ssl-verify
Parameters
None
Views
Service-Restconf view
Default Level
3: Management level
https write
Usage Guidelines
Usage Scenario
To prevent access of unauthorized HTTP clients, run the ssl-verify-mode
command to configure an HTTP server to perform SSL verification on HTTP
clients. This configuration enhances security.
Precautions
If a client does not have a certificate loaded or has an incorrect certificate loaded,
the verification fails, and the server disconnects the client.
Example
# Configure an HTTP server to perform forcible SSL verification on HTTP clients.
<HUAWEI> system-view
[~HUAWEI] http
[*HUAWEI-http] service-restconf
[*HUAWEI-http-service-restconf] ssl-verify peer