03 Huawei VRP
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.
Huawei Technologies Co., Ltd.
Address: Huawei Industrial Base
Bantian, Longgang
Shenzhen 518129
Website: https://e.huawei.com/
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:
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.
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.
Huawei VRP Page 3
To manage files on a device, log in to the device through either of the following modes:
Mastering the basic operations of the file system is crucial for network engineers to efficiently
manage the configuration files and VRP system files of devices.
System Software: The system software is a must for device startup and operation,
providing support, management, and services for a device. The common file name
extension is .cc.
configuration file and upload the configuration file to other devices to implement batch
configuration. The common file name extensions are .cfg, zip, and .dat.
Patch File: A patch is a kind of software compatible with the system software. It is used to
fix bugs in system software. Patches can also fix system defects and optimize some
functions to meet service requirements. The common file name extension is .pat.
PAF File: A PAF file effectively controls product features and resources. The common file
name extension is .bin.
The flash memory is nonvolatile and can avoid data loss in case of power-off. It is used to
store system software, configuration files, and so on. Patch files and PAF files are
uploaded by maintenance personnel and generally stored in the flash memory or SD
card.
NVRAM is nonvolatile random access memory. It is used to store log buffer files. Logs will
be written into the flash memory after the timer expires or the buffer is full.
The SD card can avoid data loss data in case of power-off. The SD card has a large
storage capacity and is generally installed on a main control board. It is used to store
system files, configuration files, log files, and so on.
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.
To use a device management mode, you must first log in to a device through a login mode
supported by this device management mode.
Web System
The web system provides a graphical user interface (GUI) for easy device management
and maintenance. This method, however, can be used to manage and maintain only
some, not all, device functions.
The web system supports the HTTP and HTTPS login modes.
CLI
The CLI requires users to use commands provided by a device to manage and maintain
the device. This mode implements refined device management but requires users to be
familiar with the commands.
The CLI supports the console port, Telnet, and SSH login modes.
Such a user interface can be a console user interface or virtual type terminal (VTY) user
interface.
A console user interface is used to manage and monitor users who log in to a device
through the console port.
The serial port of a user terminal can be directly connected to the console port of a
device for local access.
The VTY user interface is used to manage and monitor users who log in to a device by
means of VTY.
After a Telnet or STelnet connection is established between a user terminal and a device,
a VTY channel is established to implement remote access to the device.
Command
User Level Name Available Command
Level
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.
Huawei VRP Page 8
Use this mode when you need to configure a device that is powered on for the first time.
You can use the console port of the device for a local login.
The console port is a serial port provided by the main control board of a device.
To implement the login, directly connect your terminal's serial port to the device's
console port, and use PuTTY to log in to the device. You can then configure the device
after the login succeeds.
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 9
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.
Huawei VRP Page 10
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.
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.
Huawei VRP Page 11
1.3.12 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.
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:
Keyword: ip
Example 2:
Each operation command must start with a command word, and the command word is
selected from the standard command word list.
Each command must contain a maximum of one command word and can contain multiple
keywords and parameters. A parameter must be composed of a parameter name and a
parameter value.
The command word, keywords, parameter names, and parameter values in a command are
separated by spaces.
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.
Command examples:
<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.
Huawei VRP Page 14
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.
Backspace: deletes the character before the cursor and moves the cursor to the left.
When the cursor reaches the beginning of the command, an alarm is generated.
Left cursor key ← or Ctrl+B: moves the cursor one character to the left. When the cursor
reaches the beginning of the command, an alarm is generated.
Right cursor key → or Ctrl+F: moves the cursor one character to the right. When the
cursor reaches the end of the command, an alarm is generated.
<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.
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.
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.
The online help can be classified into full help and partial help. To obtain the online help,
enter a question mark (?) when using a command.
Full Help
To obtain full help, press ? after a view displayed. The system will then display all
commands in the view and their descriptions.
<Huawei> ?
User view commands:
arp-ping ARP-ping
autosave <Group> autosave command group
Huawei VRP Page 16
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 VRP Page 17
<Huawei> system-view
[Huawei] sysname Server
[Server] undo sysname
[Huawei]
<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
Command shortcut keys are classified into user-defined shortcut keys and system shortcut
keys.
There are four user-defined shortcut keys: Ctrl+G, Ctrl+L, Ctrl+O, and Ctrl+U.
You can associate a user-defined shortcut key with any command. After you press a
shortcut key, the system will automatically run the command associated with the
shortcut key.
<Huawei> system-view
Huawei VRP Page 18
CTRL_Y: deletes the character at the cursor and all characters on the right of the cursor.
<Huawei>pwd
<Huawei>dir
<Huawei>more
<Huawei>acd
<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 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 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.
Huawei VRP Page 20
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 file name cannot be the same as the system startup file name.
Otherwise, the system displays an error message.
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 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 VRP Page 22
<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.
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 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.
Huawei VRP Page 24
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 reboot command restarts a device. Before the device reboots, you are prompted to save
configurations.
Check information about files and directories in the current directory of a router named
RTA.
<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
Huawei VRP Page 25
Make a copy for the save.zip file and name the copy file.txt.
<Huawei>delete file.txt
<Huawei>dir
Directory of flash:/dhcp/
Idx Attr Size(Byte) Date Time(LMT) FileName
0 -rw- 98 Dec 27 2019 02:54:09 dhcp-duid.txt
1,090,732 KB total (784,340 KB free)
<Huawei>undelete file.txt
<Huawei>dir
Directory of flash:/dhcp/
Idx Attr Size(Byte) Date Time(LMT) FileName
0 -rw- 98 Dec 27 2019 02:54:09 dhcp-duid.txt
1 -rw- 121,802 Dec 27 2019 03:13:50 file.txt
1,090,732 KB total (784,340 KB free)
Connect the router and PC. Assign the IP addresses shown in the figure to the router and
PC.
Allow other employees of the company to use the password huawei123 to remotely log
in to the router through the PC. Allow them to view configurations but disable them from
modifying configurations.
Save current configurations and name the configuration file huawei.zip. Configure this
file as the configuration file for the next startup.
Configuration Procedure:
<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.
<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
Huawei VRP Page 28
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.
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.
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.
Huawei VRP Page 29
1.5 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.
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?
Huawei VRP Page 30
1.6 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.