0% found this document useful (0 votes)
39 views

CLI Overview

CLI Overview

Uploaded by

Randy Dookheran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

CLI Overview

CLI Overview

Uploaded by

Randy Dookheran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

CloudEngine 12800 Series Switches

Command Reference 1 CLI Overview

1 CLI Overview

About This Chapter

1.1 How to Use Command Lines


This section describes how to use command lines and some techniques to improve operating
efficiency.
1.2 Displaying the Command Output
This section describes how to query the configuration information about command lines,
control the method in which command outputs are displayed, and filter the command outputs.
1.3 Configuration Examples
This section provides several examples that illustrate the use of command lines.

1.1 How to Use Command Lines


This section describes how to use command lines and some techniques to improve operating
efficiency.

1.1.1 Entering Command Views


The device has many functions; therefore various configuration commands and query
commands are provided to facilitate device management and maintenance. Huawei switch
registers commands to different command views based on the functions of the commands so
that users can easily use them. To configure a function, enter the corresponding command
view and then run corresponding commands.

The device provides various command views. For the methods of entering the command
views except the following views, see the CloudEngine 12800 Series Switches Command
Reference.

Common Command Views


l User view
In the user view, you can view the running status and statistics of the device.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 1


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

How To Enter: When a user logs in to the device, the user enters the user view and the
following prompt is displayed:
<HUAWEI>

l System view
In the system view, you can set the system parameters of the device, and enter other
function views from this view.
How To Enter: Run the system-view command and press Enter in the user view. The
system view is displayed.
<HUAWEI> system-view
Enter system view, return user view with return command.
[~HUAWEI]

l Interface view
In the interface view, you can configure interface parameters including physical
attributes, link layer protocols, and IP addresses.
How To Enter: Run the interface command and specify an interface type and number to
enter the interface view.The interface 10GE is used as an example.
[~HUAWEI] interface 10ge X/Y/Z
[~HUAWEI-10GEX/Y/Z]

X/Y/Z indicates the number of an interface that needs to be specified. It is in the format of
slot number/card number/interface sequence number.
l Routing protocol view
In routing protocol views, you can configure most routing protocol parameters. The
routing protocol views include the IS-IS view, OSPF view, and RIP view.
How To Enter: Run a command to activate a routing protocol process in the system view.
The corresponding routing protocol view is displayed.
[~HUAWEI] isis
[*HUAWEI-isis-1]

The command line prompt HUAWEI is the default host name (sysname). The prompt
indicates the current view. For example, <> indicates the user view and [] indicates all other
views except the user view.

You can enter ! or # followed by a character string in any view. All entered content
(including ! and #) is displayed as comments. That is, the corresponding configuration is not
generated.

NOTE

l Some commands can be executed in multiple views, but they have different functions after being
executed in different views. For example, you can run the lldp enable command in the system view
to enable LLDP globally and in the interface view to enable LLDP on an interface.
l In the system view, you can run the diagnose command to enter the diagnostic view. Diagnostic
commands are used for device fault diagnosis. If you run some commands in the diagnostic view, the
device may fail to run properly or services may be interrupted. Contact technical support personnel
and use these diagnostic commands with caution.

Exiting Command Views


You can run the quit command to return from the current view to an upper-level view.

For example, after you run the quit command to return from the AAA view to the system
view, you can run the quit command again to return from the system view to the user view.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 2


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

[~HUAWEI-aaa] quit
[~HUAWEI] quit
<HUAWEI>

To return from the AAA view directly to the user view, press Ctrl+Z or run the return
command.
# Press Ctrl+Z to return directly to the user view.
[~HUAWEI-aaa] // Enter Ctrl+Z
<HUAWEI>

# Run the return command to return directly to the user view.


[~HUAWEI-aaa] return
<HUAWEI>

1.1.2 Selecting a Mode for the Configuration to Take Effect


The system allows configurations to take effect immediately or in two stages to ensure
reliability of user configurations.
Before configuring a service, enter the system view. After the system view is displayed, the
system initiates the corresponding configuration process based on the configured mode.
l The immediate mode is the traditional mode.
After you enter a command line and press Enter, the system performs the syntax check.
The configuration takes effect as soon as it passes the syntax check.
l In the two-stage mode, the system configuration process is divided into two stages.
– In the first stage, a user enters command lines and the system performs syntax and
semantics checks in the candidate database. If syntax or semantics errors are found
in the command lines, the system displays a message on the terminal to inform the
user of the error and the cause.
– In the second stage, a user commits the configuration, and the system enters the
configuration commitment stage. The system delivers configurations in the
candidate database to a service. If the configurations take effect, the system adds
them to the running database of the current system. During the configuration
commitment stage, the system checks the configuration validity and displays
messages when configurations in the candidate databases are identical with those in
the running databases.

Table 1-1 Advantages and disadvantages of each mode


Mode Advantage Disadvantage

Immediate mode The system can immediately Configuration errors impact


detect the configuration services immediately
impact on services. because configurations take
effect immediately. Besides,
you cannot delete
configurations from the
services as a whole but have
to delete commands one by
one.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 3


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Mode Advantage Disadvantage

Two-stage mode l Allows several service Configurations take effect


configurations to take only after the commit
effect as a whole. command is run.
l Allows users to preview
configurations in the
candidate database.
l Clears a configuration
that does not take effect
if an error occurs or the
configuration does not
meet the expectation.
l Minimizes the impact of
configuration process on
current services.

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:
l Query commands (such as display interface) are run.
l Maintenance commands (such as slave switchover, dual-active restore,
stack upgrade fast rollback-timer, stack upgrade fast stack member, switch mode,
and reset keepalive packets count) are run.
l 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.
l The existing configurations on a device are reconfigured.

Immediate Mode
Run: system-view immediately, Enable the immediate mode.
In the immediate mode, the command prompt is as follows:
<HUAWEI> system-view immediately
Enter system view, return user view with return command.
[HUAWEI]

Two-Stage Mode
1. Run: system-view, enable the two-stage mode.
2. (Optional) Run: display configuration candidate [ merge ], display all uncommitted
configurations.
If you specify the merge keyword, the command displays uncommitted configurations
and committed configurations. If you do not specify the merge keyword, the command
displays uncommitted configurations.
You can edit the uncommitted configurations.
3. (Optional) Run: clear configuration candidate, delete all the uncommitted
configurations.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 4


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

If you do not need to execute the uncommitted configurations in the current


configuration process, you can delete them.
4. (Optional) Run: commit trial [ time ], enable trial running of a system configuration.
This configuration enables the trial running of new functions and services without
interrupting the services running on the live network, which improves network
reliability.
To disable the trial running of the configuration before the trial running times out, run the
abort trial command to roll the system configuration back to the configuration state
before the trial running. To view the trial running status of a system configuration, run
the display configuration trial status command.
5. Run: commit, commit configurations.
In the two-stage mode, if the user has modified configurations but has not submit the
modification, the system prompt ~ is changed to *, prompting the user that the configurations
are not submitted. After the user runs the commit command to submit the configurations, the
system prompt * is restored to ~.
The following is an example:
<HUAWEI> system-view
Enter system view, return user view with return command.
[~HUAWEI] sysname HUAWEIA
[*HUAWEI] commit
[~HUAWEIA]

The symbol * has two meanings:


1. When * is displayed in an interactive operation, it indicates the configurations that have
not been submitted.
2. After the display current-configuration inactive or display current-configuration all
command is executed, * in the command output indicates offline configuration.

NOTE

l In both the immediate mode and two-stage mode, the system can lock the configuration of a service
as soon as the service process is initiated, to prevent a service from being affected. When the
configuration is locked, users can query configurations but cannot edit or commit configurations. If
configurations fail to be committed, waiting for 30 seconds and committing configurations again are
recommended. If configurations fail to be committed again, it indicates that the configuration is
locked by a user.
l You can run the configuration exclusive command to lock a configuration. If a configuration is
locked by another user, ask the user to unlock it.
l In two-phase configuration mode, when you perform the same configurations for multiple users,
only the configuration committed first takes effect. For other users, the system prompts a
configuration conflict.

1.1.3 Setting Command Levels


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.

Context
l The system grants users different access permissions based on their roles. User levels are
classified into sixteen levels, which correspond to the command levels. Users can use

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 5


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

only the commands at the same or lower level than their own levels. By default, there are
four command levels 0 to 3 and sixteen user levels 0 to 15. Table 1-2 describes the
relationship between command levels and user levels.

Table 1-2 Relationship between command levels and user levels


User Com Name Description
Leve man
l d
Leve
l

0 0 Visit level Commands of this level include network diagnosis tool


commands (such as ping and tracert), commands for
accessing external devices from the local device (such
as Telnet) and some display commands.

1 0, 1 Monitoring Commands of this level are used for system


level maintenance, including display commands.
NOTE
Some display commands are not at this level. For example,
the display current-configuration and display saved-
configuration commands are at level 3. For details about
command levels, see the CloudEngine 12800 Series Switches
Command Reference.

2 0, 1, Configurati Commands of this level are used for service


2 on level configuration to provide direct network services,
including routing commands and commands of each
network layer.

3 to 0, 1, Manageme Commands of this level are used for basic system


15 2, 3 nt level operations, including file system, FTP, TFTP
download, user management, command level
configuration, and debugging.

l If refined right management is required, run the command-privilege level rearrange


command to extend command levels.

NOTICE
Changing the default command level without the guidance of technical personnel is not
recommended. This may result in inconvenience for operation and maintenance and bring
about security problems.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 6


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Step 2 Run:
command-privilege level level view view-name command-key

The command level is set in the specified view.

Step 3 (Optional) Run:


command-privilege level rearrange

The command levels are extended in a batch.

You can use the command only when your user level is 15.

If the level of a command has been changed using the command-privilege level command,
the level of this command remains unchanged after you run the command-privilege level
rearrange command. Levels of the other commands are changed as follows:

l The visit level and monitoring level are retained.


l The configuration level is upgraded to level 10, and the management level is upgraded to
level 15.

The original command levels 0, 1, 2, and 3 are updated to 0, 1, 10, and 15 respectively. There
are no commands at levels 2 to 9 and levels 11 to 14. You can set commands to any of these
levels to manage user rights.

Step 4 Run:
commit

The configuration is committed.

----End

1.1.4 Editing Command Lines

Editing Feature
You can edit commands in a CLI that supports multi-line edition. Each command can contain
a maximum of 1022 characters. The keywords in the commands are case insensitive. Whether
a command parameter is case sensitive or not depends on what the parameter is.

Table 1-3 lists keys that are frequently used for command editing.

Table 1-3 Keys for command editing


Key Function

Common key Inserts a character at the current location of the cursor if the
editing buffer is not full, and the cursor moves to the right.
Otherwise, an alarm is generated.

Backspace Deletes the character on the left of the cursor and the cursor
moves to the left. When the cursor reaches the head of the
command, an alarm is generated.

Left cursor key ← or Ctrl Moves the cursor to the left by the space of a character. When
+B the cursor reaches the head of the command, an alarm is
generated.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 7


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Key Function

Right cursor key → or Moves the cursor to the right by the space of a character. When
Ctrl+F the cursor reaches the end of the command, an alarm is
generated.

Operating Techniques
Incomplete Keyword
You can enter incomplete keywords on the device. In the current view, you do not need to
enter complete keywords if the entered characters can match a unique keyword. This function
improves operating efficiency.
For example, to execute the display current-configuration command, you can enter d cu, di
cu, or dis cu, but you cannot enter d c or dis c because they do not match unique keywords.

NOTICE
The maximum length of a command (including the incomplete command) to be entered is
1022 characters. If a command in incomplete form is configured, the system saves the
command to the configuration file in its complete form, which may cause the command to
have more than 1022 characters. In this case, the command in incomplete form cannot be
restored after the system restarts. Therefore, when you configure a command in incomplete
form, pay attention to the length of the command.

Tab
Enter an incomplete keyword and press Tab to complete the keyword.
l When a unique keyword matches the input, the system replaces the incomplete input
with the unique keyword and displays it in a new line with the cursor leaving a space
behind. For example:
a. Enter an incomplete keyword.
[~HUAWEI] info-

b. Press Tab.
The system replaces the entered keyword and displays it in a new line with the
complete keyword followed by a space.
[~HUAWEI] info-center

l When the input has multiple matches, press Tab repeatedly to display the keywords
beginning with the incomplete input in a circle until the desired keyword is displayed. In
this case, the cursor closely follows the end of the keyword. For example:
a. Enter an incomplete keyword.
[~HUAWEI] info-center log

b. Press Tab.
The system displays the prefixes of all the matched keywords. In this example, the
prefix is log.
[~HUAWEI] info-center log-severity

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 8


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Press Tab to switch from one matched keyword to another. In this case, the cursor
closely follows the end of a word.
[~HUAWEI] info-center logbuffer
[~HUAWEI] info-center logfile
[~HUAWEI] info-center loghost

Stop pressing Tab when the desired keyword is displayed.


l When an incorrect keyword is entered, press Tab and it is displayed in a new line without
being changed. For example:
a. Enter an incorrect keyword.
[~HUAWEI] info-center loglog

b. Press Tab.
[~HUAWEI] info-center loglog

The system displays information in a new line, but the keyword loglog remains
unchanged and there is no space between the cursor and the keyword, indicating
that this keyword does not exist.

1.1.5 Using Command Line Online Help


When using a command line, you can use the online help to obtain real-time help without
memorizing a large number of complex commands.
When entering command lines, you can enter a question mark (?) at any time to obtain online
help. You can choose to obtain full help or partial help.

Full Help
When entering a command, you can use the full help function to obtain keywords and
parameters for the command. Use any of the following methods to obtain full help from a
command line.
l Enter a question mark (?) in any command view to obtain all the commands and their
simple descriptions. For example:
<HUAWEI> ?
Current view commands:
activate Activate locked user
backup Backup information
capture-packet Enable capturing packet
cd Change current directory
check Check Version
clear Clear operation
clock Clock status and configuration information
copy Copy from one file to another
...

l Enter some keywords of a command and a question mark (?) separated by a space. All
keywords associated with this command, as well as simple descriptions, are displayed.
For example:
<HUAWEI> system-view
[~HUAWEI] user-interface vty 0 4
[~HUAWEI-ui-vty0-4] authentication-mode ?
aaa AAA authentication
password Authentication through the password of a user terminal interface
[~HUAWEI-ui-vty0-4] authentication-mode aaa ?
| Matching output
> Redirect the output to a file
>> Redirect the output to a file in append mode
<cr>

[~HUAWEI-ui-vty0-4] authentication-mode aaa

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 9


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

– "aaa" and "password" are keywords. "AAA authentication" and "Authentication


through the password of a user terminal interface" describe the keywords
respectively.
– "|" indicates that you can specify a method to display matching information. For
details, see 1.2.3 Filtering Command Outputs.
– ">" indicates that you can export the command output to a specified file. If the
destination file exists, overwrite the content in the previous file.
– ">>" indicates that you can add the command output to the end of a specified file
and reserve the content in the original file.
– <cr> indicates that there is no keyword or parameter in this position. You can press
Enter to run this command.
l Enter some keywords of a command and a question mark (?) separated by a space. All
parameters associated with this keyword, as well as simple descriptions, are listed. For
example:
<HUAWEI> system-view
[~HUAWEI] ftp server timeout ?
INTEGER<1-35791> The value of FTP timeout, the default value is 30 minutes
[~HUAWEI] ftp server timeout 35 ?
| Matching output
> Redirect the output to a file
>> Redirect the output to a file in append mode
<cr>

[~HUAWEI] ftp server timeout 35


"INTEGER<1-35791>" describes the value range of the parameter. "The value of FTP
timeout, the default value is 30 minutes" briefly describes the function of this parameter.

Partial Help
If you enter only the first or first several characters of a command keyword, partial help
provides keywords that begin with this character or character string. Use any of the following
methods to obtain partial help from a command line.
l Enter a character string followed directly by a question mark (?) to display all keywords
that begin with this character string. For example:
<HUAWEI> d?
debugging delete
dir display
<HUAWEI> d

l Enter a command and a string followed directly by a question mark (?) to display all the
keywords that begin with this string. For example:
<HUAWEI> display b?
bfd bgp

l Enter the first several letters of a keyword in a command and press Tab to display a
complete keyword. The first several letters, however, must uniquely identify the
keyword. If they do not identify a specific keyword, press Tab continuously to display
different keywords and you can select one as required.

NOTE

The command output obtained through the online help function is used for reference only.

1.1.6 Interpreting Command Line Error Messages


If a command is entered and passes syntax check, the system executes it. Otherwise, the
system reports an error message.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 10


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Table 1-4 lists the common error messages.

Table 1-4 Common error messages of the command line

Error Message Cause of the Error

Error: Unrecognized command found No command is found.


at '^' position.
No keyword is found.

Error: Wrong parameter found at '^' The parameter type is incorrect.


position.
The parameter value exceeds the limit.

Error: Incomplete command found at The entered command is incomplete.


'^' position.

Error: Too many parameters found at Too many parameters are entered.
'^' position.

Error: Ambiguous command found at Indefinite command is entered.


'^' position.

1.1.7 Using the undo Command Line


If a command line begins with the keyword undo, it is an undo command line. The undo
command lines restore default settings of parameters, disable functions, or delete
configurations. Almost each configuration command line has a corresponding undo
command.

Some examples of using the undo command are listed as follows:

l The undo command restores the default setting.


The sysname command sets a device host name. For example:
<HUAWEI> system-view
[~HUAWEI] sysname Server
[*HUAWEI] commit
[~Server] undo sysname
[*Server] commit
[~HUAWEI]

l The undo command disables a specified function.


The ftp server enable command enables the FTP server function on the device. For
example:
<HUAWEI> system-view
[~HUAWEI] ftp server enable
Warning: FTP is not a secure protocol, and it is recommended to use SFTP.
[*HUAWEI] commit
[~HUAWEI] undo ftp server
Info: Succeeded in closing the FTP server.
[*HUAWEI] commit

l The undo command deletes a specified configuration.


The header command configures the header information displayed on terminals when
users log in. For example:

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 11


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

<HUAWEI> system-view
[~HUAWEI] header login information "Hello,Welcome to Huawei!"
[*HUAWEI] commit

Log out of the terminal and re-log in. A message "Hello, Welcome to Huawei!" is
displayed before authentication. Run the undo header login command.
Hello,Welcome to Huawei!
Password:
Info: The max number of VTY users is 21, and the number of current VTY users
on
line is 2.
The current login time is 2012-06-06 16:31:24.
<HUAWEI> system-view
[~HUAWEI] undo header login
[*HUAWEI] commit

Log out of the terminal and re-log in. No message is displayed before authentication.
Password:
Info: The max number of VTY users is 21, and the number of current VTY users
on
line is 2.
The current login time is 2012-06-06 16:45:06.
<HUAWEI>

NOTE

The command output provided here is used for reference only. The actual output information may differ
from the preceding information.

1.1.8 Displaying History Commands


The device automatically stores history commands entered by a user. To enter a command that
has been executed, you can use this function to call up the history command.

By default, the system saves 10 history commands for each user. Run the history-command
max-size size-value command to reset the number of history commands that can be saved in a
specified user interface view. The maximum number is 256.

NOTE

If the value specified in the history-command max-size size-value command is large, it may take a long
time to obtain a required history command. Therefore, a large value is not recommended.

Table 1-5 shows operations on history commands.

Table 1-5 Accessing history commands

Action Command or Key Result

Display history display history-command [ all- l The history commands


commands. users ] entered by the current
users are displayed when
all-users is not selected.
l The history commands
entered by all users are
displayed when all-users
is selected. (all-users
can be selected only by
users of level 3 or
higher.)

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 12


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Action Command or Key Result

Display the earlier Up arrow key ↑ or Ctrl+P An earlier history command


history command. is displayed. If the current
command is the first
command, an alarm is
generated when you attempt
to display the earlier history
command.

Display the later Down arrow key ↓ or Ctrl+N A later history command is
history command. displayed. If the current
command is the latest
command, no output is
displayed and an alarm is
generated when you attempt
to display the later history
command.

NOTE

You cannot access history commands using the Up arrow key ↑ in HyperTerminal Windows 9X. The
Up arrow key ↑ has a different function in HyperTerminal Windows 9X and needs to be replaced by the
shortcut key Ctrl+P.

When using history commands, note the following:

l The saved history commands are the same as those entered by users. For example, if the
user enters an incomplete command, the saved command also is incomplete.
l If the user runs the same command several times, only the latest command is saved. If
the command is entered in different forms, they are considered as different commands.
For example, if the display current-configuration command is run several times, only
one history command is saved. If the display current-configuration command and the
dis curr command are used, both of them are saved.
l History commands entered by the current user can be deleted using the reset history-
command command in the user view, history commands entered by all users can be
deleted using the reset history-command all-users command in the user view. The
deleted history commands cannot be displayed.

1.1.9 Using Command Line Shortcut Keys


You can use shortcut keys provided by the device to quickly enter commands.

There are two types of shortcut keys:


l User-defined shortcut keys: include Ctrl+G, Ctrl+L, Ctrl+O, and Ctrl+U. You can
associate these shortcut keys with any commands. When a shortcut key is pressed, the
system runs the corresponding command.
l System-defined shortcut keys: shortcut keys defined in the system that have fixed
functions. Users cannot define these shortcut keys. Table 1-6 lists the frequently used
system-defined shortcut keys.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 13


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

NOTE

The terminal in use may affect the functions of the shortcut keys. For example, if the shortcut keys
defined by the terminal conflict with those defined in the system, the shortcut keys entered by the user
are captured by the terminal program and the commands corresponding to the shortcut keys are not
executed.

User-defined Shortcut Keys


When a user frequently uses a command or some commands, the user can use shortcut keys to
define these commands. Only management-level users have the rights to define shortcut keys.
The configurations are as follows:
1. Run the system-view command to enter the system view.
2. Run the hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_U } command-text
command to configure a shortcut key corresponding to a command.
3. Run the commit command to commit the configuration.

The system supports four user-defined shortcut keys and the default values are as follows:
l Ctrl+G: display current-configuration
l Ctrl+L: display ip routing-table
l Ctrl+O: undo debugging all
l Ctrl+U: Null

NOTE

l When defining shortcut keys, use double quotation marks to define the command if this command
contains several keywords separated by spaces. For example, hotkey ctrl_l "display tcp status".
Do not use double quotation marks to define a command if the command contains only one
keyword.
l Run the display hotkey command to view the status of the defined, undefined, and system-defined
shortcut keys.
l Run the undo hotkey command to restore default values of the configured shortcut keys.
l Shortcut keys are executed in the same way as commands. The system can record commands in their
original formats in the command buffer and logs to help query and locate the fault.
l The user-defined shortcut keys are available to all users. If a user does not have the rights to use the
command defined by a shortcut key, the system displays an error message when this shortcut key is
executed.

System-defined Shortcut Keys

Table 1-6 System-defined shortcut keys


Key Function

Ctrl+A Moves the cursor to the beginning of the


current line.

Ctrl+B Moves the cursor back one character.

Ctrl+C Stops performing current functions.

Ctrl+D Deletes the character where the cursor is


located at.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 14


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Key Function

Ctrl+E Moves the cursor to the end of the current line.

Ctrl+F Moves the cursor forward one character.

Ctrl+H Deletes the character on the left side of the


cursor.

Ctrl+K Stops outgoing connections in the call


establishment stage.

Ctrl+N Displays the next command in the history


command buffer.

Ctrl+P Displays the previous command in the history


command buffer.

Ctrl+R Redisplays information about the current line.

Ctrl+T Stops outgoing connections.

Ctrl+V Pastes the text of the clipboard.

Ctrl+W Deletes a character string on the left side of the


cursor.

Ctrl+X Deletes all the characters on the left side of the


cursor.

Ctrl+Y Deletes all the characters on the right side of the


cursor and the character where the cursor is
located at.

Ctrl+Z Returns to the user view.

Ctrl+] Stops incoming connections or redirects the


connections.

Esc+B Moves the cursor back one word.

Esc+D Deletes one word on the right side of the cursor.

Esc+F Moves the cursor forward one word.

Esc+N Moves the cursor downward a line.

Esc+P Moves the cursor upward a line.

Esc+< Locates the cursor at the start of text in the


clipboard.

Esc+> Locates the cursor at the end of text in the


clipboard.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 15


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

1.2 Displaying the Command Output


This section describes how to query the configuration information about command lines,
control the method in which command outputs are displayed, and filter the command outputs.

1.2.1 Displaying Command Line Configurations


After the configurations are complete, you can run the display command to check the
configuration and running information on the device.
For example, after all configurations of the FTP service are complete, you can run the display
ftp server command to check parameters of the FTP server. For details on the usage and
functions of the display command, see Checking the Configuration in each feature of the
Configuration Guide.
You can also check the current running configurations and configurations in the current view.
l Check the current running configurations:
display current-configuration
This command does not display parameters that use default settings.
l Check configurations in the current view:
display this
This command does not display parameters that use default settings.

NOTE

l You can run the timestamp enable command to enable the timestamp function in the system so that
the system adds the query time to the output of the display command.
l If the value of a field in the command output is too long, only some beginning characters of the
value are displayed.

1.2.2 Controlling the Display Mode of Commands


When running commands, you can specify the display mode.
l When the display output is more than one page, you can use Pg Up and Pg Dn to display
information on the previous page and the next page.
l When the information cannot be completely displayed on one screen, the system will
pause and you can view the information. You can use the function keys listed in Table
1-7 to control the display mode of command lines.
NOTE
The screen-length screen-length temporary command sets the lines to be displayed temporarily
on the terminal screen. If screen-length is 0, the split screen function is disabled. Therefore, the
system will not pause when the information cannot be completely displayed on one screen.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 16


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Table 1-7 Display mode of commands


Key Function

Ctrl+C or Ctrl+Z Stops displaying information and running


commands.
NOTE
You can also press any key (the number key or letter
key) except space and Enter.

Space Continues to display the next screen of


information.

Enter Continues to display the next line of


information.

1.2.3 Filtering Command Outputs


Filtering command outputs help you quickly find the information you need. For example, you
can use a regular expression (specifying the rule to filter information) in a display command
filter the output information.

Display Feature
When the information cannot be completely displayed on one screen, you can adopt the pause
function. You have three choices, as described in Table 1-8.

Table 1-8 Display functions


Key Function

Plus sign (+)+regular-expression Functions the same as | include regular-


expression.

Minus sign (-)+regular-expression Functions the same as | exclude regular-


expression.

Slash (/)+regular-expression Functions the same as | begin regular-


expression.

Regular Expressions
A regular expression is a mode matching tool. It consists of common characters (such as
letters from a to z) and special characters (called meta-characters). The regular expression is a
template according to which you can search for the required string.
A regular expression provides the following functions:
l Searches for and obtains a sub-string that matches a rule in the string.
l Substitutes a string based on a certain matching rule.
The regular expression consists of common characters and special characters.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 17


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

l Common characters
Common characters are used to match themselves in a string, including all upper-case
and lower-case letters, digits, punctuations, and special symbols. For example, a matches
the letter "a" in "abc", 10 matches the digit "10" in "10.113.25.155", and @ matches the
symbol "@" in "[email protected]".
l Special characters
Special characters are used together with common characters to match the complex or
special string combination. Table 1-9 describes special characters and their syntax.

Table 1-9 Description of special characters

Special Function Example


Characte
rs

\ Defines an escape character, which \* matches "*".


is used to mark the next character
(common or special) as the
common character.

^ Matches the starting position of the ^10 matches "10.10.10.1" instead


string. of "20.10.10.1".

$ Matches the ending position of the 1$ matches "10.10.10.1" instead of


string. "10.10.10.2".

* Matches the preceding element 10* matches "1", "10", "100",


zero or more times. "1000", and so on.
(10)* matches "null", "10", "1010",
"101010", and so on.

+ Matches the preceding element one 10+ matches "10", "100", "1000",
or more times. and so on.
(10)+ matches "10", "1010",
"101010", and so on.

. Matches any single character. 0.0 matches "0x0", "020", and so


on.
.oo. matches "book", "look", "tool",
and so on.

() Defines a subexpression, which can 100(200)+ matches "100200",


be null. Both the expression and "100200200", and so on.
the subexpression should be
matched.

x|y Matches x or y. 100|200 matches "100" or "200".


1(2|3)4 matches "124" or "134",
instead of "1234", "14", "1224",
and "1334".

[xyz] Matches any single character in the [123] matches the character 2 in
regular expression. "255".

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 18


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Special Function Example


Characte
rs

[^xyz] Matches any character that is not in [^123] matches any character
the regular expression. except for "1", "2", and "3".

[a-z] Matches any character within the [0-9] matches any character
specified range. ranging from 0 to 9.

[^a-z] Matches any character beyond the [^0-9] matches all non-numeric
specified range. characters.

_ Matches a comma ",", left brace _2008_ matches "2008", "space


"{", right brace "}", left parenthesis 2008 space", "space 2008", "2008
"(", and right parenthesis ")". space", ",2008,", "{2008}",
Matches the starting position of the "(2008)", "{2008)", and "(2008}".
input string.
Matches the ending position of the
input string.
Matches a space.

NOTE

Unless otherwise specified, all the characters in the preceding table must be printable characters.
l Degeneration of special characters
Certain special characters, when placed at certain positions in a regular expression,
degenerate to common characters.
– The special characters following "\" match special characters themselves.
– The special characters "*", and "+" are placed at the starting position of the regular
expression. For example, +45 matches "+45" and abc(*def) matches "abc*def".
– The special character "^" is placed at any position except for the start of the regular
expression. For example, abc^ matches "abc^".
– The special character "$" is placed at any position except for the end of the regular
expression. For example, 12$2 matches "12$2".
– A right parenthesis ")" or right bracket "]" is not paired with a corresponding left
parenthesis "(" or bracket "[". For example, abc) matches "abc)" and 0-9] matches
"0-9]".
NOTE

Unless otherwise specified, degeneration rules also apply when the preceding regular expressions
are subexpressions within parentheses.
l Combination of common and special characters
In actual usage, regular expressions combine multiple common and special characters to
match certain strings.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 19


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Specifying a Filtering Mode in a Command


NOTE

When filtering conditions are set to query output information, the first line of the command output starts
with the entire regular expression but not the string to be filtered.

The system allows you to use | count to display the number of lines, | section to display the
command output by section after using filtering mode, | ignore-case to match a string of case-
insensitive characters, and | no-more to display filtered output information on only one
screen. | count, | section, | ignore-case, and | no-more can work together with the following
filtering modes.
Three filtering modes are provided for commands that support regular expressions.
l | begin regular-expression: displays all the lines beginning with the line that matches the
regular expression.
Filter the character strings to be entered until the specified case-sensitive character string
is displayed. All the character strings following this specified character string are
displayed on the screen.
l | exclude regular-expression: displays all the lines that do not match the regular
expression.
If the character strings to be entered do not contain the specified case-sensitive character
string, they are displayed on the screen. Otherwise, they are filtered.
l | include regular-expression: displays all the lines that match the regular expression.
If the character strings to be entered contain the specified case-sensitive character string,
they are displayed on the screen. Otherwise, they are filtered.
NOTE

The value of regular-expression is a string of 1 to 255 characters.


The command output can be filtered by multiple regular expressions. The regular expressions take effect
in configuration sequence. A maximum of 32 regular expressions can be configured to filter the
command output.
The | section parameter only applies to commands whose output information contains section
information, such as the display current-configuration and display this commands.

The following examples describe how to specify a filter mode in a command.


Example 1: Run the display interface brief command to display all the lines that do not
match the regular expression 10GE|40GE. 10GE|40GE matches 10GE or 40GE.
<HUAWEI> display interface brief | exclude 10GE|40GE
PHY: Physical
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
(b): BFD down
(e): EFM down
(d): Dampening Suppressed
(p): port alarm down
(dl): DLDP down
InUti/OutUti: input utility rate/output utility rate
Interface PHY Protocol InUti OutUti inErrors outErrors
Eth-Trunk2 down down 0% 0% 0 0
Eth-Trunk27 up up 0.01% 0.01% 0 0
MEth0/0/0 up up 0.01% 0.01% 0 0
NULL0 up up(s) 0% 0% 0 0
Vlanif2 down down -- -- 0 0
Vlanif10 down down -- -- 0 0

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 20


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Vlanif20 down down -- -- 0 0


Vlanif200 up up -- -- 0 0

Example 2: Run the display current-configuration command to display all the lines that
match the regular expression vlan.
<HUAWEI> display current-configuration | include vlan
vlan batch 2 9 to 20 77 99 200 222 4091
vlan 19
mux-vlan
vlan 222
aggregate-vlan
access-vlan 1
instance 2 vlan 2
carrier-vlan 100
ce-vlan 10
port trunk allow-pass vlan 99 200
igmp-snooping static-router-port vlan 99
port trunk allow-pass vlan 20
port default vlan 77
port trunk allow-pass vlan 20

Example 3: Run the display current-configuration command to display the number of lines
that match the regular expression vlan.
<HUAWEI> display current-configuration | include vlan | count
Total lines: 14.

NOTE

The preceding information is used for reference only.

The device can redirect the output of a display command to a specified file in either of the
following modes:
l > filename
The output is redirected to a specified file. If the file already exists, the content of the file
is overwritten.
l >> filename
The output is appended to a specified file, with the original content of the file remaining
unchanged.

1.3 Configuration Examples


This section provides several examples that illustrate the use of command lines.

1.3.1 Example for Configuring User Services in Immediate Mode


Networking Requirements
As shown in Figure 1-1, the user has logged in to the device.
The user may forget to submit the configurations; therefore, the user requires that the
configuration be automatically submitted and take effect.

Figure 1-1 Networking diagram for configuring user services in immediate mode
Switch User
IP
Network

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 21


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Configuration Roadmap
The configuration roadmap is as follows:
1. Choose the immediate mode so that the device automatically submits the configuration
and the configuration immediately takes effect.
2. Perform and verify the configuration.

Procedure
Step 1 Choose the immediate mode.
<HUAWEI> system-view immediately

Step 2 Set the IP address for the device interface to 10.10.10.1.


[HUAWEI] vlan 10
[HUAWEI-vlan10] quit
[HUAWEI] interface 10ge 1/0/1
[HUAWEI-10GE1/0/1] port link-type trunk
[HUAWEI-10GE1/0/1] port trunk allow-pass vlan 10
[HUAWEI-10GE1/0/1] quit
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] ip address 10.10.10.1 255.255.0.0

Step 3 Verify the configuration.


# Run the display this command in the current view. The command output shows that the
configuration takes effect immediately.
[HUAWEI-Vlanif10] display this
#
interface Vlanif10
ip address 10.10.10.1 255.255.0.0
#
return

----End

Configuration Files
#
interface Vlanif10
ip address 10.10.10.1 255.255.0.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return

1.3.2 Example for Multiple Users to Configure a Same Service in


Two-Stage Mode

Networking Requirements
As shown in Figure 1-2, user A and user B log in to the device at the same time. After user A
configures a service on the device, user B performs the same configuration for the service on
the device.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 22


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Figure 1-2 Networking diagram for multiple users to configure a same service in two-stage
mode
UserA

Switch
IP
Network UserB

When user B submits a configuration that is the same as the configuration submitted by user
A, the system will notify user B that the configuration conflicts with an existing
configuration.

Configuration Roadmap
The configuration roadmap is as follows:
1. User A and user B configure the same service successively.
2. User A submits the configuration.
3. User B submits the configuration.

Procedure
Step 1 User A and user B configure the same service successively.
l User A configures the IP address of VLANIF 10 to be 10.10.10.1.
<HUAWEI> system-view
[~HUAWEI] vlan 10
[*HUAWEI-vlan10] quit
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] port trunk allow-pass vlan 10
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] interface vlanif 10
[*HUAWEI-Vlanif10] ip address 10.10.10.1 255.255.0.0

l User B configures the IP address of VLANIF 10 to be 10.10.10.1.


<HUAWEI> system-view
[~HUAWEI] vlan 10
[*HUAWEI-vlan10] quit
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] port trunk allow-pass vlan 10
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] interface vlanif 10
[*HUAWEI-Vlanif10] ip address 10.10.10.1 255.255.0.0

Step 2 User A submits the configuration.


[*HUAWEI-Vlanif10] commit

Step 3 User B submits the configuration.


[*HUAWEI-Vlanif10] commit
ip address 10.10.10.1 255.255.0.0
Error: The address already exists.
Commit canceled, the configuration conflicted with other user, you can modify th
e configuration and commit again.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 23


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

The system prompts user B that the configuration of user B conflicts with that of user A.

----End

Configuration Files
#
interface Vlanif10
ip address 10.10.10.1 255.255.0.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return

1.3.3 Example for Multiple Users to Perform Different


Configurations for a Same Service in Two-Stage Mode

Networking Requirements
As shown in Figure 1-3, user A and user B log in to the device at the same time. After user A
configures a service on the device, user B performs a different configuration for the service on
the device. For example, two users configure different IP addresses on the same interface.

Figure 1-3 Networking diagram for multiple users to perform different configurations for a
same service in two-stage mode
UserA

Switch
IP
Network UserB

When user B submits the configuration, the configuration will overwrite the configuration
submitted by user A.

Configuration Roadmap
The configuration roadmap is as follows:
1. User A and user B perform different configurations for a same service.
2. User A submits the configuration.
3. User B submits the configuration.

Procedure
Step 1 User A and user B perform different configurations for a same service.
l User A configures the IP address of VLANIF 10 to be 10.10.10.1.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 24


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

<HUAWEI> system-view
[~HUAWEI] vlan 10
[*HUAWEI-vlan10] quit
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] port trunk allow-pass vlan 10
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] interface vlanif 10
[*HUAWEI-Vlanif10] ip address 10.10.10.1 255.255.0.0

l User B configures the IP address of VLANIF 10 to be 10.10.10.100.


<HUAWEI> system-view
[~HUAWEI] vlan 10
[*HUAWEI-vlan10] quit
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] port trunk allow-pass vlan 10
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] interface vlanif 10
[*HUAWEI-Vlanif10] ip address 10.10.10.100 255.255.0.0

Step 2 User A submits the configuration.


[*HUAWEI-Vlanif10] commit

Step 3 User B submits the configuration.


[*HUAWEI-Vlanif10] commit

Step 4 Verify the configuration.

# Run the display this command in the current view. The command output shows that the
configuration of user B overwrites the configuration submitted by user A.
[~HUAWEI-Vlanif10] display this
#
interface Vlanif10
ip address 10.10.10.100 255.255.0.0
#
return

----End

Configuration Files
#
interface Vlanif10
ip address 10.10.10.100 255.255.0.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return

1.3.4 Example for Multiple Users to Configure Different Services


in Two-Stage Mode

Networking Requirements
As shown in Figure 1-4, user A and user B log in to the device at the same time. After user A
configures a service on the device, user B configures another service on the device.

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 25


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

Figure 1-4 Networking diagram for multiple users to configure different services in two-stage
mode
UserA

Switch
IP
Network UserB

If user A and user B submit two configurations of different services, both configurations take
effect.

Configuration Roadmap
The configuration roadmap is as follows:
1. User A and user B configure different services on the device.
2. User A submits the configuration.
3. User B submits the configuration.

Procedure
Step 1 User A and user B configure different services on the device.
l User A configures the IP address of VLANIF 10 to be 10.10.10.1.
<HUAWEI> system-view
[~HUAWEI] vlan 10
[*HUAWEI-vlan10] quit
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] port trunk allow-pass vlan 10
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] interface vlanif 10
[*HUAWEI-Vlanif10] ip address 10.10.10.1 255.255.0.0

l User B enables the FTP service.


<HUAWEI> system-view
[*HUAWEI] ftp server enable

Step 2 User A submits the configuration.


[*HUAWEI-Vlanif10] commit

Step 3 User B submits the configuration.


[*HUAWEI] commit

Step 4 Verify the configuration.


# Run the display current-configuration command to display the current configuration. You
can see from the command output that configurations made by user A and user B both take
effect.
<HUAWEI> display current-configuration
#
FTP server enable
...

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 26


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

#
interface Vlanif10
ip address 10.10.10.1 255.255.0.0
...
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
...
#
return

----End

Configuration Files
#
FTP server enable
#
interface Vlanif10
ip address 10.10.10.1 255.255.0.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return

1.3.5 Example for Using Tab


Networking Requirements
The user wants to enter commands in fast and convenient mode to facilitate completion of
service configurations. The device supports the function that the user enters the first character
or first several characters of the keyword and presses Tab to complete the keyword, which
improves input efficiency.

Configuration Roadmap
The configuration roadmap is as follows:
1. If there is only one match for the incomplete keyword, enter the incomplete keyword and
press Tab.
2. If there are several matches for the keyword, enter the incomplete keyword and press
Tab repeatedly until the desired keyword is displayed.
3. Enter the incorrect keyword and press Tab. In this case, the incorrect keyword remains
unchanged.
Use Tab if:
There Is Only One Match for an Incomplete Keyword
1. Enter an incomplete keyword.
[*HUAWEI] info-

2. Press Tab.
The system replaces the entered keyword and displays it in a new line with the complete
keyword followed by a space.
[*HUAWEI] info-center

There Are Several Matches for an Incomplete Keyword

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 27


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

# The keyword info-center can be followed by the following keywords. (The command
output provided here is used for reference only. The actual output information may differ from
the following information.)
[*HUAWEI] info-center ?
channel Set the name of information channel
console Setting of console configuration
enable Enable the information center
filter-id Specify the configuration of the ID filtering table
log-severity Set log severity
logbuffer Setting of log buffer configuration
logfile Setting of logfile configuration
loghost Setting of logging host configuration
max-logfile-number Setting of logfile numbers
monitor Setting of monitor configuration
snmp Setting of snmp configuration
source Information source setting
statistic-suppress Suppression that the first occurrence of an event is
always logged immediately, but subsequence identical
messages are suppressed
timestamp Set the time stamp type of information
trapbuffer Setting of trap buffer configuration

1. Enter an incomplete keyword.


[*HUAWEI] info-center log

2. Press Tab.
The system displays the prefixes of all the matched keywords. In this example, the prefix
is log.
[*HUAWEI] info-center log-severity
Press Tab to switch from one matched keyword to another. In this case, the cursor
closely follows the end of a word.
[*HUAWEI] info-center logbuffer
[*HUAWEI] info-center logfile
[*HUAWEI] info-center loghost

Stop pressing Tab when the desired keyword is displayed.

An Incorrect keyword Is Entered

1. Enter an incorrect keyword.


[*HUAWEI] info-center loglog

2. Press Tab.
[*HUAWEI] info-center loglog

The system displays information in a new line, but the keyword loglog remains
unchanged and there is no space between the cursor and the keyword, indicating that this
keyword does not exist.

1.3.6 Example for Defining Shortcut Keys

Networking Requirements
The user always uses a command to configure services and query information on any device
in a network. The frequent command input brings a low efficiency; therefore, the user
requires fast command input and execution.

Configuration Roadmap
The configuration roadmap is as follows:

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 28


Copyright © Huawei Technologies Co., Ltd.
CloudEngine 12800 Series Switches
Command Reference 1 CLI Overview

1. Define shortcut keys to improve the command input efficiency. For example, define the
shortcut key Ctrl+U and associate it with the display ip routing-table command. To
view information in the routing table, press the shortcut key Ctrl+U.
2. Enter Ctrl+U at the prompt [*HUAWEI] to run the defined command and view the
execution result.

Procedure
Step 1 Define the shortcut key Ctrl+U, associate it with the display ip routing-table command, and
run the command.
<HUAWEI> system-view
[*HUAWEI] hotkey ctrl_u "display ip routing-table"
[*HUAWEI] commit

Step 2 Press Ctrl+U at the prompt of [*HUAWEI] to run the display ip routing-table command.
[*HUAWEI] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : _public_
Destinations : 22 Routes : 22

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0


1.1.1.9/32 Direct 0 0 D 127.0.0.1 LoopBack1
3.3.3.3/32 OSPF 10 1 D 111.11.11.2 Vlanif111
3.3.3.9/32 OSPF 10 1 D 111.11.11.2 Vlanif111
10.0.0.0/8 Static 60 0 RD 192.168.1.3 MEth0/0/0
23.23.23.23/32 Direct 0 0 D 127.0.0.1 LoopBack23
111.11.11.0/24 Direct 0 0 D 111.11.11.1 Vlanif111
111.11.11.1/32 Direct 0 0 D 127.0.0.1 Vlanif111
111.11.11.255/32 Direct 0 0 D 127.0.0.1 Vlanif111
123.123.123.0/24 Direct 0 0 D 123.123.123.1 Vlanif123
123.123.123.1/32 Direct 0 0 D 127.0.0.1 Vlanif123
123.123.123.255/32 Direct 0 0 D 127.0.0.1 Vlanif123
124.0.0.0/8 Static 60 0 RD 123.123.123.2 Vlanif123
124.124.124.0/24 Static 60 0 RD 123.123.123.2 Vlanif123
124.124.124.2/32 Static 60 0 RD 123.123.123.2 Vlanif123
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.182 MEth0/0/0
192.168.1.182/32 Direct 0 0 D 127.0.0.1 MEth0/0/0
192.168.1.255/32 Direct 0 0 D 127.0.0.1 MEth0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

----End

Issue 04 (2018-02-28) Huawei Proprietary and Confidential 29


Copyright © Huawei Technologies Co., Ltd.

You might also like