3, Huawie VRP
3, Huawie 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
To manage files on a device, log in to the device through either of the following
modes:
Local login through the console port or Telnet
Remote login through FTP, TFTP, or SFTP
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.
Common file types:
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: A configuration file stores configuration commands,
enabling a device to start with the configurations in the file. A configuration
file is a collection of command lines. Current configurations are stored in a
configuration file so that the configurations are still effective after the device
restarts. Users can view configurations in the 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.
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.
The serial port of a user terminal can be directly connected to the console
port of a device for local access.
VTY User Interface
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.
User Command
Name Available Command
Level 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.
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.
Huawei VRP Page 9
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.
Huawei VRP Page 10
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.
9 CLI
10 Basic Command Structure
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
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.
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 VRP Page 14
<Huawei> ?
User view commands:
arp-ping ARP-ping
autosave <Group> autosave command group
backup Backup information
cd Change current directory
clear Clear
clock Specify the system clock
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
^
Huawei VRP Page 15
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> 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
<Huawei> system-view
[Huawei] hotkey ctrl_l "display tcp status"
<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 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 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.
Huawei VRP Page 18
[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>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 datetime utc HH:MM:SS YYYY-MM-DD changes the UTC.
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
<Huawei>dir
Directory of flash:/
Idx Attr Size(Byte) Date Time(LMT) FileName
0 drw- - Mar 04 2020 04:39:52 dhcp
1 -rw- 121,802 May 26 2014 09:20:58 portalpage.zip
2 -rw- 828,482 Mar 04 2020 04:51:45 save.zip
3 -rw- 2,263 Mar 04 2020 04:39:45 statemach.efs
4 -rw- 828,482 May 26 2014 09:20:58 sslvpn.zip
5 -rw- 828,482 Mar 04 2020 04:56:05 file.txt
1,090,732 KB total (784,340 KB free)
<Huawei>move file.txt flash:/dhcp/
<Huawei>cd dhcp
<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,344 KB free)
<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)
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
<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
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.
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.
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.
Huawei VRP Page 25
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.
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 26
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.