Huawei Notes
Huawei Notes
Lab Guide
Version: 1.0
1
Copyright © Huawei Technologies Co., Ltd. 2021. All rights reserved.
Without the written permission of the Company, no unit or individual may extract or copy part or
all of the contents of this document, and may not disseminate it in any form.
Trademark Claims
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks or registered trademarks mentioned in this document are the property of their
respective owners.
note
The products, services, or features that you purchase are subject to Huawei's commercial contracts
and terms. All or part of the products, services, or features described in this document may not be
within your purchase or use scope. Unless otherwise specified in the contract, Huawei does not
make any express or implied representations or warranties in this document.
This document is subject to irregular updates due to product version upgrades or other reasons.
Unless otherwise agreed, this document is intended for guidance only and all statements,
information and recommendations in this document do not constitute any warranty, express or
implied.
1.1.2 Purpose
Understand the meaning of the command line view and the methods of entering and leaving the
command line view.
Master some common commands
Learn how to revoke an order
How to use the shortcut keys of the command line
Figure 1-1 Be familiar with the VRP operating system experiment topology.
1
Computer Networks Lab Guide Page 2
# When R1 turns light blue, the startup is successful. (The figure shows that the router is started
successfully.)
# Double-click R1. When # stops and <Huawei> is displayed, you can configure the router.
Huawei devices provide various functions and various configuration and query
commands. To facilitate the use of these commands, Huawei devices register the
commands in different command views based on their functions. Before configuring a
function, enter the command line view and run the corresponding commands.
Input the first few letters of a keyword of a command and press <tab> to display the
complete keyword. The prerequisite is that these letters can uniquely identify the
2
Computer Networks Lab Guide Page 3
keyword. Otherwise, press <tab> continuously to display different keywords. You can
select the required keywords, such as:
"inter"+TAB: Because the command starting with inter in the current view only
contains interface, the command is directly completed as interface. If you press TAB
for multiple times, the command does not change.
[R1-GigabitEthernet0/0/1]
The view of GigabitEthernet0/0/1 is displayed.
[R1-GigabitEthernet0/0/1]i?
icmp <Group> icmp command group
igmp Specify parameters for IGMP
ip <Group> ip command group
ipsec Specify IPSec(IP Security) configuration information
ipv6 <Group> ipv6 command group
isis Configure interface parameters for ISIS
If you remember only one or more characters at the beginning of a command keyword
when you enter a command, you can use the partial help to obtain the prompts of all
keywords starting with the string. For example:
In the GigabitEthernet 0/0/1 interface view, enter i +?, the options of all commands
starting with i in the current view are displayed. You can press TAB to complete the
options or manually complete the options. Where, "icmp" and "igmp" are keywords,
and "<Group> icmp command group" and "Specify parameters for IGMP" are keyword
descriptions.
[R1-GigabitEthernet0/0/1]ip ?
accounting <Group> accounting command group
address <Group> address command group
binding Enable binding of an interface with a VPN instance
fast-forwarding Enable fast forwarding
forward-broadcast Specify IP directed broadcast information
netstream IP netstream feature
verify IP verify
<cr> indicates that there is no keyword or parameter in this position. You can directly
press Enter.
[R1-GigabitEthernet0/0/1]dis this
#
3
Computer Networks Lab Guide Page 4
interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0
#
The display this command displays the running configuration in the current view.
Some effective configuration parameters will not be displayed if they are the same as
the default working parameters. Some parameters are not displayed if the commands
for which the parameters are configured are not submitted successfully. This
command is used to check the configuration.
The device supports incomplete keyword input. That is, if the entered character
matches a unique keyword in the current view, you do not need to enter complete
keywords. This function provides a quick input mode to improve operation efficiency.
For example:
After the dis this command is run on an interface, all commands can be executed
normally because only the display this command matches the dis this command in the
current view. Similarly, "dis cu" and "d cu" are equivalent to "display current-
configuration".
[R1-GigabitEthernet0/0/1]quit
Using the quit command, you can return from the current view to a lower-level view.
If the user view is used, you can exit the system.
# The IP address of the interface is incorrectly configured. Configure the IP address to interface
GigabitEthernet 0/0/2.
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]undo ip address
4
Computer Networks Lab Guide Page 5
After a command is executed, if the information displayed exceeds one page, the
system automatically stops outputting the information. At the bottom of the displayed
information, "--More ----" is displayed. You can run the following command:
1. Type <Ctrl+C> or <Ctrl+Z> to stop the display or command execution.
2. Press the space bar to display the information on the next page.
3. Press Enter to display the next line of information.
In addition to the quit command, you can also run the following command:
1. The return command can be used to return to the user view in any view.
2. Press Ctrl+Z to return to the user view in any view.
You can run commands to modify the current configurations of a device. If the
configurations are not saved, you need to save the current configurations to the
configuration file before restarting the device. You can run the save command to save
the configuration to the default path and overwrite the original configuration file. You
can also run the save configuration-file command to save the current configuration to
a specified file on the storage device. Generally, this command does not affect the
current startup configuration file of the system.
# Compare the current configuration with the configuration used for the next startup.
<R1>compare configuration
The current configuration is the same as the next startup configuration file.
5
Computer Networks Lab Guide Page 6
The current configuration is the same as the configuration file for next startup.
vrpcfg.zip: configuration file. The configuration file must have a .cfg or .zip extension.
ar651c-v300r019c00Sspc100.cc: system software. The system software must have a .cc
extension.
6
Computer Networks Lab Guide Page 7
# Set this file to the configuration file used for the next startup.
<R1>startup saved-configuration test.cfg
This operation will take several minutes, please wait.....
Info: Succeeded in setting the file for booting system
The display startup command displays the system software, backup system
software, configuration file, license file, patch file, and voice file related to the
current and next startup of the device.
7
Computer Networks Lab Guide Page 8
1.4 Appendix
Function Keys function
8
Computer Networks Lab Guide Page 9
9
Computer Networks Lab Guide Page 10
2.1.2 Purpose
Master the method of creating a VLAN.
Master the methods of configuring Access, Trunk, and Hybrid interfaces.
Configure interface-based VLAN division.
Configure MAC address-based VLAN division.
How to view the MAC address table and VLAN information
10
Computer Networks Lab Guide Page 11
PC IP Address/Mask
PC1 10.1.3.1/24
PC2 10.1.3.2/24
PC3 10.1.3.3/24
PC4 10.1.3.4/24
Take PC1 as an example. Right-click PC1 and choose Settings from the shortcut menu. On the Basic
Configuration page, configure the IP address. After the configuration is complete, click Apply.
11
Computer Networks Lab Guide Page 12
Using the vlan vlan-id command, you can create a VLAN and enter the VLAN
view. If a VLAN already exists, you can directly enter the VLAN view.
Using the vlan batch {vlan-id1 [to vlan-id2]} command, you can create VLANs in
batches.
[S2]vlan batch 2 to 3
The port link-type {access | hybrid | trunk} command configures a link type for an
interface. You can set the interface type to Access, Trunk, or Hybrid.
[S1-GigabitEthernet0/0/1]port default vlan 2
The port default vlan vlan-id command configures a default VLAN on an interface
and adds the interface to the VLAN.
[S1-GigabitEthernet0/0/1]quit
[S1]interface GigabitEthernet0/0/2
[S1-GigabitEthernet0/0/2]port link-type access
[S1-GigabitEthernet0/0/2]port default vlan 3
[S1-GigabitEthernet0/0/2]quit
[S2]interface GigabitEthernet0/0/1
[S2-GigabitEthernet0/0/14]port link-type access
[S2-GigabitEthernet0/0/14]port default vlan 2
[S2-GigabitEthernet0/0/14]quit
# Configure the interconnection interface between S1 and S2 as a trunk interface and allow only
VLANs 2 and 3 to pass through.
[S1]interface GigabitEthernet0/0/10
[S1-GigabitEthernet0/0/10]port link-type trunk
[S1-GigabitEthernet0/0/10]port trunk allow-pass vlan 2 3
The port trunk allow-pass vlan command adds a trunk interface to a VLAN.
[S1-GigabitEthernet0/0/10]undo port trunk allow-pass vlan 1
The undo port trunk allow-pass vlan command deletes the VLAN to which a trunk
interface is added.
VLAN 1 is in the allowed list by default. If it has no actual service usage, you need to
delete it for security purposes.
[S2]interface GigabitEthernet0/0/10
[S2-GigabitEthernet0/0/10]port link-type trunk
[S2-GigabitEthernet0/0/10]port trunk allow-pass vlan 2 3
[S2-GigabitEthernet0/0/10]undo port trunk allow-pass vlan 1
12
Computer Networks Lab Guide Page 13
[S2]display vlan
The total number of vlans is: 4
------------------------------------------------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
------------------------------------------------------------------------------------------------------------------------
13
Computer Networks Lab Guide Page 14
3 common UT:GE0/0/14(U)
TG:GE0/0/10(U)
2) Run the ping command on PC2 to verify that PC2 can ping PC3.
3) Run the ping command on PC1 to verify that PC1 cannot ping PC3.
4) Run the display mac-address verbose command on S1 and S2 to check the MAC address table of
the switch.
14
Computer Networks Lab Guide Page 15
interface GigabitEthernet0/0/10
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 2 to 3
#
Configuration of S2
sysname S2
#
vlan batch 2 to 3
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
#
interface GigabitEthernet0/0/10
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet0/0/14
port link-type access
port default vlan 3
#
15