< Home

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. Those listed in the following figure are common command views. For the methods of entering the command views except the following views, see the S2720, S5700, and S6700 V200R019C10Command 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:

<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 the interface view.

[HUAWEI] interface gigabitethernet X/Y/Z
[HUAWEI-GigabitEthernetX/Y/Z] 

X/Y/Z indicates the number of an interface that needs to be specified. It is in the format of stack ID/card number/interface sequence number.

The interface GigabitEthernet is used as an example.

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

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 the entered content (including ! and #) is displayed as comments and no corresponding configuration will be generated.

  • Some commands can be executed in multiple views, but they have different functions when 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 fail to run properly or services may be interrupted. Contact technical support personnel and use these diagnostic commands with caution.
  • You can enter ! or # followed by a character string in any view. All the entered content (including ! and #) is displayed as comments and can be properly. That is, no error message is displayed and no the corresponding configuration is not generated.

Exiting Command Views

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

For example, you can run the quit command to return from the AAA view to the system view. You can then run the quit command again to return from the system view to the user view.
[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> 

Intelligent Rollback

Intelligent rollback, by default, enables the system to automatically return to the previous view if a command fails to be executed in the current view. The system continues to attempt to return to the required view until it returns to the system view. If you want to disable the intelligent rollback function, run the undo terminal command forward matched upper-view command. This command is valid only for the current login user who runs this command.

Intelligent rollback cannot be performed in the port group view and VLAN-Range view.

If command matching fails because an ambiguous command is entered in the current view, no intelligent rollback can be performed.

If the intelligent rollback function is enabled, commands may be executed in unexpected views, and services may be interrupted. Before configuring a command, check whether the command to be configured exists in the view. If the command does not exist, run the command in the correct view.

The following provides two application examples for intelligent rollback. The system enters the applicable view of a command after performing one view return attempt in the first example, and performs multiple attempts in the second example.

  1. After entering an OSPF area view, the system allows a user to directly enter another OSPF area view, without the need to manually return to the OSPF view.

    <HUAWEI> system-view
    [HUAWEI] ospf 100
    [HUAWEI-ospf-100] area 1
    [HUAWEI-ospf-100-area-0.0.0.1] area 2
    [HUAWEI-ospf-100-area-0.0.0.2] 
  2. After entering an OSPF area view, the system allows a user to directly enter an interface view, without the need to manually return to the system view.

    <HUAWEI> system-view
    [HUAWEI] ospf 100
    [HUAWEI-ospf-100] area 1
    [HUAWEI-ospf-100-area-0.0.0.1] interface gigabitEthernet 0/0/3
    [HUAWEI-GigabitEthernet0/0/3] 
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >