- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
01-CLI Commands | 110.03 KB |
The term "switch" or "device" in this chapter refers to the switching engine on a WX3000E wireless switch.
command-alias enable
Syntax
command-alias enable
undo command-alias enable
View
System view
Default level
2: System level
Parameters
None
Description
Use the command-alias enable command to enable the command alias function.
Use the undo command-alias enable command to disable the command alias function.
By default, the command alias function is disabled.
Examples
# Enable the command alias function.
<Sysname> system-view
[Sysname] command-alias enable
# Disable the command alias function.
<Sysname> system-view
[Sysname] undo command-alias enable
command-alias mapping
Syntax
command-alias mapping cmdkey alias
undo command-alias mapping cmdkey
View
System view
Default level
2: System level
Parameters
cmdkey: The complete form of the first keyword of a command.
alias: Specifies the command alias, which cannot be the same as the first keyword of an existing command.
Description
Use the command-alias mapping command to configure command aliases.
Use the undo command-alias mapping command to delete command aliases.
By default, a command has no alias.
Examples
# Configure command aliases by specifying show as the replacement of the display keyword.
<Sysname> system-view
[Sysname] command-alias mapping display show
After configuring the command aliases, the display commands have their aliases. For example, if the original command is display clock, now its alias is show clock and you can input the alias to view the system time and date.
# Delete the command aliases by canceling the replacement of the display keyword.
<Sysname> system-view
[Sysname] undo command-alias mapping display
command-privilege level
Syntax
command-privilege level level view view command
undo command-privilege view view command
View
System view
Default level
3: Manage level
Parameters
level level: Command level, which ranges from 0 to 3.
view view: Specifies a view.
command: Command to be set in the specified view.
Description
Use the command-privilege command to assign a level for the specified command in the specified view.
Use the undo command-privilege view command to restore the default.
By default, each command in a view has a specified level.
Command levels include four privileges: visit (0), monitor (1), system (2), and manage (3). You can assign a privilege level according to the user’s need. When logging in to the switch, the user can access the assigned level and all levels below it.
· Level changes can cause maintenance, operation, and security problem. H3C recommends that you use the default command level or that you modify the command level under the guidance of professional staff.
· The command specified in the command-privilege command must be complete, and has valid arguments. For example, the default level of the tftp server-address { get | put | sget } source-filename [ destination-filename ] [ source { interface interface-type interface-number | ip source-ip-address } ] command is 3. After the command-privilege level 0 view shell tftp 1.1.1.1 put a.cfg command is executed, when users with the user privilege level of 0 log in to the switch, they can execute the tftp server-address put source-filename command (such as the tftp 192.168.1.26 put syslog.txt command), but cannot execute the command with the get, sget or source keyword, and cannot specify the destination-filename argument.
· The command specified in the undo command-privilege view command can be incomplete. For example, after the undo command-privilege view system ftp command is executed, all commands starting with the keyword ftp (such as ftp server acl, ftp server enable, and ftp timeout) are restored to their default level. If you have modified the level of commands ftp server enable and ftp timeout, and you want to restore only the ftp server enable command to its default level, you should use the undo command-privilege view system ftp server command.
· If you modify the command level of a command in a specified view from the default command level to a lower level, remember to modify the command levels of the quit command and the corresponding command used to enter this view. For example, the default command level of commands interface and system-view is 2 (system level). If you want to make the interface command available to the level 1 users, you need to execute the following three commands: command-privilege level 1 view shell system-view, command-privilege level 1 view system interface GigabitEthernet 3/0/1, and command-privilege level 1 view system quit. Then, the level 1 users can enter system view, execute the interface ethernet command, and return to user view.
Examples
# Set the command level of the interface command to 0 in system view.
[Sysname] command-privilege level 0 view system interface
display clipboard
Syntax
display clipboard [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display clipboard command to view the contents of the clipboard.
To copy the specified content to the clipboard:
· Move the cursor to the starting position of the content and press the <Esc+Shift+,> combination.
· Move the cursor to the ending position of the content and press the <Esc+Shift+.> combination.
Examples
# View the content of the clipboard.
<Sysname> display clipboard
---------------- CLIPBOARD-----------------
display current-configuration
display command-alias
Syntax
display command-alias [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display command-alias command to display defined command aliases and the corresponding commands.
Examples
# Display the defined command aliases and the corresponding commands.
<Sysname> display command-alias
Command alias is enabled
index alias command key
1 show display
display history-command
Syntax
display history-command [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display history-command command to display commands saved in the history command buffer.
By default, the system saves the last 10 executed commands in the history command buffer.
To set the size of the history command buffer, use the history-command max-size command. For more information, see the chapter “Logging in to the device commands.”
Examples
# Display history commands in current user view.
<Sysname> display history-command
display history-command
system-view
vlan 2
quit
display hotkey
Syntax
display hotkey [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display hotkey command to display hotkey information.
Examples
# Display hotkey information.
<Sysname> display hotkey
----------------- HOTKEY -----------------
=Defined hotkeys=
Hotkeys Command
CTRL_G display current-configuration
CTRL_L display ip routing-table
CTRL_O undo debug all
=Undefined hotkeys=
Hotkeys Command
CTRL_T NULL
CTRL_U NULL
=System hotkeys=
Hotkeys Function
CTRL_A Move the cursor to the beginning of the current line.
CTRL_B Move the cursor one character left.
CTRL_C Stop current command function.
CTRL_D Erase current character.
CTRL_E Move the cursor to the end of the current line.
CTRL_F Move the cursor one character right.
CTRL_H Erase the character left of the cursor.
CTRL_K Kill outgoing connection.
CTRL_N Display the next command from the history buffer.
CTRL_P Display the previous command from the history buffer.
CTRL_R Redisplay the current line.
CTRL_V Paste text from the clipboard.
CTRL_W Delete the word left of the cursor.
CTRL_X Delete all characters up to the cursor.
CTRL_Y Delete all characters after the cursor.
CTRL_Z Return to the User View.
CTRL_] Kill incoming connection or redirect connection.
ESC_B Move the cursor one word back.
ESC_D Delete remainder of word.
ESC_F Move the cursor forward one word.
ESC_N Move the cursor down a line.
ESC_P Move the cursor up a line.
ESC_< Specify the beginning of clipboard.
ESC_> Specify the end of clipboard.
hotkey
Syntax
hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_T | CTRL_U } command
undo hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_T | CTRL_U }
View
System view
Default level
2: System level
Parameters
CTRL_G: Associates hot key Ctrl+G to the specified command.
CTRL_L: Associates hot key Ctrl+L to the specified command.
CTRL_O: Associates hot key Ctrl+O to the specified command.
CTRL_T: Associates hot key Ctrl+T to the specified command.
CTRL_U: Associates hot key Ctrl+U to the specified command.
command: The command line associated with the hot key.
Description
Use the hotkey command to associate a hot key to a command.
Use the undo hotkey command to restore the default.
By default, Ctrl+G, Ctrl+L and Ctrl+O have these corresponding commands:
· Ctrl+G corresponds to display current-configuration.
· Ctrl+L corresponds to display ip routing-table.
· Ctrl+O corresponds to undo debugging all.
You can modify the associations as needed.
Examples
# Associate the hot key Ctrl+T to the display tcp status command.
<Sysname> system-view
[Sysname] hotkey ctrl_t display tcp status
quit
Syntax
quit
View
Any view
Default level
0: Visit level (executed in user view)
2: System level (executed in other views)
Parameters
None
Description
Use the quit command to return to a lower-level view.
In user view, the quit command terminates the connection and reconnects to the switch.
Examples
# Switch from GigabitEthernet 3/0/1 interface view to system view, and then to user view.
[Sysname-GigabitEthernet3/0/1] quit
[Sysname] quit
<Sysname>
return
Syntax
return
View
Any view except user view
Default level
2: System level
Parameters
None
Description
Use the return command to return to user view from the current view, which can also be done with the hot key Ctrl+Z.
Related commands: quit.
Examples
# Return to user view from GigabitEthernet 3/0/1 view.
[Sysname-GigabitEthernet3/0/1] return
<Sysname>
screen-length disable
Syntax
screen-length disable
undo screen-length disable
View
User view
Default level
1: Monitor level
Parameters
None
Description
Use the screen-length disable command to disable the multiple-screen output function.
Use the undo screen-length disable command to enable the multiple-screen output function.
By default, a login user uses the settings of the screen-length command. The default settings of the screen-length command are: multiple-screen output is enabled and 24 lines are displayed on the next screen. (For more information about the screen-length command, see the chapter “Logging in to the device commands.”)
When the user logs out, the settings restore to their default values.
Examples
# Disable multiple-screen output for the current user.
<Sysname> screen-length disable
super
Syntax
super [ level ]
View
User view
Default level
0: Visit level
Parameters
level: User level, which ranges from 0 to 3 and defaults to 3.
Description
Use the super command to switch from the current user privilege level to a specified user privilege level.
If a level is not specified, the command switches the user privilege level to 3. Command levels include four privileges: visit (0), monitor (1), system (2), and manage (3). You can assign a privilege level according to the user’s need. When logging in to the switch, the user can access the assigned level and all levels below it.
Related commands: super password.
Examples
# Switch to user privilege level 2 (The current user privilege level is 3.).
<Sysname> super 2
User privilege level is 2, and only those commands can be used
whose level is equal or less than this.
Privilege note: 0-VISIT, 1-MONITOR, 2-SYSTEM, 3-MANAGE
# Switch the user privilege level back to 3 (switching password 123 has been set. If no password is set, the user privilege level cannot be switched to 3.).
<Sysname> super 3
Password:
User privilege level is 3, and only those commands can be used
whose level is equal or less than this.
Privilege note: 0-VISIT, 1-MONITOR, 2-SYSTEM, 3-MANAGE
super authentication-mode
Syntax
super authentication-mode { local | scheme } *
undo super authentication-mode
View
System view
Default level
2: System level
Parameters
local: Authenticates a user by using the local password set with the super password command. When no password is set with the super password command, two results can occur: The privilege level switch succeeds if the user is logged in through OAP. The switch fails if the user logs in through the VTY user interfaces or inputs an incorrect switch password.
scheme: AAA authentication. For more information about AAA, see the Security Configuration Guide.
local scheme: First local and then scheme, which means to authenticate a user by using the local password first. If no password is set for the user logged in through OAP, the privilege level switch succeeds. If no password is set for the user logged in through the VTY user interfaces, the AAA authentication is performed.
scheme local: First scheme and then local, which means that AAA authentication is performed first. If the AAA configuration is invalid (the domain parameters or authentication scheme are not configured) or the server does not respond, the local password authentication is performed.
Description
Use the super authentication-mode command to set the authentication mode for user privilege level switch.
Use the undo super authentication-mode command to restore the default.
By default, the authentication mode for the user privilege level switch is local.
Related commands: super password.
Examples
# Set the authentication mode for the user privilege level switch to local.
<Sysname> system-view
[Sysname] super authentication-mode local
# Set the authentication mode for the user privilege level switch to scheme local.
<Sysname> system-view
[Sysname] super authentication-mode scheme local
super password
Syntax
super password [ level user-level ] { simple | cipher } password
undo super password [ level user-level ]
View
System view
Default level
2: System level
Parameters
level user-level: User privilege level, which ranges from 1 to 3 and defaults to 3.
simple: Sets a password in plain text, and the password is displayed in plain text.
cipher: Sets a password in cipher text, and the password is displayed in cipher text.
password: Password, a case-sensitive string of characters.
· A simple password is a string of 1 to 16 characters.
· A cipher password is a string of 1 to 16 characters in plain text or 24 characters in cipher text. For example, the simple text “1234567” corresponds to the cipher text “(TT8F]Y\5SQ=^Q`MAF4<1!!”.
Description
Use the super password command to set the password used to switch from the current user privilege level to a higher one.
Use the undo super password command to restore the default.
By default, no password is set for switching to a higher privilege level.
· A cipher-text password is recommended because a simple-text password easily gets cracked.
· During authentication, you must input a simple-text password regardless of the password type you set.
Examples
# Set simple-text password abc for switching to user privilege level 3.
<Sysname> system-view
[Sysname] super password level 3 simple abc
# Display the configured password for level switching.
[Sysname] display current-configuration
#
super password level 3 simple abc
# Set cipher-text password abc for switching to user privilege level 3.
<Sysname> system-view
[Sysname] super password level 3 cipher abc
# Display the configured password for level switching.
[Sysname] display current-configuration | include super
super password level 3 cipher ;)<01%^&;YGQ=^Q`MAF4<1!!
system-view
Syntax
system-view
View
User view
Default level
2: System level
Parameters
None
Description
Use the system-view command to enter system view from the current user view.
Related commands: quit, return.
Examples
# Enter system view from the current user view.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname]