Saturday , December 7 2024
Home / Command Line / Huawei CLI introduction

Huawei CLI introduction

To start working with Huawei devices, it is necessary to look at CLI (Command Line Interface). All Huawei datacom devices use the same OS called VRP (Versatile Routing Platform). As an example we can take NE40E router with V600R001C00SPC900 software installed. When you establish connection with the router, it does not matter it is telnet, ssh or console, you enter the user view with the prompt of <Quidway>. The prompt < > indicates user view and the prompt [ ] indicates other views. To start configuring the router you should move from user view to system view. You can do this by using “system-view” command.

<Quidway> system-view
[Quidway]

From system view you are able to configure all functions available in VRP software. Let’s assume that you want to configure MPLS, both globally and on Ethernet interface.

[Quidway]
[Quidway]mpls
[Quidway-mpls]quit
[Quidway]interface GigabitEthernet 1/0/5
[Quidway-GigabitEthernet1/0/5]mpls

Besides command line views the system adopts a hierarchical protection mode that has 16 command levels. The default command levels are as follows:

  • Level 0 – visit
  • Level 1 – monitoring
  • Level 2 – configuration
  • Level 3 – management

You can change default to 16 command levels by “command-privilege level rearrange” command.

[Quidway]command-privilege level rearrange

You will be asked about super password for level 15, so be careful and follow instructions displayed. Otherwise you will have problem, after this change, to log into the router.

If you don’t adjust a command level separately, after the command level is updated, all originally registered command lines adjust automatically according to the following rules:

  • Level 0 and Level 1 – unchanged
  • Level 2 – Level 10
  • Level 3 – Level 15

You can adjust the command lines to remaining levels separately to refine the management of privilege.

You can enter “?” in any command line views to display all available commands with a short description.

[Quidway]mpls ?
l2vpn        Operate on MPLS L2 VPN
ldp          Label Distribution Protocol(LDP)
lsr-id       Specify LSR(Label Switched Router) identifier
oam          Specify OAM(Operation, Administration and Maintenance)
             configuration information
switch-l2vc  Specifying switch-l2vc configuration information
<cr>

You can enter a character string with a “?” closely following it to display all commands that begin with this character string.

[Quidway]d?
 dhcp            diffserv
 display         dns
 dustproof

Common error massages of the command line:

Error messages Cause of the error
Unrecognized command The command cannot be found
The key word cannot be found
Wrong parameter Parameter type error
The parameter value exceeds the limit
Incomplete command Incomplete command entered
Too many parameters Too many parameters entered
Ambiguous command Indefinite parameters entered

System-defined shortcut keys:

Key Function
CTRL_A The cursor moves to the beginning of the current line.
CTRL_B The cursor moves to the left by the space of a character.
CTRL_C Terminates the running function.
CTRL_D Deletes the character where the cursor lies.
CTRL_E The cursor moves to the end of the current line.
CTRL_F The cursor moves to the right by the space of a character.
CTRL_H Deletes one character on the left of the cursor.
CTRL_K Stops the creation of the outbound connection.
CTRL_N Displays the next command in the history command buffer.
CTRL_P Displays the previous command in the history command buffer.
CTRL_R Repeats the display of the information of the current line.
CTRL_T Terminates the outbound connection.
CTRL_V Pastes the contents on the clipboard.
CTRL_W Deletes a character string or character on the left of the cursor.
CTRL_X Deletes all the characters on the left of the cursor.
CTRL_Y Deletes all the characters on the right of the cursor.
CTRL_Z Returns to the user view.
CTRL_] Terminates the inbound or redirection connections.
ESC_B The cursor moves to the left by the space of a word.
ESC_D Deletes a word on the right of the cursor.
ESC_F The cursor moves to the right to the next word end.
ESC_N The cursor moves downward to the next line.
ESC_P The cursor moves upward to the previous line.
ESC_SHIFT_< Sets the position of the cursor to the beginning of the clipboard.
ESC_SHIFT_> Sets the position of the cursor to the end of the clipboard.

You can also define shortcut keys using the following command:

[Quidway]hotkey CTRL_U "display ip interface brief"

By default three shortcut keys are defined:

  • CTRL_G – display current-configuration
  • CTRL_L – display ip routing-table
  • CTRL_O – undo debugging all
There are also two hidden modes available for Huawei R&D:
[Quidway]_h
Now you enter a hidden command view for developer's testing, some
commands may affect operation by wrong use, please carefully use it
with HUAWEI engineer's direction.
[Quidway-hidecmd]
[Quidway]_d
Now you enter diagnose command view.
[Quidway-diagnose]

There are many commands but using them by normal engineer is not safe 😉

I wanted to show you the basic structure of Huawei VRP CLI. Next time I will show you a basic system configuration. If you have any additional questions, anything is not clear for you, would like to know more, do not hesitate to ask.

Leave a Reply

Your email address will not be published. Required fields are marked *