No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Fat AP and Cloud AP V200R008C00 CLI-based Configuration Guide

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
How to Use Command Lines

How to Use Command Lines

Entering Command Views

The device has many functions; therefore various configuration commands and query commands are provided to facilitate device management and maintenance. Huawei access point registers commands to different command views based on the functions of the commands, so users can easily use them. To use a function, enter the corresponding command view first 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 Command Reference.

Common Command Views
Name How To Enter Function
User view

When a user logs in to the device, the user enters the user view and the following prompt is displayed on the screen:

<Huawei>

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

System view

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 Ctrl+Z.
[Huawei]

In the system view, you can set the system parameters of the device, and enter other function views from this view.

Interface view

Run the interface command and specify an interface type and number to enter an interface view.

[Huawei] interface gigabitethernet X/Y/Z
[Huawei-GigabitEthernetX/Y/Z] 
NOTE:
  • X/Y/Z indicates the number of an interface that needs to be specified. It is in the format of slot number/sub card number/interface sequence number.

  • The interface GigabitEthernet is only an example.

You can configure interface parameters in the interface view. The interface parameters include physical attributes, link layer protocols, and IP addresses.

WLAN view

Run the wlan command and press Enter in the system view. The WLAN view is displayed.

[Huawei] wlan
[Huawei-wlan-view]                                                       

In the WLAN view, you can configure most WLAN parameters.

NOTE:
  • 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 user view.

  • 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.

  • 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 run improperly or services may be interrupted. Contact technical support personnel and use these diagnostic commands with caution.
Quitting Command Views

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

For example, return from the interface view to the system view and run the quit command to return to the user view.
[Huawei-GigabitEthernet0/0/1] quit                                                  
[Huawei]quit
<Huawei> 

To return from the interface 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-GigabitEthernet0/0/1]           #Press Ctrl+Z.
<Huawei> 
# Run the return command to return directly to the user view.
[Huawei-GigabitEthernet0/0/1] return
<Huawei> 

Setting Command Levels

Context

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.

  • 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 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 3-1 describes the relationship between command levels and user levels.

    Table 3-1  Relationship between command levels and user levels

    User Level

    Command Level

    Name

    Description

    0

    0

    Visit level

    Commands of this level include network diagnosis tool commands (such as ping and tracert), and commands for accessing external devices from the local device (such as Telnet).

    1

    0, 1

    Monitoring level

    Commands of this level are used for system 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 Command Reference.

    2

    0, 1, 2

    Configuration level

    Commands of this level are used for service configuration to provide direct network services, including routing commands and commands of each network layer.

    3 to 15

    0, 1, 2, 3

    Management level

    Commands of this level are used for basic system operations, including file system, FTP, TFTP download, user management, command level configuration, and debugging.

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

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    command-privilege level level view view-name command-key

    The command level is set in the specified view.

Editing Command Lines

Editing Feature

You can edit commands in a CLI that supports multi-line edition. Each command can contain a maximum of 512 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 3-2 lists keys that are frequently used for command editing.

Table 3-2  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+B

Moves the cursor to the left by the space of a character. When the cursor reaches the head of the command, an alarm is generated.

Right cursor key → or Ctrl+F

Moves the cursor to the right by the space of a character. When 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.

NOTE:

The maximum length of a command (including the incomplete command) to be entered is 512 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 512 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.
  • 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:
    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
  • 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:
    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 logbuffer
      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 logfile
      [Huawei] info-center loghost

      Stop pressing Tab when the desired keyword is displayed.

  • When an incorrect keyword is entered, press Tab and it is displayed in a new line without being changed. For example:
    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.

Using Command Line Online Help

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.

  • Enter a question mark (?) in any command view to obtain all the commands and their simple descriptions. For example:
    <Huawei> ?
    User view commands:
      autosave       <Group> autosave command group
      backup         Backup  information
      cd             Change current directory
      clear          Clear
      clock          Specify the system clock
      cls            Clear screen
      compare        Compare configuration file
      copy           Copy from one file to another
    ...
  • 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 ?
      <cr>  Please press ENTER to execute command
    [Huawei-ui-vty0-4] authentication-mode aaa
    • "aaa" and "password" are keywords. "AAA authentication" and "Authentication through the password of a user terminal interface" describe the keywords respectively.

    • <cr> indicates that there is no keyword or parameter in this position. You can press Enter to run this command.

  • 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 timeout ?
      INTEGER<1-35791>  The value of FTP timeout (in minute) 
    [Huawei] ftp timeout 35 ?
      <cr>  Please press ENTER to execute command
    [Huawei] ftp timeout 35

    "INTEGER<1-35791>" describes the value range of the parameter. "The value of FTP timeout (in 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.

  • 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  <Group> debugging command group
      delete     Delete a file
      dir        List files on a filesystem
      display    Display information 
    <Huawei>d
  • 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?
      binding           Display binding relation of profile
      bridge            Bridge MAC
      bridge-link       Bridge link
      bridge-profile    Display Bridge profile
      bridge-whitelist  Bridge Whitelist
  • 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.

Interpreting Command Line Error Messages

Table 3-3 lists the common error messages.

Table 3-3  Common error messages of the command line

Error Message

Cause of the Error

Error: Unrecognized command found at '^' position.

No command is found.

No keyword is found.

Error: Wrong parameter found at '^' position.

The parameter type is incorrect.

The parameter value exceeds the limit.

Error: Incomplete command found at '^' position.

The entered command is incomplete.

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

Too many parameters are entered.

Error: Ambiguous command found at '^' position.

Indefinite command is entered.

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:

  • The undo command restores the default setting.

    The sysname command sets a device host name. For example:

    <Huawei> system-view
    [Huawei] sysname Server
    [Server] undo sysname
    [Huawei]
  • 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.
    Info: Succeeded in starting the FTP server 
    [Huawei] undo ftp server
    Info: Succeeded in closing the FTP server.
  • The undo command deletes a specified configuration.

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

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

    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!
    
    Login authentication                                                            
                                                                                    
                                                                                    
    Username:huawei                                                                  
    Password:                                                                       
      ----------------------------------------------------------------------------- 
                                                                                    
      User last login information:                                                  
      ----------------------------------------------------------------------------- 
      Access Type: Telnet                                                           
      IP-Address : 192.168.40.1                                                     
      Time       : 2013-04-07 16:50:02+08:00                                        
      ----------------------------------------------------------------------------- 
    <Huawei> system-view
    [Huawei] undo header login
    

    Log out of the terminal and re-log in. No message is displayed before authentication.

    Login authentication                                                            
                                                                                    
                                                                                    
    Username:huawei                                                                 
    Password:                                                                       
      ----------------------------------------------------------------------------- 
                                                                                    
      User last login information:                                                  
      ----------------------------------------------------------------------------- 
      Access Type: Telnet                                                           
      IP-Address : 172.168.254.204                                                  
      Time       : 2005-08-19 17:45:30+08:00                                        
      ----------------------------------------------------------------------------- 
    <Huawei> 
NOTE:

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

Displaying History Commands

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 are allowed to be saved in a specified user interface view. The maximum number is 256.

NOTE:

If the value is too large, it may take a long time to obtain a required history command. Therefore, a large value is not recommended.

Table 3-4 shows operations of history commands.

Table 3-4  Accessing history commands

Action

Command or Key

Result

Display history commands.

display history-command

Display history commands entered by the current user.

Display the earlier history command.

Up arrow key ↑ or Ctrl+P

If there is an earlier history command, the earlier history command is displayed. Otherwise, an alarm is generated.

Display the later history command.

Down arrow key ↓ or Ctrl+N

If there is a later history command, the later history command is displayed. Otherwise, the command is cleared and an alarm is generated.

NOTE:

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

When using history commands, note the following:

  • The saved history commands are the same as that those entered by users. For example, if the user enters an incomplete command, the saved command also is incomplete.

  • 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.

Using Command Line Shortcut Keys

There are two types of shortcut keys:
  • 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.

  • System-defined shortcut keys: shortcut keys defined in the system that have fixed functions. Users cannot define these shortcut keys. Table 3-5 lists the frequently used system-defined shortcut keys.

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 and configuration-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.
The system supports four user-defined shortcut keys and the default values are as follows:
  • Ctrl+G: display current-configuration

  • Ctrl+L: undo idle-timeout

  • Ctrl+O: undo debugging all

  • Ctrl+U: Null

NOTE:
  • 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.

  • Run the display hotkey command to view the status of the defined, undefined, and system-defined shortcut keys.

  • Run the undo hotkey command to restore default values of the configured shortcut keys.

  • 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.

  • 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 3-5  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.

Ctrl+E

Moves the cursor to the end of the last line.

Ctrl+F

Moves the cursor forward one character.

Ctrl+H

Deletes the character on the left side of the cursor.

Ctrl+I

Provides the same function as Tab.

Ctrl+J

Provides the same function as Enter.

Ctrl+M

Provides the same function as Enter.

Ctrl+N

Displays the next command in the history command buffer.

Ctrl+P

Displays the previous command in the history command buffer.

Ctrl+T

Provides the same function as a question mark.

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.

Translation
Download
Updated: 2019-01-11

Document ID: EDOC1000176006

Views: 118741

Downloads: 309

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next