03 Huawei VRP
03 Huawei VRP
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and the
customer. All or part of the products, services and features described in this document may not be within the
purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information, and
recommendations in this document are provided "AS IS" without warranties, guarantees or representations of any
kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the preparation
of this document to ensure accuracy of the contents, but all statements, information, and recommendations in this
document do not constitute a warranty of any kind, express or implied.
Website: https://e.huawei.com/
Huawei Certification System
Huawei Certification follows the "platform + ecosystem" development strategy, which is a new
collaborative architecture of ICT infrastructure based on "Cloud-Pipe-Terminal". Huawei has set up
a complete certification system consisting of three categories: ICT infrastructure certification,
platform and service certification, and ICT vertical certification. It is the only certification system
that covers all ICT technical fields in the industry. Huawei offers three levels of certification:
Huawei Certified ICT Associate (HCIA), Huawei Certified ICT Professional (HCIP), and Huawei
Certified ICT Expert (HCIE). Huawei Certification covers all ICT fields and adapts to the industry
trend of ICT convergence. With its leading talent development system and certification standards, it
is committed to fostering new ICT talent in the digital era, and building a sound ICT talent
ecosystem.
Huawei Certified ICT Associate-Datacom (HCIA-Datacom) is designed for Huawei's frontline
engineers and anyone who want to understand Huawei's datacom products and technologies. The
HCIA-Datacom certification covers routing and switching principles, basic WLAN principles,
network security basics, network management and O&M basics, SDN and programmability and
automation basics.
The Huawei certification system introduces the industry, fosters innovation, and imparts cutting-
edge datacom knowledge.
Contents
1.1 Foreword
The Versatile Routing Platform (VRP) is a universal operating system (OS) platform for Huawei
datacom products. It is based on IP and adopts a component-based architecture. It provides rich
features and functions, including application-based tailorable and extensible functions, greatly
improving the running efficiency of the devices that use this OS. To efficiently manage such devices,
you must be familiar with VRP and VRP-based configuration.
This course describes the basic concepts, common commands, and command line interface (CLI) of
VRP.
1.2 Objectives
On completion of this course, you will be able to:
Understand VRP basics.
Learn how to use CLI.
Master basic CLI commands.
2 What Is VRP
VRP is a universal OS platform for Huawei datacom products. It serves as the software core engine of
Huawei's full series of routers from low-end to core ones, Ethernet switches, service gateways, and so
on.
VRP provides the following functions:
Provides a unified user interface and a unified management interface.
Implements the functions of the control plane and defines the interface specifications of the
forwarding plane.
Implements communication between the device forwarding plane and VRP control plane.
Boot Read-Only Memory (BootROM) is a set of programs added to the ROM chip of a device.
BootROM stores the device's most important input and output programs, system settings, startup self-
check program, and system automatic startup program.
The startup interface provides the information about the running program of the system, the running
VRP version, and the loading path.
Level
Network diagnosis commands (such as ping
and tracert), commands for accessing external
0 0 Visit level devices from the local device (such as Telnet
client commands), and some display
commands
System maintenance commands, including
1 0 and 1 Monitoring level
display commands
Service configuration commands, including
Configuration routing commands and IP configuration
2 0, 1, and 2
level commands, to directly provide users with
network services
Commands for controlling basic system
operations and providing support for services,
Management including the file system, FTP, TFTP
3-15 0, 1, 2, and 3
level download, user management, and command
level commands, as well as debugging
commands for fault diagnosis
To limit users' access permissions to a device, the device manages users by level and establishes a
mapping between user levels and command levels. After a user logs in to a device, the user can use
only commands of the corresponding levels or lower. By default, the user command level ranges from
0 to 3, and the user level ranges from 0 to 15. The mapping between user levels and command levels
is shown in the table.
Note: The login page, mode, and IP address may vary according to devices. For details, see the
product documentation.
6 Local Login
Use a console cable to connect the console port of a device with the COM port of a computer. You
can then use PuTTY on the computer to log in to the device and perform local commissioning and
maintenance. A console port is an RJ45 port that complies with the RS232 serial port standard. At
present, the COM ports provided by most desktop computers can be connected to console ports. In
most cases, a laptop does not provide a COM port. Therefore, a USB-to-RS232 conversion port is
required if you use a laptop.
The console port login function is enabled by default and does not need to be pre-configured.
Huawei VRP Page 8
7 PuTTY Configuration
PuTTY is a connection software for login through Telnet, SSH, serial interfaces, and so on.
In local login, the terminal is connected to the console port of the Huawei device through a serial port.
Therefore, set Connection type to Serial. Set Serial line based on the actually used port on the
terminal. Set Speed to 9600.
Many terminal simulators can initiate console connections. PuTTY is one of the options for
connecting to VRP. If PuTTY is used for access to VRP, you must set port parameters. The figure in
the slide shows examples of port parameter settings. If the parameter values were ever changed, you
need to restore the default values.
After the settings are complete, click Open. The connection with VRP is then set up.
If you use the SSH login mode, set Connection type to SSH, enter the IP address of the remote
login server, and use the default port number 22.
If you use the Telnet login mode, set Connection type to Telnet, enter the IP address of the
remote login server, and use the default port number 23.
8 PuTTY Configuration
By default, the SSH login function is disabled on a device. You need to log in to the device through
the console port and configure mandatory parameters for SSH login before using the SSH login
function.
8.1.1 CLI
After a login succeeds, the command line interface (CLI) is displayed.
The CLI is a common tool for engineers to interact with network devices. When the command prompt
is displayed after a user logs in to a device, it means that the user has entered the CLI successfully.
Huawei VRP Page 10
9 CLI
10 Basic Command Structure
Command word: specifies the operation to be executed in a command, such as display (device
status query) or reboot (device restart).
Keyword: a special character string that is used to further restrict a command. It is an extension
of a command and can also be used to express the command composition logic.
Parameter list: is composed of parameter names and values to further restrict the command
function. It can contain one or more pairs of parameter names and values.
Example 1:
display ip interface GE0/0/0: displays interface information.
Command word: display
Keyword: ip
Huawei VRP Page 11
11 Command Views 1
User view: In this view, you can check the running status and statistics of a device. The user view is
the first view displayed after you log in to a device. Only query and tool commands are provided in
the user view.
System view: In this view, you can set system parameters and enter the configuration views of other
commands. In the user view, only the system view can be accessed. Global configuration commands
are provided in the system view. If the system has a lower-level configuration view, the command for
entering the lower-level configuration view is provided in the system view.
Other views: In other views, such as the interface view and protocol view, you can set interface
parameters and protocol parameters.
Huawei VRP Page 12
Command examples:
12 Command Views 2
<Huawei>system-view #This command is used to enter the system view from the user view. The user view is
the first view that is displayed after you log in to a device.
[Huawei]interface GigabitEthernet 0/0/1 #This command is used to enter the interface view from the
system view.
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.1 24 #This command is used to set an IP address.
[Huawei-GigabitEthernet0/0/1]quit #This command is used to return to the previous view.
[Huawei]ospf 1 #This command is used to enter the protocol view from the system view.
[Huawei-ospf-1]area 0 #This command is used to enter the OSPF area view from the OSPF view.
[Huawei-ospf-1-area-0.0.0.0]return #This command is used to return to the user view.
After you log in to the system, the user view is displayed first. This view provides only display
commands and tool commands, such as ping and telnet. It does not provide any configuration
commands.
You can run the system-view command in the user view to enter the system view. The system view
provides some simple global configuration commands.
In a complex configuration scenario, for example, multiple parameters need to be configured for an
Ethernet interface, you can run the interface GigabitEthernet X command (X indicates the number of
the interface) to enter the GE interface view. Configurations performed in this view take effect only
on the specified GE interface.
<Huawei>d cu
<Huawei>di cu
<Huawei>dis cu
<Huawei>d c
^
Error:Ambiguous command found at '^' position.
<Huawei>dis c
^
Error:Ambiguous command found at '^' position.
For example, the display current-configuration command is identified when you enter d cu,
di cu, or dis cu. However, the command cannot be identified if you enter d c or dis c
because the character string d c or dis c matches more than one command.
Note: "keyword" mentioned in this section means any character string except a parameter value string
in a command. The meaning is different from that of "keyword" in the command format.
3. Command editing through the Tab key
If an entered character string matches a unique keyword, the system automatically supplements
the keyword after you press Tab. If the keyword is complete, it remains unchanged even if you
press Tab repeatedly.
If an entered character string matches more than one keyword, you can press Tab repeatedly. The
system will then circularly display the keywords beginning with the entered character string to
help you find the desired keyword.
If an entered character string cannot identify any keyword, the entered string remains unchanged
after you press Tab.
<Huawei> ?
User view commands:
arp-ping ARP-ping
autosave <Group> autosave command group
backup Backup information
Huawei VRP Page 14
Partial Help
To obtain partial help, press ? after you enter the start character or character string of a
command. The system will then display all the commands that start with this character or
character string.
<Huawei> d?
debugging <Group> debugging command group
delete Delete a file
dialer Dialer
dir List files on a filesystem
display Display information
The command help information displayed in this slide is for reference only, which varies according to
devices.
[Huawei] sysname
^
Error:Incomplete command found at ‘^’ position. #A supplement needs to be made at the position pointed by
the arrow.
[Huawei] a
^
Error: Ambiguous command found at '^' position. #More than one command matches the keyword at the position
pointed by the arrow. In this example, it indicates that there are multiple keywords starting with a.
[Huawei-GigabitEthernet0/0/0]ospf cost 800000 #The parameter value at the position pointed by the arrow is
invalid.
^
Error: Wrong parameter found at '^' position.
<Huawei> system-view
[Huawei] sysname Server
[Server] undo sysname
[Huawei]
Huawei VRP Page 15
<Huawei> system-view
[Huawei] ftp server enable
[Huawei] undo ftp server
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.1 24
[Huawei-GigabitEthernet0/0/1]undo ip address
<Huawei> system-view
[Huawei] hotkey ctrl_l "display tcp status"
<Huawei>pwd
<Huawei>dir
<Huawei>more
<Huawei>acd
Huawei VRP Page 16
<Huawei>makdir
<Huawei>rmdir
<Huawei>copy
<Huawei>move
<Huawei>rename
<Huawei>delete
<Huawei>undelete
<Huawei>reset recycle-bin
VRP uses the file system to manages files and directories on a device. To manage files and
directories, you often need to run basic commands to query file or directory information. Such
commonly used basic commands include pwd, dir [/all] [ filename | directory ], and more [ /binary ]
filename [ offset ] [ all ].
The pwd command displays the current working directory.
The dir [/all] [ filename | directory ] command displays information about files in the current
directory.
The more [/binary] filename [ offset ] [ all ] command displays the content of a text file.
In this example, the dir command is run in the user view to display information about files in the
flash memory.
Common commands for operating directories include cd directory, mkdir directory, and rmdir
directory.
The cd directory command changes the current working directory.
The mkdir directory command creates a directory. A directory name can contain 1 to 64
characters.
The rmdir directory command deletes a directory from the file system. A directory to be deleted
must be empty; otherwise, it cannot be deleted using this command.
The copy source-filename destination-filename command copies a file. If the target file already
exists, the system displays a message indicating that the target file will be replaced. The target
Huawei VRP Page 17
file name cannot be the same as the system startup file name. Otherwise, the system displays an
error message.
The move source-filename destination-filename command moves a file to another directory. The
move command can be used to move files only within the same storage medium.
The rename old-name new-name command renames a directory or file.
The delete [/unreserved] [ /force ] { filename | devicename } command deletes a file. If the
unreserved parameter is not specified, the deleted file is moved to the recycle bin. A file in the
recycle bin can be restored using the undelete command. However, if the /unreserved parameter
is specified, the file is permanently deleted and cannot be restored any more. If the /force
parameter is not specified in the delete command, the system displays a message asking you
whether to delete the file. However, if the /force parameter is specified, the system does not
display the message. filename specifies the name of the file to be deleted, and devicename
specifies the name of the storage medium.
The reset recycle-bin [ filename | devicename ] command permanently deletes all or a specified
file in the recycle bin. filename specifies the name of the file to be permanently deleted, and
devicename specifies the name of the storage medium.
This command configures a level for commands in a specified view. Command levels are classified
into visit, monitoring, configuration, and management, which are identified by the numbers 0, 1, 2,
and 3, respectively.
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]set authentication password cipher information
This user-interface vty command displays the virtual type terminal (VTY) user interface view, and
the set authentication password command configures the password authentication mode. The system
supports the console user interface and VTY user interface. The console user interface is used for
Huawei VRP Page 18
local login, and the VTY user interface is used for remote login. By default, a device supports a
maximum of 15 concurrent VTY-based user accesses.
This command sets a timeout period to disconnect from the user interface. If no command is entered
within the specified period, the system tears down the current connection. The default timeout period
is 10 minutes.
[Huawei]interface interface-number
[Huawei-interface-number]ip address ip address
<Huawei>display current-configuration
<Huawei>save
<Huawei>display saved-configuration
<Huawei>reset saved-configuration
This command displays the system software for the current and next startup, backup system software,
configuration file, license file, and patch file, as well as voice file.
During a device upgrade, you can run this command to configure the device to load the specified
configuration file for the next startup.
<Huawei>reboot
Generally, more than one device is deployed on a network, and the administrator needs to manage all
devices in a unified manner. The first task of device commissioning is to set a system name. A system
name uniquely identifies a device. The default system name of an AR series router is Huawei, and that
of an S series switch is HUAWEI. A system name takes effect immediately after being set.
Huawei VRP Page 19
To ensure successful coordination with other devices, you need to correctly set the system clock.
System clock = Coordinated Universal Time (UTC) ± Time difference between the UTC and the time
of the local time zone. Generally, a device has default UTC and time difference settings.
You can run the clock datetime command to set the system clock of the device. The date and time
format is HH:MM:SS YYYY-MM-DD. If this command is run, the UTC is the system time minus
the time difference.
You can also change the UTC and the system time zone to change the system clock.
The clock datetime utc HH:MM:SS YYYY-MM-DD changes the UTC.
The clock timezone time-zone-name { add | minus } offset command configures the local time
zone. The UTC is the local time plus or minus the offset.
If a region adopts the daylight saving time, the system time is adjusted according to the user setting
at the moment when the daylight saving time starts. VRP supports the daylight saving time function.
Each type of user interface has a corresponding user interface view. A user interface view is a
command line view provided by the system for you to configure and manage all physical and logical
interfaces working in asynchronous interaction mode, implementing unified management of different
user interfaces. Before accessing a device, you need to set user interface parameters. The system
supports console and VTY user interfaces. The console port is a serial port provided by the main
control board of a device. A VTY is a virtual line port. A VTY connection is set up after a Telnet or
SSH connection is established between a user terminal and a device, allowing the user to access the
device in VTY mode. Generally, a maximum of 15 users can log in to a device through VTY at the
same time. You can run the user-interface maximum-vty number command to set the maximum
number of users that can concurrently access a device in VTY mode. If the maximum number of login
users is set to 0, no user can log in to the device through Telnet or SSH. The display user-interface
command displays information about a user interface.
The maximum number of VTY interfaces may vary according to the device type and used VRP
version.
To run the IP service on an interface, you must configure an IP address for the interface. Generally, an
interface requires only one IP address. For the same interface, a newly configured primary IP address
replaces the original primary IP address.
You can run the ip address { mask | mask-length } command to configure an IP address for an
interface. In this command, mask indicates a 32-bit subnet mask, for example, 255.255.255.0; mask-
length indicates a mask length, for example, 24. Specify either of them when configuring an IP
address.
A loopback interface is a logical interface that can be used to simulate a network or an IP host. The
loopback interface is stable and reliable, and can also be used as the management interface if multiple
protocols are deployed.
When configuring an IP address for a physical interface, check the physical status of the interface. By
default, interfaces are up on Huawei routers and switches. If an interface is manually disabled, run the
undo shutdown command to enable the interface after configuring an IP address for it.
The reset saved-configuration command deletes the configurations saved in a configuration file or
the configuration file. After this command is run, if you do not run the startup saved-configuration
command to specify the configuration file for the next startup or the save command to save current
configurations, the device uses the default parameter settings during system initialization when it
restarts.
The display startup command displays the system software for the current and next startup, backup
system software, configuration file, license file, and patch file, as well as voice file.
The startup saved-configuration configuration-file command configures the configuration file for
the next startup. The configuration-file parameter specifies the name of the configuration file for the
next startup.
Huawei VRP Page 20
The reboot command restarts a device. Before the device reboots, you are prompted to save
configurations.
<Huawei>pwd
flash:
<Huawei>dir
Directory of flash:/
Idx Attr Size(Byte) Date Time(LMT) FileName
0 drw- - Dec 27 2019 02:54:09 dhcp
1 -rw- 121,802 May 26 2014 09:20:58 portalpage.zip
2 -rw- 2,263 Dec 27 2019 02:53:59 statemach.efs
3 -rw- 828,482 May 26 2014 09:20:58 sslvpn.zip
1,090,732 KB total (784,464 KB free)
<Huawei>mkdir test
<Huawei>dir
Directory of flash:/
Idx Attr Size(Byte) Date Time(LMT) FileName
0 drw- - Dec 27 2019 02:54:39 test
1 drw- - Dec 27 2019 02:54:09 dhcp
2 -rw- 121,802 May 26 2014 09:20:58 portalpage.zip
3 -rw- 2,263 Dec 27 2019 02:53:59 statemach.efs
4 -rw- 828,482 May 26 2014 09:20:58 sslvpn.zip
1,090,732 KB total (784,460 KB free)
<Huawei>rmdir test
13
Configuration Procedure:
VRP Basic Configuration
<Huawei>system-view
[Huawei]sysname AR1
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 192.168.1.1 24
[AR1-GigabitEthernet0/0/1]quit
[AR1]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):huawei123
[AR1-ui-vty0-4]user privilege level 1
[AR1-ui-vty0-4]quit
The password configuration command may vary according to devices. For details, see the
product documentation.
For some devices, after the authentication-mode password command is entered, the password
setting page will be displayed automatically. You can then enter the password at the page that is
displayed. For some devices, you need to run the set authentication-mode password password
command to set a password.
Specify the configuration file for next startup.
<HUAWEI>save huawei.zip
Are you sure to save the configuration to huawei.zip? (y/n)[n]:y
It will take several minutes to save configuration file, please wait.........
Configuration file had been saved successfully
Note: The configuration file will take effect after being activated
<HUAWEI>startup saved-configuration huawei.zip
By default, configurations are saved in the vrpcfg.cfg file. You can also create a file for saving
the configurations. VRPv5 and VRPv8 have the same command that is used to specify the
configuration file for the next startup, but different directories for saving the file.
To save configurations, run the save command. By default, configurations are saved in the
vrpcfg.cfg file. You can also create a file for saving the configurations. In VRPv5, the
configuration file is stored in the flash: directory by default.
Checking Configurations
<AR1>display startup
MainBoard:
Startup system software: null
Next startup system software: null
Backup system software for next startup: null
Startup saved-configuration file: flash:/vrpcfg.zip
Next startup saved-configuration file: flash:/huawei.zip
Startup license file: null
Next startup license file: null
Startup patch package: null
Next startup patch package: null
Startup voice-files: null
Next startup voice-files: null
The display startup command displays the system software for the current and next startup,
backup system software, configuration file, license file, and patch file, as well as voice file.
Startup system software indicates the VRP file used for the current startup.
Huawei VRP Page 23
Next startup system software indicates the VRP file to be used for the next startup.
Startup saved-configuration file indicates the configuration file used for the current system
startup.
Next startup saved-configuration file indicates the configuration file to be used for the next
startup.
When a device starts, it loads the configuration file from the storage medium and initializes the
configuration file. If no configuration file exists in the storage medium, the device uses the
default parameter settings for initialization.
The startup saved-configuration [ configuration-file ] command sets the configuration file for
the next startup, where the configuration-file parameter specifies the name of the configuration
file.
14 More Information
VRPv5 has the running and startup configuration databases but does not have the candidate
configuration database. Therefore, a command configuration takes effect immediately after the
command is executed, without being committed. However, in VRPv8, the configuration command
takes effect only after the command committed.
14.1 Quiz
1. (Single) In which view is the sysname Huawei command used to set the device name to Huawei?
( )
A. User view
B. System view
C. interface view
D. protocol view
2. (Single) Which of the following statements about storage devices is false? ( )
A. Flash is a non-volatile memory. Data will not be lost after a power failure.
B. NVRAM non-volatile random access memory for configuration files
C. The SD card can store system files, configuration files, and logs.
D. SDRAM is equivalent to the memory of a computer.
Huawei VRP Page 24
3. (Multiple) Which of the following views cannot be used by the save command? ( )
A. User view
B. System view
C. Interface view
D. Protocol view
4. (True or False) Huawei VRP does not have a file system. Therefore, you cannot perform
operations on files. You must use external tools to perform operations on files. ( )
A. True
B. False
5. (True or False)When using the console port to manage the device, only one person can perform
this operation at the same time. When using the VTY port, multiple persons can perform this
operation at the same time. ( )
A. True
B. False
6. What is the VRP version currently used by Huawei datacom devices?
7. What is the maximum number of users that are allowed to log in to a Huawei device through the
console port concurrently?
8. How do I specify the configuration file for next startup if a device has multiple configuration
files?
14.2 Summary
VRP is a Huawei proprietary network OS that can run on various hardware platforms. VRP has
unified network, user, and management interfaces. To efficiently manage Huawei devices, you need
to be familiar with VRP commands and configurations.
You also need to understand some common commands and shortcut keys and learn how to use them.
After learning this course, you need to know basic VRP concepts, functions of common commands,
and CLI.