CloudEngine S5700, S6700 Switches Configuration Examples (V600)
CloudEngine S5700, S6700 Switches Configuration Examples (V600)
CloudEngine S5700, S6700 Switches Configuration Examples (V600)
Switches
Typical Configuration
Examples(V600)
Issue 05
Date 2023-11-15
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
Contents
3.1.6.3.8 Example for Configuring MUX VLAN (on Cascaded Devices).................................................................. 404
3.1.6.3.9 Example for Configuring Basic QinQ.................................................................................................................408
3.1.6.3.10 Example for Configuring VLAN ID-based Selective QinQ....................................................................... 411
3.1.6.3.11 Example for Configuring MQC-based Selective QinQ.............................................................................. 413
3.1.6.4 STP/RSTP/MSTP............................................................................................................................................................416
3.1.6.4.1 Example for Configuring STP............................................................................................................................... 416
3.1.6.4.2 Example for Configuring RSTP............................................................................................................................ 419
3.1.6.4.3 Example for Configuring MSTP........................................................................................................................... 423
3.1.6.4.4 Example for Configuring MSTP+VRRP Networking......................................................................................429
3.1.6.5 VBST................................................................................................................................................................................. 440
3.1.6.5.1 Example for Configuring Basic VBST Functions.............................................................................................440
3.1.7 IP Addresses and Services............................................................................................................................................ 447
3.1.7.1 ARP Security.................................................................................................................................................................. 447
3.1.7.1.1 Example for Configuring ARP Security............................................................................................................. 447
3.1.7.1.2 Example for Configuring Defense Against ARP MITM Attacks................................................................ 451
3.1.7.2 DHCPv4........................................................................................................................................................................... 454
3.1.7.2.1 Example for Configuring a DHCPv4 Server Based on an Interface Address Pool..............................454
3.1.7.2.2 Example for Configuring a DHCPv4 Server Based on a Global Address Pool (Using a Layer 3
Ethernet Interface).................................................................................................................................................................... 457
3.1.7.2.3 Example for Configuring a DHCPv4 Client...................................................................................................... 461
3.1.7.2.4 Example for Configuring DHCPv4 Relay.......................................................................................................... 463
3.1.7.2.5 Example for Configuring a DHCPv4 Server in VRRP Networking........................................................... 466
3.1.7.3 DHCP Snooping............................................................................................................................................................ 473
3.1.7.3.1 Example for Configuring DHCP Snooping Attack Defense........................................................................ 473
3.1.8 IP Routing.......................................................................................................................................................................... 477
3.1.8.1 IPv4 Static Route.......................................................................................................................................................... 477
3.1.8.1.1 Example for Configuring Static Routes for Interworking Between Different Network Segments
......................................................................................................................................................................................................... 477
3.1.8.1.2 Example for Configuring IPv4 Static Routes to Implement Load Balancing....................................... 481
3.1.9 VPN...................................................................................................................................................................................... 485
3.1.9.1 IPv4 L3VPN.................................................................................................................................................................... 485
3.1.9.1.1 Example for Configuring Mutual Access Between Local IPv4 L3VPNs.................................................. 485
3.1.9.1.2 Example for Configuring Basic IPv4 L3VPN over MPLS.............................................................................. 490
3.1.9.1.3 Example for Configuring Hub-Spoke (Double Links Between the Hub-PE and Hub-CE).............. 503
3.1.9.1.4 Example for Configuring L3VPN+VRRP............................................................................................................ 512
3.1.9.1.5 Example for Configuring a Route-Policy to Control Mutual Access Between L3VPN Users..........526
3.1.9.2 IPv6 L3VPN.................................................................................................................................................................... 534
3.1.9.2.1 Example for Configuring Basic IPv6 L3VPN over MPLS.............................................................................. 534
3.1.9.2.2 Example for Configuring IPv6 L3VPN over MPLS Hub-Spoke.................................................................. 546
3.1.10 Network Slicing............................................................................................................................................................. 556
3.1.10.1 Example for Configuring Network Slicing in an EVPN L3VPNv4 over SRv6 BE Scenario (Static
Configuration)............................................................................................................................................................................ 556
3.1.10.2 Example for Configuring VLAN Slicing.............................................................................................................. 569
Intended Audience
This document is intended for network engineers responsible for switch
management and maintenance. You should be familiar with basic Ethernet
knowledge and have extensive network management experience. In addition, you
should understand your network well, including the network topology and
deployed network services.
Symbol Conventions
The symbols used in this document are described in the following table. They are
defined as follows.
Symbol Description
Symbol Description
Command Conventions
Convention Description
Security Conventions
● Password setting
– Configuring a ciphertext password is recommended. For security
purposes, do not disable password complexity check, and change the
password periodically.
● Reliability design
Reliability must be factored in during network planning and site design to
ensure device- and solution-level protection. Device-level protection refers to
adding redundancy, for example, duplicating networks, planes, devices, and
inter-board links, to prevent single points of failure. Solution-level protection
refers to fast convergence protection, such as FRR and VRRP. If solution-level
protection is used, ensure that the primary and backup paths do not share
links or transmission devices. Otherwise, solution-level protection may fail to
take effect.
NOTE
This document applies to switches of V600R022C10 and later versions. To check the device
version, run the display version command in the user view.
In this example, S5735-L-V2 switches running V600R022C10 function as the access switches
(ACC1 and ACC2), an S8700-4 switch running V600R022C10 functions as the core switch
(CORE), and an AR651 router running V300R022C10 functions as the egress router.
Stop bit 1
Data bit 8
3. Press Connect until the following information is displayed. Set the login
password as prompted.
Login authentication
Username:admin1
Password:
Info: The max number of VTY users is 20, and the number
of current VTY users on line is 1.
The current login time is 2023-02-26 20:10:05+08:00.
You can now run commands to configure the switch. Enter a question mark
(?) after a command whenever you need help.
NOTE
STelnet is recommended for logging in to the switch because Telnet may pose security
risks. For detailed configuration procedure, see "Basic Configuration" in the
Configuration Guide based on the version of the device.
4. Log in to the switch from an operation terminal through Telnet. When the
user view prompt is displayed, you have successfully logged in.
C:\Documents and Settings\Administrator> telnet 10.10.1.1 //Enter the management IP address and
press Enter.
Login authentication
Username:admin1 //Enter the username and password.
Password:
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2023-02-06 18:33:18+00:00.
<HUAWEI> //User view prompt
[ACC1-GE1/0/1] eth-Trunk 1
[ACC1-GE1/0/1] quit
[ACC1] interface GE 1/0/2
[ACC1-GE1/0/2] eth-Trunk 1
[ACC1-GE1/0/2] quit
3. Configure the interfaces on ACC1 that connect user devices so that user
devices can be added to the VLAN. Configure the interfaces as edge ports.
[ACC1] interface GE 1/0/5 //Configure the interface connecting to PC1.
[ACC1-GE1/0/5] port link-type access
[ACC1-GE1/0/5] port default vlan 10
[ACC1-GE1/0/5] stp edged-port enable
[ACC1-GE1/0/5] quit
[ACC1] interface GE 1/0/6 //Configure the interface connecting to PC2.
[ACC1-GE1/0/6] port link-type access
[ACC1-GE1/0/6] port default vlan 10
[ACC1-GE1/0/6] stp edged-port enable
[ACC1-GE1/0/6] quit
[ACC1] interface GE 1/0/7 //Configure the interface connecting to printers.
[ACC1-GE1/0/7] port link-type access
[ACC1-GE1/0/7] port default vlan 10
[ACC1-GE1/0/7] stp edged-port enable
[ACC1-GE1/0/7] quit
NOTE
To add all users connected to ACC1 to VLAN 10, you can add Eth-Trunk 1 on CORE to
VLAN 10 as an Access interface without adding interfaces on ACC1 to VLAN 10. This
simplifies the configuration and ensures that all users connected to Eth-Trunk 1 belong
to VLAN 10.
4. Configure the BPDU protection function to improve network stability.
[ACC1] stp bpdu-protection
Partner:--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GE1/0/1 32768 00e0-fc12-2212 32768 2 289 10111100
GE1/0/2 32768 00e0-fc12-2212 32768 3 289 10111100
Run the display vlan command to check the VLAN configuration on ACC1.
The command output shows that, on ACC1, GE1/0/5 to GE1/0/7 are added to
VLAN 10 in untagged mode and Eth-Trunk 1 is added to VLAN 10 in tagged
mode.
[ACC1] display vlan
The total number of VLANs is : 1
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
10 common UT:GE1/0/5(U) GE1/0/6(U) GE1/0/7(U)
TG:Eth-Trunk1(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
10 enable default enable disable VLAN 0010
Run the display eth-trunk command to check the Eth-Trunk interface
configuration on CORE. The command output shows that 10GE1/0/1 and
10GE1/0/2 on CORE have been added to Eth-Trunk 1.
[CORE] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: lacp-static
Preempt Delay: Disabled Hash arithmetic: According to SA-XOR-DA
System Priority: 32768 System ID: 00e0-fc12-6703
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 1
--------------------------------------------------------------------------------
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
10GE1/0/1 32768 00e0-fc12-2211 32768 2 289 10111100
10GE1/0/2 32768 00e0-fc12-2211 32768 3 289 10111100
Run the display vlan command to check the VLAN configuration on CORE.
The command output shows that, on CORE, Eth-Trunk 1 and Eth-Trunk 2 are
added to VLAN 10 and VLAN 20 respectively in tagged mode and 10GE1/0/20
is added to VLAN 100 in tagged mode.
[CORE] display vlan
The total number of VLANs is : 3
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
-------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
10 common TG:Eth-Trunk1(U)
20 common TG:Eth-Trunk2(U)
100 common TG:10GE1/0/20(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
10 enable default enable disable VLAN 0010
20 enable default enable disable VLAN 0020
100 enable default enable disable VLAN 0100
NOTE
In this section, the DHCP server is configured based on a global address pool. You can also
configure the DHCP server based on the interface address pool. For details, see "IP
Addresses and Services Configuration" in the Configuration Guide based on the version of
the device.
1. Create a global address pool, configure the egress gateway and lease (the
default lease of one day is used, and no configuration is required), and
allocate fixed IP address 10.10.10.254 to the printer with MAC address a-b-c.
<CORE> system-view
[CORE] dhcp enable
[CORE] ip pool 10
[CORE-ip-pool-10] network 10.10.10.0 mask 24 //Specify the address pool range that is used to
allocate IP addresses to users in department A.
[CORE-ip-pool-10] gateway-list 10.10.10.1 //Configure the gateway address for users in
department A.
[CORE-ip-pool-10] static-bind ip-address 10.10.10.254 mac-address a-b-c //Allocate a fixed IP
address to the printer.
[CORE-ip-pool-10] quit
NOTE
After either of the preceding operations is performed, PCs can rapidly obtain
IP addresses after they start.
Interface
4. Configure a specific route to the intranet and a default static route to the
Internet.
[Router] ip route-static 10.10.10.0 255.255.255.0 10.10.100.1
[Router] ip route-static 10.10.20.0 255.255.255.0 10.10.100.1
[Router] ip route-static 0.0.0.0 0.0.0.0 1.1.1.1
5. Configure DNS resolution. The carrier provides the DNS server address.
[Router] dns resolve
[Router] dns server 8.8.8.8
2. Enable DHCP snooping on Eth-Trunk 1 that connects to the DHCP server and
configure it as a trusted interface.
[ACC1] interface eth-trunk 1
[ACC1-Eth-Trunk1] dhcp snooping enable //Enable DHCP snooping.
[ACC1-Eth-Trunk1] dhcp snooping trusted //Configure Eth-Trunk 1 as a trusted interface.
[ACC1-Eth-Trunk1] quit
ACC1 matches packets received from VLAN 10 with dynamic binding entries
in the DHCP snooping binding table. If a packet matches an entry, ACC1
forwards the packet; otherwise, ACC1 discards the packet. To check packets
received from a specified user device instead of all user devices in the VLAN,
enable IPSG on the interface connecting to the device.
For details about how to configure the switch to prevent users from
connecting a small router to the intranet and changing IP addresses, see
"DHCP Snooping Configuration" in "IP Addresses and Services Configuration"
and "IPSG Configuration" in "Security Configuration" in the Configuration
Guide based on the version of the device.
5 packet(s) transmitted
5 packet(s) received //PC1 can ping PC2 successfully, indicating that Layer 2 interworking between
PC1 and PC2 is normal.
2. Select one PC from each department to perform ping tests and verify whether
the two departments can communicate at Layer 3 through VLANIF interfaces.
Users in department A and department B communicate at Layer 3 through
VLANIF interfaces on CORE. If PC1 and PC3 can ping each other successfully,
users in the two departments can normally communicate at Layer 3 through
VLANIF interfaces. The ping command is similar to that in step 1.
3. Select one PC from each department to ping a public network address and
verify whether intranet users of the company can access the Internet
normally.
The following example uses department A. Generally, you can ping a public
network gateway address from PC1 to verify whether PC1 can access the
Internet. The public network gateway address is the IP address of the carrier
device to which the egress router connects. If the ping test succeeds, intranet
users can access the Internet normally. The ping command is similar to that in
step 1.
Configure Port type The Trunk port This configuration is for Trunk
interfaces connects to a and Access port setup. If a
and VLANs switch, and the Hybrid port setup is available on
Access port a switch, this port can connect
connects to a PC. to either a host or another
switch.
Stop bit 1
Data bit 8
3. Press Connect until the following information is displayed. Set the login
password as prompted.
Login authentication
Username:admin1
Password:
Info: The max number of VTY users is 20, and the number
of current VTY users on line is 1.
The current login time is 2023-02-26 10:10:05+08:00.
You can now run commands to configure the switch. Enter a question mark
(?) after a command whenever you need help.
3. Configure Telnet.
[HUAWEI] telnet server enable //By default, Telnet is disabled. You need to enable Telnet.
[HUAWEI] telnet server-source -i vlanif 5
Warning: Telnet server source configuration will take effect in the next login. Continue? [Y/N]: Y
[HUAWEI] user-interface vty 0 4 //Telnet is typically used for administrator login. AAA
authentication is recommended.
[HUAWEI-ui-vty0-4] protocol inbound telnet //By default, all protocol types are supported,
including SSH and Telnet.
[HUAWEI-ui-vty0-4] authentication-mode aaa
[HUAWEI-ui-vty0-4] idle-timeout 15
[HUAWEI-ui-vty0-4] quit
[HUAWEI] aaa
[HUAWEI-aaa] local-user admin1 password irreversible-cipher Helloworld@6789 //Configure the
username and password for Telnet login. The username is case-insensitive, whereas the password is
case-sensitive.
[HUAWEI-aaa] local-user admin1 privilege level 3 //Set the privilege level of the administrator
account to 3 (highest).
[HUAWEI-aaa] local-user admin1 service-type telnet
[HUAWEI-aaa] quit
NOTE
STelnet is recommended for logging in to the switch because Telnet may pose security
risks. For the detailed configuration procedure, see "Basic Configuration" in the
Configuration Guide specific to the device version.
4. Log in to the switch from an operation terminal through Telnet. When the
user view prompt is displayed, you have successfully logged in.
C:\Documents and Settings\Administrator> telnet 10.10.1.1 //Enter the management IP address and
press Enter.
Login authentication
2. Configure GE1/0/3 and GE1/0/4, through which ACC1 connects to CORE1 and
CORE2 respectively, to allow the packets from the VLANs of departments A
and B to pass through.
[ACC1] interface GE 1/0/3
[ACC1-GE1/0/3] port link-type trunk //Set the link type of GE1/0/3 to trunk.
[ACC1-GE1/0/3] port trunk allow-pass vlan 10 20 //Configure GE1/0/3 to transparently transmit
packets from the service VLANs on ACC1.
[ACC1-GE1/0/3] quit
[ACC1] interface GE 1/0/4
[ACC1-GE1/0/4] port link-type trunk //Set the link type of GE1/0/4 to trunk.
[ACC1-GE1/0/4] port trunk allow-pass vlan 10 20 //Configure GE1/0/4 to transparently transmit
packets from the service VLANs on ACC1.
[ACC1-GE1/0/4] quit
3. Configure the interfaces on ACC1 that connect user devices so that user
devices in different departments can be added to VLANs.
[ACC1] interface GE 1/0/1 //Configure the interface connecting to department A.
[ACC1-GE1/0/1] port link-type access
[ACC1-GE1/0/1] port default vlan 10
[ACC1-GE1/0/1] quit
[ACC1] interface GE 1/0/2 //Configure the interface connecting to department B.
[ACC1-GE1/0/2] port link-type access
[ACC1-GE1/0/2] port default vlan 20
[ACC1-GE1/0/2] quit
NOTE
To add all users connected to ACC1 to VLAN 10, you can add interfaces on CORE1 and
CORE2 that directly connect to ACC1 as Access interfaces, without adding interfaces
on ACC1 to VLAN 10. This simplifies the configuration and ensures that all users
connected to Eth-Trunk1 belong to VLAN 10.
[CORE1-10GE1/0/1] quit
[CORE1] interface Vlanif 10 //Configure VLANIF 10 to allow department A to
communicate with department B through Layer 3.
[CORE1-Vlanif10] ip address 192.168.10.1 24
[CORE1-Vlanif10] quit
[CORE1] interface Vlanif 20 //Configure VLANIF 20 to allow department B to
communicate with department A through Layer 3.
[CORE1-Vlanif20] ip address 192.168.20.1 24
[CORE1-Vlanif20] quit
4. Configure the interface for connecting to the other core switch and configure
a VLANIF interface.
[CORE1] interface 10GE 1/0/5
[CORE1-10GE1/0/5] port link-type access //Set the link type to access.
[CORE1-10GE1/0/5] port default vlan 300
[CORE1-10GE1/0/5] quit
[CORE1] interface Vlanif 300
[CORE1-Vlanif300] ip address 172.16.3.1 24
[CORE1-Vlanif300] quit
50 common TG:10GE1/0/4(U)
100 common TG:10GE1/0/7(U)
300 common UT:10GE1/0/5(U) //On CORE1, interfaces connecting to access switches
have been added to corresponding service VLANs.
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
10 enable default enable disable VLAN 0010
20 enable default enable disable VLAN 0020
30 enable default enable disable VLAN 0030
40 enable default enable disable VLAN 0040
50 enable default enable disable VLAN 0050
100 enable default enable disable VLAN 0100
300 enable default enable disable VLAN 0300
1. Configure a default static route to the egress router and a backup static route
on CORE1 and CORE2, respectively.
[CORE1] ip route-static 0.0.0.0 0.0.0.0 172.16.1.2 //Configure a default static route to the egress
router on CORE1.
[CORE1] ip route-static 0.0.0.0 0.0.0.0 172.16.3.2 preference 70 //Configure a backup static route
to CORE2 on CORE1.
[CORE2] ip route-static 0.0.0.0 0.0.0.0 172.16.2.2
[CORE2] ip route-static 0.0.0.0 0.0.0.0 172.16.3.1 preference 70
2. On the egress router, configure a default static route to the carrier device.
[Router] ip route-static 0.0.0.0 0.0.0.0 1.1.1.1
3. On the egress router, configure primary and backup routes. The next hop of
the primary route is CORE1 and that of the backup route is CORE2.
[Router] ip route-static 192.168.10.0 255.255.255.0 172.16.1.1
[Router] ip route-static 192.168.10.0 255.255.255.0 172.16.2.1 preference 70 //Configure a backup
route to the network segment of VLAN 10, with the next hop pointing to CORE2.
[Router] ip route-static 192.168.20.0 255.255.255.0 172.16.1.1
[Router] ip route-static 192.168.20.0 255.255.255.0 172.16.2.1 preference 70 //Configure a backup
route to the network segment of VLAN 20, with the next hop pointing to CORE2.
1. Create VRRP groups 1 and 2 on CORE1 and CORE2. Set the priority of CORE1
to 120 and set the preemption delay to 20s so that CORE1 functions as the
master in VLANs 10 and 20.
[CORE1] interface Vlanif 10
[CORE1-Vlanif10] vrrp vrid 1 virtual-ip 192.168.10.3 //Configure a virtual IP address for VRRP
group 1.
[CORE1-Vlanif10] vrrp vrid 1 priority 120 //Set the priority of CORE1 to 120.
[CORE1-Vlanif10] vrrp vrid 1 preempt-mode timer delay 20
[CORE1-Vlanif10] quit
[CORE1] interface Vlanif 20
[CORE1-Vlanif20] vrrp vrid 2 virtual-ip 192.168.20.3 //Configure a virtual IP address for VRRP
group 2.
[CORE1-Vlanif20] vrrp vrid 2 priority 120
[CORE1-Vlanif20] vrrp vrid 2 preempt-mode timer delay 20
[CORE1-Vlanif20] quit
2. CORE2 uses the default priority and functions as the backup in VLANs 10 and
20.
[CORE2] interface Vlanif 10
[CORE2-Vlanif10] vrrp vrid 1 virtual-ip 192.168.10.3
[CORE2-Vlanif10] quit
[CORE2] interface Vlanif 20
[CORE2-Vlanif20] vrrp vrid 2 virtual-ip 192.168.20.3
[CORE2-Vlanif20] quit
NOTE
A physical loop exists between CORE1, CORE2, and ACC1 but the actual links do not
form a loop. By default, STP is enabled on switches. To prevent the loop from affecting
the VRRP master and backup status on CORE1 and CORE2, disable STP on upstream
interfaces of access switches. The example below shows the configuration on ACC1.
[ACC1] interface GE 1/0/3
[ACC1-GE1/0/3] stp disable //Disable STP on the upstream interface of ACC1.
[ACC1-GE1/0/3] quit
[ACC1] interface GE 1/0/4
[ACC1-GE1/0/4] stp disable
[ACC1-GE1/0/4] quit
If no loop exists on the network, you can also run the stp disable command
to disable STP on the access switch.
[ACC1] stp disable
Warning:The global STP state will be changed. Continue? [Y/N] y
Configuring the Egress Router to Allow Intranet Users to Access the Internet
1. Configure an ACL to allow users to access the Internet. The example below
allows users in VLANs 10 and 20 to access the Internet.
[Router] acl 2000
[Router-acl-basic-2000] rule permit source 192.168.10.0 0.0.0.255 //Allow users in VLAN 10 to
access the Internet.
[Router-acl-basic-2000] rule permit source 192.168.20.0 0.0.0.255 //Allow users in VLAN 20 to
access the Internet.
[Router-acl-basic-2000] rule permit source 172.16.1.0 0.0.0.255
[Router-acl-basic-2000] rule permit source 172.16.2.0 0.0.0.255
[Router-acl-basic-2000] quit
3. Configure DNS resolution. The carrier provides the DNS server address.
[Router] dns resolve
[Router] dns server 8.8.8.8
NOTE
● In this section, a global address pool is configured. You can also configure the DHCP
server with an interface address pool. For details, see "IP Addresses and Services
Configuration" in the Configuration Guide specific to the device version.
● To prevent IP address conflicts caused by an active/standby switchover in VRRP
networking, configure the active DHCP server to allocate the first half of all IP addresses
in the address pool and the standby DHCP server to allocate the second half.
1. Configure CORE1 as the active DHCP server to allocate the first half of all IP
addresses in the address pool.
<CORE1> system-view
[CORE1] dhcp enable
[CORE1] ip pool 10
[CORE1-ip-pool-10] gateway-list 192.168.10.3 //Configure the gateway address.
[CORE1-ip-pool-10] network 192.168.10.0 mask 24 //Configure the range of allocable IP
addresses.
[CORE1-ip-pool-10] excluded-ip-address 192.168.10.128 192.168.10.254 //Exclude IP addresses
ranging from 192.168.10.128 to 192.168.10.254.
[CORE1-ip-pool-10] lease day 0 hour 20 minute 0 //Configure the IP address lease.
[CORE1-ip-pool-10] dns-list 8.8.8.8 //Configure the DNS server address.
[CORE1-ip-pool-10] quit
2. Configure CORE2 as the standby DHCP server to allocate the second half of
all IP addresses in the address pool.
<CORE2> system-view
[CORE2] dhcp enable
[CORE2] ip pool 10
[CORE2-ip-pool-10] gateway-list 192.168.10.3
[CORE2-ip-pool-10] network 192.168.10.0 mask 24
[CORE2-ip-pool-10] excluded-ip-address 192.168.10.1 192.168.10.2
[CORE2-ip-pool-10] excluded-ip-address 192.168.10.4 192.168.10.127
[CORE2-ip-pool-10] lease day 0 hour 20 minute 0
[CORE2-ip-pool-10] dns-list 8.8.8.8
[CORE2-ip-pool-10] quit
The procedure of configuring dynamic IP address allocation in VLAN 20 is
similar to the preceding configuration procedure.
3. Configure users in department A to obtain IP addresses from the global
address pool.
[CORE1] interface vlanif 10
[CORE1-Vlanif10] dhcp select global //Configure users in department A to obtain IP addresses
from the global address pool.
[CORE1-Vlanif10] quit
[CORE2] interface vlanif 10
[CORE2-Vlanif10] dhcp select global
[CORE2-Vlanif10] quit
4. Run the display ip pool command to view the configuration and IP address
allocation in the global address pool 10.
[CORE1] display ip pool name 10
Pool-name : 10
Pool-No :0
Lease : 0 Days 20 Hours 0 Minutes
Domain-name : -
DNS-server0 : 8.8.8.8
NBNS-server0 : -
Netbios-type : -
Position : Local Status : Unlocked
Gateway-0 : 192.168.10.3
Network : 192.168.10.0
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------------
Start End Total Used Idle(Expired) Conflict Disable
-----------------------------------------------------------------------------
192.168.10.1 192.168.10.254 253 1 125(0) 0 127
NOTE
NOTE
Devices on the intranet use static routes. If a link fails, the administrator needs to manually
configure a new static route, interrupting network services for a long time. Configuring a
dynamic routing protocol prevents this problem. If a link fails, the dynamic routing protocol
switches traffic forwarded through the faulty link to a normal link based on an algorithm.
After the faulty link recovers, the routing protocol switches traffic back to the link. OSPF
configuration is used in the example below.
2. On the egress router, delete the static route to the intranet and retain the
static route to the Internet.
[Router] undo ip route-static 192.168.10.0 24
[Router] undo ip route-static 192.168.20.0 24
5. Configure OSPF on the egress router. To connect the intranet to the Internet,
configure a default static route to the Internet. Advertise the default route in
the OSPF area, and configure a default static route to the carrier device.
[Router] ospf 100 router-id 1.1.1.1
[Router-ospf-100] default-route-advertise always
[Router-ospf-100] area 0
[Router-ospf-100-area-0.0.0.0] network 172.16.1.0 0.0.0.255
[Router-ospf-100-area-0.0.0.0] network 172.16.2.0 0.0.0.255
[Router-ospf-100-area-0.0.0.0] quit
[Router-ospf-100] quit
[Router] ip route-static 0.0.0.0 0.0.0.0 1.1.1.1
If the link from CORE1 to the egress router fails, traffic is forwarded over the
interconnection link between CORE1 and CORE2 to CORE2, increasing traffic load and
imposing high stability and bandwidth requirements on the link. You can configure
association between VRRP and the interface status to implement fast active/standby
switchover upon an uplink failure. If you configure this function on the upstream interface
of the master in the VRRP group, the master lowers its priority to implement an active/
standby switchover when it detects that the upstream interface goes Down.
# Configure association between VRRP and the status of the upstream interface
on CORE1 to monitor the uplink.
[CORE1] interface Vlanif 10
[CORE1-Vlanif10] vrrp vrid 1 track interface 10GE 1/0/7 reduced 100 //Configure association between
VRRP and the upstream interface status.
[CORE1-Vlanif10] quit
[CORE1] interface Vlanif 20
[CORE1-Vlanif20] vrrp vrid 2 track interface 10GE 1/0/7 reduced 100
[CORE1-Vlanif20] quit
As service traffic increases, the link between CORE1 and the egress router has high
bandwidth utilization, whereas the link between CORE2 and the egress router is idle,
wasting resources and lowering reliability. To effectively use the two links, you can
configure load balancing on CORE1 and CORE2 so that CORE1 functions as the master in
some VLANs while CORE2 functions as the master in the other VLANs. The two links then
load balance traffic from all VLANs, effectively using network resources. Configure CORE1
to still function as the master in VLAN 10, and change the priority of CORE2 so that CORE2
functions as the master in VLAN 20.
2. Configure CORE2 as the master in VLAN 20 and set the preemption delay to
20s.
[CORE2] interface Vlanif 20
[CORE2-Vlanif20] vrrp vrid 2 priority 120
[CORE2-Vlanif20] vrrp vrid 2 preempt-mode timer delay 20
3. Configure association between VRRP and the status of the upstream interface
on CORE2 to monitor the uplink.
[CORE2-Vlanif20] vrrp vrid 2 track interface 10GE 1/0/8 reduced 100
[CORE2-Vlanif20] quit
interface 10GE1/0/5
port link-type access
port default vlan 300
#
return
[CORE1-10GE1/0/5] undo port default vlan
[CORE1-10GE1/0/5] undo port link-type
# Set the system priority of CORE1 to 100 so that CORE1 becomes the Actor.
[CORE1] lacp priority 100
based rate limiting on the egress router's physical interfaces connecting to the
core switches.
To properly transmit service traffic with limited bandwidth resources, the upload
and download rate of each intranet IP address cannot exceed 512 kbit/s.
1. On GigabitEthernet0/0/1, configure IP address-based rate limiting for network
segments 192.168.10.0 and 192.168.20.0 and limit the rate to 512 kbit/s. Note
that IP address-based rate limiting is configured on LAN-side interfaces. This
is because NAT-enabled WAN-side interfaces cannot identify intranet IP
addresses. When configuring IP address-based rate limiting on LAN-side
interfaces, specify the source IP address in the inbound direction to limit the
upload rate, and specify the destination IP address in the outbound direction
to limit the download rate.
[Router] interface GigabitEthernet 0/0/1
[Router-GigabitEthernet0/0/1] qos car inbound source-ip-address range 192.168.10.1 to
192.168.10.254 per-address cir 512
[Router-GigabitEthernet0/0/1] qos car outbound destination-ip-address range 192.168.10.1 to
192.168.10.254 per-address cir 512
[Router-GigabitEthernet0/0/1] qos car inbound source-ip-address range 192.168.20.1 to
192.168.20.254 per-address cir 512
[Router-GigabitEthernet0/0/1] qos car outbound destination-ip-address range 192.168.20.1 to
192.168.20.254 per-address cir 512
[Router-GigabitEthernet0/0/1] quit
2. Configure rate limiting on LAN-side interfaces of the egress router to limit the
Internet access rate and download rate.
[Router] interface GigabitEthernet 0/0/1
[Router-GigabitEthernet0/0/1] qos car inbound acl 2222 cir 2048
[Router-GigabitEthernet0/0/1] qos car outbound acl 2222 cir 4096
[Router-GigabitEthernet0/0/1] quit
1. Configure intranet servers so that external users can access them using public
IP addresses.
[Router] interface GigabitEthernet 0/0/0
[Router-GigabitEthernet0/0/0] nat server protocol tcp global current-interface www inside
192.168.50.20 www
Warning:The port 80 is well-known port. If you continue it may cause function failure.
Are you sure to continue?[Y/N]:y
[Router-GigabitEthernet0/0/0] nat server protocol tcp global current-interface ftp inside
192.168.50.10 ftp
[Router-GigabitEthernet0/0/0] quit
4. Configure NAT.
[Router] interface Dialer 0
[Router-Dialer0] nat outbound 2015
[Router-Dialer0] quit
5. Set the maximum segment size (MSS) of TCP packets to 1200 bytes. If the
default value (1460 bytes) is used, the Internet access rate may be slow.
[Router] interface Dialer 0
[Router-Dialer0] tcp adjust-mss 1200
[Router-Dialer0] quit
7. Configure a default static route to the Internet with Dialer 0 as the outbound
interface.
[Router] ip route-static 0.0.0.0 0 Dialer 0
9. Configure traffic classifiers c0, c1, and c2, and configure matching rules based
on ACL 3000, ACL 3001, and ACL 3002 in the traffic classifiers, respectively.
[Router] traffic classifier c0
[Router-classifier-c0] if-match acl 3000
[Router-classifier-c0] quit
[Router] traffic classifier c1
[Router-classifier-c1] if-match acl 3001
[Router-classifier-c1] quit
[Router] traffic classifier c2
[Router-classifier-c2] if-match acl 3002
[Router-classifier-c2] quit
10. Configure traffic behaviors to redirect traffic from the internal network
segment 192.168.10.0 to the next hop address 1.1.1.1 and to redirect traffic
from the internal network segment 192.168.20.0 to the outbound interface
Dialer 0, without redirecting traffic exchanged between intranet users.
[Router] traffic behavior b0
[Router-behavior-b0] permit
[Router-behavior-b0] quit
[Router] traffic behavior b1
[Router-behavior-b1] redirect ip-nexthop 1.1.1.1
[Router-behavior-b1] quit
[Router] traffic behavior b2
[Router-behavior-b2] redirect interface Dialer 0
[Router-behavior-b2] quit
11. Configure a traffic policy and bind traffic classifiers to traffic behaviors in the
traffic policy.
[Router] traffic policy test
[Router-trafficpolicy-test] classifier c0 behavior b0
[Router-trafficpolicy-test] classifier c1 behavior b1
[Router-trafficpolicy-test] classifier c2 behavior b2
[Router-trafficpolicy-test] quit
12. Apply the traffic policy to egress router interfaces connecting to the intranet
switches.
[Router] interface GigabitEthernet 0/0/1
[Router-GigabitEthernet0/0/1] traffic-policy test inbound
[Router-GigabitEthernet0/0/1] quit
[Router] interface GigabitEthernet 0/0/2
[Router-GigabitEthernet0/0/2] traffic-policy test inbound
[Router-GigabitEthernet0/0/2] quit
Verifying Services
1. Select two PCs from two departments to perform ping tests and verify that
the two departments can communicate at Layer 3 through VLANIF interfaces.
The following example uses two PCs (PC1 and PC2) in departments A and B.
The two PCs communicate at Layer 3 through CORE1 (or CORE2). If they can
ping each other successfully, Layer 3 interworking is normal.
<PC1> ping 192.168.20.254 //Assume that PC2 automatically obtains an IP address
192.168.20.254 through DHCP.
PING 192.168.20.254 data bytes, press CTRL_C to break
Reply from 192.168.20.254 : bytes=56 Sequence=1 ttl=253 time=62 ms
Reply from 192.168.20.254 : bytes=56 Sequence=2 ttl=253 time=16 ms
Reply from 192.168.20.254 : bytes=56 Sequence=3 ttl=253 time=62 ms
Reply from 192.168.20.254 : bytes=56 Sequence=4 ttl=253 time=94 ms
Reply from 192.168.20.254 : bytes=56 Sequence=5 ttl=253 time=63 ms
campus network, so that wired and wireless users can access the campus network
and communicate with each other. Network connectivity deployment is the basis
of campus network construction.
The table below lists the key points of network connectivity deployment, based on
the services and scale of the campus network.
Deployment Description
● Compared with the three-layer architecture, the two-layer architecture does
not have the aggregation layer. This chapter uses the three-layer architecture
as an example. For differences between the two architectures, see 2.2.1.2
Deployment Differences Between Two-Layer and Three-Layer Network
Architectures.
● Multiple switches configured with the CSS or stacking function are virtualized
into one logical switch, simplifying the configuration and networking. For a
deployment example, see 2.2.1.3 Typical CSS and Stack Deployment.
features good scalability. Typically, a campus network using the tree topology has
a hierarchical architecture that consists of the terminal layer, access layer,
aggregation layer, and core layer. In actual deployments, you can flexibly select a
two-layer or three-layer network architecture based on the network scale and
service requirements.
Deployment Differences
The difference between the two network architectures is that the three-layer
network architecture has the aggregation layer, whereas the two-layer network
architecture does not. The aggregation layer is between the core and access layers
and connects to both layers. Aggregation switches aggregate traffic from access
switches, process the traffic, and provide uplinks to the core layer.
The selection of the two network architectures depends on the following factors:
1. Network scale: The number of NEs is proportional to the investment required.
2. Network complexity: The network maintenance cost and fault locating
complexity vary depending on the network complexity. A more complex
network results in more failure points, making fault locating more difficult
and hence increasing the maintenance cost.
3. Transmission distance: A network using the three-layer architecture is larger
than a network using the two-layer architecture, if the differences between
transmission media are not considered.
Networking Requirements
At the core layer, two modular switches set up a CSS. At the aggregation layer,
every two fixed switches set up a stack. The CSS at the core layer is connected to
stacks at the aggregation layer through Eth-Trunk interfaces.
NOTE
The stack connection mode, CSS connection mode, and support for the stack and CSS
functions vary according to device models. You can use the Stack Assistant or query the
"Stack Support" or "CSS Support" section in the related product documentation to obtain
detailed information about each device model.
Deployment Roadmap
Step Deployment Roadmap Devices Involved
Data Plan
Table 2-4 Software and hardware configuration plan for the CSS
Item Data
Number of 2
member switches
CSS master The switch with the CSS ID 1 is the CSS master.
CSS priority The CSS priority of the switch with the CSS ID 1 is 150.
The switch with the CSS ID 2 uses the default CSS priority 1.
MAD The two member switches in the CSS are directly connected
using an independent cable for MAD. The cable connects
XGE 1/1/0/10 and XGE 2/1/0/10.
Number of 2
member switches
Hardware Stack ports: 10GE service ports 10GE 1/0/2 and 10GE 1/0/4
configuration of Stack topology: ring topology
each switch
Stack cable: two 3 m SFP+ AOC cables
Stack master The stack IDs of the two member switches are changed to 1
and 2 respectively. The switch with the stack ID 1 is the
master switch.
Stack priority The stack priority of the switch with the stack ID 1 is 150.
The stack priority of the switch with the stack ID 2 is 100.
Table 2-6 Plan for the connections between CSS and stack ports
Item Port Number
Procedure
Step 1 Set up a CSS.
1. Power off the switches, install CSS LPUs, and connect CSS cables and the
MAD cable according to the following figure.
NOTE
[Switch1] css enable //After confirming that the CSS configuration is correct, enable the CSS
function and restart the switch. To ensure that Switch1 becomes the master switch, restart it first.
Warning: The CSS configuration will take effect only after the system is rebooted. The next CSS mode
is CSS card. Reboot now? [Y/N]:y
<HUAWEI> system-view
[HUAWEI] sysname Switch2
[Switch2] set css id 2 //Set the CSS ID to 2. Retain the default CSS priority of Switch2.
[Switch2] interface css-port 1
[Switch2-css-port1] port interface xgigabitethernet 4/0/1 to xgigabitethernet 4/0/2 enable
[Switch2-css-port1] quit
[Switch2] interface css-port 2
[Switch2-css-port2] port interface xgigabitethernet 5/0/1 to xgigabitethernet 5/0/2 enable
[Switch2-css-port2] quit
[Switch2] display css status saved //Check whether the CSS configuration is correct.
CSS port media-type: SFP+
Current Id Saved Id CSS Enable CSS Mode Priority Master Force
------------------------------------------------------------------------------
1 2 Off LPU 1 Off
[Switch2] css enable //After confirming that the CSS configuration is correct, enable the CSS
function and restart the switch.
Warning: The CSS configuration will take effect only after the system is rebooted. The next CSS mode
is CSS card. Reboot now? [Y/N]:y
3. After the switches are restarted, check whether the CSS is set up successfully.
# Check the CSS status by observing CSS indicators on main control boards of
the switches.
The ACT indicator on a main control board of Switch1 is steady green,
indicating that this main control board is the CSS master main control board
and Switch1 is the master switch.
The ACT indicator on a main control board of Switch2 is blinking green,
indicating that this main control board is the CSS standby main control board
and Switch2 is the standby switch.
# Log in to the CSS through the console interface on any main control board
and run commands to check whether the CSS is set up successfully.
Switch1 with a higher CSS priority becomes the master switch of the CSS.
When you run the display device command to check the CSS status, the CSS
name is Switch1.
<Switch1> display device
Chassis 1 (Master Switch)
Chassis 1 || Chassis 2
================================================================================
Num [CSS port] [LPU Port] || [LPU Port] [CSS port]
1 1/1 XGigabitEthernet1/4/0/1 XGigabitEthernet2/4/0/1 2/1
2 1/1 XGigabitEthernet1/4/0/2 XGigabitEthernet2/4/0/2 2/1
3 1/2 XGigabitEthernet1/5/0/1 XGigabitEthernet2/5/0/1 2/2
4 1/2 XGigabitEthernet1/5/0/2 XGigabitEthernet2/5/0/2 2/2
Chassis 2 || Chassis 1
================================================================================
Num [CSS port] [LPU Port] || [LPU Port] [CSS port]
1 2/1 XGigabitEthernet2/4/0/1 XGigabitEthernet1/4/0/1 1/1
2 2/1 XGigabitEthernet2/4/0/2 XGigabitEthernet1/4/0/2 1/1
3 2/2 XGigabitEthernet2/5/0/1 XGigabitEthernet1/5/0/1 1/2
4 2/2 XGigabitEthernet2/5/0/2 XGigabitEthernet1/5/0/2 1/2
<Switch1> system-view
[Switch1] sysname CORE //Change the CSS name to make it easy to remember.
2. Power off the switches, and connect stack cables and the DAD cable
according to Figure 2-7.
As shown in Figure 2-7, two S6730-H28X6CZ-V2 switches set up a stack, and
the stack ports are the same as the ports configured in the preceding step.
3. After the switches are restarted, check whether the stack is set up successfully.
<Switch1> display stack configuration //The command output shows that the stack is set up
successfully, and Switch1 is the master switch.
Oper : Operation
Conf : Configuration
* : Offline configuration
# : Media mismatch or absence
Attribute Configuration:
--------------------------------------------------------------------------
Stack-Port Configuration:
--------------------------------------------------------------------------------
Stack-Port Member Ports
--------------------------------------------------------------------------------
Stack-Port1/1 10GE1/1/0/2 10GE1/1/0/4
Stack-Port2/1 10GE2/1/0/2 10GE2/1/0/4
--------------------------------------------------------------------------------
Stack-Global Configuration:
--------------------------------------------------------------------------------
AuthMode Password
--------------------------------------------------------------------------------
hmac-sha256 ******
--------------------------------------------------------------------------------
<Switch1> system-view
[Switch1] sysname AGG1 //Change the stack name to make it easy to remember.
4. Configure DAD after the stack is set up.
If the stack splits, services will be affected because two master switches exist.
To avoid this problem, use a cable to directly connect the two member
switches for DAD after the stack is set up. To be specific, the cable connects
10GE 1/0/10 and 10GE 2/0/10, as shown in Figure 2-7.
[AGG1] interface 10ge 1/0/10
[AGG1-10GE1/0/10] dual-active detect mode direct
Warning: The interface will block common data packets, except BPDU packets. Continue? [Y/N]: y
[AGG1-10GE1/0/10] quit
[AGG1] interface 10ge 2/0/10
[AGG1-10GE2/0/10] dual-active detect mode direct
Warning: The interface will block common data packets, except BPDU packets. Continue? [Y/N]: y
[AGG1-10GE2/0/10] return
<AGG1> display dual-active //Check the DAD configuration.
Stack domainID: 10
Dual-active status: Normal
Dual-active detect mode: Direct
Step 3 Configure Eth-Trunk interfaces between the CSS and stacks and between the
stacks and access switches.
1. Configure Eth-Trunk interfaces in the CSS.
<CORE> system-view
[CORE] interface eth-trunk 10 //Create an Eth-Trunk interface for connecting to AGG1.
[CORE-Eth-Trunk10] mode lacp
[CORE-Eth-Trunk10] quit
[CORE] interface xgigabitethernet 1/1/0/1
[CORE-XGigabitEthernet1/1/0/1] eth-trunk 10
[CORE-XGigabitEthernet1/1/0/1] quit
[CORE] interface xgigabitethernet 2/1/0/2
[CORE-XGigabitEthernet2/1/0/2] eth-trunk 10
[CORE-XGigabitEthernet2/1/0/2] quit
[CORE] interface eth-trunk 20 //Create an Eth-Trunk interface for connecting to AGG2.
[CORE-Eth-Trunk20] mode lacp
[CORE-Eth-Trunk20] quit
[CORE] interface xgigabitethernet 1/1/0/2
[CORE-XGigabitEthernet1/1/0/2] eth-trunk 20
[CORE-XGigabitEthernet1/1/0/2] quit
[CORE] interface xgigabitethernet 2/1/0/1
[CORE-XGigabitEthernet2/1/0/1] eth-trunk 20
[CORE-XGigabitEthernet2/1/0/1] quit
[AGG2-10GE1/0/3] quit
[AGG2] interface 10ge 2/0/3
[AGG2-10GE2/0/3] eth-trunk 40
[AGG2-10GE2/0/3] quit
4. Configure an Eth-Trunk interface on access switch ACC1.
<ACC1> system-view
[ACC1] interface eth-trunk 30 //Create an Eth-Trunk interface for connecting to stack AGG1.
[ACC1-Eth-Trunk30] mode lacp-static
[ACC1-Eth-Trunk30] quit
[ACC1] interface 10ge 1/0/1
[ACC1-10GE1/0/1] eth-trunk 30
[ACC1-10GE1/0/1] quit
[ACC1] interface 10ge 1/0/2
[ACC1-10GE1/0/2] eth-trunk 30
[ACC1-10GE1/0/2] quit
5. Configure an Eth-Trunk interface on access switch ACC2.
<ACC2> system-view
[ACC2] interface eth-trunk 40 //Create an Eth-Trunk interface for connecting to stack AGG2.
[ACC2-Eth-Trunk40] mode lacp-static
[ACC2-Eth-Trunk40] quit
[ACC2] interface 10ge 1/0/1
[ACC2-10GE1/0/1] eth-trunk 40
[ACC2-10GE1/0/1] quit
[ACC2] interface 10ge 1/0/2
[ACC2-10GE1/0/2] eth-trunk 40
[ACC2-10GE1/0/2] quit
----End
Configuration Scripts
NOTE
The CSS and stack configurations are not recorded in the configuration file, but are instead
directly written into the flash memory. Therefore, the configuration file does not contain
the CSS and stack configurations, and contains only the DAD/MAD and Eth-Trunk interface
configurations.
● CSS
#
sysname CORE
#
interface Eth-Trunk10
mode lacp
#
interface Eth-Trunk20
mode lacp
#
interface XGigabitEthernet1/1/0/1
eth-trunk 10
#
interface XGigabitEthernet1/1/0/2
eth-trunk 20
#
interface XGigabitEthernet1/1/0/10
mad detect mode direct
#
interface XGigabitEthernet2/1/0/1
eth-trunk 20
#
interface XGigabitEthernet2/1/0/2
eth-trunk 10
#
interface XGigabitEthernet2/1/0/10
mad detect mode direct
#
return
● AGG1
#
sysname AGG1
#
interface Eth-Trunk10
mode lacp
#
interface Eth-Trunk30
mode lacp
#
interface 10GE 1/0/3
eth-trunk 30
#
interface 10GE 1/0/10
mad detect mode direct
#
interface 10GE 2/0/3
eth-trunk 30
#
interface 10GE 2/0/10
mad detect mode direct
#
interface 10GE 1/0/1
eth-trunk 10
#
interface 10GE 2/0/1
eth-trunk 10
#
return
● AGG2
#
sysname AGG2
#
interface Eth-Trunk20
mode lacp
#
interface Eth-Trunk40
mode lacp
#
interface 10GE 1/0/3
eth-trunk 40
#
interface 10GE 1/0/10
mad detect mode direct
#
interface 10GE 2/0/3
eth-trunk 40
#
interface 10GE 2/0/10
mad detect mode direct
#
interface 10GE 1/0/1
eth-trunk 20
#
interface 10GE 2/0/1
eth-trunk 20
#
return
● ACC1
#
sysname ACC1
#
interface Eth-Trunk30
mode lacp
#
interface 10GE1/0/1
eth-trunk 30
#
interface 10GE1/0/2
eth-trunk 30
#
return
● ACC2
#
sysname ACC2
#
interface Eth-Trunk40
mode lacp
#
interface 10GE1/0/1
eth-trunk 40
#
interface 10GE1/0/2
eth-trunk 40
#
return
Networking Requirements
Core switches set up a CSS that functions as the core of the entire campus
network to enhance network reliability and maximize forwarding performance.
Standalone ACs are deployed in off-path mode. They function as gateways to
assign IP addresses to APs and centrally manage network-wide APs.
Aggregation switches set up stacks to implement device-level backup and increase
the port density and forwarding bandwidth.
In this example, core switches set up a CSS that functions as the gateway for
wired and wireless users on the entire network and is responsible for routing and
forwarding of user services.
AC - AC6805 V200R022C10
Deployment Roadmap
Step Deployment Roadmap Devices Involved
Data Plan
Item Data
AP group ap-group1
Deployment Precautions
● It is not recommended that VLAN 1 be used as the management VLAN or a
service VLAN. Remove all interfaces from VLAN 1. Interfaces need to
transparently transmit packets from specific VLANs, instead of all VLANs,
based on actual service requirements.
● In direct forwarding mode, it is recommended that different VLANs be used as
the management VLAN and service VLAN. If you do not follow this
recommendation, services may be interrupted, which can be illustrated with
the following example: If a VLAN is configured as both the management
VLAN and service VLAN, and the interface connecting a switch to an AP has
the management VLAN ID as the PVID, downstream packets in the service
VLAN are terminated when going out from the switch. In this case, services
are interrupted.
● In direct forwarding mode, service packets from APs are not encapsulated in
CAPWAP tunnels, but are directly forwarded to the upper-layer network.
Because of this, service packets and management packets can be transmitted
properly only if the network between APs and the upper-layer network is
added to the service VLAN and the network between ACs and APs is added to
the management VLAN.
● WLAN service configurations (for example, WMM profile, radio profile, radio,
traffic profile, security profile, security policy, and WLAN ID) of the AP
associated with the master and backup ACs must be consistent on the two
ACs; otherwise, user services may be affected after a master/backup
switchover between the ACs.
● The models and software versions of the master and backup ACs must be the
same.
● When deploying the DHCP server in the scenario where VRRP HSB is
configured, be aware of the following guidelines:
– In V200R019C00 and later versions, there is no restriction on which
interface to enable the DHCP server function. Only the master AC
allocates IP addresses, and IP address allocation information will be
synchronized to the backup AC.
– The IP address pools configured on the master and backup ACs must be
the same. If they are different, data backup between the master and
backup ACs will fail.
– Run the hsb-service-type dhcp hsb-group group-index command to
bind the DHCP service to the HSB group. If you do not perform this
operation, IP address allocation information cannot be backed up from
the master AC to the backup AC.
Procedure
Step 1 Configure CSS on core switches and stacking on aggregation switches, and
configure MAD and uplink and downlink Eth-Trunk interfaces on the switches.
# Create VLANs.
[CORE] vlan batch 20 30 40 50 60 1000
# Create Eth-Trunk 1 for connecting to CORE-AC1 and add interfaces to it. The
configuration of the Eth-Trunk interface for connecting to CORE-AC2 is similar.
[CORE] interface eth-trunk 1
[CORE-Eth-Trunk1] description con to CORE-AC1
[CORE-Eth-Trunk1] mode lacp
[CORE-Eth-Trunk1] port link-type trunk
[CORE-Eth-Trunk1] undo port trunk allow-pass vlan 1
[CORE-Eth-Trunk1] port trunk allow-pass vlan 20
[CORE-Eth-Trunk1] quit
[CORE] interface xgigabitethernet 1/1/0/3
[CORE-XGigabitEthernet1/1/0/3] eth-trunk 1
[CORE-XGigabitEthernet1/1/0/3] quit
[CORE] interface xgigabitethernet 2/1/0/3
[CORE-XGigabitEthernet2/1/0/3] eth-trunk 1
[CORE-XGigabitEthernet2/1/0/3] quit
Step 3 Configure interfaces and VLANs on AGG1. The configuration on AGG2 is similar.
# Create VLANs.
[AGG1] vlan batch 20 30 40 50
Step 4 Configure interfaces and VLANs on ACC1. The configuration on ACC2 is similar.
# Create VLANs.
[ACC1] vlan batch 20 30 40 50
Step 6 Configure DHCP on CORE so that CORE functions as a DHCP server to assign IP
addresses to wired and wireless users.
# Enable DHCP globally and configure DHCP snooping for the service VLANs.
[CORE] dhcp enable
[CORE] dhcp snooping enable
[CORE] vlan 30
[CORE-vlan30] dhcp snooping enable
[CORE-vlan30] quit
[CORE] vlan 40
[CORE-vlan40] dhcp snooping enable
[CORE-vlan40] quit
[CORE] vlan 50
[CORE-vlan50] dhcp snooping enable
[CORE-vlan50] quit
[CORE] vlan 60
# Create Layer 3 interfaces VLANIF 30 and VLANIF 40 for wireless services, and
configure CORE to assign IP addresses to STAs from the interface address pools.
[CORE] interface vlanif 30
[CORE-Vlanif30] ip address 172.16.30.1 255.255.255.0
[CORE-Vlanif30] dhcp select interface
[CORE-Vlanif30] dhcp server dns-list 192.168.11.2 //Configure the DNS server for terminals.
[CORE-Vlanif30] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP in a service VLAN
for wireless users. Otherwise, wireless users cannot communicate with each other through the AC.
Determine whether to configure this command based on actual requirements.
[CORE-Vlanif30] quit
[CORE] interface vlanif 40
[CORE-Vlanif40] ip address 172.16.40.1 255.255.255.0
[CORE-Vlanif40] dhcp select interface
[CORE-Vlanif40] dhcp server dns-list 192.168.11.2 //Configure the DNS server for terminals.
[CORE-Vlanif40] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP in a service VLAN
for wireless users. Otherwise, wireless users cannot communicate with each other through the AC.
Determine whether to configure this command based on actual requirements.
[CORE-Vlanif40] quit
# Create Layer 3 interfaces VLANIF 50 and VLANIF 60 for wired services, and
configure CORE to assign IP addresses to wired terminals from the interface
address pools.
[CORE] interface vlanif 50
[CORE-Vlanif50] ip address 172.16.50.1 255.255.255.0
[CORE-Vlanif50] dhcp select interface
[CORE-Vlanif50] dhcp server dns-list 192.168.11.2 //Configure the DNS server for terminals.
[CORE-Vlanif50] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP in a service VLAN
for wired users. Otherwise, wired users cannot communicate with each other. Determine whether to
configure this command based on actual requirements.
[CORE-Vlanif50] quit
[CORE] interface vlanif 60
[CORE-Vlanif60] ip address 172.16.60.1 255.255.255.0
[CORE-Vlanif60] dhcp select interface
[CORE-Vlanif60] dhcp server dns-list 192.168.11.2 //Configure the DNS server for terminals.
[CORE-Vlanif60] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP in a service VLAN
for wired users. Otherwise, wired users cannot communicate with each other. Determine whether to
configure this command based on actual requirements.
[CORE-Vlanif60] quit
Step 8 Configure routes from CORE-AC1 to the network segments of wired users and the
server zone. The configuration on CORE-AC2 is similar.
# Create HSB group 0 on CORE-AC1, and bind HSB service 0 and the management
VRRP group to HSB group 0.
[CORE-AC1] hsb-group 0
[CORE-AC1-hsb-group-0] bind-service 0
[CORE-AC1-hsb-group-0] track vrrp vrid 1 interface vlanif 20
[CORE-AC1-hsb-group-0] quit
# After the configuration is complete, run the display vrrp command on both
CORE-AC1 and CORE-AC2. In the command output of both devices, the State field
value of CORE-AC1 is Master and that of CORE-AC2 is Backup.
[CORE-AC1] display vrrp
Vlanif20 | Virtual Router 1
State : Master
Virtual IP : 192.168.20.3
Master IP : 192.168.20.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 1200s
TimerRun : 2s
TimerConfig : 2s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : admin-vrrp
Backup-forward : disabled
Track SysHealth Priority reduced : 254
SysHealth state : UP
Create time : 2019-11-05 15:30:25
Last change time : 2019-11-05 15:30:31
# Check the HSB service status on CORE-AC1 and CORE-AC2. In the command
output of both devices, the value Connected of Service State indicates that the
HSB channel has been established.
[CORE-AC1] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.100.1
Peer IP Address : 172.16.100.2
Source Port : 10241
Destination Port : 10241
Keep Alive Times :5
Keep Alive Interval : 3
Service State : Connected
Service Batch Modules :
Shared-key :-
----------------------------------------------------------
[CORE-AC2] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.100.2
Peer IP Address : 172.16.100.1
Source Port : 10241
Destination Port : 10241
Keep Alive Times :5
Keep Alive Interval : 3
Service State : Connected
Service Batch Modules :
Shared-key :-
----------------------------------------------------------
DHCP
----------------------------------------------------------
[CORE-AC2] display hsb-group 0
Hot Standby Group Information:
----------------------------------------------------------
HSB-group ID :0
Vrrp Group ID :1
Vrrp Interface : Vlanif20
Service Index :0
Group Vrrp Status : Backup
Group Status : Inactive
Group Backup Process : Realtime
Peer Group Device Name : AC6805
Peer Group Software Version : V200R022C10
Group Backup Modules : Access-user
DHCP
AP
----------------------------------------------------------
# Create an AP group to add APs with the same configurations to the AP group.
[CORE-AC1] wlan
[CORE-AC1-wlan-view] ap-group name ap-group1
[CORE-AC1-wlan-ap-group-ap-group1] quit
# Create a regulatory domain profile, configure the country code for the AC in the
profile, and bind the profile to the AP group.
[CORE-AC1-wlan-view] regulatory-domain-profile name domain1
[CORE-AC1-wlan-regulate-domain-domain1] country-code en
[CORE-AC1-wlan-regulate-domain-domain1] quit
[CORE-AC1-wlan-view] ap-group name ap-group1
[CORE-AC1-wlan-ap-group-ap-group1] regulatory-domain-profile domain1
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the
radio and reset the AP. Continue?[Y/N]:y
[CORE-AC1-wlan-ap-group-ap-group1] quit
# Add target APs to the AP group and configure names for the APs based on their
deployment locations.
[CORE-AC1-wlan-view] ap auth-mode mac-auth
[CORE-AC1-wlan-view] ap-id 1 ap-mac 00e0-fc12-6660
[CORE-AC1-wlan-ap-1] ap-name area_1
[CORE-AC1-wlan-ap-1] ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and
antenna gain configurations of the radio, whether to continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[CORE-AC1-wlan-ap-1] quit
[CORE-AC1-wlan-view] ap-id 2 ap-mac 00e0-fc12-6670
[CORE-AC1-wlan-ap-2] ap-name area_2
[CORE-AC1-wlan-ap-2] ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and
antenna gain configurations of the radio, whether to continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[CORE-AC1-wlan-ap-2] quit
[CORE-AC1-wlan-view] quit
# After powering on the APs, run the display ap all command on CORE-AC1 to
check the AP running status. In the command output, the State field value is nor,
indicating that the APs are in normal state.
[CORE-AC1] display ap all
Total AP information:
# Create WLAN VAP profiles, configure the service data forwarding mode and
service VLANs, apply security profiles and SSID profiles, and enable strict STA IP
address learning through DHCP, IPSG, and dynamic ARP inspection.
[CORE-AC1-wlan-view] vap-profile name vap1
[CORE-AC1-wlan-vap-prof-vap1] forward-mode direct-forward
[CORE-AC1-wlan-vap-prof-vap1] service-vlan vlan-id 30
[CORE-AC1-wlan-vap-prof-vap1] security-profile sec1
[CORE-AC1-wlan-vap-prof-vap1] ssid-profile ssid1
[CORE-AC1-wlan-vap-prof-vap1] traffic-profile traff1
[CORE-AC1-wlan-vap-prof-vap1] ip source check user-bind enable
[CORE-AC1-wlan-vap-prof-vap1] arp anti-attack check user-bind enable
[CORE-AC1-wlan-vap-prof-vap1] learn-client-address dhcp-strict
[CORE-AC1-wlan-vap-prof-vap1] quit
[CORE-AC1-wlan-view] vap-profile name vap2
[CORE-AC1-wlan-vap-prof-vap2] forward-mode direct-forward
[CORE-AC1-wlan-vap-prof-vap2] service-vlan vlan-id 40
[CORE-AC1-wlan-vap-prof-vap2] security-profile sec2
[CORE-AC1-wlan-vap-prof-vap2] ssid-profile ssid2
[CORE-AC1-wlan-vap-prof-vap2] traffic-profile traff2
[CORE-AC1-wlan-vap-prof-vap2] ip source check user-bind enable
[CORE-AC1-wlan-vap-prof-vap2] arp anti-attack check user-bind enable
[CORE-AC1-wlan-vap-prof-vap2] learn-client-address dhcp-strict
[CORE-AC1-wlan-vap-prof-vap2] quit
NOTE
IP packet check enabled using the ip source check user-bind enable command is based on
binding entries. Therefore:
● For DHCP users, enable DHCP snooping on the device to automatically generate
dynamic binding entries.
● For users using static IP addresses, manually configure static binding entries.
Before running the learn-client-address dhcp-strict command:
● Run the undo dhcp trust port command in the VAP profile view to disable the DHCP
trusted interface on an AP.
● Run the undo learn-client-address { ipv4 | ipv6 } disable command in the VAP profile
view to enable STA IP address learning.
Step 12 Configure wireless configuration synchronization in the scenario where VRRP HSB
is configured to synchronize wireless service configuration information from
CORE-AC1 to CORE-AC2.
# Configure the source interface of CORE-AC2.
[CORE-AC2] capwap source interface vlanif 20
# Run the display sync-configuration status command to check the status of the
wireless configuration synchronization function. In the command output, the
Status field value is cfg-mismatch. In this case, you need to manually trigger
wireless configuration synchronization from the master AC to the backup AC. Wait
until the backup AC automatically restarts.
[CORE-AC1] display sync-configuration status
Controller role:Master/Backup/Local
-----------------------------------------------------------------------------------------------------------------------------
Controller IP Role Device Type Version Status Last synced
-----------------------------------------------------------------------------------------------------------------------------
172.16.100.2 Backup AirEngine 8760-X1-PRO V200R022C10 cfg-mismatch(config check fail) -
-----------------------------------------------------------------------------------------------------------------------------
Total: 1
[CORE-AC1] synchronize-configuration
Warning: This operation may reset the remote AC, synchronize configurations to it, and save all its
configurations. Whether to continue? [Y/N]:y
NOTE
----End
Verification Method
● Run the following command on CORE-AC1. The command output shows that
APs have obtained IP addresses successfully.
[CORE-AC1] display ip pool interface vlanif20 used
Pool-name : vlanif20
Pool-No :0
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 :-
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 192.168.20.0
Mask : 255.255.255.0
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :2
Idle :233 Expired :0
Conflict :0 Disabled :19
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
192.168.20.1 192.168.20.254 254 2 233(0) 0 19
-------------------------------------------------------------------------------------
Client-ID format as follows:
DHCP : mac-address PPPoE : mac-address
IPSec : user-id/portnumber/vrf PPP : interface index
L2TP : cpu-slot/session-id SSL-VPN : user-id/session-id
-------------------------------------------------------------------------------------
Index IP Client-ID Type Left Status
-------------------------------------------------------------------------------------
40 192.168.20.41 00e0-fc12-6660 DHCP 72528 Used
163 192.168.20.164 00e0-fc12-6670 DHCP 72813 Used
-------------------------------------------------------------------------------------
● Run the following commands on CORE. The command output shows that
wired users have obtained IP addresses successfully.
[CORE] display ip pool interface vlanif50 used
Pool-name : Vlanif50
Pool-No :2
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 : 192.168.11.2
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 172.16.50.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :1
Idle :253 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
172.16.50.1 172.16.50.254 254 1 253(0) 0 0
-------------------------------------------------------------------------------------
Client-ID format as follows:
DHCP : mac-address PPPoE : mac-address
IPSec : user-id/portnumber/vrf PPP : interface index
L2TP : cpu-slot/session-id SSL-VPN : user-id/session-id
-------------------------------------------------------------------------------------
Index IP Client-ID Type Left Status
-------------------------------------------------------------------------------------
109 172.16.50.110 00e0-fc12-3344 DHCP 48538 Used
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
[CORE] display ip pool interface vlanif60 used
Pool-name : Vlanif60
Pool-No :3
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 : 192.168.11.2
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 172.16.60.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :1
Idle :253 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
172.16.60.1 172.16.60.254 254 1 253(0) 0 0
-------------------------------------------------------------------------------------
Client-ID format as follows:
DHCP : mac-address PPPoE : mac-address
IPSec : user-id/portnumber/vrf PPP : interface index
L2TP : cpu-slot/session-id SSL-VPN : user-id/session-id
-------------------------------------------------------------------------------------
Index IP Client-ID Type Left Status
-------------------------------------------------------------------------------------
236 172.16.60.237 00e0-fc12-3377 DHCP 48050 Used
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
# After a wireless user connects to AP1, you can view information about the
wireless user on CORE-AC1.
[CORE-AC1] display station ssid test01
Rf/WLAN: Radio ID/WLAN ID
Rx/Tx: link receive rate/link transmit rate(Mbps)
-----------------------------------------------------------------------------------------------
STA MAC AP ID Ap name Rf/WLAN Band Type Rx/Tx RSSI VLAN IP address
-----------------------------------------------------------------------------------------------
00e0-fc12-3388 2 area_2 1/1 5G 11ac 173/144 -38 30 172.16.30.180
-----------------------------------------------------------------------------------------------
Total: 1 2.4G: 0 5G: 1
Configuration Scripts
# CORE
#
vlan batch 20 30 40 50 60 1000
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 40
dhcp snooping enable
vlan 50
dhcp snooping enable
vlan 60
dhcp snooping enable
#
interface Vlanif20
ip address 192.168.20.20 255.255.255.0
#
interface Vlanif30
ip address 172.16.30.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.11.2
#
interface Vlanif40
ip address 172.16.40.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.11.2
#
interface Vlanif50
ip address 172.16.50.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.11.2
#
interface Vlanif60
ip address 172.16.60.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.11.2
#
interface Vlanif1000
ip address 192.168.11.1 255.255.255.0
#
interface Eth-Trunk1
description con to CORE-AC1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp
#
interface Eth-Trunk2
description con to CORE-AC2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp
#
interface Eth-Trunk10
description con to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 50
mode lacp
#
interface Eth-Trunk20
description con to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 60
mode lacp
#
interface XGigabitEthernet1/1/0/1
eth-trunk 10
#
interface XGigabitEthernet1/1/0/2
eth-trunk 20
#
interface XGigabitEthernet1/1/0/3
eth-trunk 1
#
interface XGigabitEthernet1/1/0/4
eth-trunk 2
#
interface XGigabitEthernet1/1/0/10
mad detect mode direct
#
interface XGigabitEthernet1/2/0/1
port link-type access
port default vlan 1000
#
interface XGigabitEthernet2/1/0/1
eth-trunk 20
#
interface XGigabitEthernet2/1/0/2
eth-trunk 10
#
interface XGigabitEthernet2/1/0/3
eth-trunk 1
#
interface XGigabitEthernet2/1/0/4
eth-trunk 2
#
interface XGigabitEthernet2/1/0/10
mad detect mode direct
#
return
# AGG1
#
vlan batch 20 30 40 50
#
interface Eth-Trunk10
description connect to CORE
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 50
mode lacp-static
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 50
mode lacp-static
port-isolate enable group 1
#
interface 10GE1/0/3
eth-trunk 30
#
interface 10GE2/0/3
eth-trunk 30
#
interface 10GE1/0/1
eth-trunk 10
#
interface 10GE2/0/1
eth-trunk 10
#
return
# AGG2
#
vlan batch 20 30 40 60
#
interface Eth-Trunk20
description connect to CORE
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 60
mode lacp-static
#
interface Eth-trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 60
mode lacp-static
port-isolate enable group 1
#
interface 10GE1/0/3
eth-trunk 40
#
interface 10GE2/0/3
eth-trunk 40
#
interface 10GE1/0/1
eth-trunk 20
#
interface 10GE2/0/1
eth-trunk 20
#
return
# ACC1
#
vlan batch 20 30 40 50
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 50
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 30
#
interface 10GE1/0/2
eth-trunk 30
#
interface GE1/0/3
port link-type access
port default vlan 50
stp edged-port enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type trunk
port trunk pvid vlan 20
port trunk allow-pass vlan 20 30 40
stp edged-port enable
port-isolate enable group 1
#
return
# ACC2
#
vlan batch 20 30 40 60
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40 60
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 40
#
interface 10GE1/0/2
eth-trunk 40
#
interface GE1/0/3
port link-type access
port default vlan 60
stp edged-port enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type trunk
port trunk pvid vlan 20
port trunk allow-pass vlan 20 30 40
stp edged-port enable
port-isolate enable group 1
#
return
# CORE-AC1
#
sysname CORE-AC1
#
vrrp recover-delay 60
#
vlan batch 20 100
#
dhcp enable
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
dhcp server excluded-ip-address 192.168.20.2
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif100
ip address 172.16.100.1 255.255.255.0
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp
#
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface XGigabitEthernet0/0/21
eth-trunk 1
#
interface XGigabitEthernet0/0/22
eth-trunk 1
#
ip route-static 172.16.50.0 255.255.255.0 192.168.20.20
ip route-static 172.16.60.0 255.255.255.0 192.168.20.20
ip route-static 192.168.11.0 255.255.255.0 192.168.20.20
#
capwap source interface vlanif20
#
hsb-service 0
# CORE-AC2
#
sysname CORE-AC2
#
vrrp recover-delay 60
#
vlan batch 20 100
#
dhcp enable
#
interface Vlanif20
ip address 192.168.20.2 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
dhcp select interface
dhcp server excluded-ip-address 192.168.20.1
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif100
ip address 172.16.100.2 255.255.255.0
#
interface Eth-Trunk2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp
#
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface XGigabitEthernet0/0/21
eth-trunk 2
#
interface XGigabitEthernet0/0/22
eth-trunk 2
#
ip route-static 172.16.50.0 255.255.255.0 192.168.20.20
ip route-static 172.16.60.0 255.255.255.0 192.168.20.20
ip route-static 192.168.11.0 255.255.255.0 192.168.20.20
#
capwap source interface vlanif20
#
hsb-service 0
service-ip-port local-ip 172.16.100.2 peer-ip 172.16.100.1 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif20
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type dhcp hsb-group 0
#
hsb-service-type ap hsb-group 0
#
wlan
traffic-profile name traff1
user-isolate l2
traffic-profile name traff2
user-isolate l2
security-profile name sec1
security-profile name sec2
ssid-profile name ssid1
ssid test01
ssid-profile name ssid2
ssid test02
vap-profile name vap1
forward-mode direct-forward
service-vlan vlan-id 30
ssid-profile ssid1
security-profile sec1
traffic-profile traff1
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
vap-profile name vap2
forward-mode direct-forward
service-vlan vlan-id 40
ssid-profile ssid2
security-profile sec2
traffic-profile traff2
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
regulatory-domain-profile name domain1
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 1 type-id 30 ap-mac 00e0-fc12-6660 ap-sn 2102355547W0E3000316
ap-name area_1
ap-group ap-group1
ap-id 2 type-id 56 ap-mac 00e0-fc12-6670 ap-sn 21500829352SGA900583
ap-name area_2
ap-group ap-group1
master controller
master-redundancy track-vrrp vrid 1 interface Vlanif20
master-redundancy peer-ip ip-address 172.16.100.1 local-ip ip-address 172.16.100.2 psk %^%#QKK0'nRL
%0U`y32S6bOSB40e=FJE^Lbs7.A]x)QQ%^%#
#
return
Networking Requirements
Core switches set up a CSS that functions as the core of the entire campus
network to enhance network reliability and maximize forwarding performance.
Aggregation switches set up stacks to implement device-level backup and increase
the port density and forwarding bandwidth. Standalone ACs are deployed in off-
path mode. They centrally manage APs on the entire network.
In this example, aggregation switches set up stacks that function as gateways for
wired and wireless users on the entire network and are responsible for routing and
forwarding of user services.
AC - AC6805 V200R022C10
Deployment Roadmap
Step Deployment Roadmap Devices Involved
Data Plan
Item Data
Precautions
● It is not recommended that VLAN 1 be used as the management VLAN or a
service VLAN. Remove all interfaces from VLAN 1. Interfaces need to
transparently transmit packets from specific VLANs, instead of all VLANs,
based on actual service requirements.
● In direct forwarding mode, it is recommended that different VLANs be used as
the management VLAN and service VLAN. If you do not follow this
recommendation, services may be interrupted, which can be illustrated with
the following example: If a VLAN is configured as both the management
VLAN and service VLAN, and the interface connecting a switch to an AP has
the management VLAN ID as the PVID, downstream packets in the service
VLAN are terminated when going out from the switch. In this case, services
are interrupted.
● In direct forwarding mode, service packets from APs are not encapsulated in
CAPWAP tunnels, but are directly forwarded to the upper-layer network.
Because of this, service packets and management packets can be transmitted
properly only if the network between APs and the upper-layer network is
added to the service VLAN and the network between ACs and APs is added to
the management VLAN.
● WLAN service configurations (for example, WMM profile, radio profile, radio,
traffic profile, security profile, security policy, and WLAN ID) of the AP
associated with the master and backup ACs must be consistent on the two
ACs; otherwise, user services may be affected after a master/backup
switchover between the ACs.
● The models and software versions of the master and backup ACs must be the
same.
● When deploying the DHCP server in the scenario where VRRP HSB is
configured, be aware of the following guidelines:
– In V200R019C00 and later versions, there is no restriction on which
interface to enable the DHCP server function. Only the master AC
allocates IP addresses, and IP address allocation information will be
synchronized to the backup AC.
– The IP address pools configured on the master and backup ACs must be
the same. If they are different, data backup between the master and
backup ACs will fail.
– Run the hsb-service-type dhcp hsb-group group-index command to
bind the DHCP service to the HSB group. If you do not perform this
operation, IP address allocation information cannot be backed up from
the master AC to the backup AC.
Procedure
Step 1 Configure CSS on core switches and stacking on aggregation switches, and
configure MAD and uplink and downlink Eth-Trunk interfaces on the switches.
For details, see 2.2.1.3 Typical CSS and Stack Deployment.
Step 2 Configure interfaces and VLANs on CORE.
# Create VLANs.
[CORE] vlan batch 70 80 1000
Step 3 Configure interfaces and VLANs on AGG1. The configuration on AGG2 is similar.
# Create VLANs.
[AGG1] vlan batch 20 30 31 50 70
[AGG1-10GE1/0/3] quit
[AGG1] interface 10ge 2/0/3
[AGG1-10GE2/0/3] eth-trunk 30
[AGG1-10GE2/0/3] quit
Step 5 Configure interfaces and VLANs on ACC1. The configuration on ACC2 is similar.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname ACC1
[ACC1] vlan batch 20 30 31 50
# Configure downlink interfaces connected to PC1 and AP1, and configure the
interfaces as edge ports.
[ACC1] interface GE 1/0/3
[ACC1-GE1/0/3] port link-type access
[ACC1-GE1/0/3] port default vlan 50
[ACC1-GE1/0/3] port-isolate enable group 1
[ACC1-GE1/0/3] stp edged-port enable
[ACC1-GE1/0/3] quit
Step 6 Configure DHCP on AGG1 so that AGG1 functions as a DHCP server to assign IP
addresses to wired and wireless users. The configuration on AGG2 is similar.
# Enable DHCP globally and configure DHCP snooping for the service VLANs.
[AGG1] dhcp enable
[AGG1] dhcp snooping enable
[AGG1] vlan 30
[AGG1-vlan30] dhcp snooping enable
[AGG1-vlan30] quit
[AGG1] vlan 31
[AGG1-vlan31] dhcp snooping enable
[AGG1-vlan31] quit
[AGG1] vlan 50
[AGG1-vlan50] dhcp snooping enable
[AGG1-vlan50] quit
# Create Layer 3 interface VLANIF 30 for wireless services and configure AGG1 to
assign IP addresses to STAs from the interface address pool.
[AGG1] interface Vlanif 30
[AGG1-Vlanif30] ip address 172.16.30.1 255.255.255.0
[AGG1-Vlanif30] dhcp select interface
[AGG1-Vlanif30] dhcp server dns-list 192.168.11.1 //Configure the DNS server for terminals.
[AGG1-Vlanif30] arp proxy intra-vlan enable //Enable intra-VLAN proxy ARP.
[AGG1-Vlanif30] quit
# Create Layer 3 interface VLANIF 31 for wireless services and configure AGG1 to
assign IP addresses to STAs from the interface address pool.
[AGG1] interface Vlanif 31
[AGG1-Vlanif31] ip address 172.16.31.1 255.255.255.0
[AGG1-Vlanif31] dhcp select interface
[AGG1-Vlanif31] dhcp server dns-list 192.168.11.1 //Configure the DNS server for terminals.
[AGG1-Vlanif31] arp proxy intra-vlan enable //Enable intra-VLAN proxy ARP.
[AGG1-Vlanif31] quit
# Create Layer 3 interface VLANIF 50 for wired services and configure AGG1 to
assign IP addresses to wired terminals from the interface address pool.
[AGG1] interface Vlanif 50
[AGG1-Vlanif50] ip address 172.16.50.1 255.255.255.0
[AGG1-Vlanif50] dhcp select interface
[AGG1-Vlanif50] dhcp server dns-list 192.168.11.1 //Configure the DNS server for terminals.
[AGG1-Vlanif50] arp proxy intra-vlan enable //Enable intra-VLAN proxy ARP.
[AGG1-Vlanif50] quit
Step 8 Configure DHCP on AGG-AC1 so that AGG-AC1 can function as a DHCP server to
assign IP addresses to APs. The configuration on AGG-AC3 is similar.
[AGG-AC1] dhcp enable
[AGG-AC1] interface Vlanif 20
[AGG-AC1-Vlanif20] ip address 172.16.20.1 255.255.255.0
[AGG-AC1-Vlanif20] dhcp select interface
[AGG-AC1-Vlanif20] dhcp server excluded-ip-address 192.168.20.2
[AGG-AC1-Vlanif20] dhcp server excluded-ip-address 192.168.20.20
[AGG-AC1-Vlanif20] quit
# Create HSB service 0 on AGG-AC1 and configure IP addresses and port numbers
for the HSB channel.
[AGG-AC1] hsb-service 0
[AGG-AC1-hsb-service-0] service-ip-port local-ip 172.16.200.1 peer-ip 172.16.200.2 local-data-port
10241 peer-data-port 10241
[AGG-AC1-hsb-service-0] quit
# Create HSB group 0 on AGG-AC1, and bind HSB service 0 and the management
VRRP group to HSB group 0.
[AGG-AC1] hsb-group 0
[AGG-AC1-hsb-group-0] bind-service 0
[AGG-AC1-hsb-group-0] track vrrp vrid 1 interface vlanif 20
[AGG-AC1-hsb-group-0] quit
# After the configuration is complete, run the display vrrp command on AGG-AC1
and AGG-AC2. In the command output of both devices, the State field value of
AGG-AC1 is Master and that of AGG-AC2 is Backup.
[AGG-AC1] display vrrp
Vlanif20 | Virtual Router 1
State : Master
Virtual IP : 192.168.20.3
Master IP : 192.168.20.3
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 1200 s
TimerRun : 2 s
TimerConfig : 2 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : admin-vrrp
Backup-forward : disabled
Track SysHealth Priority reduced : 254
SysHealth state : UP
Create time : 2019-11-30 14:23:11
Last change time : 2019-11-30
14:23:17
# Check the HSB service status on AGG-AC1 and AGG-AC2. In the command
output of both devices, the value Connected of Service State indicates that the
HSB channel has been established.
[AGG-AC1] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.200.1
Peer IP Address : 172.16.200.2
Source Port : 10241
Destination Port : 10241
Keep Alive Times :5
Keep Alive Interval : 3
Service State : Connected
Service Batch Modules :
Shared-key :-
----------------------------------------------------------
[AGG-AC2] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.200.2
Peer IP Address : 172.16.200.1
Step 10 Configure wireless services on AGG-AC1 so that AP1 can go online. The
configuration on AGG-AC2 is similar.
# Create an AP group to add APs with the same configurations to the AP group.
[AGG-AC1] wlan
[AGG-AC1-wlan-view] ap-group name ap-group1
[AGG-AC1-wlan-ap-group-ap-group1] quit
# Create a regulatory domain profile, configure the country code for the AC in the
profile, and bind the profile to the AP group.
[AGG-AC1-wlan-view] regulatory-domain-profile name domain1
[AGG-AC1-wlan-regulate-domain-domain1] country-code en
[AGG-AC1-wlan-regulate-domain-domain1] quit
[AGG-AC1-wlan-view] ap-group name ap-group1
[AGG-AC1-wlan-ap-group-ap-group1] regulatory-domain-profile domain1
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the
radio and reset the AP. Continue?[Y/N]:y
[AGG-AC1-wlan-ap-group-ap-group1] quit
# Add AP1 to the AP group ap-group1 and configure a name for the AP based on
its deployment location.
[AGG-AC1-wlan-view] ap auth-mode mac-auth
[AGG-AC1-wlan-view] ap-id 1 ap-mac 00e0-fc12-3300
[AGG-AC1-wlan-ap-1] ap-name area_1
Warning: The AP name of more than 31 characters does not take effect for APs in versions earlier than
V200R009C00.
Warning: This operation may cause AP reset. Continue? [Y/N]:y
[AGG-AC1-wlan-ap-1] ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and
antenna gain configurations of the radio, whether to continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[AGG-AC1-wlan-ap-1] quit
[AGG-AC1-wlan-view] quit
# After powering on AP1, run the display ap all command on AGG-AC1 to check
the AP running status. In the command output, the State field value is nor,
indicating that AP1 is in normal state.
[AGG-AC1] display ap all
Info: This operation may take a few seconds. Please wait for a moment.done.
Total AP information:
nor : normal [1]
-----------------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
-----------------------------------------------------------------------------------------------
1 00e0-fc12-3300 area_1 ap-group1 192.168.20.254 AirEngine 8760-X1-PRO nor 0 2M:44S
-----------------------------------------------------------------------------------------------
Total AP information:
nor : normal [1]
ExtraInfo : Extra information
P : insufficient power supply
----------------------------------------------------------------------------------------------------------
# Create WLAN VAP profiles, configure the service data forwarding mode and
service VLANs, apply security profiles and SSID profiles, and enable IPSG, dynamic
ARP inspection, and strict STA IP address learning through DHCP.
NOTE
IP packet check enabled using the ip source check user-bind enable command is based on
binding entries. Therefore:
● For DHCP users, enable DHCP snooping on the device to automatically generate
dynamic binding entries.
● For users using static IP addresses, manually configure static binding entries.
Before running the learn-client-address dhcp-strict command:
● Run the undo dhcp trust port command in the VAP profile view to disable the DHCP
trusted interface on an AP.
● Run the undo learn-client-address { ipv4 | ipv6 } disable command in the VAP profile
view to enable STA IP address learning.
----End
DNS-server0 :-
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 192.168.20.0
Mask : 255.255.255.0
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :1
Idle :251 Expired :0
Conflict :0 Disabled :2
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict
Disabled
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict
Disabled
-------------------------------------------------------------------------------------
# After a wireless user connects to AP1, you can view information about the
wireless user on AGG-AC1.
[AGG-AC1] display station ssid test01
Rf/WLAN: Radio ID/WLAN ID
Rx/Tx: link receive rate/link transmit
rate(Mbps)
-----------------------------------------------------------------------------------------------
Configuration Scripts
# CORE
#
sysname CORE
#
vlan batch 70 80 1000
#
interface Vlanif70
ip address 172.16.70.1 255.255.255.0
#
interface Vlanif80
ip address 172.16.80.1 255.255.255.0
#
interface Vlanif1000
ip address 192.168.11.254 255.255.255.0
#
interface Eth-Trunk10
description connect to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 70
mode lacp
#
interface Eth-Trunk20
description connect to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 80
mode lacp
#
interface XGigabitEthernet1/1/0/1
eth-trunk 10
#
interface XGigabitEthernet1/1/0/2
eth-trunk 20
#
interface XGigabitEthernet1/1/0/10
mad detect mode direct
#
interface XGigabitEthernet1/2/0/1
port link-type access
port default vlan 1000
#
interface XGigabitEthernet2/1/0/1
eth-trunk 20
#
interface XGigabitEthernet2/1/0/2
eth-trunk 10
#
interface XGigabitEthernet2/1/0/10
mad detect mode direct
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 172.16.70.0 0.0.0.255
network 172.16.80.0 0.0.0.255
network 192.168.11.0 0.0.0.255
#
return
# AGG-AC1
#
sysname AGG-AC1
#
vrrp recover-delay 60
#
vlan batch 20 200
#
dhcp enable
#
dhcp snooping enable
#
interface vlanif 20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
# AGG-AC2
#
sysname AGG-AC2
#
vrrp recover-delay 60
#
vlan batch 20 200
#
interface vlanif 20
ip address 192.168.20.2 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
#
interface vlanif 200
ip address 172.16.200.1 255.255.255.0
#
interface eth-trunk 1
description connect to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp
#
interface 10GE 1/0/1
eth-trunk 1
#
interface 10GE 1/0/2
port link-type trunk
port trunk allow-pass vlan 200
undo port trunk allow-pass vlan 1
#
hsb-service 0
service-ip-port local-ip 172.16.200.2 peer-ip 172.16.200.1 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif20
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type ap hsb-group 0
#
# AGG-AC3
#
sysname AGG-AC3
#
vrrp recover-delay 60
#
vlan batch 21 200
#
dhcp enable
#
dhcp snooping enable
#
interface vlanif 21
ip address 192.168.21.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.21.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
dhcp server excluded-ip-address 192.168.21.2
dhcp server excluded-ip-address 192.168.21.20
#
interface vlanif 201
ip address 172.16.201.1 255.255.255.0
#
interface eth-trunk 1
description connect to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21
mode lacp
#
interface 10GE 1/0/1
eth-trunk 1
#
interface 10GE 1/0/2
port link-type trunk
port trunk allow-pass vlan 201
undo port trunk allow-pass vlan 1
#
ospf 1 router-id 4.4.4.4
area 0.0.0.2
network 192.168.21.0 0.0.0.255
#
capwap source interface vlanif21
#
hsb-service 0
service-ip-port local-ip 172.16.201.1 peer-ip 172.16.201.2 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif21
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type ap hsb-group 0
#
wlan
traffic-profile name traff1
user-isolate l2
traffic-profile name traff2
user-isolate l2
security-profile name sec1
security-profile name sec2
ssid-profile name ssid3
ssid test03
ssid-profile name ssid4
ssid test04
vap-profile name vap1
forward-mode direct-forward
service-vlan vlan-id 40
ssid-profile ssid3
security-profile sec1
traffic-profile traff1
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
vap-profile name vap2
forward-mode direct-forward
service-vlan vlan-id 41
ssid-profile ssid2
security-profile sec2
traffic-profile traff2
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 1 type-id 30 ap-mac 00e0-fc12-6660 ap-sn 2102355547W0E3000316
ap-name area_1
ap-group ap-group1
ap-id 2 type-id 56 ap-mac 00e0-fc12-6670 ap-sn 21500829352SGA900583
ap-name area_2
ap-group ap-group1
#
# AGG-AC4
#
sysname AGG-AC4
#
vrrp recover-delay 60
#
vlan batch 21 200
#
interface vlanif 21
ip address 192.168.21.2 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.21.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
#
interface vlanif 201
ip address 172.16.201.1 255.255.255.0
#
interface eth-trunk 1
description connect to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21
mode lacp
#
interface 10GE 1/0/1
eth-trunk 1
#
interface 10GE 1/0/2
port link-type trunk
port trunk allow-pass vlan 200
undo port trunk allow-pass vlan 1
#
hsb-service 0
service-ip-port local-ip 172.16.201.2 peer-ip 172.16.201.1 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif21
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type ap hsb-group 0
#
# AGG1
#
sysname AGG1
#
vlan batch 20 30 to 31 50 70
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 31
dhcp snooping enable
vlan 50
dhcp snooping enable
#
interface Vlanif20
ip address 192.168.20.20 255.255.255.0
#
interface Vlanif30
ip address 172.16.30.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.11.1
#
interface Vlanif31
ip address 172.16.31.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.11.1
#
interface Vlanif50
ip address 172.16.50.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.11.1
#
interface Vlanif70
ip address 172.16.70.2 255.255.255.0
#
interface Eth-Trunk1
description con to AC
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp-static
#
interface Eth-Trunk10
description con to CORE
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 70
mode lacp-static
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 to 31 50
mode lacp-static
port-isolate enable group 1
#
interface 10GE 1/0/3
eth-trunk 30
#
interface 10GE 1/0/4
eth-trunk 1
#
interface 10GE 1/0/5
eth-trunk 1
#
interface 10GE 2/0/3
eth-trunk 30
#
interface 10GE 1/0/1
eth-trunk 10
#
interface 10GE 2/0/1
eth-trunk 10
#
return
# AGG2
#
sysname AGG2
#
vlan batch 21 40 to 41 60 80
#
dhcp enable
#
dhcp snooping enable
#
vlan 40
dhcp snooping enable
vlan 41
dhcp snooping enable
vlan 60
dhcp snooping enable
#
interface Vlanif21
ip address 192.168.21.20 255.255.255.0
#
interface Vlanif40
ip address 172.16.40.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.11.1
#
interface Vlanif41
ip address 172.16.41.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.11.1
#
interface Vlanif60
ip address 172.16.60.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.11.1
#
interface Vlanif80
ip address 172.16.80.2 255.255.255.0
#
interface Eth-Trunk1
description con to AC
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21
mode lacp-static
#
interface Eth-Trunk10
description con to CORE
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 80
mode lacp-static
#
interface Eth-Trunk30
port link-type trunk
# ACC1
#
sysname ACC1
#
vlan batch 20 50
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 30
#
interface 10GE1/0/2
eth-trunk 30
#
interface GE1/0/3
port link-type access
port default vlan 50
stp edged-port enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type access
port default vlan 20
stp edged-port enable
port-isolate enable group 1
#
return
# ACC2
#
sysname ACC2
#
vlan batch 21 60
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21 60
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 40
#
interface 10GE1/0/2
eth-trunk 40
#
interface GE1/0/3
port link-type access
port default vlan 60
stp edged-port enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type access
port default vlan 21
stp edged-port enable
port-isolate enable group 1
#
return
Networking Requirements
Core switches set up a CSS that functions as the core of the entire campus
network to enhance network reliability and maximize forwarding performance.
Standalone ACs are deployed in off-path mode. They function as gateways to
assign IP addresses to APs and wireless users, and centrally manage APs and
wireless users on the entire network.
Aggregation switches set up stacks to implement device-level backup and increase
the port density and forwarding bandwidth.
In this example, core switches and standalone ACs function as the gateways for
wired and wireless users on the entire network, respectively.
Figure 2-10 Core switches and standalone ACs functioning as the gateways for
wired and wireless users respectively
AC - AC6805 V200R022C10
Deployment Roadmap
Step Deployment Roadmap Devices Involved
Data Plan
AP group ap-group1
Deployment Precautions
● It is not recommended that VLAN 1 be used as a service VLAN. Remove all
interfaces from VLAN 1. Interfaces need to transparently transmit packets
from specific VLANs, instead of all VLANs, based on actual service
requirements.
● In tunnel forwarding mode, the management VLAN and service VLAN must
be different. Otherwise, MAC address flapping will occur, leading to a packet
forwarding error. The network between the AC and APs needs to permit only
packets tagged with the management VLAN ID and deny packets tagged with
the service VLAN ID.
● In tunnel forwarding mode, service packets from APs are encapsulated in
CAPWAP data tunnels and transmitted to the AC. The AC then forwards the
packets to the upper-layer network. Therefore, service packets and
management packets can be transmitted properly when the interfaces that
connect the AC to APs are added to the management VLAN and the interface
that connects the AC to the upper-layer network is added to a service VLAN.
● WLAN service configurations (for example, WMM profile, radio profile, radio,
traffic profile, security profile, security policy, and WLAN ID) of the AP
associated with the master and backup ACs must be consistent on the two
Procedure
Step 1 Configure CSS on core switches and stacking on aggregation switches, and
configure MAD and uplink and downlink Eth-Trunk interfaces on the switches.
For details, see 2.2.1.3 Typical CSS and Stack Deployment.
Step 2 Configure interfaces and VLANs on CORE.
# Create VLANs.
[CORE] vlan batch 20 30 40 50 60 1000
# Create Eth-Trunk 1 for connecting to CORE-AC1 and add interfaces to it. The
configuration of the Eth-Trunk interface for connecting to CORE-AC2 is similar.
[CORE] interface eth-trunk 1
[CORE-Eth-Trunk1] description con to CORE-AC1
[CORE-Eth-Trunk1] mode lacp
[CORE-Eth-Trunk1] port link-type trunk
[CORE-Eth-Trunk1] undo port trunk allow-pass vlan 1
[CORE-Eth-Trunk1] port trunk allow-pass vlan 20 30 40
[CORE-Eth-Trunk1] quit
[CORE] interface xgigabitethernet 1/1/0/3
[CORE-XGigabitEthernet1/1/0/3] eth-trunk 1
[CORE-XGigabitEthernet1/1/0/3] quit
[CORE] interface xgigabitethernet 2/1/0/3
[CORE-XGigabitEthernet2/1/0/3] eth-trunk 1
[CORE-XGigabitEthernet2/1/0/3] quit
Step 3 Configure interfaces and VLANs on AGG1. The configuration on AGG2 is similar.
# Create VLANs.
[AGG1] vlan batch 20 50
Step 4 Configure interfaces and VLANs on ACC1. The configuration on ACC2 is similar.
# Create VLANs.
[ACC1] vlan batch 20 50
# Configure downlink interfaces connected to PC1 and AP1, and configure the
interfaces as edge ports.
[ACC1] interface ge 1/0/3
[ACC1-GE1/0/3] port link-type access
[ACC1-GE1/0/3] port default vlan 50
Step 6 Configure DHCP on CORE so that CORE functions as the DHCP server to assign IP
addresses to wired users.
# Enable DHCP globally and configure DHCP snooping for the service VLANs.
[CORE] dhcp enable
[CORE] dhcp snooping enable
[CORE] vlan 50
[CORE-vlan50] dhcp snooping enable
[CORE-vlan50] quit
[CORE] vlan 60
[CORE-vlan60] dhcp snooping enable
[CORE-vlan60] quit
# Create Layer 3 interfaces VLANIF 50 and VLANIF 60 for wired services and
configure CORE to assign IP addresses to wired terminals from the interface
address pools.
[CORE] interface vlanif 50
[CORE-Vlanif50] ip address 172.16.50.1 255.255.255.0
[CORE-Vlanif50] dhcp select interface
[CORE-Vlanif50] dhcp server dns-list 192.168.100.2 //Configure the DNS server for terminals.
[CORE-Vlanif50] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP in a service VLAN
for wired users. Otherwise, wired users cannot communicate with each other. Determine whether to
configure this command based on actual requirements.
[CORE-Vlanif50] quit
[CORE] interface vlanif 60
# Create Layer 3 interfaces VLANIF 30 and VLANIF 40 for wired services and
configure CORE-AC1 to assign IP addresses to wireless terminals from the
interface address pools.
[CORE-AC1] interface vlanif 30
[CORE-AC1-Vlanif30] ip address 172.16.30.1 255.255.255.0
[CORE-AC1-Vlanif30] dhcp select interface
[CORE-AC1-Vlanif30] dhcp server excluded-ip-address 172.16.30.2 172.16.30.3
[CORE-AC1-Vlanif30] dhcp server dns-list 192.168.100.2 //Configure the DNS server for terminals.
[CORE-AC1-Vlanif30] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP in a service
VLAN for wireless users. Otherwise, wireless users cannot communicate with each other through the AC.
Determine whether to configure this command based on actual requirements.
[CORE-AC1-Vlanif30] quit
[CORE-AC1] interface vlanif 40
[CORE-AC1-Vlanif40] ip address 172.16.40.1 255.255.255.0
[CORE-AC1-Vlanif40] dhcp select interface
[CORE-AC1-Vlanif40] dhcp server excluded-ip-address 172.16.40.2 172.16.40.3
[CORE-AC1-Vlanif40] dhcp server dns-list 192.168.100.2 //Configure the DNS server for terminals.
[CORE-AC1-Vlanif40] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP in a service
VLAN for wireless users. Otherwise, wireless users cannot communicate with each other through the AC.
Determine whether to configure this command based on actual requirements.
[CORE-AC1-Vlanif40] quit
# Create HSB group 0 on CORE-AC1, and bind HSB service 0 and the management
VRRP group to HSB group 0.
[CORE-AC1] hsb-group 0
[CORE-AC1-hsb-group-0] bind-service 0
[CORE-AC1-hsb-group-0] track vrrp vrid 1 interface vlanif 20
[CORE-AC1-hsb-group-0] quit
# After the configuration is complete, run the display vrrp command on both
CORE-AC1 and CORE-AC2. In the command output of both devices, the State field
value of CORE-AC1 is Master and that of CORE-AC2 is Backup.
[CORE-AC1] display vrrp
Vlanif20 | Virtual Router 1
State : Master
Virtual IP : 192.168.20.3
Master IP : 192.168.20.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 1200s
TimerRun : 2s
TimerConfig : 2s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
# Check the HSB service status on CORE-AC1 and CORE-AC2. In the command
output of both devices, the value Connected of Service State indicates that the
HSB channel has been established.
[CORE-AC1] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.100.1
Peer IP Address : 172.16.100.2
Source Port : 10241
Destination Port : 10241
Keep Alive Times :5
Keep Alive Interval : 3
Service State : Connected
Service Batch Modules :
Shared-key :-
----------------------------------------------------------
[CORE-AC2] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.100.2
Peer IP Address : 172.16.100.1
Source Port : 10241
Destination Port : 10241
Keep Alive Times :5
Keep Alive Interval : 3
Service State : Connected
Service Batch Modules :
Shared-key :-
----------------------------------------------------------
# Create an AP group to add APs with the same configurations to the AP group.
[CORE-AC1] wlan
[CORE-AC1-wlan-view] ap-group name ap-group1
[CORE-AC1-wlan-ap-group-ap-group1] quit
# Create a regulatory domain profile, configure the country code for the AC in the
profile, and bind the profile to the AP group.
[CORE-AC1-wlan-view] regulatory-domain-profile name domain1
[CORE-AC1-wlan-regulate-domain-domain1] country-code en
[CORE-AC1-wlan-regulate-domain-domain1] quit
[CORE-AC1-wlan-view] ap-group name ap-group1
[CORE-AC1-wlan-ap-group-ap-group1] regulatory-domain-profile domain1
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the
radio and reset the AP. Continue?[Y/N]:y
[CORE-AC1-wlan-ap-group-ap-group1] quit
# Add target APs to the AP group and configure names for the APs based on their
deployment locations.
[CORE-AC1-wlan-view] ap auth-mode mac-auth
[CORE-AC1-wlan-view] ap-id 1 ap-mac 00e0-fc12-6660
[CORE-AC1-wlan-ap-1] ap-name area_1
[CORE-AC1-wlan-ap-1] ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and
antenna gain configurations of the radio, whether to continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[CORE-AC1-wlan-ap-1] quit
[CORE-AC1-wlan-view] ap-id 2 ap-mac 00e0-fc12-6670
[CORE-AC1-wlan-ap-2] ap-name area_2
[CORE-AC1-wlan-ap-2] ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and
antenna gain configurations of the radio, whether to continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[CORE-AC1-wlan-ap-2] quit
[CORE-AC1-wlan-view] quit
# After powering on the APs, run the display ap all command on CORE-AC1 to
check the AP running status. In the command output, the State field value is nor,
indicating that the APs are in normal state.
[CORE-AC1] display ap all
Total AP information:
nor : normal [2]
ExtraInfo : Extra information
P : insufficient power supply
---------------------------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime ExtraInfo
---------------------------------------------------------------------------------------------------------
1 00e0-fc12-6660 area_1 ap-group1 192.168.20.41 AirEngine 8760-X1-PRO nor 0 5M:26S -
2 00e0-fc12-6670 area_2 ap-group1 192.168.20.164 AirEngine 8760-X1-PRO nor 0 2M:52S -
---------------------------------------------------------------------------------------------------------
# Create WLAN VAP profiles, configure the service data forwarding mode and
service VLANs, apply security profiles and SSID profiles, and enable strict STA IP
address learning through DHCP, IPSG, and dynamic ARP inspection.
[CORE-AC1-wlan-view] vap-profile name vap1
[CORE-AC1-wlan-vap-prof-vap1] forward-mode tunnel
[CORE-AC1-wlan-vap-prof-vap1] service-vlan vlan-id 30
[CORE-AC1-wlan-vap-prof-vap1] security-profile sec1
[CORE-AC1-wlan-vap-prof-vap1] ssid-profile ssid1
[CORE-AC1-wlan-vap-prof-vap1] traffic-profile traff
[CORE-AC1-wlan-vap-prof-vap1] ip source check user-bind enable
[CORE-AC1-wlan-vap-prof-vap1] arp anti-attack check user-bind enable
[CORE-AC1-wlan-vap-prof-vap1] learn-client-address dhcp-strict
[CORE-AC1-wlan-vap-prof-vap1] quit
[CORE-AC1-wlan-view] vap-profile name vap2
[CORE-AC1-wlan-vap-prof-vap2] forward-mode tunnel
[CORE-AC1-wlan-vap-prof-vap2] service-vlan vlan-id 40
[CORE-AC1-wlan-vap-prof-vap2] security-profile sec2
[CORE-AC1-wlan-vap-prof-vap2] ssid-profile ssid2
[CORE-AC1-wlan-vap-prof-vap2] traffic-profile traff
[CORE-AC1-wlan-vap-prof-vap2] ip source check user-bind enable
[CORE-AC1-wlan-vap-prof-vap2] arp anti-attack check user-bind enable
[CORE-AC1-wlan-vap-prof-vap2] learn-client-address dhcp-strict
[CORE-AC1-wlan-vap-prof-vap2] quit
NOTE
IP packet check enabled using the ip source check user-bind enable command is based on
binding entries. Therefore:
● For DHCP users, enable DHCP snooping on the device to automatically generate
dynamic binding entries.
● For users using static IP addresses, manually configure static binding entries.
Before running the learn-client-address dhcp-strict command:
● Run the undo dhcp trust port command in the VAP profile view to disable the DHCP
trusted interface on an AP.
● Run the undo learn-client-address { ipv4 | ipv6 } disable command in the VAP profile
view to enable STA IP address learning.
Step 12 Configure wireless configuration synchronization in the scenario where VRRP HSB
is configured to synchronize wireless service configuration information from
CORE-AC1 to CORE-AC2.
# Configure the source interface of CORE-AC2.
[CORE-AC2] capwap source interface vlanif 20
# Run the display sync-configuration status command to check the status of the
wireless configuration synchronization function. In the command output, the
Status field value is cfg-mismatch. In this case, you need to manually trigger
wireless configuration synchronization from the master AC to the backup AC. Wait
until the backup AC automatically restarts.
[CORE-AC1] display sync-configuration status
Controller role:Master/Backup/Local
-----------------------------------------------------------------------------------------------------------------------------
Controller IP Role Device Type Version Status Last synced
-----------------------------------------------------------------------------------------------------------------------------
172.16.100.2 Backup AirEngine 8760-X1-PRO V200R022C10 cfg-mismatch(config check fail) -
-----------------------------------------------------------------------------------------------------------------------------
Total: 1
[CORE-AC1] synchronize-configuration
Warning: This operation may reset the remote AC, synchronize configurations to it, and save all its
configurations. Whether to continue? [Y/N]:y
NOTE
----End
Verification Method
● Run the following command on CORE-AC1. The command output shows that
APs have obtained IP addresses successfully.
[CORE-AC1] display ip pool interface vlanif20 used
Pool-name : vlanif20
Pool-No :0
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 :-
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 192.168.20.0
Mask : 255.255.255.0
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :2
Idle :233 Expired :0
Conflict :0 Disabled :19
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
192.168.20.1 192.168.20.254 254 2 233(0) 0 19
-------------------------------------------------------------------------------------
Client-ID format as follows:
DHCP : mac-address PPPoE : mac-address
IPSec : user-id/portnumber/vrf PPP : interface index
L2TP : cpu-slot/session-id SSL-VPN : user-id/session-id
-------------------------------------------------------------------------------------
Index IP Client-ID Type Left Status
-------------------------------------------------------------------------------------
40 192.168.20.41 00e0-fc12-6660 DHCP 72528 Used
163 192.168.20.164 00e0-fc12-6670 DHCP 72813 Used
-------------------------------------------------------------------------------------
● Run the following commands on CORE. The command output shows that
wired users have obtained IP addresses successfully.
[CORE] display ip pool interface vlanif50 used
Pool-name : Vlanif50
Pool-No :2
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 : 192.168.100.2
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 172.16.50.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :1
Idle :253 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
172.16.50.1 172.16.50.254 254 1 253(0) 0 0
-------------------------------------------------------------------------------------
Client-ID format as follows:
DHCP : mac-address PPPoE : mac-address
IPSec : user-id/portnumber/vrf PPP : interface index
L2TP : cpu-slot/session-id SSL-VPN : user-id/session-id
-------------------------------------------------------------------------------------
Index IP Client-ID Type Left Status
-------------------------------------------------------------------------------------
109 172.16.50.110 00e0-fc12-3344 DHCP 84875 Used
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
[CORE] display ip pool interface vlanif60 used
Pool-name : Vlanif60
Pool-No :3
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 : 192.168.100.2
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 172.16.60.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :1
Idle :253 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
172.16.60.1 172.16.60.254 254 1 253(0) 0 0
-------------------------------------------------------------------------------------
Client-ID format as follows:
DHCP : mac-address PPPoE : mac-address
IPSec : user-id/portnumber/vrf PPP : interface index
L2TP : cpu-slot/session-id SSL-VPN : user-id/session-id
-------------------------------------------------------------------------------------
Index IP Client-ID Type Left Status
-------------------------------------------------------------------------------------
236 172.16.60.237 00e0-fc12-3377 DHCP 84434 Used
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
# After a wireless user connects to AP1, you can view information about the
wireless user on CORE-AC1.
[CORE-AC1] display station ssid Employee
Rf/WLAN: Radio ID/WLAN ID
Rx/Tx: link receive rate/link transmit rate(Mbps)
-----------------------------------------------------------------------------------------------
STA MAC AP ID Ap name Rf/WLAN Band Type Rx/Tx RSSI VLAN IP address
-----------------------------------------------------------------------------------------------
00e0-fc12-3388 1 area_1 1/1 5G 11ac 173/115 -38 30 172.16.30.180
-----------------------------------------------------------------------------------------------
Total: 1 2.4G: 0 5G: 1
Configuration Scripts
# CORE
#
sysname CORE
#
vlan batch 20 30 40 50 60 1000
#
dhcp enable
#
dhcp snooping enable
#
vlan 50
dhcp snooping enable
vlan 60
dhcp snooping enable
#
interface Vlanif20
ip address 192.168.20.20 255.255.255.0
#
interface Vlanif30
ip address 172.16.30.3 255.255.255.0
#
interface Vlanif40
ip address 172.16.40.3 255.255.255.0
#
interface Vlanif50
ip address 172.16.50.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif60
ip address 172.16.60.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif1000
ip address 192.168.100.1 255.255.255.0
#
interface Eth-Trunk1
description con to CORE-AC1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40
mode lacp
#
interface Eth-Trunk2
description con to CORE-AC2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40
mode lacp
#
interface Eth-Trunk10
description con to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
mode lacp
#
interface Eth-Trunk20
description con to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 60
mode lacp
#
interface XGigabitEthernet1/1/0/1
eth-trunk 10
#
interface XGigabitEthernet1/1/0/2
eth-trunk 20
#
interface XGigabitEthernet1/1/0/3
eth-trunk 1
#
interface XGigabitEthernet1/1/0/4
eth-trunk 2
#
interface XGigabitEthernet1/1/0/10
mad detect mode direct
#
interface XGigabitEthernet1/2/0/1
port link-type access
port default vlan 1000
#
interface XGigabitEthernet2/1/0/1
eth-trunk 20
#
interface XGigabitEthernet2/1/0/2
eth-trunk 10
#
interface XGigabitEthernet2/1/0/3
eth-trunk 1
#
interface XGigabitEthernet2/1/0/4
eth-trunk 2
#
interface XGigabitEthernet2/1/0/10
mad detect mode direct
#
return
# AGG1
#
sysname AGG1
#
vlan batch 20 50
#
interface Eth-Trunk10
description connect to CORE
port link-type trunk
port trunk allow-pass vlan 20 50
mode lacp-static
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
mode lacp-static
port-isolate enable group 1
#
interface 10GE1/0/3
eth-trunk 30
#
interface 10GE2/0/3
eth-trunk 30
#
interface 10GE1/0/1
eth-trunk 10
#
interface 10GE2/0/1
eth-trunk 10
#
return
# AGG2
#
sysname AGG2
#
vlan batch 20 60
#
interface Eth-Trunk20
description connect to CORE
port link-type trunk
port trunk allow-pass vlan 20 60
mode lacp-static
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 60
mode lacp-static
port-isolate enable group 1
#
interface 10GE1/0/3
eth-trunk 40
#
interface 10GE2/0/3
eth-trunk 40
#
interface 10GE1/0/1
eth-trunk 20
#
interface 10GE2/0/1
eth-trunk 20
#
return
# ACC1
#
sysname ACC1
#
vlan batch 20 50
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 30
#
interface 10GE1/0/2
eth-trunk 30
#
interface GE1/0/3
port link-type access
port default vlan 50
stp edged-port enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type access
port default vlan 20
stp edged-port enable
port-isolate enable group 1
#
return
# ACC2
#
sysname ACC2
#
vlan batch 20 60
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 60
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 40
#
interface 10GE1/0/2
eth-trunk 40
#
interface GE1/0/3
port link-type access
port default vlan 60
stp edged-port enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type access
port default vlan 20
stp edged-port enable
port-isolate enable group 1
#
return
# CORE-AC1
#
sysname CORE-AC1
#
vrrp recover-delay 60
#
vlan batch 20 30 40 100
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 40
dhcp snooping enable
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
dhcp server excluded-ip-address 192.168.20.2
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif30
ip address 172.16.30.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.30.2 172.16.30.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif40
ip address 172.16.40.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.40.2 172.16.40.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif100
ip address 172.16.100.1 255.255.255.0
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40
mode lacp
#
interface GigabitEthernet0/0/2
# CORE-AC2
#
sysname CORE-AC2
#
vrrp recover-delay 60
#
vlan batch 20 30 40 100
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 40
dhcp snooping enable
#
interface Vlanif20
ip address 192.168.20.2 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
dhcp select interface
dhcp server excluded-ip-address 192.168.20.1
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif30
ip address 172.16.30.2 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.30.1
dhcp server excluded-ip-address 172.16.30.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif40
ip address 172.16.40.2 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.40.1
dhcp server excluded-ip-address 172.16.40.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif100
ip address 172.16.100.2 255.255.255.0
#
interface Eth-Trunk2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 40
mode lacp
#
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface XGigabitEthernet0/0/21
eth-trunk 2
#
interface XGigabitEthernet0/0/22
eth-trunk 2
#
ip route-static 0.0.0.0 0.0.0.0 192.168.20.20
#
capwap source interface vlanif20
#
hsb-service 0
service-ip-port local-ip 172.16.100.2 peer-ip 172.16.100.1 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif20
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type dhcp hsb-group 0
#
hsb-service-type ap hsb-group 0
#
wlan
traffic-profile name traff
user-isolate l2
security-profile name sec1
security-profile name sec2
ssid-profile name ssid1
ssid Employee
ssid-profile name ssid2
ssid Guest
vap-profile name vap1
forward-mode tunnel
service-vlan vlan-id 30
ssid-profile ssid1
security-profile sec1
traffic-profile traff
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
vap-profile name vap2
forward-mode tunnel
service-vlan vlan-id 40
ssid-profile ssid2
security-profile sec2
traffic-profile traff
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
regulatory-domain-profile name domain1
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 1 type-id 30 ap-mac 00e0-fc12-6660 ap-sn 2102355547W0E3000316
ap-name area_1
ap-group ap-group1
ap-id 2 type-id 56 ap-mac 00e0-fc12-6670 ap-sn 21500829352SGA900583
ap-name area_2
ap-group ap-group1
master controller
master-redundancy track-vrrp vrid 1 interface Vlanif20
master-redundancy peer-ip ip-address 172.16.100.1 local-ip ip-address 172.16.100.2 psk %^%#QKK0'nRL
%0U`y32S6bOSB40e=FJE^Lbs7.A]x)QQ%^%#
#
return
AC - AC6805 V200R022C10
Deployment Roadmap
Step Deployment Roadmap Devices Involved
Data Plan
Precautions
● It is not recommended that VLAN 1 be used as a service VLAN. Remove all
interfaces from VLAN 1. Interfaces need to transparently transmit packets
from specific VLANs, instead of all VLANs, based on actual service
requirements.
● In tunnel forwarding mode, the management VLAN and service VLAN must
be different. Otherwise, MAC address flapping will occur, leading to a packet
forwarding error. The network between the AC and APs needs to permit only
packets tagged with the management VLAN ID and deny packets tagged with
the service VLAN ID.
● In tunnel forwarding mode, service packets from APs are encapsulated in
CAPWAP data tunnels and transmitted to the AC. The AC then forwards the
packets to the upper-layer network. Therefore, service packets and
management packets can be transmitted properly when the interfaces that
connect the AC to APs are added to the management VLAN and the interface
that connects the AC to the upper-layer network is added to a service VLAN.
● WLAN service configurations (for example, WMM profile, radio profile, radio,
traffic profile, security profile, security policy, and WLAN ID) of the AP
associated with the master and backup ACs must be consistent on the two
ACs; otherwise, user services may be affected after a master/backup
switchover between the ACs.
● The models and software versions of the master and backup ACs must be the
same.
● When deploying the DHCP server in the scenario where VRRP HSB is
configured, be aware of the following guidelines:
– In V200R019C00 and later versions, there is no restriction on which
interface to enable the DHCP server function. Only the master AC
allocates IP addresses, and IP address allocation information will be
synchronized to the backup AC.
– The IP address pools configured on the master and backup ACs must be
the same. If they are different, data backup between the master and
backup ACs will fail.
– Run the hsb-service-type dhcp hsb-group group-index command to
bind the DHCP service to the HSB group. If you do not perform this
operation, IP address allocation information cannot be backed up from
the master AC to the backup AC.
Procedure
Step 1 Configure CSS on core switches and stacking on aggregation switches, and
configure MAD and uplink and downlink Eth-Trunk interfaces on the switches.
For details, see 2.2.1.3 Typical CSS and Stack Deployment.
Step 2 Configure interfaces and VLANs on CORE.
# Create VLANs.
[CORE] vlan batch 70 80 1000
Step 3 Configure interfaces and VLANs on AGG1. The configuration on AGG2 is similar.
# Create VLANs.
<AGG1> system-view
[AGG1] vlan batch 20 30 31 50 70
[AGG1-10GigabitEthernet1/0/5] eth-trunk 1
[AGG1-10GigabitEthernet1/0/5] quit
# Create VLANs.
<AC6805> system-view
[AC6805] sysname AGG-AC1
[AGG-AC1] vlan batch 20 30 31 200
Step 5 Configure interfaces and VLANs on ACC1. The configuration on ACC2 is similar.
# Create VLANs.
<ACC1> system-view
[ACC1] vlan batch 20 50
# Configure downlink interfaces connected to PC1 and AP1, and configure the
interfaces as edge ports.
[ACC1] interface GE 1/0/3
[ACC1-GE1/0/3] port link-type access
[ACC1-GE1/0/3] port default vlan 50
[ACC1-GE1/0/3] port-isolate enable group 1
[ACC1-GE1/0/3] stp edged-port enable
[ACC1-GE1/0/3] quit
[ACC1] interface GE 1/0/4
[ACC1-GE1/0/4] port link-type trunk
[ACC1-GE1/0/4] port trunk pvid vlan 20
[ACC1-GE1/0/4] port trunk allow-pass vlan 20
[ACC1-GE1/0/4] port-isolate enable group 1
[ACC1-GE1/0/4] stp edged-port enable
[ACC1-GE1/0/4] quit
Step 6 Configure DHCP on AGG1 so that AGG1 functions as a DHCP server to assign IP
addresses to wired and wireless users. The configuration on AGG2 is similar.
# Enable DHCP globally and configure DHCP snooping for the service VLAN.
[AGG1] dhcp enable
[AGG1] dhcp snooping enable
[AGG1] vlan 50
[AGG1-vlan50] dhcp snooping enable
[AGG1-vlan50] quit
# Create Layer 3 interface VLANIF 50 for wired services and configure AGG1 to
assign IP addresses to wired terminals from the interface address pool.
[AGG1] interface Vlanif 50
[AGG1-Vlanif50] ip address 172.16.50.1 255.255.255.0
[AGG1-Vlanif50] dhcp select interface
[AGG1-Vlanif50] dhcp server dns-list 192.168.100.2 //Configure the DNS server for terminals.
[AGG1-Vlanif50] arp proxy intra-vlan enable //Enable intra-VLAN proxy ARP.
[AGG1-Vlanif50] quit
# Create Layer 3 interface VLANIF 30 for wireless services and configure AGG-AC1
to assign IP addresses to STAs from the interface address pool.
[AGG-AC1] interface Vlanif 30
[AGG-AC1-Vlanif30] ip address 172.16.30.1 255.255.255.0
[AGG-AC1-Vlanif30] dhcp select interface
[AGG-AC1-Vlanif30] dhcp server dns-list 192.168.100.2 //Configure the DNS server for terminals.
[AGG-AC1-Vlanif30] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP.
[AGG-AC1-Vlanif30] quit
# Create Layer 3 interface VLANIF 31 for wireless services and configure AGG-AC1
to assign IP addresses to STAs from the interface address pool.
[AGG-AC1] interface Vlanif 31
[AGG-AC1-Vlanif31] ip address 172.16.31.1 255.255.255.0
[AGG-AC1-Vlanif31] dhcp select interface
[AGG-AC1-Vlanif31] dhcp server dns-list 192.168.100.2 //Configure the DNS server for terminals.
[AGG-AC1-Vlanif31] arp-proxy inner-sub-vlan-proxy enable //Enable intra-VLAN proxy ARP.
[AGG-AC1-Vlanif31] quit
# Create HSB service 0 on AGG-AC1 and configure IP addresses and port numbers
for the HSB channel.
[AGG-AC1] hsb-service 0
[AGG-AC1-hsb-service-0] service-ip-port local-ip 172.16.200.1 peer-ip 172.16.200.2 local-data-port
10241 peer-data-port 10241
[AGG-AC1-hsb-service-0] quit
# Create HSB group 0 on AGG-AC1, and bind HSB service 0 and the management
VRRP group to HSB group 0.
[AGG-AC1] hsb-group 0
[AGG-AC1-hsb-group-0] bind-service 0
[AGG-AC1-hsb-group-0] track vrrp vrid 1 interface vlanif 20
[AGG-AC1-hsb-group-0] quit
# After the configuration is complete, run the display vrrp command on AGG-AC1
and AGG-AC2. In the command output of both devices, the State field value of
AGG-AC1 is Master and that of AGG-AC2 is Backup.
[AGG-AC1] display vrrp
Vlanif20 | Virtual Router 1
State : Master
Virtual IP : 192.168.20.3
Master IP : 192.168.20.3
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 1200s
TimerRun : 2s
TimerConfig : 2s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : admin-vrrp
Backup-forward : disabled
Track SysHealth Priority reduced : 254
SysHealth state : UP
Create time : 2019-11-30 14:23:11
Last change time : 2019-11-30
14:23:17
# Check the HSB service status on AGG-AC1 and AGG-AC2. In the command
output of both devices, the value Connected of Service State indicates that the
HSB channel has been established.
[AGG-AC1] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.200.1
Peer IP Address : 172.16.200.2
Source Port : 10241
Destination Port : 10241
Keep Alive Times :5
Keep Alive Interval : 3
Service State : Connected
Service Batch Modules :
Shared-key :-
----------------------------------------------------------
[AGG-AC2] display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 172.16.200.2
Peer IP Address : 172.16.200.1
Source Port : 10241
Destination Port : 10241
Keep Alive Times :5
Keep Alive Interval : 3
Service State : Connected
Service Batch Modules :
Shared-key :-
----------------------------------------------------------
Step 10 Configure wireless services on AGG-AC1 so that AP1 can go online. The
configuration on AGG-AC2 is similar.
# Configure the AC's source interface.
# Create an AP group to add APs with the same configurations to the AP group.
[AGG-AC1] wlan
[AGG-AC1-wlan-view] ap-group name ap-group1
[AGG-AC1-wlan-ap-group-ap-group1] quit
# Create a regulatory domain profile, configure the country code for the AC in the
profile, and bind the profile to the AP group.
[AGG-AC1-wlan-view] regulatory-domain-profile name domain1
[AGG-AC1-wlan-regulate-domain-domain1] country-code en
[AGG-AC1-wlan-regulate-domain-domain1] quit
[AGG-AC1-wlan-view] ap-group name ap-group1
[AGG-AC1-wlan-ap-group-ap-group1] regulatory-domain-profile domain1
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the
radio and reset the AP. Continue?[Y/N]:y
[AGG-AC1-wlan-ap-group-ap-group1] quit
# Add AP1 to the AP group ap-group1 and configure a name for the AP based on
its deployment location.
[AGG-AC1-wlan-view] ap auth-mode mac-auth
[AGG-AC1-wlan-view] ap-id 1 ap-mac 00e0-fc12-3300
[AGG-AC1-wlan-ap-1] ap-name area_1
Warning: The AP name of more than 31 characters does not take effect for APs in versions earlier than
V200R009C00.
Warning: This operation may cause AP reset. Continue? [Y/N]:y
[AGG-AC1-wlan-ap-1] ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and
antenna gain configurations of the radio, whether to continue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[AGG-AC1-wlan-ap-1] quit
[AGG-AC1-wlan-view] quit
# After powering on AP1, run the display ap all command on AGG-AC1 to check
the AP running status. In the command output, the State field value is nor,
indicating that AP1 is in normal state.
[AGG-AC1] display ap all
Total AP information:
nor : normal [1]
ExtraInfo : Extra information
P : insufficient power supply
----------------------------------------------------------------------------------------------------------
[AGG-AC1-wlan-traffic-prof-traff1] user-isolate l2
[AGG-AC1-wlan-traffic-prof-test01] quit
[AGG-AC1-wlan-view] security-profile name sec2
[AGG-AC1-wlan-sec-prof-sec2] security open
[AGG-AC1-wlan-sec-prof-sec2] quit
[AGG-AC1-wlan-view] ssid-profile name ssid2
[AGG-AC1-wlan-ssid-prof-ssid2] ssid test02
[AGG-AC1-wlan-ssid-prof-test02] quit
[AGG-AC1-wlan-view] traffic-profile name traff2
[AGG-AC1-wlan-traffic-prof-traff2] user-isolate l2
[AGG-AC1-wlan-traffic-prof-traff2] quit
# Create WLAN VAP profiles, configure the service data forwarding mode and
service VLANs, apply security profiles and SSID profiles, and enable IPSG, dynamic
ARP inspection, and strict STA IP address learning through DHCP.
[AGG-AC1-wlan-view] vap-profile name test01
[AGG-AC1-wlan-vap-prof-test01] forward-mode tunnel
[AGG-AC1-wlan-vap-prof-test01] service-vlan vlan-id 30
[AGG-AC1-wlan-vap-prof-test01] security-profile sec1
[AGG-AC1-wlan-vap-prof-test01] ssid-profile ssid1
[AGG-AC1-wlan-vap-prof-test01] traffic-profile traff1
[AGG-AC1-wlan-vap-prof-test01] ip source check user-bind enable
[AGG-AC1-wlan-vap-prof-test01] arp anti-attack check user-bind enable
[AGG-AC1-wlan-vap-prof-test01] learn-client-address dhcp-strict
[AGG-AC1-wlan-vap-prof-test01] quit
[AGG-AC1-wlan-view] vap-profile name test02
[AGG-AC1-wlan-vap-prof-test02] forward-mode tunnel
[AGG-AC1-wlan-vap-prof-test02] service-vlan vlan-id 31
[AGG-AC1-wlan-vap-prof-test02] security-profile sec2
[AGG-AC1-wlan-vap-prof-test02] ssid-profile ssid2
[AGG-AC1-wlan-vap-prof-test02] traffic-profile traff2
[AGG-AC1-wlan-vap-prof-test02] ip source check user-bind enable
[AGG-AC1-wlan-vap-prof-test02] arp anti-attack check user-bind enable
[AGG-AC1-wlan-vap-prof-test02] learn-client-address dhcp-strict
[AGG-AC1-wlan-vap-prof-test02] quit
NOTE
IP packet check enabled using the ip source check user-bind enable command is based on
binding entries. Therefore:
● For DHCP users, enable DHCP snooping on the device to automatically generate
dynamic binding entries.
● For users using static IP addresses, manually configure static binding entries.
Before running the learn-client-address dhcp-strict command:
● Run the undo dhcp trust port command in the VAP profile view to disable the DHCP
trusted interface on an AP.
● Run the undo learn-client-address { ipv4 | ipv6 } disable command in the VAP profile
view to enable STA IP address learning.
----End
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict
Disabled
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 172.16.50.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :1
Idle :254 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict
Disabled
-------------------------------------------------------------------------------------
# After a wireless user connects to AP1, you can view information about the
wireless user on AGG-AC1.
[AGG-AC1] display station ssid test01
Rf/WLAN: Radio ID/WLAN ID
Rx/Tx: link receive rate/link transmit rate(Mbps)
-----------------------------------------------------------------------------------------------
STA MAC AP ID Ap name Rf/WLAN Band Type Rx/Tx RSSI VLAN IP address
-----------------------------------------------------------------------------------------------
00e0-fc12-3388 2 area_2 1/1 5G 11ac 117/115 -71 30 172.16.30.180
-----------------------------------------------------------------------------------------------
Total: 1 2.4G: 0 5G: 1
Configuration Scripts
# CORE
#
sysname CORE
#
vlan batch 70 80 1000
#
interface Vlanif70
ip address 172.16.70.1 255.255.255.0
#
interface Vlanif80
ip address 172.16.80.1 255.255.255.0
#
interface Vlanif1000
ip address 192.168.100.1 255.255.255.0
#
interface Eth-Trunk10
description connect to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 70
mode lacp
#
interface Eth-Trunk20
description connect to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 80
mode lacp
#
interface XGigabitEthernet1/1/0/1
eth-trunk 10
#
interface XGigabitEthernet1/1/0/2
eth-trunk 20
#
interface XGigabitEthernet1/1/0/10
mad detect mode direct
#
interface XGigabitEthernet1/2/0/1
port link-type access
port default vlan 1000
#
interface XGigabitEthernet2/1/0/1
eth-trunk 20
#
interface XGigabitEthernet2/1/0/2
eth-trunk 10
#
interface XGigabitEthernet2/1/0/10
mad detect mode direct
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 172.16.70.0 0.0.0.255
network 172.16.80.0 0.0.0.255
network 192.168.100.0 0.0.0.255
#
return
# AGG-AC1
#
sysname AGG-AC1
#
vrrp recover-delay 60
#
vlan batch 20 30 to 31 200
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 31
dhcp snooping enable
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
dhcp server excluded-ip-address 192.168.20.2
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif30
ip address 172.16.30.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif31
ip address 172.16.31.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif200
ip address 172.16.200.1 255.255.255.0
#
interface Eth-Trunk 1
description connect to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp
#
interface GigabitEthernet0/0/1
eth-trunk 1
#
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 200
#
ospf 1 router-id 3.3.3.3
area 0.0.0.1
network 192.168.20.0 0.0.0.255
#
capwap source interface vlanif20
#
hsb-service 0
service-ip-port local-ip 172.16.200.1 peer-ip 172.16.200.2 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif20
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type dhcp hsb-group 0
#
hsb-service-type ap hsb-group 0
#
wlan
traffic-profile name traff1
user-isolate l2
traffic-profile name traff2
user-isolate l2
security-profile name sec1
security open
security-profile name sec2
security open
ssid-profile name ssid1
ssid test01
ssid-profile name ssid2
ssid test02
vap-profile name test01
forward-mode tunnel
service-vlan vlan-id 30
ssid-profile ssid1
security-profile sec1
traffic-profile traff1
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
vap-profile name test02
forward-mode tunnel
service-vlan vlan-id 40
ssid-profile ssid2
security-profile sec2
traffic-profile traff2
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 1 type-id 30 ap-mac 00e0-fc12-6660 ap-sn 2102355547W0E3000316
ap-name area_1
ap-group ap-group1
ap-id 2 type-id 56 ap-mac 00e0-fc12-6670 ap-sn 21500829352SGA900583
ap-name area_2
ap-group ap-group1
#
# AGG-AC2
#
sysname AGG-AC2
#
vrrp recover-delay 60
#
vlan batch 20 200
#
interface vlanif20
ip address 192.168.20.2 255.255.255.0
admin-vrrp vrid 1
vrrp vrid 1 virtual-ip 192.168.20.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
#
interface vlanif200
ip address 172.16.200.1 255.255.255.0
#
interface eth-trunk 1
description connect to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
# AGG-AC3
#
sysname AGG-AC3
#
vrrp recover-delay 60
#
vlan batch 21 200
#
dhcp enable
#
dhcp snooping enable
#
vlan 40
dhcp snooping enable
vlan 41
dhcp snooping enable
#
interface vlanif21
ip address 192.168.21.1 255.255.255.0
admin-vrrp vrid 1
vrrp vrid 1 virtual-ip 192.168.21.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
dhcp server excluded-ip-address 192.168.21.2
dhcp server excluded-ip-address 192.168.21.20
#
interface Vlanif40
ip address 172.16.40.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif41
ip address 172.16.41.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface vlanif201
ip address 172.16.201.1 255.255.255.0
#
interface eth-trunk 1
description connect to AGG2
# AGG-AC4
#
sysname AGG-AC4
#
vrrp recover-delay 60
#
vlan batch 21 200
#
interface vlanif21
ip address 192.168.21.2 255.255.255.0
admin-vrrp vrid 1
vrrp vrid 1 virtual-ip 192.168.21.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
#
interface vlanif201
ip address 172.16.201.1 255.255.255.0
#
interface eth-trunk 1
description connect to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21
mode lacp
#
interface gigabitethernet 0/0/1
eth-trunk 1
#
interface gigabitethernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 200
undo port trunk allow-pass vlan 1
#
hsb-service 0
service-ip-port local-ip 172.16.201.2 peer-ip 172.16.201.1 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif21
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type dhcp hsb-group 0
#
hsb-service-type ap hsb-group 0
#
# AGG1
#
sysname AGG1
#
vlan batch 20 50 70
#
dhcp enable
#
dhcp snooping enable
#
vlan 50
dhcp snooping enable
#
interface Vlanif20
ip address 192.168.20.20 255.255.255.0
#
interface Vlanif50
ip address 172.16.50.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif70
ip address 172.16.70.2 255.255.255.0
#
interface Eth-Trunk1
description con to AC
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
mode lacp-static
#
interface Eth-Trunk10
description connect to CORE
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 70
mode lacp-static
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 to 31 50
mode lacp-static
#
interface 10GE1/0/3
eth-trunk 30
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
interface 10GE2/0/3
eth-trunk 30
#
interface 10GE1/0/1
eth-trunk 10
#
interface 10GE2/0/1
eth-trunk 10
#
return
# AGG2
#
sysname AGG2
#
vlan batch 21 60 80
#
dhcp enable
#
dhcp snooping enable
#
vlan 60
dhcp snooping enable
#
interface Vlanif21
ip address 192.168.21.20 255.255.255.0
#
interface Vlanif60
ip address 172.16.60.1 255.255.255.0
arp proxy intra-vlan enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif80
ip address 172.16.80.2 255.255.255.0
#
interface Eth-Trunk1
description con to AC
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21
mode lacp-static
#
interface Eth-Trunk10
description connect to CORE
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 80
mode lacp-static
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21 40 to 41 60
mode lacp-static
port-isolate enable group 1
#
interface 10GE1/0/3
eth-trunk 40
#
interface 10GE1/0/4
eth-trunk 2
#
interface 10GE1/0/5
eth-trunk 2
#
interface 10GE2/0/3
eth-trunk 40
#
interface 10GE1/0/1
eth-trunk 20
#
interface 10GE2/0/1
eth-trunk 20
#
return
# ACC1
#
sysname ACC1
#
vlan batch 20 50
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 30
#
interface 10GE1/0/2
eth-trunk 30
#
interface GE1/0/3
# ACC2
#
sysname ACC2
#
vlan batch 21 60
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21 60
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 30
#
interface 10GE1/0/2
eth-trunk 30
#
interface GE1/0/3
port link-type access
port default vlan 60
stp edged-port enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type access
port default vlan 21
stp edged-port enable
port-isolate enable group 1
#
return
Networking Requirements
Core switches set up a CSS that functions as the core of the entire campus
network to enhance network reliability and maximize forwarding performance.
Standalone ACs are deployed in off-path mode. They function as gateways to
assign IP addresses to APs and wireless users, and centrally manage APs and
wireless users on the entire network.
Aggregation switches set up stacks to implement device-level backup and increase
the port density and forwarding bandwidth.
In this example, core switches function as the gateway and authentication point
for wired users, and standalone ACs function as the gateway and authentication
point for wireless users. The wired and wireless users can access the network only
after being authenticated. The specific requirements are as follows:
● Users include employees (wired and wireless) who use 802.1X authentication
and guests (wireless only) who use MAC address-prioritized Portal
authentication.
● iMaster NCE-Campus functions as both the authentication server and user
service data source server.
● iMaster NCE-Campus delivers ACLs for authorization of successfully
authenticated users to control network access rights of these users of
different roles.
● Port isolation needs to be configured on access and aggregation switches to
control Layer 2 traffic of users.
Figure 2-12 Core switches and standalone ACs functioning as the authentication
points for wired and wireless users respectively
AC - AC6805 V200R022C10
Deployment Roadmap
Step Deployment Roadmap
Data Plan
Traffic profile traff: The user isolation mode is Layer 2 isolation and
Layer 3 communication.
AP group ap-group1
Table 2-24 Authentication service data plan for core switches and ACs
Item Data
Network access rights for ● Employees: Internet, DNS server, service server,
successfully authenticated and network segments of employees
users ● Guests: Internet, DNS server, and network
segments of guests
The IP addresses of the service server, special
server, and campus egress device are
192.168.100.3, 192.168.100.100, and 172.16.3.1,
respectively.
Deployment Precautions
● It is not recommended that VLAN 1 be used as a service VLAN. Remove all
interfaces from VLAN 1. Interfaces need to transparently transmit packets
from specific VLANs, instead of all VLANs, based on actual service
requirements.
● In tunnel forwarding mode, the management VLAN and service VLAN must
be different. Otherwise, MAC address flapping will occur, leading to a packet
forwarding error. The network between the AC and APs needs to permit only
packets tagged with the management VLAN ID and deny packets tagged with
the service VLAN ID.
● In tunnel forwarding mode, service packets from APs are encapsulated in
CAPWAP data tunnels and transmitted to the AC. The AC then forwards the
packets to the upper-layer network. Therefore, service packets and
management packets can be transmitted properly when the interfaces that
connect the AC to APs are added to the management VLAN and the interface
that connects the AC to the upper-layer network is added to a service VLAN.
● WLAN service configurations (for example, WMM profile, radio profile, radio,
traffic profile, security profile, security policy, and WLAN ID) of the AP
associated with the master and backup ACs must be consistent on the two
ACs; otherwise, user services may be affected after a master/backup
switchover between the ACs.
● The models and software versions of the master and backup ACs must be the
same.
● When deploying the DHCP server in the scenario where VRRP HSB is
configured, be aware of the following guidelines:
– In V200R019C00 and later versions, there is no restriction on which
interface to enable the DHCP server function. Only the master AC
Procedure
Step 1 Enable campus network connectivity. For details, see 2.2.1.6 Standalone AC
Solution: Core Switches and ACs Function as the Gateways for Wired and
Wireless Users Respectively.
# Configure the network segment for CORE to connect to the Internet.
<CORE> system-view
[CORE] interface Eth-Trunk 30
[CORE-Eth-Trunk30] mode lacp
[CORE-Eth-Trunk30] description con to Internet
[CORE-Eth-Trunk30] trunkport xgigabitethernet 1/1/0/5
[CORE-Eth-Trunk30] trunkport xgigabitethernet 2/1/0/5
[CORE-Eth-Trunk30] undo portswitch
[CORE-Eth-Trunk30] ip address 172.16.3.1 24
[CORE-Eth-Trunk30] quit
Step 3 Configure the authentication service on ACs. The following uses CORE-AC1 as an
example. The configuration of CORE-AC2 is similar to that of CORE-AC1.
1. Configure AAA parameters.
# Configure the RADIUS server template tem_rad, and configure the
parameters for interconnection between ACs and the RADIUS server, including
the IP addresses, port numbers, authentication key, and accounting key of the
RADIUS authentication and accounting servers.
<CORE-AC1> system-view
[CORE-AC1] radius-server template tem_rad
[CORE-AC1-radius-tem_rad] radius-server authentication 192.168.100.10 1812
[CORE-AC1-radius-tem_rad] radius-server accounting 192.168.100.10 1813
[CORE-AC1-radius-tem_rad] radius-server shared-key cipher YsHsjx_202206
[CORE-AC1-radius-tem_rad] quit
# Configure a RADIUS authorization server and an authorization key.
[CORE-AC1] radius-server authorization 192.168.100.10 shared-key cipher YsHsjx_202206
# Configure an AAA authentication scheme and an AAA accounting scheme,
set the authentication and accounting modes to RADIUS, and set the
accounting interval to 15 minutes.
[CORE-AC1] aaa
[CORE-AC1-aaa] authentication-scheme auth
[CORE-AC1-aaa-authen-auth] authentication-mode radius
[CORE-AC1-aaa-authen-auth] quit
[CORE-aaa] accounting-scheme acco
[CORE-AC1-aaa-accounting-acco] accounting-mode radius
[CORE-AC1-aaa-accounting-acco] accounting realtime 15
[CORE-AC1-aaa-accounting-acco] quit
2. Configure authentication-free resources and network access rights for
successfully authenticated users.
# Configure authentication-free resources to allow packets destined for the
DNS server to pass through.
[CORE-AC1] free-rule-template name default_free_rule
[CORE-AC1-free-rule-default_free_rule] free-rule 1 destination ip 192.168.100.2 mask 32
[CORE-AC1-free-rule-default_free_rule] quit
# Configure network access rights for successfully authenticated employees to
allow them to access the Internet, DNS server, and service server and to
communicate with each other.
NOTE
ACL rules for wireless users are delivered to APs. Therefore, the APs must permit
network segments of wireless users and all the network segments that wireless users
can access. Otherwise, all packets of wireless users are discarded on APs even if the
users are successfully authenticated.
[CORE-AC1] acl 3001
[CORE-AC1-acl-adv-3001] rule 1 permit ip destination 172.16.3.0 0.0.0.255
[CORE-AC1-acl-adv-3001] rule 2 permit ip destination 192.168.100.2 0.0.0.0
[CORE-AC1-acl-adv-3001] rule 3 permit ip destination 192.168.100.3 0.0.0.0
[CORE-AC1-acl-adv-3001] rule 4 permit ip destination 172.16.30.0 0.0.0.255
[CORE-AC1-acl-adv-3001] rule 5 permit ip destination 172.16.50.0 0.0.0.255
[CORE-AC1-acl-adv-3001] rule 6 permit ip destination 172.16.60.0 0.0.0.255
[CORE-AC1-acl-adv-3001] rule 7 deny ip destination any
[CORE-AC1-acl-adv-3001] quit
# Configure network access rights for successfully authenticated guests to
allow them to access the Internet and DNS server and to communicate with
each other.
[CORE-AC1] acl 3002
[CORE-AC1-acl-adv-3002] rule 1 permit ip destination 172.16.3.0 0.0.0.255 //Allow guests to
access the Internet after being authenticated.
[CORE-AC1-acl-adv-3002] rule 2 permit ip destination 192.168.100.2 0.0.0.0 //Allow guests to
Step 4 Configure Layer 2 Protocol Tunneling for 802.1X authentication packets on access
and aggregation switches. The following uses ACC1 as an example. The
configurations of other switches are similar to that of ACC1.
# Enable this function on all interfaces through which 802.1X authentication
packets pass. If a switch does not support the bpdu enable command, you only
need to run the l2protocol-tunnel user-defined-protocol 802.1x enable
command on its interface.
<ACC1> system-view
[ACC1] l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 0180-c200-0003 group-mac
0100-0000-0002
[ACC1] interface Eth-Trunk 30
[ACC1-Eth-Trunk30] l2protocol-tunnel user-defined-protocol 802.1x enable
[ACC1-Eth-Trunk30] quit
[ACC1] interface ge 1/0/3
[ACC1-GE1/0/3] l2protocol-tunnel user-defined-protocol 802.1x enable
[ACC1-GE1/0/3] quit
[ACC1] interface ge 1/0/4
[ACC1-GE1/0/4] l2protocol-tunnel user-defined-protocol 802.1x enable
[ACC1-GE1/0/4] quit
Step 5 Log in to iMaster NCE-Campus, add devices that need to communicate with
iMaster NCE-Campus, and configure RADIUS and Portal authentication
parameters.
Choose Admission > Admission Resources > Admission Device, click Create, and
add devices.
Figure 2-13 shows the procedure for adding an AC. The procedure for adding a
core switch is similar. Table 2-26 lists the parameters for communication between
iMaster NCE-Campus and the core switch and the AC.
Table 2-26 Parameter settings for adding core switches and ACs on iMaster NCE-
Campus
Parameter on iMaster Setting for Core Setting for ACs
NCE-Campus Switches
RADIUS authentication On
parameter
Portal authentication - On
parameter
Portal heartbeat On
verification
Step 6 Add user groups and user accounts. The following describes how to create an
employee group and an employee account. The procedure for creating a guest
group and a guest account is similar.
Choose Admission > Admission Resources > User Management.
Create a user group named employee and add users user1 and user2 to the user
group. Create a user group named guest and add the user guest4 to the user
group. Figure 2-14 shows the parameter settings for the user user1. The methods
for creating user2 and guest4 are similar.
Step 8 Configure network access rights for successfully authenticated employees and
guests.
1. Choose Admission > Admission Policy > Authentication and Authorization.
Click the Authorization Result tab, click Create, and configure authorized
ACLs for employees and guests, respectively.
The ACL numbers must be the same as those configured on the
authentication control device.
ACL3001 3001
ACL3002 3002
----End
Expected Results
1. The employees and guest can access only the authentication-free resources,
but not resources in post-authentication domains, before they are
authenticated or when they fail the authentication.
2. The employees and guest can be successfully authenticated and access the
network after selecting the correct access mode and entering the correct user
names and passwords.
3. After being authenticated, the employees and guest can access
authentication-free resources and resources in post-authentication domains,
but cannot access resources that are denied in the post-authentication
domains.
4. Employees can communicate with each other, but cannot communicate with
the guest.
NOTE
When a guest accesses the network for the first time, the guest can associate with the
WLAN Guest through a mobile terminal, and enter http://192.168.100.10:8080/portal in
the address box of a browser for Portal authentication. On the redirection page that is
displayed, the guest can enter the user name and password, and then is successfully
authenticated. If the guest disconnects from the WLAN and reconnects to the WLAN Guest
within 1 hour, MAC address-prioritized Portal authentication is triggered. The guest can
directly connect to the WLAN without entering the user name and password again.
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
Total: 1, printed: 1
C:\Users\*******>
C:\Users\*******>
2. Verify that the employees and guest can be successfully authenticated and
access the network after selecting the correct access mode and entering the
correct user names and passwords.
# Enter the correct user name and password on PC1, connect to the WLANs
Employee and Guest in wireless mode, and then run the display access-user
command on CORE and CORE-AC1 to view information about online users.
The command output shows that user1, user2, and guest4 are all in Success
state.
[CORE] display access-user
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
Total: 1, printed: 1
[CORE-AC1] display access-user
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
Total: 2, printed: 2
Basic:
User ID : 115318
User name : user1
Domain-name : huawei.com
User MAC : 00e0-fc12-3344
User IP address : 172.16.50.110
User vpn-instance :-
User IPv6 address : FE80::E9AA:
9FE9:95F9:C499
User IPv6 link local address : FE80::E9AA:
9FE9:95F9:C499
User access Interface : Eth-Trunk10
User vlan event : Success
QinQVlan/UserVlan : 0/50
User vlan source : user request
User access time : 2019/11/26
11:08:16
User accounting session ID :
CORE002100000000506e****0304276
User access type : 802.1x
Terminal Device Type : Data Terminal
Dynamic ACL ID(Effective) : 3001
AAA:
User authentication type : 802.1x
authentication
Current authentication method :
RADIUS
Current authorization method : -
Current accounting method :
RADIUS
------------------------------------------------------------------------------
Total: 1, printed: 1
# Run the display access-user username user2 detail and display access-
user username guest4 detail commands on CORE-AC1 to view detailed
authentication and authorization information of user2 and guest4.
[CORE-AC1] display access-user username user2 detail
Basic:
User ID : 32788
User name : user2
User MAC : 00e0-fc12-3366
User IP address : 172.16.30.165
User vpn-instance :-
User IPv6 address :-
User access Interface : Wlan-
Dbss17496
User vlan event : Success
QinQVlan/UserVlan : 0/30
User vlan source : user request
User access time : 2019/11/26
21:22:53
User accounting session ID : CORE-
AC00000000000030f0****0200014
User accounting mult session ID :
AC853DA6A42038CADA5E441A5DDD9****690329A
User access type : 802.1x
AP name : area_1
Radio ID :0
AP MAC : 00e0-fc12-6660
SSID : Employee
Online time : 494(s)
Dynamic ACL ID(Effective) : 3001
User Group Priority :0
AAA:
User authentication type : 802.1x
authentication
Current authentication method :
RADIUS
Current authorization method : -
Current accounting method :
RADIUS
------------------------------------------------------------------------------
Total: 1, printed: 1
[CORE-AC1] display access-user username guest4 detail
Basic:
User ID : 16401
User name : guest4
User MAC : 00e0-fc12-3355
User IP address : 172.16.40.210
User vpn-instance :-
User IPv6 address :-
User access Interface : Wlan-
Dbss17497
User vlan event : Success
QinQVlan/UserVlan : 0/40
User vlan source : user request
User access time : 2019/11/26
21:25:05
User accounting session ID : CORE-
AC000000000000401c****0100011
User accounting mult session ID :
AC853DA6A42064B0A6A3F913FFFFF****FFFFFFF
User access type : WEB
AP name : area_1
Radio ID :0
AP MAC : 00e0-fc12-6660
SSID : Guest
Online time : 421(s)
Web-server IP address :
192.168.100.10
Dynamic ACL ID(Effective) : 3002
User Group Priority :0
AAA:
User authentication type : WEB
authentication
Current authentication method :
RADIUS
Current authorization method : -
Current accounting method :
RADIUS
------------------------------------------------------------------------------
Total: 1, printed: 1
3. Verify that the successfully authenticated employees and guest can access
authentication-free resources and resources in post-authentication domains,
but cannot access resources that are denied in the post-authentication
domains. The following uses wired access of an employee as an example.
# On PC1, ping an authentication-free resource, for example, the DNS server
with IP address 192.168.100.2. The ping operation succeeds.
C:\Users\*******>ping 192.168.100.2
C:\Users\*******>
# On PC1, ping the service server with IP address 192.168.100.3. The ping
operation succeeds.
C:\Users\*******>ping 192.168.100.3
C:\Users\*******>
# On PC1, ping a resource in the post-authentication domain, for example,
the campus egress device with IP address 172.16.3.1. The ping operation
succeeds.
C:\Users\*******>ping 172.16.3.1
C:\Users\*******>
# On PC1, ping a resource denied in the post-authentication domain, for
example, the special server with IP address 192.168.100.100. The ping
operation fails.
C:\Users\*******>ping 192.168.100.100
C:\Users\*******>
4. Verify that employees can communicate with each other, but cannot
communicate with the guest.
# On PC1, ping the IP address of the terminal used by the wireless employee
account user2. The ping operation succeeds.
C:\Users\*******>ping 172.16.30.165
C:\Users\*******>
# On PC1, ping the IP address of the wireless terminal used by guest4. The
ping operation fails.
C:\Users\*******>ping 172.16.40.210
C:\Users\*******>
Configuration Scripts
● CORE
#
sysname CORE
#
vlan batch 20 30 40 50 60 1000
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
access-domain huawei.com force
#
dhcp enable
#
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#P&%q-,!CC~Ng<^1w;LT:NQj&B.*@a~V.Zi+<pA0H%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radius-server accounting 192.168.100.10 1813 weight 80
radius-server authorization 192.168.100.10 shared-key cipher %^
%#x`c[=x{ot~7c@T@8fMb'+lGz74$gT6:Kc/DZ1K5Z%^%#
#
acl number 3001
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
authentication-profile p1
mode lacp
#
interface Eth-Trunk20
description con to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 60
authentication-profile p1
mode lacp
#
interface Eth-Trunk30
description con to Internet
undo portswitch
ip address 172.16.3.1 255.255.255.0
mode lacp
#
interface XGigabitEthernet1/1/0/1
eth-trunk 10
#
interface XGigabitEthernet1/1/0/2
eth-trunk 20
#
interface XGigabitEthernet1/1/0/3
eth-trunk 1
#
interface XGigabitEthernet1/1/0/4
eth-trunk 2
#
interface XGigabitEthernet1/1/0/5
eth-trunk 30
#
interface XGigabitEthernet1/2/0/1
port link-type access
port default vlan 1000
#
interface XGigabitEthernet2/1/0/1
eth-trunk 20
#
interface XGigabitEthernet2/1/0/2
eth-trunk 10
#
interface XGigabitEthernet2/1/0/3
eth-trunk 1
#
interface XGigabitEthernet2/1/0/4
eth-trunk 2
#
interface XGigabitEthernet2/1/0/5
eth-trunk 30
#
dot1x-access-profile name d1
#
return
● CORE-AC1
#
sysname CORE-AC1
#
vrrp recover-delay 60
#
vlan batch 20 30 40 100
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
authentication-profile name p2
mac-access-profile mac1
portal-access-profile web1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 40
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#!XJ(Vgk2'$xrU{5H..g"f)`<ELF*e${j(A>B~f<%%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radius-server accounting 192.168.100.10 1813 weight 80
radius-server authorization 192.168.100.10 shared-key cipher %^%#Kc8XWx+M
%F{rpFQ:w[v>Ay]0A*xcqV{@CP0}M3<*%^%#
#
acl number 3001
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 192.168.100.3 0
rule 4 permit ip destination 172.16.30.0 0.0.0.255
rule 5 permit ip destination 172.16.50.0 0.0.0.255
rule 6 permit ip destination 172.16.60.0 0.0.0.255
rule 7 deny ip
acl number 3002
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 172.16.40.0 0.0.0.255
rule 4 deny ip
#
free-rule-template name default_free_rule
free-rule 1 destination ip 192.168.100.2 mask 255.255.255.255
#
web-auth-server tem_portal
server-ip 192.168.100.10
port 50200
shared-key cipher %^%#pn3AB{kK:VEVrlUe=YR2a3^q@I<~,7&Pxc&hP|^;%^%#
url http://192.168.100.10:8080/portal
server-detect interval 100 max-times 5 action log
#
portal-access-profile name web1
web-auth-server tem_portal direct
#
aaa
authentication-scheme auth
authentication-mode radius
accounting-scheme acco
accounting-mode radius
accounting realtime 15
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
dhcp server excluded-ip-address 192.168.20.2
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif30
ip address 172.16.30.1 255.255.255.0
learn-client-address dhcp-strict
vap-profile name vap2
forward-mode tunnel
service-vlan vlan-id 40
ssid-profile ssid2
security-profile sec2
traffic-profile traff
authentication-profile p2
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
regulatory-domain-profile name domain1
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 1 type-id 30 ap-mac 00e0-fc12-6660 ap-sn 2102355547W0E3000316
ap-name area_1
ap-group ap-group1
ap-id 2 type-id 56 ap-mac 00e0-fc12-6670 ap-sn 21500829352SGA900583
ap-name area_2
ap-group ap-group1
master controller
master-redundancy track-vrrp vrid 1 interface Vlanif20
master-redundancy peer-ip ip-address 172.16.100.2 local-ip ip-address 172.16.100.1 psk %^%#5Vh&
+;LCyDdLEV1gGJuP}9l(9W&u!+uHt";5T#yM%^%#
#
dot1x-access-profile name d1
#
mac-access-profile name mac1
#
return
● CORE-AC2
#
sysname CORE-AC2
#
vrrp recover-delay 60
#
vlan batch 20 30 40 100
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
authentication-profile name p2
mac-access-profile mac1
portal-access-profile web1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 40
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#!XJ(Vgk2'$xrU{5H..g"f)`<ELF*e${j(A>B~f<%%^%#
● AGG1
#
sysname AGG1
#
vlan batch 20 50
#
l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 0180-c200-0003 group-mac
0100-0000-0002
#
interface Eth-Trunk10
description connect to CORE
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
l2protocol-tunnel user-defined-protocol 802.1x enable
mode lacp
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
l2protocol-tunnel user-defined-protocol 802.1x enable
mode lacp
port-isolate enable group 1
#
interface 10GE1/0/3
eth-trunk 30
#
interface 10GE2/0/3
eth-trunk 30
#
interface 10GE1/0/1
eth-trunk 10
#
interface 10GE2/0/1
eth-trunk 10
#
return
● AGG2
#
sysname AGG2
#
vlan batch 20 60
#
l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 0180-c200-0003 group-mac
0100-0000-0002
#
interface Eth-Trunk20
description connect to CORE
port link-type trunk
● ACC1
#
sysname ACC1
#
vlan batch 20 50
#
l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 0180-c200-0003 group-mac
0100-0000-0002
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
l2protocol-tunnel user-defined-protocol 802.1x enable
mode lacp
#
interface 10GE1/0/1
eth-trunk 30
#
interface 10GE1/0/2
eth-trunk 30
#
interface GE1/0/3
port link-type access
port default vlan 50
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type access
port default vlan 20
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
return
● ACC2
#
sysname ACC2
#
vlan batch 20 60
#
l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 0180-c200-0003 group-mac
0100-0000-0002
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 60
l2protocol-tunnel user-defined-protocol 802.1x enable
mode lacp
#
interface 10GE1/0/1
eth-trunk 40
#
interface 10GE1/0/2
eth-trunk 40
#
interface GE1/0/3
port link-type access
port default vlan 60
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
interface GE1/0/4
port link-type access
port default vlan 20
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
return
Networking Requirements
Core switches set up a CSS that functions as the core of the entire campus
network to enhance network reliability and maximize forwarding performance.
● Users include employees (wired and wireless) who use 802.1X authentication
and guests (wireless only) who use MAC address-prioritized Portal
authentication.
● iMaster NCE-Campus functions as both the authentication server and user
service data source server.
● iMaster NCE-Campus delivers ACLs for authorization of successfully
authenticated users to control network access rights of these users of
different roles.
Access - S5735-L-V2
layer
AC - AC9700-M1 V200R022C10
AP - AirEngine 8760-
X1-PRO
Deployment Roadmap
Step Deployment Roadmap
Data Plan
Traffic profile traff: The user isolation mode is Layer 2 isolation and
Layer 3 communication.
Table 2-32 Authentication service data plan for aggregation switches and ACs
Item Data
Item Data
Network access rights for ● Employees: Internet, DNS server, service server,
successfully authenticated and network segments of employees
users ● Guests: Internet, DNS server, and network
segments of guests
The IP addresses of the service server, special
server, and campus egress device are
192.168.100.3, 192.168.100.100, and 172.16.3.1,
respectively.
Precautions
● It is not recommended that VLAN 1 be used as the management VLAN or a
service VLAN. Remove all interfaces from VLAN 1. Interfaces need to
transparently transmit packets from specific VLANs, instead of all VLANs,
based on actual service requirements.
● In direct forwarding mode, it is recommended that different VLANs be used as
the management VLAN and service VLAN. If you do not follow this
recommendation, services may be interrupted, which can be illustrated with
Procedure
Step 1 Enable campus network connectivity. For details, see 2.2.1.7 Standalone AC
Solution: Aggregation Switches and ACs Function as the Gateways for Wired
and Wireless Users Respectively.
# Configure the network segment for CORE to connect to the Internet.
<CORE> system-view
[CORE] interface Eth-Trunk 30
[CORE-Eth-Trunk30] mode lacp
[CORE-Eth-Trunk30] description con to Internet
[CORE-Eth-Trunk30] trunkport xgigabitethernet 1/1/0/5
[CORE-Eth-Trunk30] trunkport xgigabitethernet 2/1/0/5
[CORE-Eth-Trunk30] undo portswitch
[CORE-Eth-Trunk30] ip address 172.16.3.1 24
[CORE-Eth-Trunk30] quit
[CORE] ospf
[CORE-ospf-1] area 0
[CORE-ospf-1-area-0.0.0.0] network 172.16.3.0 0.0.0.255
[CORE-ospf-1-area-0.0.0.0] quit
[CORE-ospf-1] quit
Step 2 Configure the authentication service on aggregation switches. The following uses
AGG1 as an example. The configuration of AGG2 is similar to that of AGG1.
Step 3 Configure the authentication service on ACs. The following uses AGG-AC1 as an
example. The configurations of other ACs are similar to that of AGG-AC1.
1. Configure AAA parameters.
# Configure the RADIUS server template tem_rad, and configure the
parameters for interconnection between ACs and the RADIUS server, including
the IP addresses, port numbers, authentication key, and accounting key of the
RADIUS authentication and accounting servers.
<AGG-AC1> system-view
[AGG-AC1] radius-server template tem_rad
[AGG-AC1-radius-tem_rad] radius-server authentication 192.168.100.10 1812
[AGG-AC1-radius-tem_rad] radius-server accounting 192.168.100.10 1813
[AGG-AC1-radius-tem_rad] radius-server shared-key cipher YsHsjx_202206
[AGG-AC1-radius-tem_rad] quit
NOTE
ACL rules for wireless users are delivered to APs. Therefore, the APs must permit
network segments of wireless users and all the network segments that wireless users
can access. Otherwise, all packets of wireless users are discarded on APs even if the
users are successfully authenticated.
[AGG-AC1] acl 3001
[AGG-AC1-acl-adv-3001] rule 1 permit ip destination 172.16.3.0 0.0.0.255
[AGG-AC1-acl-adv-3001] rule 2 permit ip destination 192.168.100.2 0.0.0.0
[AGG-AC1-acl-adv-3001] rule 3 permit ip destination 192.168.100.3 0.0.0.0
[AGG-AC1-acl-adv-3001] rule 4 permit ip destination 172.16.30.0 0.0.0.255
[AGG-AC1-acl-adv-3001] rule 5 permit ip destination 172.16.40.0 0.0.0.255
[AGG-AC1-acl-adv-3001] rule 6 permit ip destination 172.16.50.0 0.0.0.255
[AGG-AC1-acl-adv-3001] rule 7 permit ip destination 172.16.60.0 0.0.0.255
[AGG-AC1-acl-adv-3001] rule 8 deny ip destination any
[AGG-AC1-acl-adv-3001] quit
Step 4 Configure Layer 2 Protocol Tunneling for 802.1X authentication packets on the
access switch. The following uses ACC1 as an example. The configuration of ACC2
is similar to that of ACC1.
# Enable this function on all interfaces through which 802.1X authentication
packets pass. If a switch does not support the bpdu enable command, you only
need to run the l2protocol-tunnel user-defined-protocol 802.1x enable
command on its interface.
<ACC1> system-view
[ACC1] l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 00e0-fc02-0003 group-mac 00e0-
fc00-0002
[ACC1] interface Eth-Trunk 30
[ACC1-Eth-Trunk30] l2protocol-tunnel user-defined-protocol 802.1x enable
[ACC1-Eth-Trunk30] quit
[ACC1] interface gigabitethernet 1/0/3
[ACC1-GigabitEthernet1/0/3] l2protocol-tunnel user-defined-protocol 802.1x enable
[ACC1-GigabitEthernet1/0/3] quit
[ACC1] interface gigabitethernet 1/0/4
[ACC1-GigabitEthernet1/0/4] l2protocol-tunnel user-defined-protocol 802.1x enable
[ACC1-GigabitEthernet1/0/4] quit
Step 5 Log in to iMaster NCE-Campus, add devices that need to communicate with
iMaster NCE-Campus, and configure RADIUS and Portal authentication
parameters.
Choose Admission > Admission Resources > Admission Device, click Create, and
add devices.
Figure 2-19 shows the procedure for adding an AC. The procedure for adding an
aggregation switch is similar. Table 2-34 lists the parameters for communication
between iMaster NCE-Campus and aggregation switches as well as ACs.
Table 2-34 Parameter settings for adding aggregation switches and ACs on
iMaster NCE-Campus
Parameter on iMaster Setting for Setting for ACs
NCE-Campus Aggregation
Switches
RADIUS authentication On
parameter
Real-time accounting 15
interval (minute)
Portal authentication - On
parameter
Portal heartbeat On
verification
Step 6 Add user groups and user accounts. The following describes how to create an
employee group and an employee account. The procedure for creating a guest
group and a guest account is similar.
Create a user group named employee and add users user1 and user2 to the user
group. Create a user group named guest and add the user guest4 to the user
group. Figure 2-20 shows the parameter settings for the user user1. The methods
for creating user2 and guest4 are similar.
Step 8 Configure network access rights for successfully authenticated employees and
guests.
1. Choose Admission > Admission Policy > Authentication and Authorization.
Click the Authorization Result tab, click Create, and configure authorized
ACLs for employees and guests, respectively.
The ACL numbers must be the same as those configured on the
authentication control device.
----End
Expected Results
1. The employees and guest can be successfully authenticated and access the
network after selecting the correct access mode and entering the correct user
names and passwords.
2. After being authenticated, the employees and guest can access
authentication-free resources and resources in post-authentication domains,
but cannot access resources that are denied in the post-authentication
domains.
3. Employees can communicate with each other, but cannot communicate with
the guest.
NOTE
When a guest accesses the network for the first time, the guest can associate with the
WLAN Guest through a mobile terminal, and enter http://192.168.100.10:8080/portal in
the address box of a browser for Portal authentication. On the redirection page that is
displayed, the guest can enter the user name and password, and then is successfully
authenticated. If the guest disconnects from the WLAN and reconnects to the WLAN Guest
within 1 hour, MAC address-prioritized Portal authentication is triggered. The guest can
directly connect to the WLAN without entering the user name and password again.
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
Total: 1, printed: 1
[AGG-AC1] display access-user
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
Total: 2, printed: 2
Basic:
User ID : 32792
User name : user1
Domain-name : huawei.com
User MAC : 00e0-fc12-3344
User IP address : 172.16.50.216
User vpn-instance :-
User IPv6 address : FE80::E9AA:
9FE9:95F9:C499
User IPv6 link local address : FE80::E9AA:
9FE9:95F9:C499
User access Interface : Eth-Trunk10
User vlan event : Success
QinQVlan/UserVlan : 0/50
User vlan source : user request
User access time : 2019/12/30
10:01:33
User accounting session ID :
AGG00018000000050ef****0200018
User access type : 802.1x
Terminal Device Type : Data Terminal
Dynamic ACL ID(Effective) : 3001
AAA:
User authentication type : 802.1x
authentication
Current authentication method :
RADIUS
Current authorization method : -
Current accounting method :
RADIUS
------------------------------------------------------------------------------
Total: 1, printed: 1
# Run the display access-user username user2 detail and display access-
user username guest4 detail commands on AGG-AC1 to view detailed
authentication and authorization information of user2 and guest4.
Basic:
User ID : 16434
User name : user2
User MAC : 00e0-fc12-3366
User IP address : 172.16.30.97
User vpn-instance :-
User IPv6 address :-
User access Interface : Wlan-
Dbss17498
User vlan event : Success
QinQVlan/UserVlan : 0/30
User vlan source : user request
User access time : 2019/12/30
10:02:55
User accounting session ID :
AC2000000000000308d****0100032
User accounting mult session ID :
AC853DA6A42038CADA5E441A5E09C****B2526E4
User access type : 802.1x
AP name : area_1
Radio ID :1
AP MAC : 00e0-fc12-4400
SSID : Employee
Online time : 115(s)
Dynamic ACL ID(Effective) : 3001
User Group Priority :0
AAA:
User authentication type : 802.1x
authentication
Current authentication method :
RADIUS
Current authorization method : -
Current accounting method :
RADIUS
------------------------------------------------------------------------------
Total: 1, printed: 1
[AGG-AC1] display access-user username guest4 detail
Basic:
User ID : 32809
User name : guest4
User MAC : 00e0-fc12-3355
User IP address : 172.16.31.165
User vpn-instance :-
User IPv6 address :-
User access Interface : Wlan-
Dbss17497
User vlan event : Success
QinQVlan/UserVlan : 0/31
User vlan source : user request
User access time : 2019/12/30
09:52:57
User accounting session ID :
AC200000000000031dd****0200029
User accounting mult session ID :
AC853DA6A42064B0A6A3F913FFFFF****FFFFFFF
User access type : WEB
AP name : area_1
Radio ID :0
AP MAC : 00e0-fc12-4400
SSID : Guest
Online time : 764(s)
Web-server IP address :
192.168.100.10
Dynamic ACL ID(Effective) : 3002
User Group Priority :0
AAA:
User authentication type : WEB
authentication
Current authentication method :
RADIUS
Current authorization method : -
Current accounting method :
RADIUS
------------------------------------------------------------------------------
Total: 1, printed: 1
2. Verify that the successfully authenticated employees and guest can access
authentication-free resources and resources in post-authentication domains,
but cannot access resources that are denied in the post-authentication
domains. The following uses wired access of an employee as an example.
# On PC1, ping an authentication-free resource, for example, the DNS server
with IP address 192.168.100.2. The ping operation succeeds.
C:\Users\*******>ping 192.168.100.2
C:\Users\*******>
# On PC1, ping the service server with IP address 192.168.100.3. The ping
operation succeeds.
C:\Users\*******>ping 192.168.100.3
C:\Users\*******>
# On PC1, ping a resource in the post-authentication domain, for example,
the campus egress device with IP address 172.16.3.1. The ping operation
succeeds.
C:\Users\*******>ping 172.16.3.1
C:\Users\*******>
C:\Users\*******>
3. Verify that employees can communicate with each other, but cannot
communicate with the guest.
# On PC1, ping the IP address of the terminal used by the wireless employee
account user2. The ping operation succeeds.
C:\Users\*******>ping 172.16.30.97
C:\Users\*******>
# On PC1, ping the IP address of the wireless terminal used by guest4. The
ping operation fails.
C:\Users\*******>ping 172.16.31.165
C:\Users\*******>
Configuration Scripts
# CORE
#
sysname CORE
#
vlan batch 70 80 1000
#
interface Vlanif70
ip address 172.16.70.1 255.255.255.0
#
interface Vlanif80
ip address 172.16.80.1 255.255.255.0
#
interface Vlanif1000
ip address 192.168.100.1 255.255.255.0
#
interface Eth-Trunk10
description connect to AGG1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 70
mode lacp
#
interface Eth-Trunk20
description connect to AGG2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 80
mode lacp
#
interface Eth-Trunk30
undo portswitch
description connect to Internet
ip address 172.16.3.1 255.255.255.0
mode lacp
#
interface XGigabitEthernet1/1/0/1
eth-trunk 10
#
interface XGigabitEthernet1/1/0/2
eth-trunk 20
#
interface XGigabitEthernet1/1/0/5
eth-trunk 30
#
interface XGigabitEthernet1/1/0/10
mad detect mode direct
#
interface XGigabitEthernet1/2/0/1
port link-type access
port default vlan 1000
#
interface XGigabitEthernet2/1/0/1
eth-trunk 20
#
interface XGigabitEthernet2/1/0/2
eth-trunk 10
#
interface XGigabitEthernet2/1/0/5
eth-trunk 30
#
interface XGigabitEthernet2/1/0/10
mad detect mode direct
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 172.16.3.0 0.0.0.255
network 172.16.70.0 0.0.0.255
network 172.16.80.0 0.0.0.255
network 192.168.100.0 0.0.0.255
#
return
# AGG1
#
sysname AGG1
#
vlan batch 20 30 to 31 50 70
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
access-domain huawei.com force
#
dhcp enable
#
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#~jZ}F$6t6/!K%~9Ow$"Vb,+LFnrEl>q<\'1!^JD7%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radius-server accounting 192.168.100.10 1813 weight 80
radius-server authorization 192.168.100.10 shared-key cipher %^%#GH(%~#au`G.f/lA~"P%I]^Z4L*yVj"[/
w"2uWP\'%^%#
#
acl number 3001
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 192.168.100.3 0
rule 4 permit ip destination 172.16.30.0 0.0.0.255
rule 5 permit ip destination 172.16.40.0 0.0.0.255
rule 6 permit ip destination 172.16.50.0 0.0.0.255
rule 7 permit ip destination 172.16.60.0 0.0.0.255
rule 8 deny ip
#
free-rule-template name default_free_rule
free-rule 1 destination ip 192.168.100.2 mask 255.255.255.255
free-rule 2 source vlan 20
#
vlan 50
dhcp snooping enable
#
aaa
authentication-scheme auth
authentication-mode radius
accounting-scheme acco
accounting-mode radius
accounting realtime 15
domain huawei.com
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
interface Vlanif20
ip address 192.168.20.20 255.255.255.0
#
interface Vlanif30
ip address 172.16.30.3 255.255.255.0
#
interface Vlanif31
ip address 172.16.31.3 255.255.255.0
#
interface Vlanif50
ip address 172.16.50.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server dns-list 192.168.100.2
#
interface Vlanif70
ip address 172.16.70.2 255.255.255.0
#
interface Eth-Trunk1
description con to AC
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 to 31
mode lacp
#
interface Eth-Trunk10
# AGG2
#
sysname AGG2
#
vlan batch 21 40 to 41 60 80
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
access-domain huawei.com force
#
dhcp enable
#
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#~jZ}F$6t6/!K%~9Ow$"Vb,+LFnrEl>q<\'1!^JD7%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radius-server accounting 192.168.100.10 1813 weight 80
radius-server authorization 192.168.100.10 shared-key cipher %^%#GH(%~#au`G.f/lA~"P%I]^Z4L*yVj"[/
w"2uWP\'%^%#
#
#
interface 10GigabitEthernet1/0/4
eth-trunk 2
#
interface 10GigabitEthernet1/0/5
eth-trunk 2
#
interface 10GigabitEthernet1/0/10
mad detect mode direct
#
interface 10GigabitEthernet2/0/3
eth-trunk 40
#
interface 10GigabitEthernet2/0/10
mad detect mode direct
#
interface 10GigabitEthernet1/0/1
eth-trunk 20
#
interface 10GigabitEthernet2/0/1
eth-trunk 20
#
ospf 1 router-id 7.7.7.7
area 0.0.0.0
network 172.16.40.0 0.0.0.255
network 172.16.41.0 0.0.0.255
network 172.16.60.0 0.0.0.255
network 172.16.80.0 0.0.0.255
#
dot1x-access-profile name d1
#
return
# AGG-AC1
#
sysname AGG-AC1
#
vrrp recover-delay 60
#
vlan batch 20 30 to 31 200
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
authentication-profile name p2
mac-access-profile mac1
portal-access-profile web1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 31
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#}q]hRf*~x5o]fjF<R#EEFXy0MI=L4)Tw]%+Nk)ET%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radius-server accounting 192.168.100.10 1813 weight 80
radius-server authorization 192.168.100.10 shared-key cipher %^%#j7U//99!v(-n+\HtWgD60K@2IFc-I
$3F)3K]ar/O%^%#
#
acl number 3001
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 192.168.100.3 0
rule 4 permit ip destination 172.16.30.0 0.0.0.255
rule 5 permit ip destination 172.16.40.0 0.0.0.255
rule 6 permit ip destination 172.16.50.0 0.0.0.255
rule 7 permit ip destination 172.16.60.0 0.0.0.255
rule 8 deny ip
acl number 3002
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 172.16.31.0 0.0.0.255
rule 4 permit ip destination 172.16.41.0 0.0.0.255
rule 5 deny ip
#
free-rule-template name default_free_rule
free-rule 1 destination ip 192.168.100.2 mask 255.255.255.255
#
web-auth-server tem_portal
server-ip 192.168.100.10
port 50200
shared-key cipher %^%#@Un19tIB1FQ\p%US,S54+gEh'8@qzSQ&BGXJ$niV%^%#
url http://192.168.100.10:8080/portal
server-detect interval 100 max-times 5 action log
#
portal-access-profile name web1
web-auth-server tem_portal direct
#
aaa
authentication-scheme auth
authentication-mode radius
accounting-scheme acco
accounting-mode radius
accounting realtime 15
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
dhcp server excluded-ip-address 192.168.20.2
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif30
ip address 172.16.30.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.30.2 172.16.30.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif31
ip address 172.16.31.1 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.31.2 172.16.31.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif200
ip address 172.16.200.1 255.255.255.0
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 to 31
mode lacp
#
interface GigabitEthernet0/0/1
eth-trunk 1
#
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 200
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.30.0 0.0.0.255
network 172.16.31.0 0.0.0.255
#
capwap source interface vlanif20
#
hsb-service 0
service-ip-port local-ip 172.16.200.1 peer-ip 172.16.200.2 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif20
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type dhcp hsb-group 0
#
hsb-service-type ap hsb-group 0
#
wlan
traffic-profile name traff
user-isolate l2
security-profile name sec1
security wpa2 dot1x aes
security-profile name sec2
ssid-profile name ssid1
ssid Employee
ssid-profile name ssid2
ssid Guest
vap-profile name vap1
forward-mode tunnel
service-vlan vlan-id 30
ssid-profile ssid1
security-profile sec1
traffic-profile traff
authentication-profile p1
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
vap-profile name vap2
forward-mode tunnel
service-vlan vlan-id 31
ssid-profile ssid2
security-profile sec2
traffic-profile traff
authentication-profile p2
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
regulatory-domain-profile name domain1
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
# AGG-AC2
#
sysname AGG-AC2
#
vrrp recover-delay 60
#
vlan batch 20 30 to 31 200
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
authentication-profile name p2
mac-access-profile mac1
portal-access-profile web1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
dhcp enable
#
dhcp snooping enable
#
vlan 30
dhcp snooping enable
vlan 31
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#}q]hRf*~x5o]fjF<R#EEFXy0MI=L4)Tw]%+Nk)ET%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radius-server accounting 192.168.100.10 1813 weight 80
radius-server authorization 192.168.100.10 shared-key cipher %^%#j7U//99!v(-n+\HtWgD60K@2IFc-I
$3F)3K]ar/O%^%#
#
acl number 3001
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 192.168.100.3 0
rule 4 permit ip destination 172.16.30.0 0.0.0.255
rule 5 permit ip destination 172.16.40.0 0.0.0.255
rule 6 permit ip destination 172.16.50.0 0.0.0.255
rule 7 permit ip destination 172.16.60.0 0.0.0.255
rule 8 deny ip
acl number 3002
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 172.16.31.0 0.0.0.255
rule 4 permit ip destination 172.16.41.0 0.0.0.255
rule 5 deny ip
#
free-rule-template name default_free_rule
free-rule 1 destination ip 192.168.100.2 mask 255.255.255.255
#
web-auth-server tem_portal
server-ip 192.168.100.10
port 50200
shared-key cipher %^%#@Un19tIB1FQ\p%US,S54+gEh'8@qzSQ&BGXJ$niV%^%#
url http://192.168.100.10:8080/portal
server-detect interval 100 max-times 5 action log
#
portal-access-profile name web1
web-auth-server tem_portal direct
#
aaa
authentication-scheme auth
authentication-mode radius
accounting-scheme acco
accounting-mode radius
accounting realtime 15
#
interface Vlanif20
ip address 192.168.20.2 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.20.3
admin-vrrp vrid 1
dhcp select interface
dhcp server excluded-ip-address 192.168.20.1
dhcp server excluded-ip-address 192.168.20.20
#
interface Vlanif30
ip address 172.16.30.2 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.30.1
dhcp server excluded-ip-address 172.16.30.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif31
ip address 172.16.31.2 255.255.255.0
arp-proxy inner-sub-vlan-proxy enable
dhcp select interface
dhcp server excluded-ip-address 172.16.31.1
dhcp server excluded-ip-address 172.16.31.3
dhcp server dns-list 192.168.100.2
#
interface Vlanif200
ip address 172.16.200.2 255.255.255.0
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30 to 31
mode lacp
#
interface GigabitEthernet0/0/1
eth-trunk 1
#
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 200
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.30.0 0.0.0.255
network 172.16.31.0 0.0.0.255
#
capwap source interface vlanif20
#
hsb-service 0
service-ip-port local-ip 172.16.200.2 peer-ip 172.16.200.1 local-data-port 10241 peer-data-port 10241
#
hsb-group 0
track vrrp vrid 1 interface Vlanif20
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type dhcp hsb-group 0
#
hsb-service-type ap hsb-group 0
#
wlan
traffic-profile name traff
user-isolate l2
security-profile name sec1
security wpa2 dot1x aes
security-profile name sec2
ssid-profile name ssid1
ssid Employee
ssid-profile name ssid2
ssid Guest
vap-profile name vap1
forward-mode tunnel
service-vlan vlan-id 30
ssid-profile ssid1
security-profile sec1
traffic-profile traff
authentication-profile p1
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
vap-profile name vap2
forward-mode tunnel
service-vlan vlan-id 31
ssid-profile ssid2
security-profile sec2
traffic-profile traff
authentication-profile p2
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
regulatory-domain-profile name domain1
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 1 type-id 30 ap-mac 00e0-fc12-6660 ap-sn 2102355547W0E3000316
ap-name area_1
ap-group ap-group1
provision-ap
#
dot1x-access-profile name d1
#
mac-access-profile name mac1
#
return
# AGG-AC3
#
sysname AGG-AC3
#
vrrp recover-delay 60
#
vlan batch 21 40 to 41 201
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
authentication-profile name p2
mac-access-profile mac1
portal-access-profile web1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
dhcp enable
#
dhcp snooping enable
#
vlan 40
dhcp snooping enable
vlan 41
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#}q]hRf*~x5o]fjF<R#EEFXy0MI=L4)Tw]%+Nk)ET%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radius-server accounting 192.168.100.10 1813 weight 80
radius-server authorization 192.168.100.10 shared-key cipher %^%#j7U//99!v(-n+\HtWgD60K@2IFc-I
$3F)3K]ar/O%^%#
#
acl number 3001
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 192.168.100.3 0
rule 4 permit ip destination 172.16.30.0 0.0.0.255
rule 5 permit ip destination 172.16.40.0 0.0.0.255
rule 6 permit ip destination 172.16.50.0 0.0.0.255
rule 7 permit ip destination 172.16.60.0 0.0.0.255
rule 8 deny ip
acl number 3002
rule 1 permit ip destination 172.16.3.0 0.0.0.255
rule 2 permit ip destination 192.168.100.2 0
rule 3 permit ip destination 172.16.31.0 0.0.0.255
rule 4 permit ip destination 172.16.41.0 0.0.0.255
rule 5 deny ip
#
free-rule-template name default_free_rule
free-rule 1 destination ip 192.168.100.2 mask 255.255.255.255
#
web-auth-server tem_portal
server-ip 192.168.100.10
port 50200
shared-key cipher %^%#@Un19tIB1FQ\p%US,S54+gEh'8@qzSQ&BGXJ$niV%^%#
url http://192.168.100.10:8080/portal
server-detect interval 100 max-times 5 action log
#
portal-access-profile name web1
web-auth-server tem_portal direct
#
aaa
authentication-scheme auth
authentication-mode radius
accounting-scheme acco
accounting-mode radius
accounting realtime 15
#
interface Vlanif21
ip address 192.168.21.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.21.3
admin-vrrp vrid 1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1200
dhcp select interface
security-profile sec1
traffic-profile traff
authentication-profile p1
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
vap-profile name vap2
forward-mode tunnel
service-vlan vlan-id 41
ssid-profile ssid2
security-profile sec2
traffic-profile traff
authentication-profile p2
ip source check user-bind enable
arp anti-attack check user-bind enable
learn-client-address dhcp-strict
regulatory-domain-profile name domain1
ap-group name ap-group2
regulatory-domain-profile domain1
radio 0
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 2 type-id 56 ap-mac 00e0-fc12-6670 ap-sn 21500829352SGA900583
ap-name area_2
ap-group ap-group2
provision-ap
#
dot1x-access-profile name d1
#
mac-access-profile name mac1
#
return
# AGG-AC4
#
sysname AGG-AC4
#
vrrp recover-delay 60
#
vlan batch 21 40 to 41 201
#
authentication-profile name p1
dot1x-access-profile d1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
authentication-profile name p2
mac-access-profile mac1
portal-access-profile web1
free-rule-template default_free_rule
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
dhcp enable
#
dhcp snooping enable
#
vlan 40
dhcp snooping enable
vlan 41
dhcp snooping enable
#
radius-server template tem_rad
radius-server shared-key cipher %^%#}q]hRf*~x5o]fjF<R#EEFXy0MI=L4)Tw]%+Nk)ET%^%#
radius-server authentication 192.168.100.10 1812 weight 80
radio 1
vap-profile vap1 wlan 1
vap-profile vap2 wlan 2
ap-id 2 type-id 56 ap-mac 00e0-fc12-6670 ap-sn 21500829352SGA900583
ap-name area_2
ap-group ap-group2
provision-ap
#
dot1x-access-profile name d1
#
mac-access-profile name mac1
#
return
# ACC1
#
sysname ACC1
#
vlan batch 20 50
#
l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 00e0-fc02-0003 group-mac 00e0-fc00-0002
#
interface Eth-Trunk30
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 50
l2protocol-tunnel user-defined-protocol 802.1x enable
mode lacp
#
interface 10GigabitEthernet1/0/1
eth-trunk 30
#
interface 10GigabitEthernet1/0/2
eth-trunk 30
#
interface GigabitEthernet1/0/3
port link-type access
port default vlan 50
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
interface GigabitEthernet1/0/4
port link-type access
port default vlan 20
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
return
# ACC2
#
sysname ACC2
#
vlan batch 21 60
#
l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 00e0-fc02-0003 group-mac 00e0-fc00-0002
#
interface Eth-Trunk40
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 21 60
l2protocol-tunnel user-defined-protocol 802.1x enable
mode lacp
#
interface 10GigabitEthernet1/0/1
eth-trunk 40
#
interface 10GigabitEthernet1/0/2
eth-trunk 40
#
interface GigabitEthernet1/0/3
port link-type access
port default vlan 60
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
interface GigabitEthernet1/0/4
port link-type access
port default vlan 21
stp edged-port enable
l2protocol-tunnel user-defined-protocol 802.1x enable
port-isolate enable group 1
#
return
Overview
This scenario aims to enable Layer 2 and Layer 3 communication between core,
aggregation, and access devices on a small-sized campus network and configure
802.1X authentication on access devices. Users can access the campus network
and communicate with each other only after being authenticated successfully.
Networking Requirements
In Figure 2-24, the campus network consists of the core layer, aggregation layer,
and access layer.
● The aggregation switch functions as a user gateway to route and forward user
services.
● Access switches function as user authentication points. Users can access the
network only after passing 802.1X authentication.
● Network devices are connected through Eth-Trunks to improve network
reliability.
Data Plan
Configuration Precautions
● It is not recommended that VLAN 1 be used as the management VLAN or a
service VLAN. Remove all interfaces from VLAN 1. Interfaces need to
transparently transmit packets from specific VLANs, instead of all VLANs,
based on actual service requirements.
● The RADIUS authentication, accounting, and authorization keys configured on
the switches must be the same as those configured on the RADIUS server.
This example describes only the configurations on the switches. For details
about the configurations on the RADIUS server, see the specific server guide.
● By default, switches allow the packets sent to the RADIUS server to pass
through, removing the need to configure an authentication-free rule for these
packets.
● In the 802.1X authentication scenario, if there is a Layer 2 switch between the
802.1X-enabled switch and users, Layer 2 transparent transmission must be
enabled for 802.1X authentication packets on the Layer 2 switch; otherwise,
users cannot be successfully authenticated.
Configuration Roadmap
Procedure
Step 1 Configure interfaces and VLANs on switches.
1. Configure interfaces and a VLAN on CORE.
<HUAWEI> system-view
[HUAWEI] sysname CORE
[CORE] vlan batch 70
[CORE] interface eth-trunk 20
[CORE-Eth-Trunk20] description connect to AGG
[CORE-Eth-Trunk20] mode lacp
[CORE-Eth-Trunk20] port link-type trunk
[CORE-Eth-Trunk20] port trunk allow-pass vlan 70
Step 2 Configure VLANIF interfaces on switches and assign IP addresses to the VLANIF
interfaces.
1. Configure a VLANIF interface on CORE and assign an IP address to the
VLANIF interface.
# Create Layer 3 interface VLANIF 70 for connecting to AGG.
[CORE] interface vlanif 70
[CORE-Vlanif70] ip address 172.16.70.1 255.255.255.0
[CORE-Vlanif70] quit
Step 3 Configure the DHCP relay function on AGG so that AGG functions as a DHCP relay
agent to forward DHCP packets between DHCP clients and the DHCP server.
# Enable the DHCP relay function and configure the DHCP server IP address on
VLANIF 50 and VLANIF 60 of AGG.
[AGG] dhcp enable
[AGG] interface vlanif 50
[AGG-Vlanif50] dhcp select relay
[AGG-Vlanif50] dhcp relay server-ip 172.16.10.4
[AGG-Vlanif50] quit
[AGG] interface vlanif 60
[AGG-Vlanif60] dhcp select relay
[AGG-Vlanif60] dhcp relay server-ip 172.16.10.4
[AGG-Vlanif60] quit
Step 6 Configure AAA parameters on ACC1. The configuration of ACC2 is similar to that
of ACC1.
# Configure the RADIUS server template tem_rad, and configure the parameters
for interconnection between ACC1 and the RADIUS server, including the IP
addresses, port numbers, authentication key, and accounting key of the RADIUS
authentication and accounting servers.
[ACC1] radius-server template tem_rad
[ACC1-radius-tem_rad] radius-server authentication 172.16.10.2 1812
[ACC1-radius-tem_rad] radius-server accounting 172.16.10.2 1813
[ACC1-radius-tem_rad] radius-server shared-key cipher YsHsjx_202206
[ACC1-radius-tem_rad] quit
# Configure the authentication domain huawei.com and bind AAA schemes and
the RADIUS server template to this domain.
[ACC1-aaa] domain huawei.com
[ACC1-aaa-domain-huawei.com] authentication-scheme auth
[ACC1-aaa-domain-huawei.com] accounting-scheme acco
[ACC1-aaa-domain-huawei.com] radius-server tem_rad
[ACC1-aaa-domain-huawei.com] quit
[ACC1-aaa] quit
----End
# Run the display ip pool interface vlanif60 used command on AGG. The
command output shows that users have obtained IP addresses.
[AGG] display ip pool interface vlanif60 used
Pool-name : Vlanif60
Pool-No :1
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 : 172.16.10.1
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 :-
Network : 172.16.60.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :254 Used :2
Idle :252 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------
172.16.60.1 172.16.60.254 254 2 252(0) 0 0
-------------------------------------------------------------------------------
Client-ID format as follows:
DHCP : mac-address PPPoE : mac-address
IPSec : user-id/portnumber/vrf PPP : interface index
L2TP : cpu-slot/session-id SSL-VPN : user-id/session-id
-------------------------------------------------------------------------------
Index IP Client-ID Type Left Status
-------------------------------------------------------------------------------
42 172.16.60.43 00e0-fc12-3344 DHCP 86380 Used
173 172.16.60.174 00e0-fc12-4400 DHCP 85890 Used
-------------------------------------------------------------------------------
# Run the ping 172.16.60.174 command on PC1 to check whether PC1 is
connected to PC3.
C:\Users>ping 172.16.60.174
Configuration Scripts
CORE
#
sysname CORE
#
vlan batch 70
#
interface eth-trunk 20
description connect to AGG
mode lacp
port link-type trunk
port trunk allow-pass vlan 70
undo port trunk allow-pass vlan 1
#
interface xgigabitethernet 0/0/1
eth-trunk 20
#
interface xgigabitethernet 0/0/2
eth-trunk 20
#
interface eth-trunk 10
undo portswitch
description connect to Internet
trunkport xgigabitethernet 0/0/3
trunkport xgigabitethernet 0/0/4
mode lacp
ip address 172.16.10.3 24
#
interface vlanif 70
ip address 172.16.70.1 255.255.255.0
#
ospf 1 router-id 1.1.1.1
area 0
network 172.16.70.0 0.0.0.255
network 172.16.10.0 0.0.0.255
#
return
AGG
#
sysname AGG
#
vlan batch 50 60 70
#
interface eth-trunk 20
description connect to CORE
mode lacp-static
port link-type trunk
port trunk allow-pass vlan 70
undo port trunk allow-pass vlan 1
#
interface 10GE 1/0/5
eth-trunk 20
#
interface 10GE 1/0/6
eth-trunk 20
#
interface eth-trunk 30
description connect to ACC1
mode lacp-static
port link-type trunk
port trunk allow-pass vlan 60
undo port trunk allow-pass vlan 1
#
interface 10GE 1/0/1
eth-trunk 30
#
interface 10GE 1/0/2
eth-trunk 30
#
interface eth-trunk 40
ACC1
#
sysname ACC1
#
vlan batch 60
#
interface eth-Trunk 30
description connect to AGG
mode lacp
port link-type trunk
port trunk allow-pass vlan 60
undo port trunk allow-pass vlan 1
#
interface gigabitethernet 0/0/1
eth-trunk 30
#
interface gigabitethernet 0/0/2
eth-trunk 30
#
interface gigabitethernet 0/0/3
port link-type access
port default vlan 60
stp edged-port enable
#
interface gigabitethernet 0/0/4
port link-type access
port default vlan 60
stp edged-port enable
#
dhcp enable
#
dhcp snooping enable
#
vlan 60
dhcp snooping enable
dhcp snooping trusted interface Eth-Trunk 30
#
radius-server template tem_rad
radius-server authentication 172.16.10.2 1812
radius-server accounting 172.16.10.2 1813
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!$!!!!*!!!!ZonC2XJ]_A]N&P!y16vPj_Uy9)u)C(uV/Z*!!!!!2jp5!!!!!!
>!!!!`)6iHP{C#&HAcVY08({:4]*A%,$y+NJ>E9=@UDl<%+%#
#
radius-server authorization 172.16.10.2 shared-key cipher %+%##!!!!!!!!!"!!!!$!!!!*!!!!ZonC2XJ]_A!^$C:
%n#~KaX8E66].pBb\^nM!!!!!2jp5!!!!!!>!!!!GI3OQ[gk[I#n({0dZ"V(Cvgj)QG[+'oB,D"YP`'A%+%#
#
aaa
authentication-scheme auth
authentication-mode radius
accounting-scheme acco
accounting-mode radius
accounting realtime 15
domain huawei.com
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
free-rule-template name default_free_rule
free-rule 1 destination ip 172.16.10.1 mask 32
#
acl 3001
rule 1 permit ip destination 172.16.10.0 0.0.0.255
rule 2 permit ip destination 172.16.50.0 0.0.0.255
rule 3 permit ip destination 172.16.60.0 0.0.0.255
rule 4 deny ip destination any
#
dot1x-access-profile name d1
#
authentication-profile name p1
dot1x-access-profile d1
access-domain huawei.com force
authentication event authen-server-up action re-authen
#
interface gigabitethernet 0/0/3
authentication-profile p1
#
interface gigabitethernet 0/0/4
authentication-profile p1
#
return
ACC2
#
sysname ACC1
#
vlan batch 50
#
interface eth-Trunk 40
description connect to AGG
mode lacp-static
port link-type trunk
port trunk allow-pass vlan 50
undo port trunk allow-pass vlan 1
#
interface 10GE 1/0/1
eth-trunk 40
#
interface 10GE 1/0/2
eth-trunk 40
#
interface 10GE 1/0/3
port link-type access
port default vlan 50
stp edged-port enable
#
interface 10GE 1/0/4
port link-type access
port default vlan 50
stp edged-port enable
#
dhcp enable
#
dhcp snooping enable
#
vlan 50
dhcp snooping enable
dhcp snooping trusted interface Eth-Trunk 40
#
radius-server template tem_rad
radius-server authentication 172.16.10.2 1812
radius-server accounting 172.16.10.2 1813
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!$!!!!*!!!!ZonC2XJ]_A]N&P!y16vPj_Uy9)u)C(uV/Z*!!!!!2jp5!!!!!!
>!!!!`)6iHP{C#&HAcVY08({:4]*A%,$y+NJ>E9=@UDl<%+%#
#
radius-server authorization 172.16.10.2 shared-key cipher %+%##!!!!!!!!!"!!!!$!!!!*!!!!ZonC2XJ]_A!^$C:
%n#~KaX8E66].pBb\^nM!!!!!2jp5!!!!!!>!!!!GI3OQ[gk[I#n({0dZ"V(Cvgj)QG[+'oB,D"YP`'A%+%#
#
aaa
authentication-scheme auth
authentication-mode radius
accounting-scheme acco
accounting-mode radius
accounting realtime 15
domain huawei.com
authentication-scheme auth
accounting-scheme acco
radius-server tem_rad
#
free-rule-template name default_free_rule
free-rule 1 destination ip 172.16.10.1 mask 32
#
acl 3001
rule 1 permit ip destination 172.16.10.0 0.0.0.255
rule 2 permit ip destination 172.16.50.0 0.0.0.255
rule 3 permit ip destination 172.16.60.0 0.0.0.255
rule 4 deny ip destination any
#
dot1x-access-profile name d1
#
authentication-profile name p1
dot1x-access-profile d1
access-domain huawei.com force
authentication event authen-server-up action re-authen
#
interface gigabitethernet 0/0/3
authentication-profile p1
#
interface gigabitethernet 0/0/4
authentication-profile p1
#
return
RUs are plug-and-play, facilitating networking. To connect the central switch and
RUs, you can select the cable type that best suits your needs, choosing from
Ethernet cables, optical fibers, and optical-electrical hybrid cables. Optical-
electrical hybrid cables will enable the central switch to remotely supply power to
RUs, ensuring network continuity in case of power failures.
The uplink interfaces of RUs can be connected to the central switch through a
single link or dual links. If there is only one link, the network is successfully
deployed after the central switch and RUs are powered on. In the case of dual
links, as shown in Figure 2-26, the two links are connected to the same central
switch and RU. Two uplink interfaces on the RU automatically form a link
aggregation group, whereas the two interfaces on the central switch need to be
manually configured to form a link aggregation group.
As shown in Figure 2-27, in dual-link scenarios, the central switch may not set up
a link aggregation group or the two links may connect to different central
switches. In these cases, the central switch will automatically detect the fault,
triggering an alarm and Error-Down event.
Networking Requirements
An enterprise builds an office building with several offices. Several cameras,
laptops, PCs, and printers are deployed in each office. A laptop may move
between several offices. Laptops from a department can only access their
department's server, regardless of their locations. For example, laptop 1 can only
access server 1 and laptop 2 can only access server 2. The networking is shown in
Figure 2-28.
Switch deployment solution: Deploy a central switch (DeviceA in the figure) in the
ELV room of the office building. Deploy an RU (RUn in the figure, where n
indicates the room number) in the ELV box of each office. The central switch
connects to RUs through hybrid cables and supplies power to RUs through PoE.
The RU in each office is connected to cameras, laptops, PCs, and printers through
Ethernet cables. The 8-port RU in this example uses four downlink ports, and
other downlink ports are reserved.
Data Plan
Configuration Roadmap
Table 2-44 Configuration roadmap for the intelligent simplified campus network
solution
Step Configuration Roadmap
Procedure
Step 1 Connect the uplink interface of each RU to the central switch and check whether
the RUs go online successfully.
# Check the RU status. Normal indicates that the RU is running properly.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] display remote-unit
------------------------------------------------------------------------------------------------------------------------
ESN ID Type ConnectInterface Status VersionMatch Name
------------------------------------------------------------------------------------------------------------------------
219801176801XXXXXXXX - S5731-L8P2HT-RUA 10GE10/0/1 Normal NO -
219801176802XXXXXXXX - S5731-L8P2HT-RUA 10GE10/0/2 Normal NO -
------------------------------------------------------------------------------------------------------------------------
Total: 2, printed: 2
Step 2 Configure the interconnection interfaces and interface isolation for the RUs.
# Bind the interconnection interface.
[DeviceA] remote-unit 0
[DeviceA-remote-unit-0] name RU101
[DeviceA-remote-unit-0] description RU101_10GE10/0/1
[DeviceA-remote-unit-0] bind interface 10GE 10/0/1
[DeviceA-remote-unit-0] quit
[DeviceA] remote-unit 1
[DeviceA-remote-unit-1] name RU201
[DeviceA-remote-unit-1] description RU201_10GE10/0/2
[DeviceA-remote-unit-1] bind interface 10GE 10/0/2
[DeviceA-remote-unit-1] quit
# Configure interface isolation in the global RU view and deliver the configuration
to the RUs.
[DeviceA] remote-unit
[DeviceA-remote-unit] isolate enable
[DeviceA-remote-unit] commit all
[DeviceA-remote-unit] quit
Step 3 Create VLANs and configure the allowed VLAN for the interfaces. Add the
interconnection interfaces 10GE10/0/1 and 10GE10/0/2 to VLAN 1100, VLAN 1200,
VLAN 1300, VLAN 1400, and VLAN 1500.
[DeviceA] vlan batch 1100 1200 1300 1400 1500
[DeviceA] interface 10GE 10/0/1
[DeviceA-10GE10/0/1] description to_RU101
[DeviceA-10GE10/0/1] port link-type hybrid
[DeviceA-10GE10/0/1] port hybrid pvid vlan 1300
[DeviceA-10GE10/0/1] port hybrid untagged vlan 1100 1200 1300 1400 1500
[DeviceA-10GE10/0/1] quit
[DeviceA] interface 10GE 10/0/2
[DeviceA-10GE10/0/2] description to_RU201
[DeviceA-10GE10/0/2] port link-type hybrid
[DeviceA-10GE10/0/2] port hybrid pvid vlan 1300
[DeviceA-10GE10/0/2] port hybrid untagged vlan 1100 1200 1300 1400 1500
[DeviceA-10GE10/0/2] quit
Step 4 Configure allowed VLANs for the uplink interface of the central switch.
[DeviceA] interface 10GE 0/0/1
[DeviceA-10GE0/0/1] port link-type trunk
[DeviceA-10GE0/0/1] port trunk allow-pass vlan 1100 1200 1300 1400 1500
[DeviceA-10GE0/0/1] quit
----End
# Run the display mac-vlan mac-address all command in any view to check the
configuration of MAC address-based VLAN assignment.
[DeviceA] display mac-vlan mac-address all
---------------------------------------------------
MAC Address MASK VLAN Priority
---------------------------------------------------
00e0-fc76-1230 ffff-ffff-ffff 1100 0
00e0-fc76-2230 ffff-ffff-ffff 1100 0
00e0-fc76-1240 ffff-ffff-ffff 1200 0
00e0-fc76-1260 ffff-ffff-ffff 1400 0
00e0-fc76-2260 ffff-ffff-ffff 1400 0
00e0-fc76-2240 ffff-ffff-ffff 1500 0
# After the terminals access the network, check the MAC address table.
[DeviceA] display mac-address
-------------------------------------------------------------------------------
MAC Address VLAN/VSI/BD Learned-From Type
-------------------------------------------------------------------------------
00e0-fc76-1230 1100/-/- 10GE10/0/1 dynamic
00e0-fc76-1240 1200/-/- 10GE10/0/1 dynamic
00e0-fc76-1250 1300/-/- 10GE10/0/1 dynamic
00e0-fc76-1260 1400/-/- 10GE10/0/1 dynamic
00e0-fc76-2230 1100/-/- 10GE10/0/2 dynamic
00e0-fc76-2240 1500/-/- 10GE10/0/2 dynamic
00e0-fc76-2250 1300/-/- 10GE10/0/2 dynamic
00e0-fc76-2260 1400/-/- 10GE10/0/2 dynamic
-------------------------------------------------------------------------------
Total items displayed = 8
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 1100 1200 1300 1400 1500
#
vlan 1100
mac-vlan mac-address 00e0-fc76-1230
mac-vlan mac-address 00e0-fc76-2230
vlan 1200
mac-vlan mac-address 00e0-fc76-1240
vlan 1400
mac-vlan mac-address 00e0-fc76-1260
mac-vlan mac-address 00e0-fc76-2260
vlan 1500
mac-vlan mac-address 00e0-fc76-2240
#
interface 10GE 10/0/1
description to_RU101
port link-type hybrid
port hybrid pvid vlan 1300
port hybrid untagged vlan 1100 1200 1300 1400 1500
mac-vlan enable
#
interface 10GE 10/0/2
description to_RU201
port link-type hybrid
port hybrid pvid vlan 1300
port hybrid untagged vlan 1100 1200 1300 1400 1500
mac-vlan enable
#
interface 10GE 0/0/1
port link-type trunk
port trunk allow-pass vlan 1100 1200 1300 1400 1500
#
remote-unit
isolate enable
commit all
#
remote-unit 0
description RU101_10GE10/0/1
name RU101
bind interface 10GE10/0/1
remote-unit 1
description RU201_10GE10/0/2
name RU201
bind interface 10GE10/0/2
#
Figure 2-29 Video traffic forwarding paths in a scenario where a VRRP gateway is
configured on a ring network
Networking Requirements
Figure 2-30 shows the IPTV networking in a region. Users can watch live TV
programs and catch-up TV programs. The requirements are as follows:
● Multicast live streams sent by the multicast source server are first forwarded
to the CDN server for transcoding and recording and then forwarded to users.
● Users can also watch catch-up TV programs in unicast mode.
● Layer 2 and Layer 3 multicast and IGMP snooping are configured to
implement multicast traffic forwarding.
● OSPF is used to implement Layer 3 traffic forwarding. Device1 and Device2
establish neighbor relationships with PE1 and PE2 respectively in area 1 of
OSPF process 1. Core establishes neighbor relationships with PE1 and PE2 in
area 0 of OSPF process 1.
● MSTP is deployed on CDN, Device1, and Device2, and a VRRP group is
configured on Device1 and Device2. Device1 is configured with a higher
priority and a preemption delay of 20s so that it functions as the master
device to forward traffic, and Device2 is configured with a lower priority so
that it functions as the backup device, implementing gateway redundancy and
improving network reliability.
● To ensure access security, traffic policies are configured on Device1 and
Device2 to restrict the access of the multicast source server.
In this example, an S12700 switch functions as Core, S8700-6 switches function as
PE1, PE2, AGG, CDN, Device1, and Device2, and S5735-L switches function as
ACC1 and ACC2.
Data Plan
LoopB 10.0.0.3/24 -
ack0
LoopB 10.0.0.1/24 -
ack0
LoopB 10.0.0.2/24 -
ack0
LoopB 10.0.0.4/24 -
ack0
Configuration Roadmap
Procedure
Step 1 Create VLANs and add interfaces to the VLANs.
# Create a VLAN on ACC1 and add interfaces to the VLAN.
<HUAWEI> system-view
[HUAWEI] sysname ACC1
[ACC1] vlan batch 33
[ACC1] interface GE 1/0/1
[ACC1-GE1/0/1] description ACC1***to***AGG
[ACC1-GE1/0/1] port link-type trunk
[ACC1-GE1/0/1] port trunk allow-pass vlan 33
[ACC1-GE1/0/1] quit
[ACC1] interface GE 1/0/2
[ACC1-GE1/0/2] port link-type access
[ACC1-GE1/0/2] port default vlan 33
[ACC1-GE1/0/2] quit
[ACC1] interface GE 1/0/3
[ACC1-GE1/0/3] port link-type access
[ACC1-GE1/0/3] port default vlan 33
[ACC1-GE1/0/3] quit
Step 2 Configure STP. Device1, Device2, and CDN form a Layer 2 loop. MSTP is used to
break the loop.
# Configure an MSTP region and enable STP on Device1.
[Device1] stp region-configuration
[Device1-mst-region] region-name IPTV
[Device1-mst-region] instance 1 vlan 530
[Device1-mst-region] instance 2 vlan 88 301 400
[Device1-mst-region] quit
[Device1] stp instance 1 root primary
[Device1] stp instance 2 root secondary
[Device1] stp enable //By default, STP is enabled globally and on interfaces of the device. You only need to
disable STP on the interface that does not need to participate in STP calculation.
[Device1] interface 10GE 1/0/1
[Device1-10GE1/0/1] stp disable
[Device1-10GE1/0/1] quit
# Configure OSPF on PE1. Ensure that there are reachable routes between PE1
and AGG through the Internet.
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] area 1
[PE1-ospf-1-area-0.0.0.1] nssa
[PE1-ospf-1-area-0.0.0.1] quit
[PE1-ospf-1] quit
[PE1] interface vlanif10
[PE1-Vlanif10] ospf enable 1 area 0.0.0.1
[PE1-Vlanif10] quit
[PE1] interface 10GE 1/0/2
[PE1-10GE1/0/2] ospf enable 1 area 0.0.0.0
[PE1-10GE1/0/2] quit
[PE1] interface 10GE 1/0/3
[PE1-10GE1/0/3] ospf enable 1 area 0.0.0.0
[PE1-10GE1/0/3] quit
[PE1] interface LoopBack0
[PE1-LoopBack0] ospf enable 1 area 0.0.0.0
[PE1-LoopBack0] quit
# Configure OSPF on PE2. Ensure that there are reachable routes between PE2
and AGG through the Internet.
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] area 1
[PE2-ospf-1-area-0.0.0.1] nssa
[PE2-ospf-1-area-0.0.0.1] quit
[PE2-ospf-1] quit
[PE2] interface vlanif10
[PE2-Vlanif10] ospf enable 1 area 0.0.0.1
[PE2-Vlanif10] quit
[PE2] interface 10GE 1/0/2
[PE2-10GE1/0/2] ospf enable 1 area 0.0.0.0
[PE2-10GE1/0/2] quit
[PE2] interface 10GE 1/0/3
[PE2-10GE1/0/3] ospf enable 1 area 0.0.0.0
[PE2-10GE1/0/3] quit
[PE2] interface LoopBack0
[PE2-LoopBack0] ospf enable 1 area 0.0.0.0
[PE2-LoopBack0] quit
[Device1-Vlanif400] pim hello-option dr-priority 100 //Adjust the priority to ensure that multicast traffic
is preferentially forwarded by Device1.
[Device1-Vlanif400] pim sm
[Device1-Vlanif400] igmp enable
[Device1-Vlanif400] quit
[Device1] interface vlanif530
[Device1-Vlanif530] pim sm
[Device1-Vlanif530] pim hello-option dr-priority 100
[Device1-Vlanif530] igmp enable //Enable IGMP on the interface because it is connected to the decoding
server.
[Device1-Vlanif530] quit
Step 8 Configure traffic policies to restrict the access of the multicast source.
# Configure traffic policies on Device1.
----End
3. Run the display pim routing-table command to verify that Device1 and PE1
can generate multicast routing entries after the multicast source sends
multicast packets and the decoding server sends Join messages.
[Device1] display pim routing-table
VPN-Instance: public net
Total 1 (*, G) entry; 0 (S, G) entry
(*, 225.0.0.1)
RP: 10.0.0.1
Protocol: pim-sm, Flag: WC
UpTime: 00:06:50
Upstream interface: Vlanif10
Upstream neighbor: 10.1.1.1
RPF prime neighbor: 10.1.1.1
Downstream interface(s)
information:
Total number of downstreams: 1
1: Vlanif530
Protocol: igmp, UpTime: 00:01:42, Expires: -
[PE1] display pim routing-table
VPN-Instance: public net
Total 1 (*, G) entry; 0 (S, G) entry
(*, 225.0.0.1)
RP: 10.0.0.1 (local)
Protocol: pim-sm, Flag: WC
UpTime: 00:12:46
Upstream interface: Register
Upstream neighbor: NULL
RPF prime neighbor: NULL
Downstream interface(s)
information:
Total number of downstreams: 1
1: Vlanif10
Protocol: pim-sm, UpTime: 00:08:59, Expires:
00:02:31
Configuration Scripts
● Core
#
sysname Core
#
multicast routing-enable
#
interface XGE1/0/1
undo portswitch
description Core***to***Sever
ip address 10.6.1.3 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface XGE1/0/2
undo portswitch
description Core***to***PE2
ip address 10.7.1.3 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface XGE1/0/3
undo portswitch
description Core***to***PE1
ip address 10.8.1.2 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface LoopBack0
ip address 10.0.0.3 255.255.255.255
ospf enable 1 area 0.0.0.0
#
ospf 1
area 0.0.0.0
#
pim
static-rp 10.0.0.2
#
return
● PE1
#
sysname PE1
#
vlan batch 10 to 11
#
multicast routing-enable
#
interface Vlanif10
description to***Device1
ip address 10.1.1.1 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.1
#
interface Vlanif11
description to***Internet
ip address 10.11.1.1 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface 10GE1/0/1
description PE1***to***Device1
port link-type access
port default vlan 10
#
interface 10GE1/0/2
undo portswitch
description PE1***to***Core
ip address 10.12.1.1 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface 10GE1/0/3
undo portswitch
description PE1***to***PE2
ip address 10.60.1.1 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface 10GE1/0/4
description PE1***to***AGG
port link-type trunk
port trunk allow-pass vlan 11
#
interface LoopBack0
ip address 10.0.0.1 255.255.255.255
pim sm
ospf enable 1 area 0.0.0.0
#
pim
c-bsr LoopBack0
c-rp LoopBack0
static-rp 10.0.0.2
#
return
● PE2
#
sysname PE2
#
vlan batch 10 22
#
multicast routing-enable
#
interface Vlanif10
description to***Device2
ip address 10.1.2.1 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.1
#
interface Vlanif22
description to***Internet
ip address 10.22.1.2 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface 10GE1/0/1
description PE2***to***Device2
port link-type access
port default vlan 10
#
interface 10GE1/0/2
undo portswitch
description PE2***to***Core
ip address 10.20.1.2 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface 10GE1/0/3
undo portswitch
description PE2***to***PE1
ip address 10.60.1.2 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.0
#
interface 10GE1/0/4
description PE2***to***AGG
port link-type trunk
port trunk allow-pass vlan 22
#
interface LoopBack0
ip address 10.0.0.2 255.255.255.255
ospf enable 1 area 0.0.0.0
#
pim
static-rp 10.0.0.2
#
return
● Device1
#
sysname Device1
#
vlan batch 10 88 301 400 530
#
stp instance 1 root primary
stp instance 2 root secondary
#
multicast routing-enable
#
igmp-snooping enable
#
stp region-configuration
region-name IPTV
instance 1 vlan 530
instance 2 vlan 88 301 400
#
acl number 3000
description ***ACL FOR IPTV_Service_IN***
rule 1 permit ip source 10.66.1.1 0.0.0.255 destination 10.4.1.1 0.0.0.127
acl number 3998
description ***ACL FOR Multicast Remark***
rule 5 permit ip source 10.5.1.80 0.0.0.15
#
traffic classifier IPTV_Multicast_Remark operator or
if-match acl 3998
traffic classifier IPTV_Service_IN operator or
if-match acl 3000
#
traffic behavior IPTV_Multicast_Remark
permit
remark dscp af41
traffic behavior IPTV_Service_IN
permit
#
traffic policy IPTV_Multicast_Remark match-order config
classifier IPTV_Multicast_Remark behavior IPTV_Multicast_Remark
traffic policy IPTV_Service_IN match-order config
classifier IPTV_Service_IN behavior IPTV_Service_IN
#
vlan 10
description to***PE1
vlan 301
description to***Device2
igmp-snooping enable
vlan 400
description ***MRF IN***
multicast drop-unknown
igmp-snooping enable
vlan 530
description ***MRF OUT***
multicast drop-unknown
igmp-snooping enable
#
interface Vlanif10
description to***PE1
ip address 10.1.1.2 255.255.255.0
pim sm
ospf enable 1 area 0.0.0.1
#
interface Vlanif88
description to***HMS
ip address 10.88.1.7 255.255.255.0
vrrp vrid 2 virtual-ip 10.88.1.100
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 20
vrrp vrid 2 track interface 10GE1/0/1 reduced 100
#
interface Vlanif301
description Device1***to***Device2
ip address 10.31.1.1 255.255.255.0
pim sm
ospf network-type p2p
ospf timer hello 1
#
interface Vlanif400
description to***MRF IN
ip address 10.4.1.2 255.255.255.0
vrrp vrid 40 virtual-ip 10.4.1.10
pim sm
igmp enable
#
interface Eth-Trunk1
description Device2***to***Device1
port link-type trunk
port trunk allow-pass vlan 88 301 400 530
#
interface 10GE1/0/1
description Device2***to***PE2
port link-type access
port default vlan 10
stp disable
traffic-policy IPTV_Service_IN inbound
#
interface 10GE1/0/2
description Device2***to***CDN
port link-type trunk
port trunk allow-pass vlan 88 301 400 530
traffic-policy IPTV_Multicast_Remark inbound
#
interface 10GE1/0/3
eth-trunk 1
#
interface 10GE1/0/4
eth-trunk 1
#
ospf 1 router-id 192.168.1.2
default-route-advertise
silent-interface Vlanif88
silent-interface Vlanif530
silent-interface Vlanif400
area 0.0.0.1
network 10.5.1.0 0.0.0.255
network 10.1.1.0 0.0.0.255
network 10.31.1.0 0.0.0.255
network 10.88.1.0 0.0.0.255
nssa
#
pim
static-rp 10.0.0.1
#
return
● CDN
#
sysname CDN
#
vlan batch 88 301 400 530
#
stp region-configuration
region-name IPTV
instance 1 vlan 530
instance 2 vlan 88 301 400
#
interface 10GE1/0/1
description CDN***to***Device2
port link-type trunk
port trunk allow-pass vlan 88 301 400 530
#
interface 10GE1/0/2
description CDN***to***Device1
port link-type trunk
port trunk allow-pass vlan 88 301 400 530
#
interface 10GE1/0/3
description CDN***to***HMS-Server
port link-type access
port default vlan 88
stp disable
#
interface 10GE1/0/4
description CDN***to***MRF-IN
port link-type access
port default vlan 400
stp disable
#
interface 10GE1/0/5
description CDN***to***MRF-OUT
port link-type access
port default vlan 530
stp disable
#
return
● AGG
#
sysname AGG
#
vlan batch 11 22 33 to 34
#
multicast routing-enable
#
interface Vlanif13
description to***Internet
ip address 10.11.1.8 255.255.255.0
pim sm
#
interface Vlanif33
description to***ACC1
ip address 10.33.1.8 255.255.255.0
pim sm
igmp enable
#
interface Vlanif34
description to***ACC2
ip address 10.34.1.8 255.255.255.0
pim sm
igmp enable
#
interface 10GE1/0/1
description AGG***to***ACC1
port link-type trunk
port trunk allow-pass vlan 33
#
interface 10GE1/0/2
description AGG***to***ACC2
port link-type trunk
port trunk allow-pass vlan 34
#
interface 10GE1/0/4
description AGG***to***PE1
port link-type trunk
port trunk allow-pass vlan 11
#
interface 10GE1/0/5
description AGG***to***PE2
port link-type trunk
port trunk allow-pass vlan 22
#
return
● ACC1
#
sysname ACC1
#
vlan batch 33
#
igmp-snooping enable
#
vlan 33
multicast drop-unknown
igmp-snooping enable
#
interface GE1/0/1
description ACC1***to***AGG
port link-type trunk
port trunk allow-pass vlan 33
#
interface GE1/0/2
port link-type access
port default vlan 33
#
interface GE1/0/3
port link-type access
port default vlan 33
#
return
● ACC2
#
sysname ACC2
#
vlan batch 34
#
igmp-snooping enable
#
vlan 34
multicast drop-unknown
igmp-snooping enable
#
interface GE1/0/1
description ACC2***to***AGG
port link-type trunk
port trunk allow-pass vlan 34
#
interface GE1/0/2
port link-type access
port default vlan 34
#
interface GE1/0/3
port link-type access
port default vlan 34
#
return
Overview
VXLAN is an NVO3 network virtualization technology. It encapsulates a data
packet received from a source VM into a UDP packet, encapsulates the IP and
MAC addresses used on the physical network in the packet outer header, and then
sends the packet over an IP network. The VXLAN tunnel endpoint (VTEP) then
decapsulates the packet and sends it to the destination VM. VXLAN enables a
virtual network to provide access services for numerous tenants, and allows
tenants to plan their own virtual networks, not limited by the physical network IP
addresses or BDs. As a result, network management is greatly simplified.
Networking Requirements
An enterprise has built a mature campus network but does not have a dedicated
data center network. All the servers of the enterprise are scattered in different
departments. The enterprise wants to build a virtual network on the existing
campus network. The requirements are as follows:
● Servers scattered in different departments form a virtual network to
implement resource integration and flexible service deployment.
● A large number of VMs are deployed on each server, and servers running
different services need to communicate with each other at Layer 3.
● Servers can access the network only after passing MAC address
authentication.
On the network shown in Figure 2-31, an enterprise has VMs deployed in
different locations. Server1 belongs to VLAN 10, Server2 belongs to VLAN 20, and
Server3 belongs to VLAN 30. VXLAN tunnels need to be established to implement
Layer 3 communication between servers running different services.
Data Plan
Configuration Roadmap
Procedure
Step 1 Establish a CSS.
The following uses VTEP2 as an example to describe how to establish a CSS. The
process of establishing a CSS named VTEP1 is similar to that of establishing a CSS
named VTEP2.
Configure two S8700-6 switches to establish a CSS named VTEP2. Name the
two devices DeviceA and DeviceB, respectively. Connect DeviceA and DeviceB
using CSS cables, as shown in Figure 2-32.
# Set the CSS member ID of DeviceA to 1, CSS priority to 150, and CSS
domain ID to 10.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] css
[DeviceA-css] css member 1
[DeviceA-css] css priority 150
[DeviceA-css] css domain 10
[DeviceA-css] quit
# Set the CSS member ID of DeviceB to 2, CSS priority to 100, and CSS
domain ID to 10.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] css
[DeviceB-css] css member 2
[DeviceB-css] css priority 100
[DeviceB-css] css domain 10
[DeviceB-css] quit
3. Configure Stack-Ports.
# You are advised to manually back up the current configuration file before
configuring a Stack-Port.
# Before configuring a Stack-Port, run the shutdown command to disable the
member ports to be added to the Stack-Port to prevent them from entering
the error-down state due to CRC error packets. The configuration procedure is
not provided here.
# On DeviceA, create a Stack-Port and add member ports to it.
[DeviceA] interface stack-port 1
[DeviceA-Stack-Port1] port member-group interface 10ge 5/0/1 10ge 6/0/1
[DeviceA-Stack-Port1] quit
[DeviceA] quit
# Run the undo shutdown command to enable the member ports that have
been shut down. The configuration procedure is not provided here.
4. Save the configurations and enable the CSS function.
# Save the configuration of DeviceA and enable the CSS function. Enable the
CSS function on DeviceA that is planned as the master device first. This
ensures that DeviceA restarts first and becomes the master device as planned.
To make the following configurations easier to understand, change the name
of the master device DeviceA to VTEP2.
<DeviceA> save
Warning: The current configuration will be written to the device. Continue? [Y/N]: y
<DeviceA> system-view
[DeviceA] sysname VTEP2
[VTEP2] css
[VTEP2-css] css enable
Warning: Make sure that one or more dual-active detection methods are configured
once the conversion is complete and the device enters the CSS or stack mode.Swi
tches working in different forward modes cannot set up a CSS or stack.
Current configuration will be converted to the next startup saved-configuration
Step 3 Configure VLAN access on access switches ACC1 to ACC3, and configure VXLAN
service access points on aggregation switches VTEP2 and VTEP3.
# Configure ACC1.
<HUAWEI> system-view
[HUAWEI] sysname ACC1
[ACC1] vlan batch 10
# Configure ACC2.
<HUAWEI> system-view
[HUAWEI] sysname ACC2
[ACC2] vlan batch 20
[ACC2] interface eth-trunk 1
[ACC2-Eth-Trunk1] port link-type trunk
[ACC2-Eth-Trunk1] undo port trunk allow-pass vlan 1
[ACC2-Eth-Trunk1] port trunk allow-pass vlan 20
[ACC2-Eth-Trunk1] quit
[ACC2] interface xgigabitethernet 0/0/1
[ACC2-XGigabitEthernet0/0/1] eth-trunk 1
[ACC2-XGigabitEthernet0/0/1] quit
[ACC2] interface xgigabitethernet 0/0/2
[ACC2-XGigabitEthernet0/0/2] eth-trunk 1
[ACC2-XGigabitEthernet0/0/2] quit
[ACC2] interface gigabitethernet 0/0/1
[ACC2-GigabitEthernet0/0/1] port link-type access
[ACC2-GigabitEthernet0/0/1] port default vlan 20
[ACC2-GigabitEthernet0/0/1] quit
# Configure ACC3.
<HUAWEI> system-view
[HUAWEI] sysname ACC3
[ACC3] vlan batch 30
[ACC3] interface eth-trunk 1
[ACC3-Eth-Trunk1] port link-type trunk
[ACC3-Eth-Trunk1] undo port trunk allow-pass vlan 1
[ACC3-Eth-Trunk1] port trunk allow-pass vlan 30
[ACC3-Eth-Trunk1] quit
[ACC3] interface xgigabitethernet 0/0/1
[ACC3-XGigabitEthernet0/0/1] eth-trunk 1
[ACC3-XGigabitEthernet0/0/1] quit
[ACC3] interface xgigabitethernet 0/0/2
[ACC3-XGigabitEthernet0/0/2] eth-trunk 1
[ACC3-XGigabitEthernet0/0/2] quit
[ACC3] interface gigabitethernet 0/0/1
[ACC3-GigabitEthernet0/0/1] port link-type access
[ACC3-GigabitEthernet0/0/1] port default vlan 30
[ACC3-GigabitEthernet0/0/1] quit
# Configure VTEP2.
[VTEP2] interface eth-trunk 11
[VTEP2-Eth-Trunk11] port link-type trunk
[VTEP2-Eth-Trunk11] undo port trunk allow-pass vlan 1
[VTEP2-Eth-Trunk11] port trunk allow-pass vlan 10
[VTEP2-Eth-Trunk11] quit
[VTEP2] interface 10GE 2/4/0/40
[VTEP2-10GE2/4/0/40] eth-trunk 11
[VTEP2-10GE2/4/0/40] quit
[VTEP2] interface 10GE 2/4/0/44
[VTEP2-10GE2/4/0/44] eth-trunk 11
[VTEP2-10GE2/4/0/44] quit
[VTEP2] interface eth-trunk 12
[VTEP2-Eth-Trunk12] port link-type trunk
# Configure VTEP3.
[VTEP3] interface eth-trunk 11
[VTEP3-Eth-Trunk11] port link-type trunk
[VTEP3-Eth-Trunk11] undo port trunk allow-pass vlan 1
[VTEP3-Eth-Trunk11] port trunk allow-pass vlan 30
[VTEP3-Eth-Trunk11] quit
[VTEP3] interface xgigabitethernet 0/0/3
[VTEP3-XGigabitEthernet0/0/3] eth-trunk 11
[VTEP3-XGigabitEthernet0/0/3] quit
[VTEP3] interface xgigabitethernet 0/0/4
[VTEP3-XGigabitEthernet0/0/4] eth-trunk 11
[VTEP3-XGigabitEthernet0/0/4] quit
# Create the AAA authentication scheme abc and set the authentication mode to
RADIUS authentication.
[VTEP2] aaa
[VTEP2-aaa] authentication-scheme abc
[VTEP2-aaa-authen-abc] authentication-mode radius
[VTEP2-aaa-authen-abc] quit
# Check whether a user can pass RADIUS authentication. (The following assumes
that the test user test1 and password YsHsjx_202206 have been configured on
the RADIUS server.)
[VTEP2] test-aaa test1 YsHsjx_202206 radius-template rd1
Info: Account test succeeded.
# Configure the authentication profile p1, bind the MAC access profile m1 to the
authentication profile, specify the domain example.com as the forcible
authentication domain in the authentication profile, set the user access mode to
multi-authen, and set the maximum number of access users to 100.
[VTEP2] authentication-profile name p1
[VTEP2-authen-profile-p1] mac-access-profile m1
[VTEP2-authen-profile-p1] access-domain example.com
[VTEP2-authen-profile-p1] authentication mode multi-authen max-user 100
[VTEP2-authen-profile-p1] quit
# Configure VTEP1.
[VTEP1] bridge-domain 10
[VTEP1-bd10] vxlan vni 10
[VTEP1-bd10] l2 binding vlan 10
[VTEP1-bd10] quit
[VTEP1] bridge-domain 20
[VTEP1-bd20] vxlan vni 20
[VTEP1-bd20] l2 binding vlan 20
[VTEP1-bd20] quit
[VTEP1] bridge-domain 30
[VTEP1-bd30] vxlan vni 30
[VTEP1-bd30] l2 binding vlan 30
[VTEP1-bd30] quit
[VTEP1] interface nve 1
[VTEP1-Nve1] source 10.200.200.1
[VTEP1-Nve1] vni 10 head-end peer-list 10.200.200.10
[VTEP1-Nve1] vni 10 head-end peer-list 10.200.200.20
[VTEP1-Nve1] vni 20 head-end peer-list 10.200.200.10
[VTEP1-Nve1] vni 20 head-end peer-list 10.200.200.20
[VTEP1-Nve1] vni 30 head-end peer-list 10.200.200.10
[VTEP1-Nve1] vni 30 head-end peer-list 10.200.200.20
[VTEP1-Nve1] quit
# Configure VTEP2.
[VTEP2] bridge-domain 10
[VTEP2-bd10] vxlan vni 10
[VTEP2-bd10] l2 binding vlan 10
[VTEP2-bd10] quit
[VTEP2] bridge-domain 20
[VTEP2-bd20] vxlan vni 20
[VTEP2-bd20] l2 binding vlan 20
[VTEP2-bd20] quit
[VTEP2] bridge-domain 30
[VTEP2-bd30] vxlan vni 30
[VTEP2-bd30] l2 binding vlan 30
[VTEP2-bd30] quit
[VTEP2] interface nve 1
[VTEP2-Nve1] source 10.200.200.10
[VTEP2-Nve1] vni 10 head-end peer-list 10.200.200.1
[VTEP2-Nve1] vni 20 head-end peer-list 10.200.200.1
[VTEP2-Nve1] vni 30 head-end peer-list 10.200.200.1
[VTEP2-Nve1] quit
# Configure VTEP3.
[VTEP3] bridge-domain 10
[VTEP3-bd10] vxlan vni 10
[VTEP3-bd10] l2 binding vlan 10
[VTEP3-bd10] quit
[VTEP3] bridge-domain 20
[VTEP3-bd20] vxlan vni 20
[VTEP3-bd20] l2 binding vlan 20
[VTEP3-bd20] quit
[VTEP3] bridge-domain 30
[VTEP3-bd30] vxlan vni 30
[VTEP3-bd30] l2 binding vlan 30
[VTEP3-bd30] quit
[VTEP3] interface nve 1
[VTEP3-Nve1] source 10.200.200.20
[VTEP3-Nve1] vni 10 head-end peer-list 10.200.200.1
[VTEP3-Nve1] vni 20 head-end peer-list 10.200.200.1
[VTEP3-Nve1] vni 30 head-end peer-list 10.200.200.1
[VTEP3-Nve1] quit
----End
Configuration Scripts
VTEP1
#
sysname VTEP1
#
vlan batch 10 11 20 30 100 200
#
bridge-domain 10
l2 binding vlan 10
vxlan vni 10
#
bridge-domain 20
l2 binding vlan 20
vxlan vni 20
#
bridge-domain 30
l2 binding vlan 30
vxlan vni 30
#
interface Vbdif10
ip address 10.118.0.10 255.255.255.0
#
interface Vbdif20
ip address 10.128.0.10 255.255.255.0
#
interface Vbdif30
ip address 10.138.0.10 255.255.255.0
#
interface Vlanif11
ip address 10.11.1.2 255.255.255.0
#
interface Vlanif100
ip address 10.1.100.1 255.255.255.252
#
interface Vlanif200
ip address 10.1.200.1 255.255.255.252
#
interface Eth-Trunk11
description TO-leaf1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface Eth-Trunk12
description TO-leaf2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 200
#
interface 10GE1/3/0/0
eth-trunk 11
#
interface 10GE1/3/0/1
port default vlan 11
#
interface 10GE1/3/0/16
eth-trunk 11
#
interface 10GE2/3/0/2
eth-trunk 12
#
interface 10GE2/3/0/14
eth-trunk 12
#
interface LoopBack0
ip address 10.200.200.1 255.255.255.255
#
interface Nve1
source 10.200.200.1
vni 10 head-end peer-list 10.200.200.10
vni 10 head-end peer-list 10.200.200.20
vni 20 head-end peer-list 10.200.200.10
vni 20 head-end peer-list 10.200.200.20
vni 30 head-end peer-list 10.200.200.10
vni 30 head-end peer-list 10.200.200.20
#
ospf 1 router-id 10.200.200.1
area 0.0.0.0
network 10.1.100.0 0.0.0.3
network 10.1.200.0 0.0.0.3
VTEP2
#
sysname VTEP2
#
authentication-profile name p1
mac-access-profile m1
access-domain example.com
authentication mode multi-authen max-user 100
#
vlan batch 10 20 100
#
aaa
authentication-scheme abc
authentication-mode radius
domain example.com
authentication-scheme abc
radius-server rd1
#
bridge-domain 10
l2 binding vlan 10
vxlan vni 10
#
bridge-domain 20
l2 binding vlan 20
vxlan vni 20
#
bridge-domain 30
l2 binding vlan 30
vxlan vni 30
#
radius-server rd1
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.3t@/5k|BENhEu>W(3\~XG!!D;!!!!!2jp5!!!!!!
A!!!!3"pK8qv!}9M#(4$jGWvQF/R[CNe/+:W^jk8HUe&W%+%#
radius-server authentication 10.11.1.1 1812 weight 80
#
mac-access-profile name m1
#
interface Vlanif100
ip address 10.1.100.2 255.255.255.252
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface Eth-Trunk11
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10
authentication-profile p1
#
interface Eth-Trunk12
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
authentication-profile p1
#
interface 10GE1/2/0/2
eth-trunk 1
#
interface 10GE1/2/0/3
eth-trunk 1
#
interface 10GE2/4/0/40
eth-trunk 11
VTEP3
#
sysname VTEP3
#
authentication-profile name p1
mac-access-profile m1
access-domain example.com
authentication mode multi-authen max-user 100
#
vlan batch 30 200
#
aaa
authentication-scheme abc
authentication-mode radius
domain example.com
authentication-scheme abc
radius-server rd1
#
bridge-domain 10
l2 binding vlan 10
vxlan vni 10
#
bridge-domain 20
l2 binding vlan 20
vxlan vni 20
#
bridge-domain 30
l2 binding vlan 30
vxlan vni 30
#
radius-server rd1
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.3t@/5k|BENhEu>W(3\~XG!!D;!!!!!2jp5!!!!!!
A!!!!3"pK8qv!}9M#(4$jGWvQF/R[CNe/+:W^jk8HUe&W%+%#
radius-server authentication 10.11.1.1 1812 weight 80
#
mac-access-profile name m1
#
interface Vlanif200
ACC1
#
sysname ACC1
#
vlan batch 10
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface XGigabitEthernet0/0/1
eth-trunk 1
#
interface XGigabitEthernet0/0/2
eth-trunk 1
#
return
ACC2
#
sysname ACC2
#
vlan batch 20
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 20
#
interface XGigabitEthernet0/0/1
eth-trunk 1
#
interface XGigabitEthernet0/0/2
eth-trunk 1
#
return
ACC3
#
sysname ACC3
#
vlan batch 30
#
interface Eth-Trunk1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 30
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 30
#
interface XGigabitEthernet0/0/1
eth-trunk 1
#
interface XGigabitEthernet0/0/2
eth-trunk 1
#
return
Precautions
Switch configurations used in this example apply to S series switches running
V600.
Networking Requirements
In Figure 2-33, a company has multiple departments that belong to different
network segments, and each department needs to access the Internet. It is
required that users access the Internet through the Layer 2 switch and firewall and
that the firewall function as the gateway of users.
Figure 2-33 Configuring a Layer 2 switch to work with a firewall for Internet
access
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface-based VLAN assignment on the switch for Layer 2
forwarding.
2. Configure the firewall as the gateway of users to implement Layer 3
forwarding across network segments through sub-interfaces or VLANIF
interfaces.
3. Configure the firewall as the DHCP server to assign IP addresses to users.
4. Configure an interzone security policy for the firewall so that packets can be
forwarded among different zones.
5. Configure the port address translation (PAT) function on the firewall to
enable intranet users to access the Internet.
Procedure
Step 1 Configure the switch.
# Configure the interfaces connecting to user devices.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 2 3
[Switch] interface GE 1/0/2
[Switch-GE1/0/2] port default vlan 2
[Switch-GE1/0/2] quit
[Switch] interface GE 1/0/3
[Switch-GE1/0/3] port default vlan 3
[Switch-GE1/0/3] quit
----End
Configuration Scripts
● Switch
#
sysname Switch
#
vlan batch 2 to 3
#
interface GE 1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GE 1/0/2
port default vlan 2
#
interface GE 1/0/3
port default vlan 3
#
return
● USG (used when the firewall performs Layer 3 forwarding through sub-
interfaces)
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/1.1
vlan-type dot1q 2
ip address 192.168.1.1 255.255.255.0
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface GigabitEthernet0/0/1.2
vlan-type dot1q 3
ip address 192.168.2.1 255.255.255.0
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface GigabitEthernet0/0/2
ip address 203.0.113.2 255.255.255.0
#
firewall zone trust
set priority 85
add interface GigabitEthernet0/0/1
add interface GigabitEthernet0/0/1.1
add interface GigabitEthernet0/0/1.2
#
firewall zone untrust
set priority 5
add interface GigabitEthernet0/0/2
#
ip route-static 0.0.0.0 0.0.0.0 203.0.113.1
#
nat address-group addressgroup1 0 mode pat
route enable
section 0 203.0.113.2 203.0.113.2
#
security-policy
rule name policy1
source-zone trust
destination-zone untrust
source-address 192.168.0.0 mask 255.255.0.0
action permit
#
nat-policy
rule name policy_nat1
source-zone trust
destination-zone untrust
source-address 192.168.0.0 mask 255.255.0.0
action source-nat address-group addressgroup1
#
return
● USG (used when the firewall performs Layer 3 forwarding through VLANIF
interfaces)
#
vlan batch 2 to 3
#
interface Vlanif2
ip address 192.168.1.1 255.255.255.0
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface Vlanif3
ip address 192.168.2.1 255.255.255.0
Related Content
Videos
Connecting an S Series Switch Acting as a Layer 2 Switch to a Firewall
Precautions
Switch configurations used in this example apply to S series switches running
V600.
Networking Requirements
In Figure 2-34, a company has multiple departments that belong to different
network segments, and each department needs to access the Internet. It is
required that users access the Internet through the Layer 3 switch and firewall and
that the Layer 3 switch function as the gateway of users.
Figure 2-34 Configuring a Layer 3 switch to work with a firewall for Internet
access
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure the switch.
# Configure the interfaces connecting to users and corresponding VLANIF
interfaces.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 2 3
[Switch] interface GE 1/0/2
[Switch-GE1/0/2] port default vlan 2 //Add the interface to VLAN 2.
[Switch-GE1/0/2] quit
[Switch] interface GE 1/0/3
[Switch-GE1/0/3] port default vlan 3
[Switch-GE1/0/3] quit
[Switch] interface Vlanif 2
[Switch-Vlanif2] ip address 192.168.1.1 24
[Switch-Vlanif2] quit
[Switch] interface Vlanif 3
[Switch-Vlanif3] ip address 192.168.2.1 24
[Switch-Vlanif3] quit
After the configurations are complete, PC1 and PC2 can ping the external network
IP address 203.0.113.1/24 and access the Internet.
----End
Configuration Scripts
● Switch
#
sysname Switch
#
vlan batch 2 to 3 100
#
dhcp enable
#
interface Vlanif2
ip address 192.168.1.1 255.255.255.0
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface Vlanif3
ip address 192.168.2.1 255.255.255.0
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface Vlanif100
ip address 192.168.100.2 255.255.255.0
#
interface GE 1/0/1
port default vlan 100
#
interface GE 1/0/2
port default vlan 2
#
interface GE 1/0/3
port default vlan 3
#
ip route-static 0.0.0.0 0.0.0.0 192.168.100.1
#
return
● USG
#
interface GigabitEthernet0/0/1
ip address 192.168.100.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 203.0.113.2 255.255.255.0
#
firewall zone trust
set priority 85
add interface GigabitEthernet0/0/1
#
firewall zone untrust
set priority 5
add interface GigabitEthernet0/0/2
#
ip route-static 0.0.0.0 0.0.0.0 203.0.113.1
ip route-static 192.168.0.0 255.255.0.0 192.168.100.2
#
nat address-group addressgroup1 0
mode pat
route enable
section 0 203.0.113.2 203.0.113.2
#
security-policy
rule name policy1
source-zone trust
destination-zone untrust
source-address 192.168.0.0 mask 255.255.0.0
action permit
#
nat-policy
rule name policy_nat1
source-zone trust
destination-zone untrust
source-address 192.168.0.0 mask 255.255.0.0
action natsource-nat address-group addressgroup1
#
return
Precautions
Switch configurations used in this example apply to S series switches running
V600.
This example uses router configurations of AR651 V300R022C10. For other router
configurations, see the corresponding documentation.
Networking Requirements
In Figure 2-35, a company has multiple departments that belong to different
network segments, and each department needs to access the Internet. It is
required that users access the Internet through the Layer 2 switch and router and
that the router function as the gateway of users.
Figure 2-35 Configuring a Layer 2 switch to work with a router for Internet access
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure the switch.
# Configure the NAT function to enable intranet users to access the Internet.
[Router] acl number 2001
[Router-acl-basic-2001] rule 5 permit source 192.168.0.0 0.0.255.255 //NAT takes effect only for
source IP addresses on the network segment 192.168.0.0/16 and translates only source IP addresses of
outgoing packets on GE0/0/2.
[Router-acl-basic-2001] quit
[Router] interface GigabitEthernet 0/0/2
[Router-GigabitEthernet0/0/2] nat outbound 2001
[Router-GigabitEthernet0/0/2] quit
Configuration Scripts
● Switch
#
sysname Switch
#
vlan batch 2 to 3
#
interface GE 1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GE 1/0/2
port default vlan 2
#
interface GE 1/0/3
port default vlan 3
#
return
● Router (used when the router performs Layer 3 forwarding through sub-
interfaces)
#
sysname Router
#
vlan batch 2 to 3
#
dhcp enable
#
acl number 2001
rule 5 permit source 192.168.0.0 0.0.255.255
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/1.1
dot1q termination vid 2
ip address 192.168.1.1 255.255.255.0
arp broadcast enable
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface GigabitEthernet0/0/1.2
dot1q termination vid 3
ip address 192.168.2.1 255.255.255.0
arp broadcast enable
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface GigabitEthernet0/0/2
ip address 203.0.113.2 255.255.255.0
nat outbound 2001
#
ip route-static 0.0.0.0 0.0.0.0 203.0.113.1
#
return
● Router (used when the router performs Layer 3 forwarding through VLANIF
interfaces)
#
sysname Router
#
vlan batch 2 to 3
#
dhcp enable
#
acl number 2001
rule 5 permit source 192.168.0.0 0.0.255.255
#
interface Vlanif2
ip address 192.168.1.1 255.255.255.0
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface Vlanif3
Related Content
Videos
Connecting an S Series Switch Acting as a Layer 2 Switch to a Router
Precautions
● Switch configurations used in this example apply to S series switches running
V600.
● This example uses router configurations of AR651 V300R022C10. For other
router configurations, see the corresponding documentation.
Networking Requirements
In Figure 2-36, a company has multiple departments that belong to different
network segments, and each department needs to access the Internet. It is
required that users access the Internet through the Layer 3 switch and router and
that the Layer 3 switch function as the gateway of users.
Figure 2-36 Configuring a Layer 3 switch to work with a router for Internet access
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the switch as the gateway of users to allow users to communicate
across network segments through VLANIF interfaces.
2. Configure the switch as the DHCP server to assign IP addresses to users.
3. Configure the NAT function on the router to enable intranet users to access
the Internet.
Procedure
Step 1 Configure the switch.
# Configure the interfaces connecting to users and corresponding VLANIF
interfaces.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 2 3
[Switch] interface GE 1/0/2
[Switch-GE1/0/2] port default vlan 2 //Add the interface to VLAN 2.
[Switch-GE1/0/2] quit
[Switch] interface GE 1/0/3
[Switch-GE1/0/3] port default vlan 3
[Switch-GE1/0/3] quit
[Switch] interface Vlanif 2
[Switch-Vlanif2] ip address 192.168.1.1 24
[Switch-Vlanif2] quit
[Switch] interface Vlanif 3
# Configure the NAT function to enable intranet users to access the Internet.
[Router] acl number 2001
[Router-acl-basic-2001] rule 5 permit source 192.168.0.0 0.0.255.255 //NAT takes effect only for source
IP addresses on the network segment 192.168.0.0/16 and translates only source IP addresses of outgoing
packets on GE0/0/2.
[Router-acl-basic-2001] quit
[Router] interface GigabitEthernet 0/0/2
[Router-GigabitEthernet0/0/2] nat outbound 2001
[Router-GigabitEthernet0/0/2] quit
----End
Configuration Scripts
● Switch
#
sysname Switch
#
vlan batch 2 to 3 100
#
dhcp enable
#
interface Vlanif2
ip address 192.168.1.1 255.255.255.0
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface Vlanif3
ip address 192.168.2.1 255.255.255.0
dhcp select interface
dhcp server dns-list 114.114.114.114 223.5.5.5
#
interface Vlanif100
ip address 192.168.100.2 255.255.255.0
#
interface GE 1/0/1
port default vlan 100
#
interface GE 1/0/2
port default vlan 2
#
interface GE 1/0/3
port default vlan 3
#
ip route-static 0.0.0.0 0.0.0.0 192.168.100.1
#
return
● Router
#
sysname Router
#
acl number 2001
rule 5 permit source 192.168.0.0 0.0.255.255
#
interface GigabitEthernet0/0/1
ip address 192.168.100.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 203.0.113.2 255.255.255.0
nat outbound 2001
#
ip route-static 0.0.0.0 0.0.0.0 203.0.113.1
ip route-static 192.168.0.0 255.255.0.0 192.168.100.2
#
return
Networking Requirements
When a device is powered on for the first time, you can use the console port to
log in to the device to configure and manage the device. In Figure 3-1, the
console port of the device is connected to PC1.
Figure 3-1 Network diagram of configuring first login through the console port
Configuration Roadmap
1. Log in to the device through the console port.
2. Perform basic configurations on the device.
Procedure
Step 1 Connect the DB9 connector of the prepared console cable to the PC's serial port
(COM), and the RJ45 connector to the device's console port.
Step 2 Start a terminal emulation program on the PC. Create a connection and set the
port and communication parameters. (This section uses the third-party software
PuTTY as an example.)
1. Click Session to create a connection, as shown in Figure 3-2.
2. Click Serial, select the port to be connected, and set the communication
parameters, as shown in Figure 3-3.
a. Select the port based on actual situations. For example, on Windows, you
can open Device Manager to view port information and select the port
to be connected.
b. Set the communication parameters. Ensure that the communication
parameter settings in the terminal emulation software are consistent with
the default parameter settings (9600 bit/s transmission rate, 8 data bits,
1 stop bit, no parity check, and no flow control) of the device's console
port.
c. Click Open.
NOTE
A PC may have multiple ports that can be connected to the device. In this step, you
need to select the port to be connected to a console cable. In most cases, COM1 is
used.
If the device's console port communication parameters are modified, you need to
modify those on the PC accordingly and re-establish the connection.
Step 3 Press Enter until information similar to the following is displayed. Enter a
password and confirm the password as prompted. (The following information is
for reference only.)
User interface con0 is available
NOTE
● You must set a login password upon first login to the device through the console port.
By default, you can use the console port to perform administrator operations after
successfully logging in to the device.
● The password is a string of 8 to 16 case-sensitive characters. It must contain at least
two of the following character types: uppercase letters, lowercase letters, digits, and
special characters. Special characters do not include question marks (?) or spaces.
● The password entered in interactive mode will not be displayed on the terminal screen.
● For security purposes, change the password periodically.
----End
Networking Requirements
Users want to easily configure and manage the device shown in Figure 3-4. AAA
authentication needs to be configured for Telnet users on the server, and an ACL
policy needs to be configured to ensure that only the users matching the ACL can
log in to the device.
Configuration Roadmap
The configuration roadmap is as follows:
Configuration Precautions
In insecure network environments, you are advised to use a secure password
authentication mode, encryption authentication algorithm, and protocol. For
details about secure configuration examples, see 3.1.2.2.2 Example for
Configuring STelnet Login.
Procedure
Step 1 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm/protocol feature package (WEAKEA).
Step 2 # Set the IP address of the management interface for the Telnet server.
<HUAWEI> system-view
[HUAWEI] sysname Telnet Server
[Telnet Server] interface meth 0/0/0
[Telnet Server-MEth0/0/0] ip address 10.137.217.177 255.255.255.0
[Telnet Server-MEth0/0/0] quit
Step 3 Set the server port number and enable the server function.
----End
# Press Enter, and enter the user name and password configured for AAA
authentication in the login window. If the authentication is successful, the
command line prompt for the user view is displayed, indicating that you have
successfully logged in to the device.
Username:admin1234
Password:
Info: The max number of VTY users is 8, the number of current VTY users online is 1, and total number of
terminal users online is 1.
<Telnet Server>
Configuration Scripts
#
sysname Telnet Server
#
telnet server enable
telnet server-source all-interface
telnet server port 1025
#
acl number 2001
rule 5 permit source 10.137.217.10 0
rule 10 deny source 10.137.217.20 0
#
aaa
local-user admin1234 password irreversible-cipher $1d$g8wLJ`LjL!$CyE(V{3qg5DdU:PM[6=6O
$UF-.fQ,Q}>^)OBzgoU$
local-user admin1234 service-type telnet
local-user admin1234 privilege level 3
#
interface MEth0/0/0
ip address 10.137.217.177 255.255.255.0
#
user-interface maximum-vty 8
#
user-interface vty 0 7
acl 2001 inbound
authentication-mode aaa
history-command max-size 20
idle-timeout 20 0
screen-length 30
#
return
Networking Requirements
In Figure 3-5, after the STelnet server function is enabled on the device
functioning as the SSH server, the PC functioning as the SSH client can connect to
the SSH server in different authentication modes. This section uses the RSA
authentication mode as an example to describe how to log in to the SSH server
using STelnet.
To improve system security and prevent unauthorized users from logging in to the
SSH server, you can configure an ACL rule on the SSH server.
Configuration Roadmap
The configuration roadmap is as follows:
1. # Set the IP address of the management interface for the SSH server.
2. Configure the SSH server to generate a local key pair.
3. Configure a VTY user interface on the SSH server.
4. Create a local user and configure the service type for the user.
5. Create an SSH user and configure the authentication mode for the user.
6. On the SSH client, create a key pair based on the configured SSH user
authentication mode and copy the public key to the SSH server.
7. On the SSH server, edit the public key and assign it to the user.
8. Enable STelnet on the SSH server and set the service type of the SSH user to
STelnet.
9. On the SSH server, configure an ACL to allow access of the STelnet client.
10. Set parameters for STelnet login to the server.
Data Preparation
To complete the configuration, ensure that the following configurations have been
completed:
NOTE
To ensure high security, you are advised to use the RSA key pair whose length is 3072 bits
or longer.
● OpenSSH has been installed on the SSH client.
● The IP address of the management interface for the SSH server is
10.248.103.194/24.
● The local user's authentication mode is set to password authentication, and
the user name and password are admin123 and YsHsjx_202206, respectively.
● The SSH user's authentication mode is RSA.
● ACL 2000 is configured to allow the clients on the network segment
10.248.103.0/24 to access the SSH server.
Procedure
Step 1 # Set the IP address of the management interface for the SSH server.
<HUAWEI> system-view
[HUAWEI] sysname SSH Server
[SSH Server] interface meth 0/0/0
[SSH Server-MEth0/0/0] ip address 10.248.103.194 255.255.255.0
[SSH Server-MEth0/0/0] quit
NOTE
If SSH is configured as the login protocol, the device automatically disables the Telnet
function.
Step 4 On the server, create a local user and configure the service type for the user.
[SSH Server] aaa
[SSH Server-aaa] local-user admin123 password
Please configure the login password (8-128)
It is recommended that the password consist of at least 2 types of characters, including lowercase letters,
uppercase letters, numerals and special characters.
Please enter password:
Please confirm password:
Info: Add a new user.
[SSH Server-aaa] local-user admin123 service-type ssh
[SSH Server-aaa] local-user admin123 privilege level 3
[SSH Server-aaa] quit
Step 5 Create an SSH user on the server and configure the authentication mode for the
user.
[SSH Server] ssh user admin123
[SSH Server] ssh user admin123 authentication-type rsa
Step 6 Configure the public key algorithm, encryption algorithm, key exchange algorithm
list, HMAC authentication algorithm, and minimum key length on the SSH server.
[SSH Server] ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
[SSH Server] ssh server hmac sha2_256 sha2_512
[SSH Server] ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
[SSH Server] ssh server publickey rsa_sha2_256 rsa_sha2_512
[SSH Server] ssh server dh-exchange min-len 3072
Step 7 Use OpenSSH to create an RSA key pair on the SSH client and copy the public key
to the SSH server.
Access the Windows CLI, create an RSA key pair, and save it to the local
id_rsa.pub file. (The following information is for reference only.)
C:\Users\User1>ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\User1/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\User1/.ssh/id_rsa.
Step 8 On the SSH server, edit the public key generated using OpenSSH on the SSH client
and assign it to the user.
[SSH Server] rsa peer-public-key rsa01 encoding-type openssh
[SSH Server-rsa-public-key] public-key-code begin
[SSH Server-rsa-public-key-rsa-key-code] ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQCg5Ag490i6ilB7QuCVb35B8RJEh1DIYB88h2p1qjdh7qdMQv8rp
JaVAgQWxwzKZO0XdFuz4ReGQzTCSf7Det7Ajicddw3qi+6P8hRqZj6MPdLg/o3RN4aPCfr/
LFWCwqJ3gWGHlOC7qqjRk+6pySVoiWcSk5/elBkU7WVk/
cSWrt4qFXJV373OCesKcEVeDvAa1Tvx6L3LQroBqUO0EXzDgOthPCmOqiqvS5h3JipzqVsesdSKjeInooCQzS
Ov5eePpBcFcIvU6wFiLIZ5vnf6YtypgTVzHuje/sh4xM7Iuuon7AYXKHT8NpO9jd9zA/lKaRPXyDtei1O1Bt/
5lxnn
[SSH Server-rsa-public-key-rsa-key-code] public-key-code end
[SSH Server-key-code] peer-public-key end
[SSH Server] ssh user admin123 assign rsa-key rsa01
Step 9 Enable the STelnet function and set the user service type to STelnet.
[SSH Server] stelnet server enable
[SSH Server] ssh server-source all-interface
[SSH Server] ssh user admin123 service-type stelnet
----End
Configuration Scripts
#
sysname SSH Server
#
acl number 2000
rule 5 permit source 10.248.103.0 0.0.0.255
#
rsa peer-public-key rsa01 encoding-type openssh
public-key-code begin
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQCg5Ag490i6ilB7QuCVb35B8RJEh1DIYB88h2p1qjdh7qdMQv8rpJaVA
gQWxwzKZO0XdFuz4ReGQzTCSf7Det7Ajicddw3qi+6P8hRqZj6MPdLg/o3RN4aPCfr/
LFWCwqJ3gWGHlOC7qqjRk+6pySVoiWcSk5/elBkU7WVk/
cSWrt4qFXJV373OCesKcEVeDvAa1Tvx6L3LQroBqUO0EXzDgOthPCmOqiqvS5h3JipzqVsesdSKjeInooCQzSOv5e
ePpBcFcIvU6wFiLIZ5vnf6YtypgTVzHuje/sh4xM7Iuuon7AYXKHT8NpO9jd9zA/lKaRPXyDtei1O1Bt/5lxnn rsa-key
public-key-code end
peer-public-key end
#
aaa
local-user admin123 password irreversible-cipher $1d$+,JS+))\\2$KVNj(.
3`_5x0FCKGv}H&.kUTI`Ff&H*eBqO.ua>)$
local-user admin123 service-type terminal ssh
local-user admin123 privilege level 3
#
interface MEth0/0/0
ip address 10.248.103.194 255.255.255.0
#
stelnet server enable
ssh user admin123
ssh user admin123 authentication-type rsa
ssh user admin123 assign rsa-key rsa01
ssh user admin123 service-type stelnet
ssh server-source all-interface
ssh server acl 2000
#
ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
ssh server hmac sha2_256 sha2_512
ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
ssh server publickey rsa_sha2_256 rsa_sha2_512
ssh server dh-exchange min-len 3072
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
return
Networking Requirements
If users cannot remotely log in to a device, they can locally log in to the device
through the console port on the device. Password authentication is used for login
through the console port. To prevent unauthorized users from accessing a device,
you can change the authentication mode of the console user interface (used for
login through the console port) to AAA authentication.
Configuration Roadmap
The configuration roadmap is as follows:
1. Use the terminal emulation software to log in to the device through the
console port.
2. Configure the authentication mode for the console user interface.
NOTE
If the system does not provide terminal emulation software, obtain it from a third party. For
details about how to use the software, see the software user guide or online help.
Procedure
Step 1 Connect the DB9 connector of the prepared console cable to the PC's serial port
(COM), and the RJ45 connector to the device's console port. If there is no DB9
serial port on your terminal (PC), use a DB9-to-USB cable to connect the USB port
to the terminal.
2. Click Serial and set the port to be connected and the communication
parameters, as shown in Figure 3-8.
a. Select the port according to your requirements. For example, in a
Windows operating system, you can open Device Manager to view port
information and select the port to be connected.
b. Ensure that the communication parameters you set in the terminal
emulation software are consistent with the default parameter settings of
the device's console port.
c. Click Open.
NOTE
A PC may have multiple ports that can be connected to the device. In this step, the
port to be connected to a console cable must be selected. In most cases, COM1 is
used.
If the device's communication parameters are modified, those on the PC must be
modified accordingly and the connection must be re-established.
Step 3 Press Enter until the system prompts you to enter the password. (During AAA
authentication, the system asks you to enter the user name and password. The
following information is for reference only.)
Login authentication
Password:
You can run commands to configure the device. Enter a question mark (?) if you
need help.
Step 4 Configure the authentication mode for the console user interface.
<HUAWEI> system-view
[HUAWEI] user-interface console 0
[HUAWEI-ui-console0] authentication-mode aaa
[HUAWEI-ui-console0] user privilege level 3
[HUAWEI-ui-console0] quit
[HUAWEI] aaa
----End
Configuration Scripts
#
aaa
local-user admin1234 password irreversible-cipher $1d$g8wLJ`LjL!$CyE(V{3qg5DdU:PM[6=6O
$UF-.fQ,Q}>^)OBzgoU$
local-user admin1234 service-type terminal
local-user admin1234 privilege level 3
#
user-interface con 0
authentication-mode aaa
#
return
3.1.2.2.4 Example for Configuring Telnet Login Based on ACL Rules and RADIUS
Authentication
Networking Requirements
The network administrator requires remote management and maintenance on a
device and high network security for protecting the network against unauthorized
access. To meet the requirements, you can configure Telnet login based on ACL
rules and RADIUS authentication.
In Figure 3-9, DeviceA is the Telnet server, and there are reachable routes between
the network administrator's PC and DeviceA and between DeviceA and the
RADIUS server. The IP address and port number of the RADIUS server are
10.1.6.6/24 and 1812, respectively.
Figure 3-9 Network diagram for configuring Telnet login based on ACL rules and
RADIUS authentication
NOTE
In this example, interface1 and interface2 represent 10GE1/0/1 and 10GE1/0/2, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Set device interface parameters.
2. Configure Telnet to enable users to log in to the device through Telnet.
3. Configure an ACL rule to ensure that only users matching the ACL rule can
log in to the device.
4. Configure the RADIUS protocol to implement RADIUS authentication. After
the configuration is complete, users must use the user name and password
configured on the RADIUS server to log in to the device through Telnet,
ensuring login security.
5. Configure the RADIUS server.
Configuration Precautions
● In insecure network environments, you are advised to use a secure password
authentication mode, encryption authentication algorithm, and protocol. For
details about the configuration example of secure authentication, see
3.1.2.2.5 Example for Configuring STelnet Login Based on RADIUS
Authentication.
● Ensure that there are reachable routes between devices before the
configuration.
● Ensure that the IP address, port number, and shared key of the RADIUS server
are configured correctly on the device and are the same as those on the
RADIUS server.
● After a domain is configured as the global default administrative domain, the
AAA configuration in this domain is used, regardless of whether the user
name of the administrator contains the domain name.
● Ensure that a user has been configured on the RADIUS server. In this example,
the user [email protected] (user name@domain name) and password
YsHsjx_202206 have been configured on the RADIUS server.
● If the RADIUS server does not support the user names containing domain
names, run the undo radius-server user-name domain-included command
to configure the device not to encapsulate the domain name in the user name
when sending packets to the RADIUS server.
Procedure
Step 1 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm/protocol feature package (WEAKEA).
Step 2 Set interface parameters.
# Configure IP addresses for interfaces.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20
# Set the authentication mode and protocol for accessing VTY user interfaces 0 to
4 to AAA and Telnet, respectively.
[DeviceA] user-interface vty 0 4
[DeviceA-ui-vty0-4] authentication-mode aaa
[DeviceA-ui-vty0-4] protocol inbound telnet
[DeviceA-ui-vty0-4] user privilege level 3
[DeviceA-ui-vty0-4] quit
# Create a domain, and apply the AAA authentication scheme and RADIUS server
template to the domain.
[DeviceA-aaa] domain huawei.com
[DeviceA-aaa-domain-huawei.com] authentication-scheme auth1
[DeviceA-aaa-domain-huawei.com] radius-server 1
[DeviceA-aaa-domain-huawei.com] quit
[DeviceA-aaa] quit
----End
# In the login window, enter the user name admin123 and password
YsHsjx_202206 configured on the RADIUS server as prompted, and press Enter. If
the authentication succeeds, you can successfully log in to DeviceA through Telnet.
(The following information is for reference only.)
Username:admin123
Password:
Info: The max number of VTY users is 8, the number of current VTY users online is 1, and total number of
terminal users online is 1.
<>
Configuration Scripts
#
sysname DeviceA
#
acl number 2000
rule permit source 10.137.217.10 0
#
radius-server template 1
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.3t@/5k|BENhEu>W(3\~XG!!D;!!!!!2jp5!!!!!!
A!!!!3"pK8qv!}9M#(4$jGWvQF/R[CNe/+:W^jk8HUe&W%+%#
radius-server authentication 10.1.6.6 1812 weight 80
#
aaa
authentication-scheme auth1
authentication-mode radius
accounting-scheme acc1
accounting-mode radius
domain huawei.com
authentication-scheme auth1
accounting-scheme acc1
radius-server 1
#
domain huawei.com admin
#
vlan batch 10 20
#
interface Vlanif10
ip address 10.1.1.2 255.255.255.0
#
interface Vlanif20
ip address 10.1.6.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
Networking Requirements
The network administrator requires secure remote login to a device and high
network security for protecting the network against unauthorized access. To meet
the requirements, you can configure STelnet login based on RADIUS
authentication.
In Figure 3-10, DeviceA functions as an SSH server and there are reachable routes
between it and the RADIUS server. The IP address and port number of the RADIUS
server are 10.1.6.6/24 and 1812, respectively.
Figure 3-10 Network diagram for configuring STelnet login based on RADIUS
authentication
NOTE
In this example, interface1 and interface2 represent 10GE1/0/1 and 10GE1/0/2, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Set device interface parameters.
2. Configure the SSH server to generate a local key pair to implement secure
data exchange between the server and client.
3. Configure STelnet to enable users to log in to the device through STelnet.
4. Configure an ACL rule to ensure that only users matching the ACL rule can
log in to the device.
Configuration Precautions
● Ensure that the SSH server login software has been installed on the user
terminal before configuring STelnet login.
● Ensure that there are reachable routes between the user terminal and the
device and between the device and RADIUS server.
● After a domain is configured as the global default administrative domain, the
AAA configuration in this domain is used, regardless of whether the user
name of the administrator contains the domain name.
● Ensure that a user has been configured on the RADIUS server. In this example,
the user [email protected] (user name@domain name) and password
YsHsjx_202206 have been configured on the RADIUS server.
● If the RADIUS server does not support the user names containing domain
names, run the undo radius-server user-name domain-included command
to configure the device not to encapsulate the domain name in the user name
when sending packets to the RADIUS server.
Procedure
Step 1 Set interface parameters.
# Configure IP addresses for interfaces.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 10.1.1.2 255.255.255.0
[DeviceA-Vlanif10] quit
[DeviceA] interface vlanif 20
[DeviceA-Vlanif20] ip address 10.1.6.2 255.255.255.0
[DeviceA-Vlanif20] quit
# Create an SSH user on the server and set the authentication mode to password
authentication.
[DeviceA] ssh user admin123
[DeviceA] ssh user admin123 authentication-type password
NOTE
To configure password authentication for multiple SSH users, run the ssh authentication-
type default password command to specify password authentication as the default
authentication mode of SSH users. After this configuration is complete, you do not need to
repeatedly configure the authentication mode and service type for each SSH user,
simplifying configuration and improving efficiency.
NOTE
# Create a domain, and apply the AAA authentication scheme and RADIUS server
template to the domain.
[DeviceA-aaa] domain huawei.com
[DeviceA-aaa-domain-huawei.com] authentication-scheme auth1
[DeviceA-aaa-domain-huawei.com] radius-server 1
[DeviceA-aaa-domain-huawei.com] quit
[DeviceA-aaa] quit
----End
Warning: Negotiated key exchange algorithm and identity key for server authentication are not safe. It is
recommended that you disable the insecure algorithm or upgrade the client.
Configuration Scripts
#
sysname DeviceA
#
acl number 2000
rule 5 permit source 10.137.217.10 0
#
radius-server template 1
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.3t@/5k|BENhEu>W(3\~XG!!D;!!!!!2jp5!!!!!!
A!!!!3"pK8qv!}9M#(4$jGWvQF/R[CNe/+:W^jk8HUe&W%+%#
radius-server authentication 10.1.6.6 1812 weight 80
#
aaa
authentication-scheme auth1
authentication-mode radius
accounting-scheme acc1
accounting-mode radius
domain huawei.com
authentication-scheme auth1
accounting-scheme acc1
radius-server 1
#
domain huawei.com admin
#
vlan batch 10 20
#
interface Vlanif10
ip address 10.1.1.2 255.255.255.0
#
interface Vlanif20
ip address 10.1.6.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
stelnet server enable
ssh user admin123
ssh user admin123 authentication-type password
ssh user admin123 service-type stelnet
ssh server-source all-interface
ssh server acl 2000
#
user-interface vty 0 4
authentication-mode aaa
user privilege level 3
protocol inbound ssh
#
ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
ssh server hmac sha2_256 sha2_512
ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
ssh server publickey rsa_sha2_256 rsa_sha2_512
ssh server dh-exchange min-len 3072
#
return
3.1.2.3.1 Example for Configuring Web UI-based Login Through HTTPS (Default
Certificate)
Networking Requirements
In Figure 3-11, the local account admin123 is configured for DeviceA, which can
be used to log in to the web UI of DeviceA through HTTPS.
Figure 3-11 Network diagram for logging in to the web UI through HTTPS
(default certificate)
NOTE
Data Planning
Item Data
Password YsHsjx_202206
Configuration Roadmap
1. Configure all interfaces to be used to access the web UI.
2. Configure a login interface for the device.
3. Create a local user account for logging in to the web UI of the device.
4. Enable the web service function on the device.
5. Use the local user account to log in to the web UI of the device.
Procedure
Step 1 Configure all interfaces to be used to access the web UI.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] web-manager server-source all-interface
When this function is enabled, HTTPS is used even if you use HTTP to access
the web UI.
3. Enter the created web user account (user name: admin123; password:
YsHsjx_202206) and click Login.
----End
Configuration Scripts
#
sysname DeviceA
#
web-manager server-source all-interface
web-manager enable port 8443443
web-manager http forward enable
#
interface Vlanif10
ip address 10.3.0.1 255.255.255.0
#
aaa
local-user admin123 password irreversible-cipher $1d$OwseVRh@LH}ZeTBm$1nH4$ab>d(N{-%0!
ab48y=Ic*xEUR4pVhR2"9-~,$
local-user admin123 service-type http
local-user admin123 privilege level 3
#
return
Networking Requirements
A user logs in to a device using the console port, Telnet, or STelnet, and needs to
perform the following operations on the files on the device:
● View files and subdirectories in the current directory.
● Create a directory named test. Copy the vrpcfg.zip file to the directory test
and rename the file backup.zip.
● View files in the test directory.
Procedure
Step 1 View files and subdirectories in the current directory.
<HUAWEI> system-view
[HUAWEI] sysname Device
[Device] quit
<Device> dir
Directory of flash:/
Step 2 Create a directory named test. Copy the vrpcfg.zip file to the directory test and
rename the file backup.zip.
# Create the test directory.
<Device> mkdir test
Info: Create directory flash:/test/......Done.
# Copy the vrpcfg.zip file to the test directory and rename the file backup.zip.
<Device> copy vrpcfg.zip flash:/test/backup.zip
Info: Are you sure to copy flash:/vrpcfg.zip to flash:/test/backup.zip?[Y/N]:y
100% complete
Info: Copied file flash:/vrpcfg.zip to flash:/test/backup.zip...Done.
NOTE
If the destination file name is not specified, the source file name is used as the destination
file name by default. That is, the destination file has the same name as the source file.
----End
Configuration Scripts
#
sysname Device
#
return
Networking Requirements
In Figure 3-12, PC1 connects to the device at 10.136.23.5. The device needs to be
upgraded. To be specific, the device needs to function as the FTP server so that the
system software can be uploaded from PC1 to the device and the configuration
file of the device can be saved to PC1 for backup. In addition, an ACL policy needs
to be configured so that only PC1 can access the FTP server.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the FTP server function for the device and configure information
about an FTP user, including the source address, user name, password, user
privilege level, service type, and authorized directory.
2. Configure access permissions on the FTP server.
3. Save the current configuration file on the device.
4. Log in to the FTP server from PC1.
5. Upload the system software to the device and back up the configuration file
of the device to PC1.
Configuration Precautions
In insecure network environments, you are advised to use a secure password
authentication mode, encryption authentication algorithm, or protocol. For details
about secure configuration examples, see 3.1.2.4.3 Example for Configuring a
Device as an SFTP Server.
Procedure
Step 1 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm/protocol feature package (WEAKEA).
Step 2 Configure an IP address for the FTP server.
<HUAWEI> system-view
[HUAWEI] sysname FTP_Server
[FTP_Server] interface 10ge 1/0/1
[SSH Server-10GE1/0/1] undo portswitch
[FTP_Server-10GE1/0/1] ip address 10.136.23.5 255.255.255.0
[FTP_Server-10GE1/0/1] quit
Step 3 Configure the FTP server function for the device and configure information about
an FTP user.
[FTP_Server] ftp server enable
[FTP_Server] ftp server source all-interface
[FTP_Server] aaa
[FTP_Server-aaa] local-user admin1234 password
Please configure the login password (8-128)
It is recommended that the password consist of at least 2 types of characters, including lowercase letters,
uppercase letters, numerals and special characters.
Please enter password:
Step 6 Log in to the FTP server from PC1 using the user name admin1234 and password
YsHsjx_202206. Set the file transfer mode to binary.
Assume that PC1 runs the Windows operating system.
C:\Documents and Settings\Administrator> ftp 10.136.23.5
Connected to 10.136.23.5.
220 FTP service ready.
User (10.136.23.5:(none)): admin1234
331 Password required for admin1234.
Password:
230 User logged in.
ftp> binary
200 Type set to I.
ftp>
Step 7 Upload the system software to the device and back up the configuration file of
the device to PC1.
# Upload the system software to the device.
ftp> put devicesoft.cc
200 Port command okay.
150 Opening BINARY mode data connection for /devicesoft.cc
226 Transfer complete.
ftp: 107973953 bytes sent in 151.05Seconds 560.79Kbytes/sec.
NOTE
When uploading or downloading files, you need to specify the FTP working directory of the
client. For example, the default FTP working directory of the Windows operating system is
C:\Windows\System32. Save the system software to be uploaded to this directory in
advance, and the backup configuration file is also saved to this directory.
----End
<FTP_Server> dir
Directory of flash:/
# Access the FTP user's working directory on PC1 and check for the vrpcfg.zip file.
Configuration Scripts
#
sysname FTP_Server
#
ftp server enable
ftp serversource all-interface
ftp server acl 2001
#
acl number 2001
rule 5 permit source 10.136.23.10 0
rule 10 deny source 10.136.23.20 0
#
aaa
local-user admin1234 password irreversible-cipher $1d$g8wLJ`LjL!$CyE(V{3qg5DdU:PM[6=6O
$UF-.fQ,Q}>^)OBzgoU$
local-user admin1234 privilege level 3
local-user admin1234 ftp-directory flash:
local-user admin1234 service-type ftp
#
interface 10GE1/0/1
undo portswitch
ip address 10.136.23.5 255.255.255.0
#
return
Networking Requirements
In Figure 3-13, PC1 connects to the device at 10.1.1.5. Files need to be securely
transferred between PC1 and the device. To ensure secure file transfer, the device
needs to be configured as an SSH server to provide the SFTP service, so that the
SSH server can authenticate the client (PC1) and bidirectional data is encrypted. In
addition, an ACL policy needs to be configured so that only PC1 can access the
SSH server.
Figure 3-13 Network diagram for performing file operations using SFTP
NOTE
Configuration Roadmap
The configuration roadmap is as follows:
1. Generate a local key pair and enable the SFTP server function on the SSH
server so that the server and client can securely exchange data.
2. Configure SSH user information including the authentication mode, service
type, authorized directory, user name, and password.
3. Configure access permissions on the SSH server to control access from SSH
users.
4. Connect to the SSH server from the PC using the third-party software
OpenSSH.
Procedure
Step 1 Configure an IP address for the SSH server.
<HUAWEI> system-view
[HUAWEI] sysname FTP_Server
[SSH Server] interface 10ge 1/0/1
[SSH Server-10GE1/0/1] undo portswitch
[SSH Server-10GE1/0/1] ip address 10.1.1.5 255.255.255.0
[SSH Server-10GE1/0/1] quit
Step 2 On the SSH server, generate a local key pair and enable the SFTP server function.
[SSH Server] rsa local-key-pair create
The key name will be:Host_Server
The range of public key size is (2048, 4096).
NOTE: Key pair generation will take a short while.
Please input the modulus [default = 3072]:3072
[SSH Server] sftp server enable
[SSH Server] ssh server-source all-interface
Step 3 Configure the public key algorithm, encryption algorithm, key exchange algorithm
list, HMAC authentication algorithm, and minimum key length on the SSH server.
[SSH Server] ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
[SSH Server] ssh server hmac sha2_256 sha2_512
[SSH Server] ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
[SSH Server] ssh server publickey rsa_sha2_256 rsa_sha2_512
[SSH Server] ssh server dh-exchange min-len 3072
Step 4 Configure SSH user information including the authentication mode, service type,
authorized directory, user name, and password.
[SSH Server] ssh user client001 authentication-type password
Info: Succeeded in adding a new SSH user.
[SSH Server] ssh user client001 service-type sftp
----End
After you connect to the SSH server using the third-party software, the SFTP view
is displayed. You can then perform file operations in the SFTP view.
Configuration Scripts
#
sysname SSH Server
#
acl number 2001
rule 5 permit source 10.1.1.1 0
rule 10 deny source 10.1.1.2 0
#
aaa
local-user client001 password irreversible-cipher $1d$v!=.5/:(q-$xL=\K
+if"'S}>k7vGP5$_ox0B@ys7.'DBHL~3*aN$
local-user client001 service-type terminal ssh
local-user client001 privilege level 3
#
interface 10GE1/0/1
undo portswitch
ip address 10.1.1.5 255.255.255.0
#
sftp server enable
ssh server-source all-interface
ssh server acl 2001
ssh user client001
ssh user client001 authentication-type password
ssh user client001 service-type sftp
Networking Requirements
In Figure 3-14, the remote device with IP address 10.1.1.1/24 functions as the
TFTP server. The device with IP address 10.2.1.1/24 functions as the TFTP client
and has reachable routes to the TFTP server.
The TFTP client needs to be upgraded. To be specific, you need to download the
system software from the TFTP server to the TFTP client and back up the current
configuration file of the TFTP client to the TFTP server.
Figure 3-14 Network diagram for accessing files on another device using TFTP
NOTE
Configuration Roadmap
The configuration roadmap is as follows:
1. Run the TFTP software on the TFTP server and set the TFTP working directory.
2. Upload files from and download files to the TFTP client using TFTP
commands.
Configuration Precautions
In insecure network environments, you are advised to use a secure password
authentication mode, encryption authentication algorithm, or protocol. For details
about secure configuration examples, see 3.1.2.4.7 Example for Configuring a
Device as an SCP Client.
Procedure
Step 1 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm/protocol feature package (WEAKEA).
Step 2 Run the TFTP software on the TFTP server and set the TFTP working directory. For
details, see the help document of the third-party software.
Step 3 Upload files from and download files to the TFTP client using TFTP commands.
<HUAWEI> tftp 10.1.1.1 get devicesoft.cc
Info: Transfer file in binary mode.
Please wait for a while...
/ 107973953 bytes transferred
Info: Downloaded the file successfully.
<HUAWEI> tftp 10.1.1.1 put vrpcfg.zip
Info: Transfer file in binary mode.
Please wait for a while...
/ 100% [***********]
Info: Uploaded the file successfully.
----End
# Access the working directory on the TFTP server and check whether the
vrpcfg.zip file has been uploaded successfully.
Configuration Scripts
None
Networking Requirements
In Figure 3-15, the remote device with IP address 10.1.1.1/24 functions as the FTP
server. The device with IP address 10.2.1.1/24 functions as the FTP client and has
reachable routes to the FTP server.
The FTP client needs to be upgraded. To be specific, you need to download the
system software from the FTP server to the FTP client and back up the current
configuration file of the FTP client to the FTP server.
Figure 3-15 Network diagram for accessing files on another device using FTP
NOTE
Configuration Roadmap
The configuration roadmap is as follows:
1. Run the FTP software on the FTP server and configure an FTP user.
2. Establish a connection between the FTP client and FTP server.
3. Download files from and upload files to the FTP server using FTP commands.
Configuration Precautions
In insecure network environments, you are advised to use a secure password
authentication mode, encryption authentication algorithm, or protocol. For details
about secure configuration examples, see 3.1.2.4.6 Example for Configuring a
Device as an SFTP Client.
Procedure
Step 1 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm/protocol feature package (WEAKEA).
Step 2 Run the FTP software on the FTP server and configure an FTP user. For details, see
the help document of the third-party software.
Step 3 Establish a connection between the FTP client and FTP server.
<HUAWEI> ftp 10.1.1.1
Trying 10.1.1.1 ...
Press CTRL + K to abort
Connected to 10.1.1.1.
220 FTP service ready.
User(10.1.1.1:(none)):admin
331 Password required for admin.
Enter password:
230 User logged in.
[ftp]
Step 4 Download files from and upload files to the FTP server using FTP commands.
[ftp] binary
200 Type is Image (Binary)
[ftp] get devicesoft.cc
500 Unidentified command SIZE test123.cfg
200 PORT command okay
150 "D:\FTP\test123.cfg" file ready to send (3544 bytes) in IMAGE / Binary mode
..
226 Transfer finished successfully.
FTP: 107973953 byte(s) received in 151.05 second(s) 560.79Kbyte(s)/sec.
[ftp] put vrpcfg.zip
200 PORT command okay
150 "D:\FTP\vrpcfg.zip" file ready to receive in IMAGE / Binary mode
/ 100% [***********]
226 Transfer finished successfully.
FTP: 1257 byte(s) send in 0.03 second(s) 40.55Kbyte(s)/sec.
[ftp] quit
----End
# Access the working directory on the FTP server and check for the vrpcfg.zip file.
Configuration Scripts
None
Networking Requirements
The SSH protocol uses encryption to secure the connection between a client and a
server. All user authentication, commands, output, and file transfers are encrypted
to protect against attacks in the network. A client can securely connect to the SSH
server and transfer files using SFTP.
In Figure 3-16, routes between the SSH server and clients client001 and client002
are reachable. In this example, a Huawei device functions as the SSH server.
The two clients are required to connect to the SSH server in password and RSA
authentication modes respectively to ensure secure access to files on the SSH
server.
Figure 3-16 Network diagram for accessing files on another device using SFTP
NOTE
Configuration Roadmap
The configuration roadmap is as follows:
1. Generate a local key pair and enable the SFTP server function on the server so
that the server and client can securely exchange data.
2. On the SSH server, configure client001 and client002 to access the SSH
server in password and RSA authentication modes, respectively.
3. Generate a local key pair on client002 and configure the RSA public key of
client002 on the SSH server so that the server can authenticate the client
when the client attempts to access the server.
4. Configure client001 and client002 to connect to the SSH server using SFTP
for file access.
Procedure
Step 1 On the server, generate a local key pair and enable the SFTP server function.
<HUAWEI> system-view
[HUAWEI] sysname SSH Server
[SSH Server] rsa local-key-pair create
The key name will be:Host_Server
The range of public key size is (2048, 4096).
NOTE: Key pair generation will take a short while.
Please input the modulus [default = 3072]:3072
[SSH Server] sftp server enable
[SSH Server] ssh server-source all-interface
Step 2 Configure the public key algorithm, encryption algorithm, key exchange algorithm
list, HMAC authentication algorithm, and minimum key length on the SSH server.
[SSH Server] ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
[SSH Server] ssh server hmac sha2_256 sha2_512
[SSH Server] ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
[SSH Server] ssh server publickey rsa_sha2_256 rsa_sha2_512
[SSH Server] ssh server dh-exchange min-len 3072
# Create an SSH user named client002 and configure the RSA authentication
mode for the user.
[SSH Server] ssh user client002
[SSH Server] ssh user client002 authentication-type rsa
[SSH Server] ssh authorization-type default root
[SSH Server] ssh user client002 service-type sftp
[SSH Server] ssh user client002 sftp-directory flash:/
Step 5 Generate a local key pair on client002 and configure the RSA public key of
client002 on the SSH server.
# Generate a local key pair the client.
<HUAWEI> system-view
[HUAWEI] sysname client002
[client002] rsa local-key-pair create
The key name will be:Host_Server
The range of public key size is (2048, 4096).
NOTE: Key pair generation will take a short while.
Please input the modulus [default = 3072]:3072
# Configure the RSA public key of the client on the server. (The information in
bold in the display command output is the RSA public key of the client. Copy the
key to the server.)
[SSH Server] rsa peer-public-key rsakey001 encoding-type der
[SSH Server-rsa-public-key] public-key-code begin
[SSH Server-rsa-public-key-rsa-key-code] 3082010A
[SSH Server-rsa-public-key-rsa-key-code] 02820101
[SSH Server-rsa-public-key-rsa-key-code] 00BBB7A0 4924AF13 04F2662D 2ED43B9D 589967EB
[SSH Server-rsa-public-key-rsa-key-code] D8A4F785 5AD1F662 13845081 0C65F6B3 88A9C415
[SSH Server-rsa-public-key-rsa-key-code] D81C34BD 41A4B580 70DC7460 E4A5407B 9B95630F
[SSH Server-rsa-public-key-rsa-key-code] E211F4B3 1115772D FB95D3DC 915A1858 D0DE49F7
[SSH Server-rsa-public-key-rsa-key-code] F39DD7A7 7795F2B9 C9562E8B 598CB50F 6D39240D
[SSH Server-rsa-public-key-rsa-key-code] B5C6F1D3 33A218D0 98C30104 F8F3A8CA 7172C95B
[SSH Server-rsa-public-key-rsa-key-code] 03AEC0A0 8A7E99F6 6C1939AA 52CC2E31 B6703278
[SSH Server-rsa-public-key-rsa-key-code] AEE1BCD8 DC21FCA2 041C9A4C 1856A935 6894998D
[SSH Server-rsa-public-key-rsa-key-code] FBFA88FF 1708C3A6 7E092368 ACE983D7 C8DDCDF5
[SSH Server-rsa-public-key-rsa-key-code] 26F5D4E5 16A15C5C D6D0018E 4EAFE055 B93FCB87
[SSH Server-rsa-public-key-rsa-key-code] 2BB46EFB 02C04C3B F167A417 380CD0B0 0BC59493
[SSH Server-rsa-public-key-rsa-key-code] 646CBE96 BCAF3DB7 AD0AFA0A 5D14155E D7F97DC1
[SSH Server-rsa-public-key-rsa-key-code] 32693DE5 4B103442 8E0F4DAD 2598BE5E 19
[SSH Server-rsa-public-key-rsa-key-code] 0203
[SSH Server-rsa-public-key-v-key-code] 010001
[SSH Server-rsa-public-key-rsa-key-code] public-key-code end
[SSH Server-rsa-public-key] peer-public-key end
----End
Configuration Scripts
● SSH server
#
sysname SSH Server
#
rsa peer-public-key rsakey001 encoding-type der
public-key-code begin
3082010A
02820101
00BBB7A0 4924AF13 04F2662D 2ED43B9D 589967EB D8A4F785 5AD1F662 13845081
0C65F6B3 88A9C415 D81C34BD 41A4B580 70DC7460 E4A5407B 9B95630F E211F4B3
1115772D FB95D3DC 915A1858 D0DE49F7 F39DD7A7 7795F2B9 C9562E8B 598CB50F
6D39240D B5C6F1D3 33A218D0 98C30104 F8F3A8CA 7172C95B 03AEC0A0 8A7E99F6
6C1939AA 52CC2E31 B6703278 AEE1BCD8 DC21FCA2 041C9A4C 1856A935 6894998D
FBFA88FF 1708C3A6 7E092368 ACE983D7 C8DDCDF5 26F5D4E5 16A15C5C D6D0018E
4EAFE055 B93FCB87 2BB46EFB 02C04C3B F167A417 380CD0B0 0BC59493 646CBE96
BCAF3DB7 AD0AFA0A 5D14155E D7F97DC1 32693DE5 4B103442 8E0F4DAD 2598BE5E
19
0203
010001
public-key-code end
peer-public-key end
#
aaa
local-user client001 password irreversible-cipher $1d$g8wLJ`LjL!$CyE(V{3qg5DdU:PM[6=6O
$UF-.fQ,Q}>^)OBzgoU$
local-user client001 service-type terminal ssh
local-user client001 privilege level 3
#
sftp server enable
ssh user client001
ssh user client001 authentication-type password
ssh user client001 service-type sftp
ssh user client001 sftp-directory flash:/
ssh user client002
ssh user client002 authentication-type rsa
ssh user client002 assign rsa-key rsakey001
ssh user client002 service-type sftp
ssh user client002 sftp-directory flash:/
#
ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
ssh server hmac sha2_256 sha2_512
ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
ssh server publickey rsa_sha2_256 rsa_sha2_512
ssh server dh-exchange min-len 3072
#
return
● client001
#
sysname client001
#
● client002
#
sysname client002
#
ssh client first-time enable
#
ssh client cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
ssh client hmac sha2_256 sha2_512
ssh client key-exchange dh_group_exchange_sha256 dh_group16_sha512
ssh client publickey rsa_sha2_256 rsa_sha2_512
#
return
Networking Requirements
Compared with SFTP, SCP simplifies file transfer operations by combining user
identity authentication and file transfer to improve configuration efficiency.
In Figure 3-17, the routes between the SCP client and SSH server are reachable.
The SCP client needs to download files from the SSH server.
Figure 3-17 Network diagram for configuring a device to access files on another
device as an SCP client
NOTE
Configuration Roadmap
The configuration roadmap is as follows:
1. Generate a local key pair on the SSH server.
2. Create an SSH user on the SSH server.
3. Enable the SCP server function on the SSH server.
4. Download files from the SSH server to the SCP client.
Procedure
Step 1 Generate a local key pair on the server.
<HUAWEI> system-view
[HUAWEI] sysname SSH Server
[SSH Server] rsa local-key-pair create
The key name will be:Host
The range of public key size is (2048, 4096).
NOTE: Key pair generation will take a short while.
Please input the modulus [default = 3072]:
# Create an SSH user named Client, set the authentication mode to password,
and set the service type to all.
[SSH Server] ssh user Client
[SSH Server] ssh user Client authentication-type password
[SSH Server] ssh user Client service-type all
Step 4 Configure the public key algorithm, encryption algorithm, key exchange algorithm
list, HMAC authentication algorithm, and minimum key length on the SSH server.
[SSH Server] ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
[SSH Server] ssh server hmac sha2_256 sha2_512
[SSH Server] ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
[SSH Server] ssh server publickey rsa_sha2_256 rsa_sha2_512
[SSH Server] ssh server dh-exchange min-len 3072
----End
<HUAWEI> system-view
[HUAWEI] sysname SCP Client
[SCP Client] ssh client first-time enable
# Download the backup.cfg file from the SSH server at 10.1.1.1 to the local
directory using the aes256_ctr encryption algorithm.
[SCP Client] scp -cipher aes256_ctr [email protected]:backup.cfg backup.cfg
Trying 10.1.1.1 ...
Press CTRL+K to abort
Connected to 10.1.1.1 ...
Continue to access it? [Y/N]:y
[Y/N]:y
The server's public key will be saved with the name 10.1.1.1. Please wait...
Enter password:
backup.cfg 100% 19174Bytes 7Kb/s
Configuration Scripts
● SSH server
#
sysname SSH Server
#
aaa
local-user Client password irreversible-cipher $#z$!9S<a#>H7{7dI>%0S{AcKGC=t:zjv14LlQqHO\
\P.*=<x1]u;y*P`'GR3[m}$
local-user Client service-type terminal ssh
local-user Client privilege level 3
#
scp server enable
ssh user Client
ssh user Client authentication-type password
ssh user Client service-type all
ssh server-source all-interface
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
ssh server cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
ssh server hmac sha2_256 sha2_512
ssh server key-exchange dh_group_exchange_sha256 dh_group16_sha512
ssh server publickey rsa_sha2_256 rsa_sha2_512
ssh server dh-exchange min-len 3072
#
return
● SCP client
#
sysname SCP Client
#
ssh client first-time enable
#
ssh client cipher aes128_ctr aes256_ctr aes192_ctr aes128_gcm aes256_gcm
ssh client hmac sha2_256 sha2_512
ssh client key-exchange dh_group_exchange_sha256 dh_group16_sha512
ssh client publickey rsa_sha2_256 rsa_sha2_512
#
return
3.1.3.1.1 Example for Configuring the Rates and Duplex Modes of Ethernet
Interfaces
Networking Requirements
As shown in Figure 3-18, DeviceA, DeviceB, and DeviceC are connected to
10GE1/0/1, 10GE1/0/2, and 10GE1/0/3, respectively, on DeviceD, which is
connected to the Internet through 10GE1/0/4.
Figure 3-18 Network diagram of configuring the rate and duplex mode in non-
auto-negotiation mode
NOTE
Configuration Roadmap
● Configure interfaces to work in non-auto-negotiation mode to prevent their
rates from being affected.
● Forcibly set the duplex mode to full-duplex for the interfaces working in non-
auto-negotiation mode to prevent packet loss.
● Forcibly set the working rate to 100 Mbit/s for the interfaces working in non-
auto-negotiation mode to prevent data congestion.
Procedure
Step 1 Create an interface group and add interface1, interface2, and interface3 to it.
<HUAWEI> system-view
[HUAWEI] sysname DeviceD
[DeviceD] port-group portgroup1 //Create a permanent interface group portgroup1 and enter its view.
[DeviceD-port-group-portgroup1] group-member 10GE1/0/1 to 10GE1/0/3 //Add 10GE1/0/1, 10GE1/0/2,
and 10GE1/0/3 to portgroup1.
----End
The command output shows that the interface works in non-negotiation mode,
the working rate is 100 Mbit/s, and the duplex mode is full-duplex.
Similarly, you can run the display interface 10ge1/0/2 and display interface
10ge1/0/3 commands to check information about 10GE1/0/2 and 10GE1/0/3,
respectively.
Configuring Scripts
#
sysname DeviceD
#
port-group portgroup1
group-member 10GE1/0/1 to 10GE1/0/3
negotiation disable
duplex full
speed 100
#
return
Networking Requirements
As shown in Figure 3-19, PC1, PC2, PC3, and PC4 each are on a different network
segment, and DeviceB, DeviceC, DeviceD, and DeviceE are access devices for the
Configuration Roadmap
The configuration roadmap is as follows:
● Switch the interface working mode to Layer 3.
● Configure the IP addresses of Layer 3 Ethernet interfaces as gateway
addresses.
Procedure
Step 1 Switch the interface working mode to Layer 3.
# Switch a single interface to Layer 3 mode.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface 10ge 1/0/1
----End
If Switch Port is displayed, the interface works in Layer 2 mode. If Route Port is
displayed, the interface works in Layer 3 mode. The preceding command output
shows that the interface works in Layer 3 mode.
Configuring Scripts
#
sysname DeviceA
#
interface 10ge1/0/1
undo portswitch
ip address 10.10.1.1 255.255.255.0
#
interface 10ge1/0/2
undo portswitch
ip address 10.10.2.1 255.255.255.0
#
interface 10ge1/0/3
undo portswitch
ip address 10.10.3.1 255.255.255.0
#
interface 10ge1/0/4
undo portswitch
ip address 10.10.4.1 255.255.255.0
#
return
Networking Requirements
In Figure 3-20, PC1, PC2, and PC3 all belong to VLAN 10. PC1 and PC2 are
allowed to communicate with PC3, but are not allowed to communicate with each
other.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Add the interfaces to the specified VLAN.
2. Enable port isolation.
Precautions
Switching an interface from Layer 3 to Layer 2 is required only when the interface
works at Layer 3.
Procedure
Step 1 Create VLAN 10 and add interfaces to VLAN 10.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan 10
[DeviceA-vlan10] quit
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type access
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10
#
interface 10GE1/0/1
port default vlan 10
port-isolate enable group 1
#
interface 10GE1/0/2
port default vlan 10
port-isolate enable group 1
#
interface 10GE1/0/3
port default vlan 10
#
return
3.1.4.1 SNMP
Networking Requirements
As shown in Figure 3-21, the NMS is used to manage the device on the network.
Because the network is small and secure, SNMPv1 is configured for the device to
communicate with the NMS. It is expected that, after a new device is added to the
network, existing network resources be utilized to manage the new device and to
quickly locate and rectify network faults.
Precautions
If the network environment is insecure, you are advised to use SNMPv3 for
communication with the NMS.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the device to run SNMPv1 so that the NMS running SNMPv1 can
manage the device.
2. Configure access control so that only the NMS with the specified IP address
can perform read/write operations on the specified MIB objects of the device.
3. Configure a community name based on which the device permits access of
the NMS.
4. Configure a trap host and enable the device to proactively send traps.
5. Add the device to the NMS. The community name configured on the device
must be the same as that used by the NMS; otherwise, the NMS cannot
manage the device.
Procedure
Step 1 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm or protocol feature package (WEAKEA).
Step 2 Configure available routes between the device and the NMSs. Detailed
configurations are not provided.
Step 4 Configure the device to run SNMPv1 so that the NMS running SNMPv1 can
manage the device.
[Device] snmp-agent sys-info version v1 //By default, only SNMPv3 is supported.
Step 6 Configure access control so that only the NMS with the specified IP address can
perform read/write operations on the specified MIB objects of the device.
# Configure an ACL to permit only the NMS with IP address 10.1.1.1 to access the
device.
[Device] acl 2001
[Device-acl4-basic-2001] rule permit source 10.1.1.1 0
[Device-acl4-basic-2001] rule deny
[Device-acl4-basic-2001] quit
# Configure MIB views to specify the MIB objects that can be accessed by the
NMS.
[Device] snmp-agent mib-view included isoview01 system //Configure the system subtree to be
accessible in the MIB view isoview01.
[Device] snmp-agent mib-view included isoview02 interfaces //Configure the interfaces subtree to be
accessible in the MIB view isoview02.
Step 7 Configure a community name. When a device is added to the NMS, the
community name is used for authentication and the ACL is applied for access
control.
[Device] snmp-agent community read adminnms01 mib-view isoview01 acl 2001 //Configure
adminnms01 to have the read-only permission on the system subtree.
[Device] snmp-agent community write adminnms02 mib-view isoview02 acl 2001 //Configure
adminnms02 to have the read and write permissions on the interfaces subtree.
Step 8 Configure a trap host and enable the device to proactively send traps.
[Device] snmp-agent trap enable
Warning: All switches of SNMP trap/notification will be open. Continue? [Y/N]:y //Enable the device to
send all traps. By default, the device is enabled to send only some traps. You can run the display snmp-
agent trap all command to check the status of traps.
[Device] snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname adminnms01
v1
NOTE
The parameter settings on the NMS must be the same as those on the device. Otherwise,
the device cannot be added to the NMS.
----End
Configuration Scripts
#
sysname Device
#
acl number 2001
rule 5 permit source 10.1.1.1 0
rule 10 deny
#
snmp-agent
snmp-agent local-engineid 800007DB03360102101100
snmp-agent community read cipher %#%#Pqp'RXi))/y\KgEtwP9A3x2z5_FgxG1v'D/
8>=G,D9<yMC^RAM_YB:F0BZlF="bHXg%lH*L"Jq'lea`S%#%# mib-view isoview01 acl 2001
snmp-agent community write cipher %#%#.T|&Whvyf$<Gd"I,wXi5SP_6~Nakk6<<+3H:N-h@aJ6d,l0md
%HCeAY8~>X=>xV\JKNAL=124r839v<*%#%# mib-view isoview02 acl 2001
snmp-agent sys-info version v1
snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname cipher %#%#uq/!
YZfvW4*vf[~C|.:Cl}UqS(vXd#wwqR~5M(rU%%#%#
snmp-agent mib-view included isoview01 system
snmp-agent mib-view included isoview02 interfaces
snmp-agent trap enable
snmp-agent protocol source-interface LoopBack0
#
return
Networking Requirements
As shown in Figure 3-22, two NMSs (NMS1 and NMS2) connect to the device
over a public network. According to the network planning, NMS2 can manage
every MIB object on the device, whereas NMS1 does not manage the device.
On the device, only the modules that are enabled by default are allowed to send
alarms to NMS2. This prevents an excess of unwanted alarms from being sent to
NMS2, which would otherwise make fault locating difficult. Inform messages need
to be used to ensure that alarms are received by NMS2, because alarms sent by
the device have to travel across the public network to reach NMS2.
Precautions
If the network environment is insecure, you are advised to use SNMPv3 for
communication with the NMS.
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm or protocol feature package (WEAKEA).
Step 2 Configure available routes between the device and the NMSs. Detailed
configurations are not provided.
Step 5 Configure a source interface for SNMP to receive and respond to NMS request
packets.
[DeviceA] snmp-agent protocol source-interface Loopback0
----End
VPN instance :-
Security name : %+%##!!!!!!!!!"!!!!$!!!!*!!!!%&K/U}|G\2KYm@@k}uDDU#gLLO<J"0Q'/kH!!!!!
2jp5!!!!!!<!!!!rv4VL.ucqLA!PK/olg}.vn0tBf0m4'5^XcK!!!!!%+%#
Port : 162
Type : inform
Version : v2c
Level : No authentication and privacy
NMS type : NMS
With ext vb : No
Notification filter profile name : -
Heart beat required : No
---------------------------------------------------------------------------
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
acl number 2001
rule 5 permit source 1.1.1.2 0
rule 6 deny source 1.1.1.1 0
#
vlan 10
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface Vlanif10
ip address 1.1.2.1 255.255.255.0
#
interface LoopBack0
ip address 10.1.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 1.1.2.0 0.0.0.255
#
snmp-agent
snmp-agent local-engineid 800007DB0300FDFDFD2211
snmp-agent community write cipher %@%##!!!!!!!!!"!!!!"!!!!*!!!!PR=uJ|5'u%-3Bw@/>NzBr/
k=X0[ALT.K~:,!!!!!2jp5!!!!!!U!!!!%{+lTl_[/Jh<3.<4RvQ/.Z'33]YwPJkB^`J9g":TFqD-'B
$kmL6;vyHwQ74KEFp22!!!!!!!!!!!!!!!%@%# mib-view allexthgmp acl 2001 alias
__CommunityAliasName_01_8357
#
snmp-agent sys-info contact call Operator at 010-12345678
snmp-agent sys-info version v2c
snmp-agent password min-length 9
snmp-agent target-host host-name __targetHost_1_11752 inform address udp-domain 1.1.1.2 params
securityname cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!PR=uJ|5'u%<OoF8~{B=#QW("E3cky"H*I%E!!!!!2jp5!!!!!!
<!!!!%m9qN;K61!+'7q>-bKZ&qJzJ3nQ\g)WWHkL!!!!!%+%# v2c
#
snmp-agent mib-view excluded allexthgmp huaweiUtility.7
#
snmp-agent notification-log enable
snmp-agent notification-log global-ageout 36
snmp-agent inform timeout 5
snmp-agent inform resend-times 6
snmp-agent inform pending 7
#
snmp-agent protocol source-interface LoopBack0
#
snmp-agent trap enable
#
return
Networking Requirements
As shown in Figure 3-23, two NMSs (NMS1 and NMS2) connect to the device
over a public network. According to the network planning, NMS2 can manage
every MIB object on the device, whereas NMS1 does not manage the device.
On the device, only the modules that are enabled by default are allowed to send
alarms to NMS2. This prevents an excess of unwanted alarms from being sent to
NMS2, which would otherwise make fault locating difficult.
The data transmitted between NMS2 and the device needs to be encrypted and
the NMS administrator needs to be authenticated because the data has to travel
across the public network. The contact information of the device administrator
needs to be configured on the device, in order to help the NMS administrator
contact the device administrator if a fault occurs.
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure available routes between the device and the NMSs. Detailed
configurations are not provided.
Step 4 Configure a source interface for SNMP to receive and respond to NMS request
packets.
[DeviceA] snmp-agent protocol source-interface Loopback0
# Configure a user group and a user. Configure authentication and encryption for
data of the user.
[DeviceA] snmp-agent group v3 admin privacy write-view iso notify-view iso read-view iso
[DeviceA] snmp-agent usm-user v3 nms2-admin group admin acl 2001
[DeviceA] snmp-agent usm-user v3 nms2-admin authentication-mode sha2-256
Please configure the authentication password (8-255)
Enter Password:
Confirm Password:
[DeviceA] snmp-agent usm-user v3 nms2-admin privacy-mode aes128
Please configure the privacy password (8-255)
Enter Password:
Confirm Password:
For details about NMS configuration, see the corresponding NMS configuration
guide.
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
acl number 2001
rule 5 permit source 1.1.1.2 0.0.0.0
rule 6 deny source 1.1.1.1 0.0.0.0
#
vlan 10
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface Vlanif10
ip address 1.1.2.1 255.255.255.0
#
interface loopback0
ip address 10.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.2.0 0.0.0.255
network 1.1.3.1 0.0.0.0
#
snmp-agent
snmp-agent local-engineid 800007DB03D0C65B951201
#
snmp-agent sys-info contact call Operator at 010-12345678
snmp-agent sys-info version v3
snmp-agent password min-length 10
snmp-agent group v3 admin privacy read-view iso write-view iso notify-view iso
snmp-agent target-host host-name __targetHost_1_27466 trap address udp-domain 1.1.1.2 params
securityname nms2-admin v3 privacy
#
snmp-agent mib-view included iso iso
snmp-agent usm-user v3 nms2-admin
snmp-agent usm-user v3 nms2-admin group admin
snmp-agent usm-user v3 nms2-admin authentication-mode sha2-256 cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!
PR=uJ|5'u%{Ku|VKwEyE-uN:Pp9K`O+oLF,!!!!!2jp5!!!!!!<!!!!6r!o;)ju=D<fXX.r3a`QWe'gPol7aEif^M'!!!!!%+
%#
snmp-agent usm-user v3 nms2-admin privacy-mode aes128 cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!PR=uJ|5'u
%B.79IwRIE3(xTzFsYNQ5iH4;X!!!!!2jp5!!!!!!<!!!!A"X3:)AC815G!a6]bVc8-wj'EK9!&V<M0HP!!!!!%+%#
snmp-agent usm-user v3 nms2-admin acl 2001
#
snmp-agent protocol source-interface LoopBack0
#
snmp-agent trap enable
#
return
Networking Requirements
Use a console cable (serial cable) and a network cable to set up a network
between your PC and the device. Specifically, connect the console cable from your
PC to the console port of the device , and connect the network cable from your PC
to any Ethernet interface on the device, as shown in Networking diagram of
upgrading a new device.
NOTE
Configuration Roadmap
1. Log in to the device through the console port.
2. Run any FTP software on the PC and configure an FTP user.
3. Configure the management IP address of the device so that the device and
the PC reside on the same network segment.
4. Configure the device as the FTP client to obtain the system software package
from the PC and check whether the system software package is successfully
loaded.
5. Specify the system software and patch for next startup.
6. Restart the device.
Configuration Precautions
● Prepare the upgrade tools, including the PC, network cable, and serial cable.
● Obtain the target system software.
– Visit Huawei enterprise technical support website and select the
corresponding product in the software download area.
– Select software of the required version.
– Click Download next to the product_version.cc file of the required
version.
● Obtain the target patch file.
– Visit Huawei enterprise technical support website and select the
corresponding product in the software download area.
– Select the desired patch file.
– Click Download next to the product_version.PAT file of the required
version.
Procedure
Step 1 Log in to the device from the PC through the console port. For details, see
Example for Configuring First Login Through a Console Port.
Step 2 Run the install feature-software WEAKEA command in the user view to install
the weak security algorithm/protocol feature package (WEAKEA).
Step 3 Run any FTP software on the PC.
Step 4 Configure a management IP address for the device to ensure that the device and
PC reside in the same network segment and can ping each other.
# Configure a management IP address for the device.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] ip address 10.10.1.1 24
[DeviceA-10GE1/0/1] quit
Step 5 Establish an FTP connection between the device and the PC.
<DeviceA> ftp 10.10.1.2
Trying 10.10.1.2 ...
Press CTRL + K to abort
Connected to 10.10.1.2.
220 FTP service ready.
User(10.10.1.2:(none)):admin
331 Password required for admin.
Enter password:
230 User logged in.
[ftp]
Step 6 Configure the device as the FTP client to transfer files to the PC using FTP
commands.
[ftp] binary
200 Type is Image (Binary)
[ftp] get product_version.cc //Load the system software to the device. product_version.cc is the file
name of the system software.
500 Unidentified command SIZE test123.cfg
200 PORT command okay
150 "D:\FTP\test123.cfg" file ready to send (3544 bytes) in IMAGE / Binary mode
..
226 Transfer finished successfully.
FTP: 107973953 byte(s) received in 151.05 second(s) 560.79Kbyte(s)/sec.
[ftp] get product_version.PAT //Load the patch file to the device. product_version.PAT is the file name
of the system patch.
200 PORT command okay
150 "D:\FTP\vrpcfg.zip" file ready to receive in IMAGE / Binary mode
/ 100% [***********]
226 Transfer finished successfully.
FTP: 1257 byte(s) send in 0.03 second(s) 40.55Kbyte(s)/sec.
[ftp] quit
Step 7 Check whether the system software and patch are successfully loaded.
<DeviceA> dir
Directory of flash:/
Step 8 Specify the system software and patch for next startup.
# For devices with a single main control board:
<DeviceA> startup system-software product_version.cc //Specify the system software for next startup.
<DeviceA> startup patch product_version.PAT all //Specify the patch for next startup. If the current
version does not have a corresponding patch, you do not need to run this command.
Step 9 Check the boot items for next startup. (The actual command output varies
depending on the device. The following command output is only an example.)
<DeviceA> display startup
MainBoard:
Configured startup system software: flash:/basicsoft.cc
Startup system software: flash:/basicsoft.cc
Next startup system software: flash:/product_version.cc
Startup saved-configuration file: flash:/vrpcfg.zip
Next startup saved-configuration file: flash:/vrpcfg.zip
Startup paf file: default
Next startup paf file: default
Startup patch package: NULL
Next startup patch package: NULL
----End
Configuration Scripts
#
sysname DeviceA
#
interface 10GE1/0/1
ip address 10.10.1.1 24
#
return
3.1.5 Virtualization
3.1.5.1 Stack
Networking Requirements
On a new enterprise network, access devices are required to provide ample ports,
and the network structure must be simple for easy configuration and
management.
In Figure 3-25, DeviceA, DeviceB, and DeviceC set up a stack in a ring topology.
Configuration Roadmap
The configuration roadmap is as follows:
1. Plan stack setup.
2. Perform stack configurations on member devices based on the stack plan,
including the stack ID, stack priority, and Stack-Port. Then save the
configurations and power off the devices.
3. Use stack cables to connect the devices and power them on.
NOTE
● Stack-Port n/1 on the local device must be connected to Stack-Port n/2 on the
remote device.
● Multiple physical member ports can be bound to a Stack-Port to improve
stack reliability and bandwidth. The stack will not split as long as one physical
link is available between the member devices, but the stack bandwidth
decreases.
● If the Stack-Ports on the two devices contain multiple physical member ports,
the physical member ports can be connected in any sequence.
● When more than two devices set up a stack, the ring topology is recommended for
improved system reliability. In this case, the stack bandwidth is the minimum
bandwidth among all Stack-Ports.
● When two devices set up a stack, it is recommended that only one Stack-Port be
created on each member device and that multiple physical member ports be added
to each Stack-Port.
4. Check whether the stack is set up successfully.
Procedure
Step 1 Plan stack setup as follows:
● Stack ID: 1 for DeviceA, 2 for DeviceB, and 3 for DeviceC
● Stack priority: 150 for DeviceA (so that it can be elected as the master
device), 100 for DeviceB, and 50 for DeviceC
● Stack topology: ring topology, as shown in Figure 3-26
Attribute Configuration:
-----------------------------------------
MemberID Domain Priority DelayTime
Oper(Conf) Oper(Conf) Oper(Conf) Oper(Conf)
-------------------------------------------------------------
1(1) --(10) 100(150) 0(0)
-------------------------------------------------------------
Stack-Port Configuration:
--------------------------------------------------------------------------------
Stack-Port Member Ports
--------------------------------------------------------------------------------
Stack-Port1/1 10GE1/0/1 10GE1/0/2
Stack-Port1/2 10GE1/0/3 10GE1/0/4
--------------------------------------------------------------------------------
Stack-Global Configuration:
--------------------------------------------------------------------------------
AuthMode Password
--------------------------------------------------------------------------------
- -
--------------------------------------------------------------------------------
NOTE
If a device needs to be deployed with factory settings using ZTP, you are not advised to run
the save command to save the configurations.
Step 6 Power off DeviceA, DeviceB, and DeviceC. Then connect them using cables and
power them on by referring to "Connecting Stack Cables and Powering On All
Member Devices" in "Stack Configuration" in CLI Configuration Guide >
Virtualization Configuration.
To ensure that DeviceA will become the master device, power on DeviceA first.
After DeviceA starts, power on DeviceB.
Step 7 Check whether the stack is set up successfully.
# Log in to the stack through the console port or management port of any
member device and run the display stack command to check whether the stack is
set up successfully. When logging in to the stack through the management port,
use the IP address of the master device.
<HUAWEI> display stack
--------------------------------------------------------------------------------
MemberID Role MAC Priority DeviceType Description
--------------------------------------------------------------------------------
1 Master 00e0-fc12-1111 255 S6730-H24X6C-V2
2 Standby 00e0-fc12-2222 100 S6730-H24X6C-V2
3 Slave 00e0-fc12-3333 100 S6730-H24X6C-V2
--------------------------------------------------------------------------------
Stack Link:
----------------------------------------------------------------------------
Stack-Port Port Status PeerPort PeerStatus
----------------------------------------------------------------------------
Stack-Port1/1 10GE1/0/1 up 10GE2/0/3 up
Stack-Port1/1 10GE1/0/2 up 10GE2/0/4 up
Stack-Port1/2 10GE1/0/3 up 10GE3/0/1 up
Stack-Port1/2 10GE1/0/4 up 10GE3/0/2 up
Stack-Port2/1 10GE2/0/1 up 10GE3/0/3 up
Stack-Port2/1 10GE2/0/2 up 10GE3/0/4 up
Stack-Port2/2 10GE2/0/3 up 10GE1/0/1 up
Stack-Port2/2 10GE2/0/4 up 10GE1/0/2 up
Stack-Port3/1 10GE3/0/1 up 10GE1/0/3 up
Stack-Port3/1 10GE3/0/2 up 10GE1/0/4 up
Stack-Port3/2 10GE3/0/3 up 10GE2/0/1 up
Stack-Port3/2 10GE3/0/4 up 10GE2/0/2 up
----------------------------------------------------------------------------
The command output shows that the topology information is consistent with the
stack cable connections, indicating that all stack links are set up successfully and
no abnormal link exists.
----End
Configuration Scripts
The stack configuration is saved in the device memory and is not written into the
configuration file.
#
sysname DeviceA
#
3.1.6.1 MAC
Networking Requirements
In Figure 3-27, a server is connected to 10GE 1/0/2 of a device. To prevent the
device from broadcasting the packets destined for the server, it is required that a
static MAC address entry of the server be configured on the device so that the
device always unicasts the packets destined for the server through 10GE 1/0/2. In
addition, it is required that the MAC address of the PC be statically bound to 10GE
1/0/1 to ensure secure communication between the PC and the server.
NOTE
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Figure 3-27 Network diagram for configuring static MAC address entries
Configuration Roadmap
The configuration roadmap is as follows:
1. Create a VLAN and add interfaces to the VLAN to implement Layer 2
forwarding.
2. Configure the static MAC address entry of the server on an interface.
Procedure
Step 1 Create VLAN 2 and add 10GE 1/0/1 and 10GE 1/0/2 to VLAN 2.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 2
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 2
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE] portswitch
[DeviceA-10GE] port link-type access
[DeviceA-10GE] port default vlan 2
[DeviceA-10GE] quit
Step 3 Configure a static MAC address entry of the server on 10GE 1/0/2.
[DeviceA] mac-address static 00e0-fc12-3457 10ge 1/0/2 vlan 2
----End
-------------------------------------------------------------------------------
Total items displayed = 2
Configuration Scripts
#
sysname DeviceA
#
vlan batch 2
#
interface 10GE1/0/1
port link-type access
port default vlan 2
#
interface 10GE1/0/2
port link-type access
port default vlan 2
#
mac-address static 00e0-fc12-3456 10GE1/0/1 vlan 2
mac-address static 00e0-fc12-3457 10GE1/0/2 vlan 2
#
return
Networking Requirements
In Figure 3-28, a device receives an access request from an unauthorized user. The
MAC address of the unauthorized user is 00e0-fc12-3456 and the unauthorized
user belongs to VLAN 3. The MAC address needs to be configured as a blackhole
MAC address so that the device filters out packets from the unauthorized user.
Figure 3-28 Network diagram for configuring a blackhole MAC address entry
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure a blackhole MAC address entry.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan 3
[DeviceA-vlan 3] quit
[DeviceA] mac-address blackhole 00e0-fc12-3456 vlan 3
----End
-------------------------------------------------------------------------------
Total items displayed = 1
Configuration Scripts
#
sysname DeviceA
#
vlan batch 3
#
mac-address blackhole 00e0-fc12-3456 vlan 3
#
return
Networking Requirements
In Figure 3-29, user networks 1 and 2 belong to VLAN 10 and VLAN 20,
respectively. The two user networks are connected to DeviceA through DeviceB,
and DeviceA is connected to DeviceB through 10GE 1/0/1. To control the number
of access users on DeviceA, configure MAC address learning limit on 10GE 1/0/1.
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and add 10GE 1/0/1 to them to implement Layer 2 forwarding.
2. Configure MAC address learning limit on 10GE 1/0/1 to control the number of
access users.
Procedure
Step 1 Create VLANs and add 10GE 1/0/1 to them.
# Add 10GE 1/0/1 to VLAN 10 and VLAN 20.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10 20
[DeviceA-10GE1/0/1] quit
----End
Configuration Scripts
#
sysname DeviceA
#
vlan batch 10 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
mac-address limit maximum 100 alarm enable
#
return
Networking Requirements
In Figure 3-30, user network 1 is connected to DeviceA through DeviceB, and
DeviceA uses 10GE 1/0/1. Likewise, user network 2 is connected to DeviceA
through DeviceC, and DeviceA uses 10GE 1/0/2. 10GE 1/0/1 and 10GE 1/0/2 both
belong to VLAN 2. To control the number of access users, configure MAC address
learning limit in VLAN 2.
Interfaces 1 and 2 in this example represent 10GE 1/0/1 and 10GE 1/0/2, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLAN 2 and add 10GE 1/0/1 and 10GE 1/0/2 to it to implement Layer
2 forwarding.
2. Configure MAC address learning limit on 10GE 1/0/1 and 10GE 1/0/2 to
control the number of access users.
Procedure
Step 1 Create a VLAN and add 10GE 1/0/1 and 10GE 1/0/2 to it.
# Add 10GE 1/0/1 and 10GE 1/0/2 to VLAN 2.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan 2
[DeviceA-vlan2] quit
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 2
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 2
[DeviceA-10GE1/0/2] quit
----End
Configuration Scripts
#
sysname DeviceA
#
vlan batch 2
#
vlan 2
mac-address limit maximum 100 action forward
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2
#
interface 10GE1/0/2
port link-type trunk
3.1.6.2 Eth-Trunk
Networking Requirements
In Figure 3-31, DeviceA and DeviceB are connected through multiple links,
requiring high bandwidth for traffic load balancing. These links need to be
bundled into an Eth-Trunk to ensure data transmission and link reliability.
In this example, Interface 1, Interface 2, and Interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Create Eth-Trunk 1 on DeviceA and DeviceB and configure Eth-Trunk 1 to work in
manual mode.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] portswitch
[DeviceA-Eth-Trunk1] mode manual load-balance
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] interface eth-trunk 1
[DeviceB-Eth-Trunk1] portswitch
[DeviceB-Eth-Trunk1] mode manual load-balance
Step 2 Add member interfaces to the Eth-Trunk interface on DeviceA and DeviceB.
# Configure DeviceA.
[DeviceA-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/3
[DeviceA-Eth-Trunk1] quit
# Configure DeviceB.
[DeviceB-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/3
[DeviceB-Eth-Trunk1] quit
----End
The command output shows that Eth-Trunk 1 has three member interfaces: 10GE
1/0/1, 10GE 1/0/2, and 10GE 1/0/3 and that these member interfaces are in up
state. The Operating Status of Eth-Trunk 1 is up.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
interface Eth-Trunk1
portswitch
#
interface 10GE1/0/1
eth-trunk 1
#
interface 10GE1/0/2
eth-trunk 1
#
interface 10GE1/0/3
eth-trunk 1
#
return
● DeviceB
#
sysname DeviceB
#
interface Eth-Trunk1
portswitch
#
interface 10GE1/0/1
eth-trunk 1
#
interface 10GE1/0/2
eth-trunk 1
#
interface 10GE1/0/3
eth-trunk 1
#
return
Networking Requirements
In Figure 3-32, DeviceA and DeviceB are connected through multiple links. A LAG
in static LACP mode is configured on the two devices to improve bandwidth and
reliability between them. The requirements are as follows:
● Traffic can be load balanced over two active links.
● One link between DeviceA and DeviceB functions as a backup link. If a fault
occurs on an active link, the backup link replaces the faulty link to ensure
reliable data transmission.
In this example, Interface 1, Interface 2, and Interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Create Eth-Trunk 1 on DeviceA and DeviceB and configure Eth-Trunk 1 to work in
static LACP mode.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] mode lacp-static
[DeviceA-Eth-Trunk1] quit
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] interface eth-trunk 1
[DeviceB-Eth-Trunk1] mode lacp-static
[DeviceB-Eth-Trunk1] quit
Step 2 Add member interfaces to the Eth-Trunk interface on DeviceA and DeviceB.
# Configure DeviceA.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] eth-trunk 1
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] eth-trunk 1
[DeviceA-10GE1/0/2] quit
# Configure DeviceB.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] eth-trunk 1
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] eth-trunk 1
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] eth-trunk 1
[DeviceB-10GE1/0/3] quit
Step 3 Set the LACP system priority on DeviceA to 100 and retain the default LACP
system priority on DeviceB so that DeviceA acts as the Actor.
[DeviceA] lacp priority 100
Step 4 On DeviceA, set the upper threshold for the number of active interfaces to 2. The
remaining link is used as a backup link.
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] lacp max active-linknumber 2
[DeviceA-Eth-Trunk1] quit
Step 5 Set LACP interface priorities and determine active interfaces on DeviceA.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] lacp priority 100
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] lacp priority 100
[DeviceA-10GE1/0/2] quit
----End
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
10GE1/0/1 32768 xxxx-xxxx-xxxx 32768 4 20289 10111100
10GE1/0/2 32768 xxxx-xxxx-xxxx 32768 5 20289 10111100
10GE1/0/3 32768 xxxx-xxxx-xxxx 32768 6 20289 10100000
[DeviceB] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 Working Mode: Static
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
10GE1/0/1 100 xxxx-xxxx-xxxx 100 1 20289 10111100
10GE1/0/2 100 xxxx-xxxx-xxxx 100 2 20289 10111100
10GE1/0/3 100 xxxx-xxxx-xxxx 32768 3 20289 10100000
The command output shows that the LACP system priority of DeviceA is 100,
which is higher than the LACP system priority of DeviceB. Member interfaces 10GE
1/0/1 and 10GE 1/0/2 are active interfaces and are in Selected state, and interface
10GE 1/0/3 is in Unselect state. Load balancing and link backup are implemented.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
lacp priority 100
#
interface Eth-Trunk1
mode lacp-static
lacp max active-linknumber 2
#
interface 10GE1/0/1
eth-trunk 1
lacp priority 100
#
interface 10GE1/0/2
eth-trunk 1
lacp priority 100
#
interface 10GE1/0/3
eth-trunk 1
#
return
● DeviceB
#
sysname DeviceB
#
interface Eth-Trunk1
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 1
#
interface 10GE1/0/2
eth-trunk 1
#
interface 10GE1/0/3
eth-trunk 1
#
return
Networking Requirements
On the network shown in Figure 3-33, DeviceA and DeviceB are connected
through dedicated CSS cables to establish a CSS that functions as a logical switch
to increase the total device capacity. To implement backup between devices and
improve reliability, physical interfaces on the two devices are added to the same
Eth-Trunk interface. When no fault occurs on the network, member interface
information on the PE shows that data traffic from VLAN 2 is forwarded through
member interfaces 10GE1/0/1 and 10GE1/0/2, and data traffic from VLAN 3 is
also forwarded through member interfaces 10GE1/0/1 and 10GE1/0/2. This
increases bandwidth capacity between devices but reduces traffic forwarding
efficiency.
To ensure that data traffic from VLAN 2 is forwarded through 10GE1/0/1 and data
traffic from VLAN 3 is forwarded through 10GE1/0/2, configure local preferential
forwarding of traffic on the Eth-Trunk interface in the CSS or stack.
NOTE
Procedure
Step 1 Create an Eth-Trunk interface and configure the allowed VLANs.
Step 3 Configure local preferential forwarding of traffic on the Eth-Trunk interface in the
CSS or stack.
[CSS] interface eth-trunk 10
[CSS-Eth-Trunk10] undo local-preference disable
[CSS] quit
----End
Configuration Scripts
● CSS
sysname CSS
#
vlan batch 2 3
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface 10GE1/1/0/2
port link-type trunk
port trunk allow-pass vlan 2
#
interface 10GE2/1/0/2
port link-type trunk
port trunk allow-pass vlan 3
#
interface 10GE1/1/0/1
eth-trunk 10
#
interface 10GE2/1/0/1
eth-trunk 10
#
return
● PE
#
sysname PE
#
interface Eth-Trunk10
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface 10GE1/0/1
eth-trunk 10
#
interface 10GE1/0/2
eth-trunk 10
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 2
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 3
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 3
#
return
3.1.6.3 VLAN
Networking Requirements
In Figure 3-34, the two hosts connected to DeviceA are located on different
network segments. One belongs to VLAN 2, and the other belongs to VLAN 3.
Both hosts need to communicate with each other.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Create VLANs and add interfaces to the VLANs.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 2 3
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 2
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type access
[DeviceA-10GE1/0/2] port default vlan 3
[DeviceA-10GE1/0/2] quit
----End
Configuration Scripts
#
sysname DeviceA
#
vlan batch 2 to 3
#
interface Vlanif2
ip address 10.10.10.2 255.255.255.0
#
interface Vlanif3
ip address 10.10.20.2 255.255.255.0
#
interface 10GE1/0/1
port default vlan 2
#
interface 10GE1/0/2
port default vlan 3
#
return
Networking Requirements
In Figure 3-35, Host1, Host2, Host5, and Host6 belong to VLAN 2, and Host3,
Host4, Host7, and Host8 belong to VLAN 3. The interfaces on the link between
DeviceA and DeviceC and those on the link between DeviceC and DeviceB allow
packets sourced from VLAN 2 and VLAN 3 to pass through. This ensures that hosts
in the same VLAN on DeviceA and DeviceB can directly communicate with each
other at Layer 2, but hosts in different VLANs cannot.
In this example, interfaces 1 through 5 represent 10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/3, 10GE
1/0/4, and 10GE 1/0/5, respectively.
Procedure
Step 1 On DeviceA and DeviceB, configure the interfaces connecting to hosts as access
interfaces, add Host1, Host2, Host5, and Host6 to VLAN 2, and add Host3, Host4,
Host7, and Host8 to VLAN 3.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 2 3
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 2
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type access
[DeviceA-10GE1/0/2] port default vlan 2
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port link-type access
[DeviceA-10GE1/0/3] port default vlan 3
[DeviceA-10GE1/0/3] quit
[DeviceA] interface 10ge 1/0/4
[DeviceA-10GE1/0/4] portswitch
[DeviceA-10GE1/0/4] port link-type access
[DeviceA-10GE1/0/4] port default vlan 3
[DeviceA-10GE1/0/4] quit
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 2 3
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
Step 2 Configure the link between DeviceA and DeviceC and that between DeviceB and
DeviceC as trunk links.
# Configure DeviceA.
[DeviceA] interface 10ge 1/0/5
[DeviceA-10GE1/0/5] portswitch
[DeviceA-10GE1/0/5] port link-type trunk
[DeviceA-10GE1/0/5] port trunk allow-pass vlan 2 3
[DeviceA-10GE1/0/5] quit
# Configure DeviceB.
[DeviceB] interface 10ge 1/0/5
[DeviceB-10GE1/0/5] portswitch
[DeviceB-10GE1/0/5] port link-type trunk
[DeviceB-10GE1/0/5] port trunk allow-pass vlan 2 3
[DeviceB-10GE1/0/5] quit
# Configure DeviceC.
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
[DeviceC] vlan batch 2 3
[DeviceC] interface 10ge 1/0/1
[DeviceC-10GE1/0/1] portswitch
[DeviceC-10GE1/0/1] port link-type trunk
[DeviceC-10GE1/0/1] port trunk allow-pass vlan 2 3
[DeviceC-10GE1/0/1] quit
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] portswitch
[DeviceC-10GE1/0/2] port link-type trunk
[DeviceC-10GE1/0/2] port trunk allow-pass vlan 2 3
[DeviceC-10GE1/0/2] quit
----End
VID Ports
--------------------------------------------------------------------------------
2 UT:10GE1/0/1(U) 10GE1/0/2(U)
TG:10GE1/0/5(U)
# Run the display port vlan command to check information about allowed VLANs
on involved interfaces. The following example shows the command output on
10GE 1/0/5 of DeviceA.
[DeviceA] display port vlan 10ge 1/0/5
Port Link Type PVID Trunk VLAN List Port Description
---------------------------------------------------------------------------------------------------------------
10GE1/0/5 trunk 1 1-3
# Hosts in VLAN 2 can ping one another, as can those in VLAN 3. However, hosts
in VLAN 2 cannot ping hosts in VLAN 3.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 2 to 3
#
interface 10GE1/0/1
port default vlan 2
#
interface 10GE1/0/2
port default vlan 2
#
interface 10GE1/0/3
port default vlan 3
#
interface 10GE1/0/4
port default vlan 3
#
interface 10GE1/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 to 3
#
interface 10GE1/0/1
port default vlan 2
#
interface 10GE1/0/2
port default vlan 2
#
interface 10GE1/0/3
port default vlan 3
#
interface 10GE1/0/4
port default vlan 3
#
interface 10GE1/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 2 to 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
Networking Requirements
In Figure 3-36, PC1 and PC2 belong to VLAN 2 and VLAN 3 respectively and are
connected to DeviceA at the aggregation layer through DeviceB at the access
layer. PC3 belongs to VLAN 4 and is connected to DeviceA through DeviceC at the
access layer. DeviceB functions as the gateway of PC1 and PC2, and DeviceC
functions as the gateway of PC3. Static routes are configured on the devices to
allow PCs to communicate with each other and access the upper-layer device.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure DeviceB at the access layer.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 2 3
----End
VID Ports
--------------------------------------------------------------------------------
2 UT:10GE1/0/2(U) 10GE1/0/3(U)
TG:10GE1/0/1(U)
# Run the display port vlan command to check information about allowed VLANs
on an interface. The following example uses the command output about 10GE
1/0/1 on DeviceB.
[DeviceB] display port vlan 10ge 1/0/1
Port Link Type PVID Trunk VLAN List Port Description
---------------------------------------------------------------------------------------------------------------
10GE1/0/1 trunk 1 2-3
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 5
#
interface Vlanif5
ip address 192.168.5.1 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 5
#
interface 10GE1/0/2
port link-type access
port default vlan 5
#
interface 10GE1/0/3
port link-type access
port default vlan 5
#
ip route-static 0.0.0.0 0.0.0.0 192.168.5.4
ip route-static 192.168.2.0 255.255.255.0 192.168.5.2
ip route-static 192.168.3.0 255.255.255.0 192.168.5.2
ip route-static 192.168.4.0 255.255.255.0 192.168.5.3
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 to 3 5
#
#
interface Vlanif2
ip address 192.168.2.1 255.255.255.0
#
interface Vlanif3
ip address 192.168.3.1 255.255.255.0
#
interface Vlanif5
ip address 192.168.5.2 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 5
#
interface 10GE1/0/2
port link-type access
port default vlan 2
#
interface 10GE1/0/3
port link-type access
port default vlan 3
#
ip route-static 0.0.0.0 0.0.0.0 192.168.5.1
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 4 to 5
#
#
interface Vlanif4
ip address 192.168.4.1 255.255.255.0
#
interface Vlanif5
ip address 192.168.5.3 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 5
#
interface 10GE1/0/2
port link-type access
port default vlan 4
#
ip route-static 0.0.0.0 0.0.0.0 192.168.5.1
#
return
Networking Requirements
In Figure 3-37, PC1 and PC2 belong to VLAN 2 and VLAN 3 respectively and are
connected to DeviceA at the aggregation layer through DeviceB at the access
layer. PC3 belongs to VLAN 4 and is connected to DeviceA through DeviceC at the
access layer. No configuration is performed on DeviceC, and DeviceC functions as
a hub and supports plug-and-play. DeviceA functions as the gateway of PC1, PC2,
and PC3 to allow PCs to communicate with each other and access the upper-layer
device.
Figure 3-37 Network diagram for configuring the aggregation device as the
gateway
NOTE
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure DeviceB at the access layer.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 2 3
----End
VID Ports
--------------------------------------------------------------------------------
2 UT:10GE1/0/2(U) 10GE1/0/3(U)
TG:10GE1/0/1(U)
# Run the display port vlan command to check information about allowed VLANs
on an interface. The following example uses the command output about 10GE
1/0/1 on DeviceB.
[DeviceB] display port vlan 10ge 1/0/1
Port Link Type PVID Trunk VLAN List Port Description
---------------------------------------------------------------------------------------------------------------
10GE1/0/1 trunk 1 2-3
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 2 to 5
#
interface Vlanif2
ip address 192.168.2.1 255.255.255.0
#
interface Vlanif3
ip address 192.168.3.1 255.255.255.0
#
interface Vlanif4
ip address 192.168.4.1 255.255.255.0
#
interface Vlanif5
ip address 192.168.5.1 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 5
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface 10GE1/0/3
port link-type access
port default vlan 4
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 to 3
#
interface 10GE1/0/1
Networking Requirements
In Figure 3-38, Host1, Host2, and Host3 are added to VLAN 10 based on their
MAC addresses. They can communicate with each other and also access the
Internet. Hosts with MAC addresses not associated with VLAN 10 cannot access
the Internet or communicate with authorized hosts in VLAN 10.
In this example, interface 1, interface 2, interface 3, and interface 4 represent 10GE 1/0/1,
10GE 1/0/2, 10GE 1/0/3, and 10GE 1/0/4, respectively.
Procedure
Step 1 Create VLAN 10 and associate host MAC addresses with the VLAN.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan 10
[DeviceA-vlan10] mac-vlan mac-address 00e0-fc00-1111
[DeviceA-vlan10] mac-vlan mac-address 00e0-fc00-2222
[DeviceA-vlan10] mac-vlan mac-address 00e0-fc00-3333
[DeviceA-vlan10] quit
Step 2 On DeviceA, add all four interfaces to VLAN 10 and enable MAC address-based
VLAN assignment on 10GE 1/0/2 to 10GE 1/0/4.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type hybrid
[DeviceA-10GE1/0/1] port hybrid tagged vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type hybrid
[DeviceA-10GE1/0/2] port hybrid untagged vlan 10
[DeviceA-10GE1/0/2] mac-vlan enable
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port link-type hybrid
[DeviceA-10GE1/0/3] port hybrid untagged vlan 10
[DeviceA-10GE1/0/3] mac-vlan enable
[DeviceA-10GE1/0/3] quit
[DeviceA] interface 10ge 1/0/4
[DeviceA-10GE1/0/4] portswitch
[DeviceA-10GE1/0/4] port link-type hybrid
[DeviceA-10GE1/0/4] port hybrid untagged vlan 10
[DeviceA-10GE1/0/4] mac-vlan enable
[DeviceA-10GE1/0/4] quit
----End
# Authorized hosts Host1, Host2, and Host3 on the network can communicate
with each other and access the Internet. Hosts with MAC addresses not associated
with VLAN 10 cannot access the Internet or communicate with the authorized
hosts.
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10
#
vlan 10
mac-vlan mac-address 00e0-fc00-1111
mac-vlan mac-address 00e0-fc00-2222
mac-vlan mac-address 00e0-fc00-3333
#
interface 10GE1/0/1
port link-type hybrid
port hybrid tagged vlan 10
#
interface 10GE1/0/2
port link-type hybrid
port hybrid untagged vlan 10
mac-vlan enable
#
interface 10GE1/0/3
port link-type hybrid
port hybrid untagged vlan 10
mac-vlan enable
#
interface 10GE1/0/4
port link-type hybrid
port hybrid untagged vlan 10
mac-vlan enable
#
return
Networking Requirements
In Figure 3-39, PC1, PC2, and PC3 are located on different network segments. It is
necessary for PCs on different network segments to be added to different VLANs.
In this example, PC1, PC2, and PC3 need to be added to VLAN 100, VLAN 200, and
VLAN 300, respectively.
Procedure
Step 1 Create VLANs and associate subnets with the VLANs.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 100 200 300
[DeviceA] vlan 100
[DeviceA-vlan100] ip-subnet-vlan 1 ip 192.168.1.2 24 priority 2
[DeviceA-vlan100] quit
[DeviceA] vlan 200
[DeviceA-vlan200] ip-subnet-vlan 1 ip 192.168.2.2 24 priority 3
[DeviceA-vlan200] quit
[DeviceA] vlan 300
[DeviceA-vlan300] ip-subnet-vlan 1 ip 192.168.3.2 24 priority 4
[DeviceA-vlan300] quit
Step 2 Set 10GE 1/0/1 to a hybrid interface, configure the interface to allow packets from
VLAN 100, VLAN 200, and VLAN 300 to pass through, and enable subnet-based
VLAN assignment on the interface.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type hybrid
[DeviceA-10GE1/0/1] port hybrid untagged vlan 100
[DeviceA-10GE1/0/1] port hybrid untagged vlan 200
[DeviceA-10GE1/0/1] port hybrid untagged vlan 300
[DeviceA-10GE1/0/1] ip-subnet-vlan enable
[DeviceA-10GE1/0/1] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 100 200 300
#
vlan 100
ip-subnet-vlan 1 ip 192.168.1.2 255.255.255.0 priority 2
#
vlan 200
ip-subnet-vlan 1 ip 192.168.2.2 255.255.255.0 priority 3
#
vlan 300
ip-subnet-vlan 1 ip 192.168.3.2 255.255.255.0 priority 4
#
interface 10GE1/0/1
port link-type hybrid
port hybrid untagged vlan 100
port hybrid untagged vlan 200
port hybrid untagged vlan 300
ip-subnet-vlan enable
#
return
Networking Requirements
On the network shown in Figure 3-40, VLAN 2 and VLAN 3 are two sub-VLANs
connected to VLAN 4, which is a super-VLAN. PCs in VLAN 2 and VLAN 3 need to
communicate with each other.
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs on CEs and determine the VLANs to which users belong.
2. Configure VLAN aggregation on the PE.
a. Configure the Layer 2 forwarding function.
b. Create a super-VLAN and add sub-VLANs to it.
c. Create a VLANIF interface for the super-VLAN and configure an IP
address for the VLANIF interface as the gateway address.
Data Plan
To complete the configuration, you need the following data:
● IDs of VLANs to which users belong.
● IP addresses of users.
● Numbers of interfaces connecting CEs to users.
● Sub-VLAN IDs and super-VLAN ID.
● Number and IP address of the VLANIF interface of the super-VLAN.
Procedure
Step 1 Create VLANs on CEs and add Layer 2 interfaces to the VLANs.
# Configure CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 2
[CE1] interface 10ge 1/0/1
[CE1-10GE1/0/1] portswitch
[CE1-10GE1/0/1] port link-type access
[CE1-10GE1/0/1] port default vlan 2
[CE1-10GE1/0/1] quit
[CE1] interface 10ge 1/0/2
[CE1-10GE1/0/2] portswitch
[CE1-10GE1/0/2] port link-type access
[CE1-10GE1/0/2] port default vlan 2
[CE1-10GE1/0/2] quit
[CE1] interface 10ge 1/0/3
[CE1-10GE1/0/3] portswitch
[CE1-10GE1/0/3] port link-type trunk
[CE1-10GE1/0/3] port trunk allow-pass vlan 2
[CE1-10GE1/0/3] quit
# Configure CE2.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 3
[CE2] interface 10ge 1/0/1
[CE2-10GE1/0/1] portswitch
[CE2-10GE1/0/1] port link-type access
[CE2-10GE1/0/1] port default vlan 3
[CE2-10GE1/0/1] quit
[CE2] interface 10ge 1/0/2
[CE2-10GE1/0/2] portswitch
[CE2-10GE1/0/2] port link-type access
[CE2-10GE1/0/2] port default vlan 3
[CE2-10GE1/0/2] quit
[CE2] interface 10ge 1/0/3
[CE2-10GE1/0/3] portswitch
[CE2-10GE1/0/3] port link-type trunk
[CE2-10GE1/0/3] port trunk allow-pass vlan 3
[CE2-10GE1/0/3] quit
# Create a VLANIF interface for the super-VLAN and configure an IP address for
the VLANIF interface.
After the preceding configurations are complete, configure an IP address for each
PC. The IP addresses of PCs and the IP address of the VLANIF interface must be on
the same network segment. If the configuration is successful, the PCs used by
employees in each VLAN can communicate with the corresponding switch, but PCs
in VLAN 2 and VLAN 3 cannot communicate with each other.
Step 3 Enable inter-VLAN proxy ARP.
[PE-vlanif4] arp proxy inter-vlan enable
[PE-vlanif4] quit
----End
Configuration Scripts
● CE1
#
sysname CE1
#
vlan batch 2
#
interface 10GE1/0/1
● PE
#
sysname PE
#
vlan batch 2 to 4
#
vlan 4
aggregate-vlan
access-vlan 2 to 3
#
interface Vlanif4
ip address 10.1.1.12 255.255.255.0
arp proxy inter-vlan enable
#
interface 10GE1/0/1
Networking Requirements
On the network shown in Figure 3-41, it is required that all hosts can access the
Internet, hosts in VLAN 3 can communicate with each other, and hosts in VLAN 4
cannot communicate with each other.
Procedure
Step 1 Configure MUX VLAN.
# Create VLAN 2 to VLAN 4 on DeviceB. Configure VLAN 2 as a principal VLAN,
VLAN 3 as a group VLAN, and VLAN 4 as a separate VLAN.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 2 3 4
[DeviceB] vlan 2
[DeviceB-vlan2] mux-vlan
[DeviceB-vlan2] subordinate group 3
[DeviceB-vlan2] subordinate separate 4
[DeviceB-vlan2] quit
Step 2 Add uplink interface 1 of DeviceB to VLAN 2, enable the MUX VLAN function on
interface 1, and configure downlink interface 2 and interface 3 to allow packets
from VLAN 2 to VLAN 4 to pass through.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 2
[DeviceB-10GE1/0/1] port mux-vlan enable vlan 2
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] portswitch
[DeviceB-10GE1/0/2] port link-type trunk
[DeviceB-10GE1/0/2] port trunk allow-pass vlan 2 to 4
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] portswitch
[DeviceB-10GE1/0/3] port link-type trunk
[DeviceB-10GE1/0/3] port trunk allow-pass vlan 2 to 4
[DeviceB-10GE1/0/3] quit
Step 3 Configure uplink interface 1 of DeviceC to allow packets from VLAN 2 to VLAN 4
to pass through, add downlink interface 2 and interface 3 to VLAN 3, and enable
the MUX VLAN function on interface 2 and interface 3.
[DeviceC] interface 10ge 1/0/1
[DeviceC-10GE1/0/1] portswitch
[DeviceC-10GE1/0/1] port link-type trunk
[DeviceC-10GE1/0/1] port trunk allow-pass vlan 2 to 4
[DeviceC-10GE1/0/1] quit
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] portswitch
[DeviceC-10GE1/0/2] port link-type access
[DeviceC-10GE1/0/2] port default vlan 3
[DeviceC-10GE1/0/2] port mux-vlan enable vlan 3
[DeviceC-10GE1/0/2] quit
[DeviceC] interface 10ge 1/0/3
[DeviceC-10GE1/0/3] portswitch
[DeviceC-10GE1/0/3] port link-type access
[DeviceC-10GE1/0/3] port default vlan 3
[DeviceC-10GE1/0/3] port mux-vlan enable vlan 3
[DeviceC-10GE1/0/3] quit
Step 4 Configure uplink interface 1 of DeviceD to allow packets from VLAN 2 to VLAN 4
to pass through, add downlink interface 2 and interface 3 to VLAN 4, and enable
the MUX VLAN function on interface 2 and interface 3.
[DeviceD] interface 10ge 1/0/1
[DeviceD-10GE1/0/1] portswitch
[DeviceD-10GE1/0/1] port link-type trunk
[DeviceD-10GE1/0/1] port trunk allow-pass vlan 2 to 4
[DeviceD-10GE1/0/1] quit
[DeviceD] interface 10ge 1/0/2
[DeviceD-10GE1/0/2] portswitch
[DeviceD-10GE1/0/2] port link-type access
[DeviceD-10GE1/0/2] port default vlan 4
[DeviceD-10GE1/0/2] port mux-vlan enable vlan 4
[DeviceD-10GE1/0/2] quit
[DeviceD] interface 10ge 1/0/3
[DeviceD-10GE1/0/3] portswitch
[DeviceD-10GE1/0/3] port link-type access
[DeviceD-10GE1/0/3] port default vlan 4
[DeviceD-10GE1/0/3] port mux-vlan enable vlan 4
[DeviceD-10GE1/0/3] quit
Step 5 Create VLANIF 2 on DeviceA, configure the IP address 10.1.1.1 24 for VLANIF 2,
and add interface 1 to VLAN 2.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 2
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 2
[DeviceA-10GE1/0/1] quit
[DeviceA] interface vlanif 2
[DeviceA-Vlanif2] ip address 10.1.1.1 24
[DeviceA-Vlanif2] quit
NOTE
If the MUX VLAN contains multiple group VLANs and they need to communicate with each
other, run the arp proxy intra-vlan enable command on the VLANIF interface of DeviceA
to configure intra-VLAN proxy ARP.
Step 6 Configure IP addresses for hosts on the network and ensure that the IP addresses
are on the same network segment as the IP address of VLANIF 2 on DeviceA.
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 2
#
interface Vlanif2
ip address 10.10.10.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 to 4
#
vlan 2
mux-vlan
subordinate separate 4
subordinate group 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2
● DeviceC
#
sysname DeviceC
#
vlan batch 2 to 4
#
vlan 2
mux-vlan
subordinate separate 4
subordinate group 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4
#
interface 10GE1/0/2
port default vlan 3
port mux-vlan enable vlan 3
#
interface 10GE1/0/3
port default vlan 3
port mux-vlan enable vlan 3
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 2 to 4
#
vlan 2
mux-vlan
subordinate separate 4
subordinate group 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4
#
interface 10GE1/0/2
port default vlan 4
port mux-vlan enable vlan 4
#
interface 10GE1/0/3
port default vlan 4
port mux-vlan enable vlan 4
#
return
Networking Requirements
In Figure 3-42, DeviceA and DeviceB located in different areas are connected to
user networks A and B, and connected to each other through the public network.
On the public network, VLAN 100 and VLAN 200 are assigned for user networks A
and B to transmit traffic, respectively. Basic QinQ needs to be configured on
DeviceA and DeviceB so that VLANs can be divided in user networks A and B
separately without affecting each other, users in user network A connected to
DeviceA can communicate with users in the same network connected to DeviceB,
and users in different user networks are isolated from each other.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Create VLANs.
# Create VLAN 100 and VLAN 200 on DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 100 200
Step 2 On DeviceA, configure 10GE 1/0/1 and 10GE 1/0/2 as QinQ interfaces, configure
10GE 1/0/1 to add an outer tag with VLAN ID 100 to packets, and configure 10GE
1/0/2 to add an outer tag with VLAN ID 200 to packets. The configuration of
DeviceB is similar to that of DeviceA.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type dot1q-tunnel
[DeviceA-10GE1/0/1] port default vlan 100
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type dot1q-tunnel
[DeviceA-10GE1/0/2] port default vlan 200
[DeviceA-10GE1/0/2] quit
Step 3 Add 10GE 1/0/3 on DeviceA to VLAN 100 and VLAN 200. The configuration of
DeviceB is similar to that of DeviceA.
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 100 200
#
interface 10GE1/0/1
port link-type dot1q-tunnel
port default vlan 100
#
interface 10GE1/0/2
port link-type dot1q-tunnel
port default vlan 200
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 100 200
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 100 200
#
interface 10GE1/0/1
port link-type dot1q-tunnel
port default vlan 100
#
interface 10GE1/0/2
port link-type dot1q-tunnel
port default vlan 200
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 100 200
#
return
Networking Requirements
In Figure 3-43, service A and service B are user services in location X and location
Y. Service A at both locations belongs to one VLAN range, and service B at both
locations belongs to another VLAN range. To ensure security between services and
conserve VLAN IDs on the core/backbone network, traffic between the two
locations must be transparently transmitted through the core/backbone network.
In addition, the same services at both locations must be able to communicate with
each other, but different services must be isolated from each other.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Create VLANs.
# Create VLAN 2 and VLAN 3 (outer VLAN IDs to be added) on 10GE 1/0/1 of
DeviceA. The configuration of DeviceB is similar to the configuration of DeviceA.
For detailed configurations, see Configuration Scripts.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 2 3
# Configure 10GE 1/0/2 on DeviceA to allow packets from VLAN 2 and VLAN 3 to
pass through. The configuration of DeviceB is similar to the configuration of
DeviceA. For detailed configurations, see Configuration Scripts.
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 2 3
[DeviceA-10GE1/0/2] quit
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 2 3
#
interface 10GE1/0/1
port link-type hybrid
port hybrid untagged vlan 2 3
port vlan-stacking vlan 200 to 299 stack-vlan 2
port vlan-stacking vlan 300 to 399 stack-vlan 3
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 3
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 3
#
interface 10GE1/0/1
port link-type hybrid
port hybrid untagged vlan 2 3
port vlan-stacking vlan 200 to 299 stack-vlan 2
Networking Requirements
In Figure 3-44, PC1 and PC2 connected to DeviceA belong to VLAN 200 and VLAN
300, respectively, whereas PC3 and PC4 connected to DeviceD belong to VLAN 200
and VLAN 300, respectively, whereas PC1 and PC3 are on the same network
segment, and PC2 and PC4 are on the same network segment. On the network
between DeviceB and DeviceC, VLAN 2 is used for communication between PC1
and PC3, whereas VLAN 3 is used for communication between PC2 and PC4. MQC-
based selective QinQ needs to be configured on DeviceB so that PC1 can
unidirectionally access PC3 and PC2 can unidirectionally access PC4.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Create VLANs and add interfaces to the VLANs.
# Create VLAN 200 and VLAN 300 on DeviceA, add 10GE 1/0/2 to VLAN 200 and
10GE 1/0/3 to VLAN 300, and configure 10GE 1/0/1 to allow packets from VLAN
200 and VLAN 300 to pass through. The configuration of DeviceD is similar to that
of DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
# Create VLAN 2 and VLAN 3 on DeviceB so that DeviceB can add an outer VLAN
2 or VLAN 3 tag to packets. Configure 10GE 1/0/1 and 10GE 1/0/2 to allow
packets from the two VLANs to pass through.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 2 3
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 2 3
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] portswitch
[DeviceB-10GE1/0/2] port link-type trunk
[DeviceB-10GE1/0/2] port trunk allow-pass vlan 2 3
[DeviceB-10GE1/0/2] quit
# Create VLAN 2 and VLAN 3 on DeviceC, and configure 10GE 1/0/1 and 10GE
1/0/2 to allow packets from VLAN 2 and VLAN 3 to pass through.
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
[DeviceC] vlan batch 2 3
[DeviceC] interface 10ge 1/0/1
[DeviceC-10GE1/0/1] portswitch
[DeviceC-10GE1/0/1] port link-type hybrid
[DeviceC-10GE1/0/1] port hybrid untagged vlan 2 3
[DeviceC-10GE1/0/1] quit
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] portswitch
[DeviceC-10GE1/0/2] port link-type hybrid
[DeviceC-10GE1/0/2] port hybrid untagged vlan 2 3
[DeviceC-10GE1/0/2] quit
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 200 300
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 200 300
#
interface 10GE1/0/2
port default vlan 200
#
interface 10GE1/0/3
port default vlan 300
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 to 3
#
traffic classifier name1 type or
if-match vlan 200
#
traffic classifier name2 type or
if-match vlan 300
#
traffic behavior name1
vlan-stacking vlan 2
#
traffic behavior name2
vlan-stacking vlan 3
#
traffic policy name1
classifier name1 behavior name1 precedence 5
classifier name2 behavior name2 precedence 10
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
traffic-policy name1 inbound
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 2 to 3
#
interface 10GE1/0/1
port link-type hybrid
port hybrid untagged vlan 2 to 3
#
interface 10GE1/0/2
port link-type hybrid
port hybrid untagged vlan 2 to 3
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 200 300
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 200 300
#
interface 10GE1/0/2
port default vlan 200
#
interface 10GE1/0/3
port default vlan 300
#
return
3.1.6.4 STP/RSTP/MSTP
Networking Requirements
In Figure 3-45, there is a loop between DeviceA, DeviceB, DeviceC, and DeviceD.
In this case, STP can be deployed on the network to break the loop and thereby
avoid broadcast storms and MAC address flapping.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure each device to work in STP mode.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] stp mode stp
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] stp mode stp
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
[DeviceC] stp mode stp
<HUAWEI> system-view
[HUAWEI] sysname DeviceD
[DeviceD] stp mode stp
Step 2 Specify the root bridge and a secondary root bridge. It is best reality to specify
network devices with high performance and higher network layers as the root
bridge and a secondary root bridge.
# Configure DeviceA as the root bridge.
[DeviceA] stp root primary
Step 3 Configure all devices on the network to use the same path cost calculation
method. Set a path cost value for 10GE 1/0/1 on DeviceC to block this port.
# Configure DeviceA to use the Huawei legacy standard to calculate the path cost.
[DeviceA] stp pathcost-standard legacy
# Configure DeviceB to use the Huawei legacy standard to calculate the path cost.
[DeviceB] stp pathcost-standard legacy
# Configure DeviceC to use the Huawei legacy standard to calculate the path cost.
Set the path cost value for 10GE 1/0/1 on DeviceC to 20000, which is greater than
that for any other interface, to block this 10GE 1/0/1.
# Configure DeviceD to use the Huawei legacy standard to calculate the path cost.
[DeviceD] stp pathcost-standard legacy
Step 4 Disable STP on DeviceB's and DeviceC's ports that are connected to PCs.
By default, STP, RSTP, or MSTP is enabled on a device. You can run the stp enable
command in the system view to enable this function if it is disabled.
----End
# Run the display stp brief command on DeviceA to check the port role and
status. The command output shows that 10GE 1/0/1 and 10GE 1/0/2 have been
elected as designated ports during spanning tree calculation and are in
Forwarding state.
[DeviceA] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding none 2 disable
0 10GE1/0/2 DESI forwarding none 2 disable
# Run the display stp interface brief command on DeviceB to check the role and
status of 10GE 1/0/1. The command output shows that 10GE 1/0/1 has been
elected as a designated port and is in Forwarding state.
[DeviceB] display stp interface 10ge 1/0/1 brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding none 2 disable
# Run the display stp brief command on DeviceC to check the port role and
status. The command output shows that 10GE 1/0/1 has been elected as an
alternate port and is in Discarding state and that 10GE 1/0/3 has been elected as
a root port and is in Forwarding state.
[DeviceC] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 ALTE discarding none 20000 disable
0 10GE1/0/3 ROOT forwarding none 2 disable
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
stp mode stp
stp instance 0 root primary
stp pathcost-standard legacy
#
return
● DeviceB
#
sysname DeviceB
#
stp mode stp
stp instance 0 root secondary
stp pathcost-standard legacy
#
interface 10GE1/0/2
stp disable
#
return
● DeviceC
#
sysname DeviceC
#
stp mode stp
stp pathcost-standard legacy
#
interface 10GE1/0/1
stp instance 0 cost 20000
#
interface 10GE1/0/2
stp disable
#
return
● DeviceD
#
sysname DeviceD
#
stp mode stp
stp pathcost-standard legacy
#
return
Networking Requirements
In Figure 3-46, there is a loop between DeviceA, DeviceB, DeviceC, and DeviceD.
In this case, RSTP can be deployed on this network to break the loop and thereby
avoid broadcast storms and MAC address flapping.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure each device to work in RSTP mode.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] stp mode rstp
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] stp mode rstp
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
[DeviceC] stp mode rstp
<HUAWEI> system-view
[HUAWEI] sysname DeviceD
[DeviceD] stp mode rstp
Step 2 Specify the root bridge and a secondary root bridge. It is best reality to specify
network devices with high performance and higher network layers as the root
bridge and a secondary root bridge.
# Configure DeviceA as the root bridge.
[DeviceA] stp root primary
Step 3 Configure all devices on the network to use the same path cost calculation
method. Set a path cost value for 10GE 1/0/1 on DeviceC to block this port.
# Configure DeviceA to use the Huawei legacy standard to calculate the path cost.
[DeviceA] stp pathcost-standard legacy
# Configure DeviceB to use the Huawei legacy standard to calculate the path cost.
[DeviceB] stp pathcost-standard legacy
# Configure DeviceC to use the Huawei legacy standard to calculate the path cost.
Set the path cost value for 10GE 1/0/1 on DeviceC to 20000, which is greater than
that for any other interface, to block this 10GE 1/0/1.
# Configure DeviceD to use the Huawei legacy standard to calculate the path cost.
[DeviceD] stp pathcost-standard legacy
Step 4 Configure DeviceB's and DeviceC's ports that are connected to PCs as edge ports.
# Configure 10GE 1/0/2 on DeviceB as an edge port and enable BPDU protection.
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] portswitch
[DeviceB-10GE1/0/2] stp edged-port enable
[DeviceB-10GE1/0/2] quit
[DeviceB] stp bpdu-protection
# Configure 10GE 1/0/2 on DeviceC as an edge port and enable BPDU protection.
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] portswitch
[DeviceC-10GE1/0/2] stp edged-port enable
[DeviceC-10GE1/0/2] quit
[DeviceC] stp bpdu-protection
By default, STP, RSTP, or MSTP is enabled on a device. You can run the stp enable
command in the system view to enable this function if it is disabled.
Step 6 Enable root protection for the designated ports 10GE 1/0/1 and 10GE 1/0/2 on the
root bridge DeviceA.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] stp root-protection
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] stp root-protection
[DeviceA-10GE1/0/2] quit
----End
# Run the display stp brief command on DeviceA to check the port status and
enabled protection function. The command output shows that 10GE 1/0/1 and
10GE 1/0/2 have been elected as designated ports through spanning tree
calculation and that root protection has been enabled for the designated ports.
[DeviceA] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding root 2 disable
0 10GE1/0/2 DESI forwarding root 2 disable
# Run the display stp interface brief command on DeviceB to check the role and
status of 10GE 1/0/1. The command output shows that 10GE 1/0/1 has been
elected as a designated port and is in Forwarding state.
# Run the display stp brief command on DeviceC to check the port role and
status. The command output shows that 10GE 1/0/1 has been elected as an
alternate port and is in Discarding state. Furthermore, 10GE 1/0/3 has been
elected as a root port and is in Forwarding state.
[DeviceC] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 ALTE discarding none 20000 disable
0 10GE1/0/3 ROOT forwarding none 2 disable
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
stp mode rstp
stp instance 0 root primary
stp pathcost-standard legacy
#
interface 10GE1/0/1
stp root-protection
#
interface 10GE1/0/2
stp root-protection
#
return
● DeviceB
#
sysname DeviceB
#
stp mode rstp
stp bpdu-protection
stp instance 0 root secondary
stp pathcost-standard legacy
#
interface 10GE1/0/2
stp edged-port enable
#
return
● DeviceC
#
sysname DeviceC
#
stp mode rstp
stp bpdu-protection
stp pathcost-standard legacy
#
interface 10GE1/0/1
stp instance 0 cost 20000
#
interface 10GE1/0/2
stp edged-port enable
#
return
● DeviceD
#
sysname DeviceD
#
stp mode rstp
Networking Requirements
In Figure 3-47, there is a loop between DeviceA, DeviceB, DeviceC, and DeviceD.
In this case, MSTP can be deployed on the network to break the loop, avoid
broadcast storms and MAC address flapping, and implement load balancing for
traffic of VLANs 2 to 10 and VLANs 11 to 20.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure the same MST region RG1 on DeviceA, DeviceB, DeviceC, and DeviceD
and create MSTI 1 and MSTI 2.
NOTE
Two devices belong to the same MST region when they have the same MST region name,
VLAN-to-MSTI mappings, and revision level of the MST region.
A VLAN can be mapped to only one MSTI. If you map a VLAN to multiple MSTIs, only the
latest one will take effect.
Step 2 In the MST region RG1, configure the root bridge and a secondary root bridge in
MSTI 1 and MSTI 2.
# Configure DeviceA as the root bridge in MSTI 1.
[DeviceA] stp instance 1 root primary
Step 3 Configure the same path cost calculation method for all devices on the network.
For the ports to be blocked in MSTI 1 and MSTI 2, set the path costs to be greater
than the default value.
# Configure DeviceA to use the Huawei legacy standard to calculate the path cost.
[DeviceA] stp pathcost-standard legacy
# Configure DeviceB to use the Huawei legacy standard to calculate the path cost.
[DeviceB] stp pathcost-standard legacy
# Configure DeviceC to use the Huawei legacy standard to calculate the path cost,
and set the path cost of 10GE 1/0/2 in MSTI 2 to 20000.
[DeviceC] stp pathcost-standard legacy
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] portswitch
[DeviceC-10GE1/0/2] stp instance 2 cost 20000
[DeviceC-10GE1/0/2] quit
# Configure DeviceD to use the Huawei legacy standard to calculate the path cost,
and set the path cost of 10GE 1/0/2 in MSTI 1 to 20000.
[DeviceD] stp pathcost-standard legacy
[DeviceD] interface 10ge 1/0/2
[DeviceD-10GE1/0/2] portswitch
[DeviceD-10GE1/0/2] stp instance 1 cost 20000
[DeviceD-10GE1/0/2] quit
Step 6 Configure protection functions. For example, configure root protection for the
designated ports of the root bridge in each MSTI.
# Enable root protection on 10GE 1/0/1 of DeviceA.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] stp root-protection
[DeviceA-10GE1/0/1] quit
# Create VLANs 2 to 20 on DeviceB and add 10GE 1/0/1 and 10GE 1/0/2 on
DeviceB to the VLANs.
[DeviceB] vlan batch 2 to 20
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 2 to 20
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] portswitch
[DeviceB-10GE1/0/2] port link-type trunk
[DeviceB-10GE1/0/2] port trunk allow-pass vlan 2 to 20
[DeviceB-10GE1/0/2] quit
# Create VLANs 2 to 20 on DeviceC and add 10GE 1/0/1, 10GE 1/0/2, and 10GE
1/0/3 on DeviceC to the VLANs.
[DeviceC] vlan batch 2 to 20
[DeviceC] interface 10ge 1/0/1
[DeviceC-10GE1/0/1] portswitch
[DeviceC-10GE1/0/1] port link-type access
[DeviceC-10GE1/0/1] port default vlan 2
[DeviceC-10GE1/0/1] quit
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] portswitch
[DeviceC-10GE1/0/2] port link-type trunk
[DeviceC-10GE1/0/2] port trunk allow-pass vlan 2 to 20
[DeviceC-10GE1/0/2] quit
[DeviceC] interface 10ge 1/0/3
[DeviceC-10GE1/0/3] portswitch
[DeviceC-10GE1/0/3] port link-type trunk
[DeviceC-10GE1/0/3] port trunk allow-pass vlan 2 to 20
[DeviceC-10GE1/0/3] quit
# Create VLANs 2 to 20 on DeviceD and add 10GE 1/0/1, 10GE 1/0/2, and 10GE
1/0/3 on DeviceD to the VLANs.
[DeviceD] vlan batch 2 to 20
[DeviceD] interface 10ge 1/0/1
[DeviceD-10GE1/0/1] portswitch
[DeviceD-10GE1/0/1] port link-type access
[DeviceD-10GE1/0/1] port default vlan 11
[DeviceD-10GE1/0/1] quit
[DeviceD] interface 10ge 1/0/2
[DeviceD-10GE1/0/2] portswitch
[DeviceD-10GE1/0/2] port link-type trunk
[DeviceD-10GE1/0/2] port trunk allow-pass vlan 2 to 20
[DeviceD-10GE1/0/2] quit
----End
# Run the display stp brief command on DeviceA to check the port role and
status. In MSTI 1, 10GE 1/0/2 and 10GE 1/0/1 on DeviceA are designated ports
because DeviceA is the root bridge. In MSTI 2, 10GE 1/0/1 on DeviceA is the
designated port and 10GE 1/0/2 on DeviceA is the root port.
[DeviceA] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding root 2 disable
0 10GE1/0/2 DESI forwarding none 2 disable
1 10GE1/0/1 DESI forwarding root 2 disable
1 10GE1/0/2 DESI forwarding none 2 disable
2 10GE1/0/1 DESI forwarding root 2 disable
2 10GE1/0/2 ROOT forwarding none 2 disable
# Run the display stp brief command on DeviceB to check the port role and
status. In MSTI 2, 10GE 1/0/1 and 10GE 1/0/2 on DeviceB are designated ports
because DeviceB is the root bridge. In MSTI 1, 10GE 1/0/1 on DeviceB is the
designated port and 10GE 1/0/2 on DeviceB is the root port.
[DeviceB] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding root 2 disable
0 10GE1/0/2 ROOT forwarding none 2 disable
1 10GE1/0/1 DESI forwarding root 2 disable
1 10GE1/0/2 ROOT forwarding none 2 disable
2 10GE1/0/1 DESI forwarding root 2 disable
2 10GE1/0/2 DESI forwarding none 2 disable
# Run the display stp interface brief command on DeviceC to check the port role
and status. 10GE 1/0/3 on DeviceC is the root port in MSTI 1 and MSTI 2. 10GE
1/0/2 on DeviceC is the blocked port in MSTI 2 and is the designated port in MSTI
1.
[DeviceC] display stp interface 10ge 1/0/3 brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/3 ROOT forwarding none 2 disable
1 10GE1/0/3 ROOT forwarding none 2 disable
2 10GE1/0/3 ROOT forwarding none 2 disable
[DeviceC] display stp interface 10ge 1/0/2 brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/2 DESI forwarding none 2 disable
1 10GE1/0/2 DESI forwarding none 2 disable
2 10GE1/0/2 ALTE discarding none 20000 disable
# Run the display stp interface brief command on DeviceD to check the port role
and status. 10GE 1/0/3 on DeviceD is the root port in MSTI 1 and MSTI 2. 10GE
1/0/2 on DeviceD is the blocked port in MSTI 1 and is the designated port in MSTI
2.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 2 to 20
#
stp instance 1 root primary
stp instance 2 root secondary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 to 20
#
stp instance 1 root secondary
stp instance 2 root primary
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 2 to 20
#
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
#
interface 10GE1/0/1
port link-type access
port default vlan 2
stp disable
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp instance 2 cost 20000
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 2 to 20
#
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
#
interface 10GE1/0/1
port link-type access
port default vlan 11
stp disable
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp instance 1 cost 20000
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
return
Networking Requirements
On the network shown in Figure 3-48, hosts access the Internet through DeviceC,
which is uplinked to DeviceA and DeviceB through redundant links. However, these
links cause a loop that may lead to broadcast storms and damage MAC address
entries. It is therefore required that the loop be prevented while redundant links
are available. In this way, if one uplink is disconnected, traffic can be switched to
the other uplink for forwarding, and network bandwidth can be efficiently used.
MSTP can be deployed to prevent the loop. It blocks redundant links on the Layer
2 network and prunes the network into a tree topology. In addition, VRRP can be
configured on DeviceA and DeviceB. HostA then uses DeviceA as the default
gateway to access the Internet, and DeviceB functions as the backup gateway.
Conversely, HostB uses DeviceB as the default gateway to access the Internet, and
DeviceA functions as the backup gateway. This provides high reliability while
ensuring traffic load balancing.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic MSTP functions on the devices on the ring network, including:
a. Configure an MST region and create multiple MSTIs. Map VLAN 2 to
MSTI 1 and map VLAN 3 to MSTI 2 to balance traffic.
b. Configure the root bridge and secondary root bridge for each MSTI in the
MST region.
c. Configure an appropriate path cost for an interface in each MSTI so that
the interface can be blocked.
d. Enable MSTP to prevent loops, including:
Procedure
Step 1 Configure basic MSTP functions.
1. On DeviceA, DeviceB, and DeviceC, configure an MST region named RG1 and
create MSTI 1 and MSTI 2.
# Configure an MST region on DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
– The path cost range varies depending on which standard is used to calculate the
path cost. This example uses the Huawei legacy standard and requires a path cost
of 20000 for the interfaces to be blocked in MSTI 1 and MSTI 2.
– Devices on the same network must use the same standard to calculate the path
costs of their interfaces.
# Configure DeviceA to use the Huawei legacy standard to calculate the path
costs of the desired interfaces.
[DeviceA] stp pathcost-standard legacy
# Configure DeviceB to use the Huawei legacy standard to calculate the path
costs of the desired interfaces.
[DeviceB] stp pathcost-standard legacy
# Configure DeviceC to use the Huawei legacy standard to calculate the path
costs of the desired interfaces, and set the path cost of 10GE1/0/1 in MSTI 2
and 10GE1/0/4 in MSTI 1 to 20000.
[DeviceC] stp pathcost-standard legacy
[DeviceC] interface 10ge1/0/1
NOTE
Step 2 Configure protection functions. For example, configure root protection for the
designated ports of the root bridge in each MSTI.
After the preceding configurations are complete and the network becomes stable,
perform the following operations to verify the configuration.
NOTE
This example uses MSTI 1 and MSTI 2. As such, you do not need to check the interface
status in MSTI 0.
# Run the display stp brief command on DeviceA to check the interface status
and protection type. The displayed information is as follows:
[DeviceA] display stp brief
MSTID Port Role STP State Protection
0 10GE1/0/1 DESI FORWARDING ROOT
0 10GE1/0/2 DESI FORWARDING NONE
1 10GE1/0/1 DESI FORWARDING ROOT
1 10GE1/0/2 DESI FORWARDING NONE
2 10GE1/0/1 DESI FORWARDING ROOT
2 10GE1/0/2 ROOT FORWARDING NONE
In MSTI 2, DeviceB is the root bridge; therefore, 10GE1/0/1 and 10GE1/0/2 become
the designated ports. In MSTI 1, 10GE1/0/1 on DeviceB becomes the designated
port and 10GE1/0/2 the root port.
# Run the display stp interface brief command on DeviceC. The displayed
information is as follows:
[DeviceC] display stp interface 10ge1/0/1 brief
MSTID Port Role STP State Protection
0 10GE1/0/1 ROOT FORWARDING NONE
1 10GE1/0/1 ROOT FORWARDING NONE
2 10GE1/0/1 ALTE DISCARDING NONE
[DeviceC] display stp interface 10ge1/0/4 brief
MSTID Port Role STP State Protection
0 10GE1/0/4 ALTE DISCARDING NONE
1 10GE1/0/4 ALTE DISCARDING NONE
2 10GE1/0/4 ROOT FORWARDING NONE
# Create VRRP group 1 on DeviceA and DeviceB, and set the VRRP priority to 120
and preemption delay to 20s on DeviceA, which then becomes the master device.
[DeviceA] interface vlanif 2
[DeviceA-Vlanif2] vrrp vrid 1 virtual-ip 10.1.2.100
[DeviceA-Vlanif2] vrrp vrid 1 priority 120
[DeviceA-Vlanif2] vrrp vrid 1 preempt timer delay 20
[DeviceA-Vlanif2] quit
# Use the default VRRP priority for DeviceB, which functions as the backup device.
[DeviceB] interface vlanif 2
[DeviceB-Vlanif2] vrrp vrid 1 virtual-ip 10.1.2.100
[DeviceB-Vlanif2] quit
# Create VRRP group 2 on DeviceA and DeviceB, and set the VRRP priority to 120
and preemption delay to 20s on DeviceB, which then becomes the master device.
[DeviceB] interface vlanif 3
[DeviceB-Vlanif3] vrrp vrid 2 virtual-ip 10.1.3.100
[DeviceB-Vlanif3] vrrp vrid 2 priority 120
[DeviceB-Vlanif3] vrrp vrid 2 preempt timer delay 20
[DeviceB-Vlanif3] quit
# Use the default VRRP priority for DeviceA, which functions as the backup device.
[DeviceA] interface vlanif 3
[DeviceA-Vlanif3] vrrp vrid 2 virtual-ip 10.1.3.100
[DeviceA-Vlanif3] quit
# Set the virtual IP address 10.1.2.100 of VRRP group 1 as the default gateway of
HostA and the virtual IP address 10.1.3.100 of VRRP group 2 as the default
gateway of HostB.
# After completing the preceding configurations, run the display vrrp command
on DeviceA. The command output shows that DeviceA functions as the master
device in VRRP group 1 and backup device in VRRP group 2.
# Run the display vrrp command on DeviceB. The command output shows that
DeviceB functions as the backup device in VRRP group 1 and master device in
VRRP group 2.
[DeviceB] display vrrp
Vlanif2 | Virtual Router 1
State : Backup
Virtual IP : 10.1.2.100
Master IP : 10.1.2.102
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 00e0-fc12-3456
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2021-05-11 11:39:18
Last change time : 2021-05-26 11:38:58
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 00e0-fc12-3457
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2021-05-11 11:40:18
Last change time : 2021-05-26 11:48:58
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 2 to 4
#
stp instance 1 root primary
stp instance 2 root secondary
stp bpdu-protection
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2
instance 2 vlan 3
#
interface Vlanif2
ip address 10.1.2.102 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.2.100
vrrp vrid 1 priority 120
vrrp vrid 1 preempt timer delay 20
#
interface Vlanif3
ip address 10.1.3.102 255.255.255.0
vrrp vrid 2 virtual-ip 10.1.3.100
#
interface Vlanif4
ip address 10.1.4.102 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp root-protection
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 4
stp edged-port enable
#
ospf 1
area 0.0.0.0
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
network 10.1.4.0 0.0.0.255
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 2 to 3 5
#
stp instance 1 root secondary
stp instance 2 root primary
stp bpdu-protection
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2
instance 2 vlan 3
#
interface Vlanif2
ip address 10.1.2.103 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.2.100
#
interface Vlanif3
ip address 10.1.3.103 255.255.255.0
vrrp vrid 2 virtual-ip 10.1.3.100
vrrp vrid 2 priority 120
vrrp vrid 2 preempt timer delay 20
#
interface Vlanif5
ip address 10.1.5.103 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp root-protection
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 5
stp edged-port enable
#
ospf 1
area 0.0.0.0
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
network 10.1.5.0 0.0.0.255
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 2 to 3
#
stp bpdu-protection
stp pathcost-standard legacy
#
stp region-configuration
region-name RG1
instance 1 vlan 2
instance 2 vlan 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp instance 2 cost 20000
#
interface 10GE1/0/2
port link-type access
port default vlan 2
stp edged-port enable
#
interface 10GE1/0/3
port link-type access
port default vlan 3
stp edged-port enable
#
interface 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp instance 1 cost 20000
#
return
3.1.6.5 VBST
Networking Requirements
In Figure 3-49, DeviceC and DeviceD are dual-homed to DeviceA and DeviceB,
respectively, forming a ring network. DeviceC transmits traffic from VLAN 10 and
VLAN 20, and DeviceD transmits traffic from VLAN 20 and VLAN 30. The customer
wants to deploy VBST on such a network to fulfill the following requirements:
Service traffic in each VLAN is correctly forwarded and service traffic from
different VLANs is load balanced to improve link efficiency.
In this example, interfaces 1, 2, 3, 4, and 5 represent 10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/3,
10GE 1/0/4, and 10GE 1/0/5 respectively.
Procedure
Step 1 Create required VLANs on devices.
#On DeviceB, add 10GE 1/0/1 to VLAN 10, VLAN 20, and VLAN 30, 10GE 1/0/2 to
VLAN 10 and VLAN 20, and 10GE 1/0/3 to VLAN 20 and VLAN 30.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 10 20 30
[DeviceB-10GE1/0/1] undo port trunk allow-pass vlan 1
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] portswitch
[DeviceB-10GE1/0/2] port link-type trunk
[DeviceB-10GE1/0/2] port trunk allow-pass vlan 10 20
[DeviceB-10GE1/0/2] undo port trunk allow-pass vlan 1
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] portswitch
[DeviceB-10GE1/0/3] port link-type trunk
[DeviceB-10GE1/0/3] port trunk allow-pass vlan 20 30
[DeviceB-10GE1/0/3] undo port trunk allow-pass vlan 1
[DeviceB-10GE1/0/3] quit
#On DeviceC, add 10GE 1/0/2 to VLAN 10 and VLAN 20, 10GE 1/0/3 to VLAN 10
and VLAN 20, 10GE 1/0/4 to VLAN 10, and 10GE 1/0/5 to VLAN 20.
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] portswitch
[DeviceC-10GE1/0/2] port link-type trunk
[DeviceC-10GE1/0/2] port trunk allow-pass vlan 10 20
[DeviceC-10GE1/0/2] undo port trunk allow-pass vlan 1
[DeviceC-10GE1/0/2] quit
[DeviceC] interface 10ge 1/0/3
[DeviceC-10GE1/0/3] portswitch
[DeviceC-10GE1/0/3] port link-type trunk
[DeviceC-10GE1/0/3] port trunk allow-pass vlan 10 20
[DeviceC-10GE1/0/3] undo port trunk allow-pass vlan 1
[DeviceC-10GE1/0/3] quit
[DeviceC] interface 10ge 1/0/4
[DeviceC-10GE1/0/4] portswitch
[DeviceC-10GE1/0/4] port link-type access
[DeviceC-10GE1/0/4] port default vlan 10
[DeviceC-10GE1/0/4] quit
[DeviceC] interface 10ge 1/0/5
[DeviceC-10GE1/0/5] portswitch
[DeviceC-10GE1/0/5] port link-type access
#On DeviceD, add 10GE 1/0/2 to VLAN 20 and VLAN 30, 10GE 1/0/3 to VLAN 20
and VLAN 30, 10GE 1/0/4 to VLAN 20, and 10GE 1/0/5 to VLAN 30.
[DeviceD] interface 10ge 1/0/2
[DeviceD-10GE1/0/2] portswitch
[DeviceD-10GE1/0/2] port link-type trunk
[DeviceD-10GE1/0/2] port trunk allow-pass vlan 20 30
[DeviceD-10GE1/0/2] undo port trunk allow-pass vlan 1
[DeviceD-10GE1/0/2] quit
[DeviceD] interface 10ge 1/0/3
[DeviceD-10GE1/0/3] portswitch
[DeviceD-10GE1/0/3] port link-type trunk
[DeviceD-10GE1/0/3] port trunk allow-pass vlan 20 30
[DeviceD-10GE1/0/3] undo port trunk allow-pass vlan 1
[DeviceD-10GE1/0/3] quit
[DeviceD] interface 10ge 1/0/4
[DeviceD-10GE1/0/4] portswitch
[DeviceD-10GE1/0/4] port link-type access
[DeviceD-10GE1/0/4] port default vlan 20
[DeviceD-10GE1/0/4] quit
[DeviceD] interface 10ge 1/0/5
[DeviceD-10GE1/0/5] portswitch
[DeviceD-10GE1/0/5] port link-type access
[DeviceD-10GE1/0/5] port default vlan 30
[DeviceD-10GE1/0/5] quit
Step 4 Configure the root bridges and secondary root bridges in VLANs.
# Configure DeviceA as the root bridge in VLAN 10.
[DeviceA] stp vlan 10 root primary
Step 5 Configure a proper path cost for a port in corresponding VLANs so that the port
will be blocked.
NOTE
● The path cost range varies depending on the path cost calculation method. In this
example, setting the path cost to 2000000 for blocking interfaces complies with the
default IEEE 802.1t calculation method.
● All devices on a network must use the same path cost calculation method.
# Set the path cost of 10GE 1/0/2 on DeviceC to 2000000 in VLAN 10 and VLAN
20.
[DeviceC] interface 10ge 1/0/2
[DeviceC-10GE1/0/2] stp vlan 10 cost 2000000
[DeviceC-10GE1/0/2] stp vlan 20 cost 2000000
[DeviceC-10GE1/0/2] quit
# Set the path cost of 10GE 1/0/2 on DeviceD to 2000000 in VLAN 20 and VLAN
30.
[DeviceD] interface 10ge 1/0/2
[DeviceD-10GE1/0/2] stp vlan 20 cost 2000000
[DeviceD-10GE1/0/2] stp vlan 30 cost 2000000
[DeviceD-10GE1/0/2] quit
----End
# Run the display stp vlan information brief command on DeviceA, DeviceB,
DeviceC, and DeviceD to check the port status. The command output on DeviceA
is used as an example. DeviceA participates in spanning tree calculation in VLAN
10, VLAN 20, and VLAN 30. DeviceA is the root bridge in both VLAN 10 and VLAN
20, so 10GE 1/0/1 and 10GE 1/0/3 are elected as the designated ports in VLAN 10
whereas 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3 are elected as the designated
ports in VLAN 20. DeviceA is the secondary root bridge in VLAN 30, so 10GE 1/0/1
and 10GE 1/0/2 are elected as the root port and designated port, respectively, in
VLAN 30.
[DeviceA] display stp vlan information brief
--------------------------------------------------------------------------------
VLANID Interface Role STPState Protection Cost Edged
--------------------------------------------------------------------------------
10 10GE1/0/1 DESI forwarding none 200 disable
10 10GE1/0/3 DESI forwarding none 200 disable
20 10GE1/0/1 DESI forwarding none 200 disable
20 10GE1/0/2 DESI forwarding none 200 disable
20 10GE1/0/3 DESI forwarding none 200 disable
30 10GE1/0/1 ROOT forwarding none 200 disable
30 10GE1/0/2 DESI forwarding none 200 disable
--------------------------------------------------------------------------------
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
stp vlan 10 20 root primary
stp vlan 30 root secondary
#
vlan batch 10 20 30
#
stp mode vbst
#
interface 10GE1/0/1
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 30
#
interface 10GE1/0/2
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30
#
interface 10GE1/0/3
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20
#
return
● DeviceB
#
sysname DeviceB
#
stp vlan 10 20 root secondary
stp vlan 30 root primary
#
vlan batch 10 20 30
#
stp mode vbst
#
interface 10GE1/0/1
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20 30
#
interface 10GE1/0/2
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20
#
interface 10GE1/0/3
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 10 20
#
stp mode vbst
#
interface 10GE1/0/2
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20
stp vlan 10 20 cost 2000000
#
interface 10GE1/0/3
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 10 20
#
interface 10GE1/0/4
portswitch
port default vlan 10
#
interface 10GE1/0/5
portswitch
port default vlan 20
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 20 30
#
stp mode vbst
#
interface 10GE1/0/2
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 20 30
stp vlan 20 30 cost 2000000
#
interface 10GE1/0/3
portswitch
port link-type trunk
undo port trunk allow-pass vlan 1
Networking Requirements
As shown in Figure 3-50, Device is connected to the server through 10GE 1/0/3, to
HostA and HostB in VLAN 10 through 10GE 1/0/1, and to HostC and HostD in
VLAN 20 through 10GE 1/0/2. In this scenario, the following ARP attacks may
occur:
● If the server is attacked, it may send a large number of packets with
unreachable destination IP addresses.
● If HostA is attacked, it may send a large number of bogus ARP messages with
different source IP addresses.
● If HostC is attacked, it may send a large number of ARP messages with fixed
source IP addresses.
● If HostD is attacked, it may send a large number of ARP messages with
unreachable destination IP addresses.
To prevent these attacks, configure ARP security on Device.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure strict ARP learning globally so that the device learns only address
information carried in the ARP reply messages in response to the ARP request
messages that the device itself sends.
2. Configure ARP entry limiting on an interface to enable the device to limit the
number of ARP entries that the interface can learn, preventing an ARP entry
overflow.
3. Configure fixed ARP to prevent attackers from sending bogus ARP messages
to modify ARP entries.
4. Configure rate limiting on ARP messages to limit the number of ARP
messages processed per second, reducing system overheads.
5. Configure rate limiting on ARP Miss messages to limit the number of ARP
Miss messages processed per second, reducing system overheads. In addition,
ensure that the device can process a large number of ARP Miss messages
from the server.
Data Preparation
To complete the configuration, you need the following data:
● Limit on the number of ARP entries that an interface can learn: 20
● Mode of fixed ARP: fixed-mac
● Rate limit for ARP messages: 15
● Rate limit for ARP Miss messages: 30 for HostD; 20 for other hosts; 50 for the
server
Procedure
Step 1 Configure IP addresses and routing protocols for the interfaces. For detailed
configurations, see Configuration Scripts.
Step 2 Configure strict ARP learning.
<HUAWEI> system-view
[HUAWEI] sysname Device
[Device] arp learning strict
# Configure an ARP entry limit for 10GE 1/0/2 and 10GE 1/0/3. For configuration
details, see the configuration of 10GE 1/0/1.
Step 4 Configure fixed ARP.
[Device] arp anti-attack entry-check fixed-mac enable
----End
# Run the display arp limit interface command to check the ARP entry limit
configured on 10GE 1/0/1.
<HUAWEI> display arp limit interface 10ge1/0/1
Interface VLAN Limit Learnt
---------------------------------------------------------------------------
10GE1/0/1 10 20 0
---------------------------------------------------------------------------
Total:1
# Run the display arp miss anti-attack rate-limit command to check the rate
limits configured for ARP Miss messages.
<HUAWEI> display arp miss anti-attack rate-limit
Global ARP miss rate-limit : 500 (0 means no limit)
# Run the display arp packet statistics command to check ARP message
statistics.
<HUAWEI> display arp packet statistics
ARP Packets Received
Total: 154333
Learnt Count: 8
Discard For Entry Limit: 5
Discard For Speed Limit: 0
Discard For Proxy Suppress: 0
Discard For Other: 151597
ARP Packets Sent
Total: 0
Request: 0
Reply: 0
Gratuitous ARP: 0
ARP-Miss Message Received:
Total: 0
Discard For Speed Limit: 0
Discard For Other: 3
Configuration Scripts
Device
#
sysname Device
#
vlan batch 10 20 30
#
arp learning strict
arp anti-attack entry-check fixed-mac enable
arp anti-attack rate-limit source-ip maximum 15
arp miss anti-attack rate-limit source-ip 10.10.10.10 maximum 30
arp miss anti-attack rate-limit source-ip maximum 20
arp miss anti-attack rate-limit source-ip 10.20.20.20 maximum 50
#
interface Vlanif10
ip address 10.9.9.1 255.255.255.0
#
interface Vlanif20
ip address 10.10.10.1 255.255.255.0
#
interface Vlanif30
ip address 10.20.20.1 255.255.255.0
#
interface 10GE1/0/1
arp limit vlan 10 20
#
interface 10GE1/0/2
arp limit vlan 20 20
#
interface 10GE1/0/3
arp limit vlan 30 20
#
return
Networking Requirements
As shown in Figure 3-51, DeviceA connects to the DHCP server through
10GE1/0/4, connects to DHCP clients UserA and UserB through 10GE1/0/1 and
10GE1/0/2 respectively, and connects to UserC with a static IP address through
10GE1/0/3. 10GE1/0/1, 10GE1/0/2, 10GE1/0/3, and 10GE1/0/4 of DeviceA all
belong to VLAN 10. An administrator wants to defend against ARP MITM attacks
and theft of authorized users' data, and wants to learn the frequency and scope of
these attacks.
Configuration Roadmap
1. Enable DAI on DeviceA so that it compares the source IP address, source MAC
address, VLAN, and interface information in a received ARP message with
DHCP snooping binding entries. This defends against ARP MITM attacks.
2. Enable the alarm function for the ARP messages discarded by DAI on DeviceA.
After the function is enabled, DeviceA counts the number of ARP messages
discarded because they do not match DHCP snooping binding entries, and
generates an alarm when the number of discarded ARP messages exceeds the
alarm threshold. The administrator can then learn the frequency and scope of
the current ARP MITM attacks based on the alarm and the number of
discarded ARP messages.
3. Enable DHCP snooping and configure a static binding entry on DeviceA for
DAI to take effect.
Procedure
Step 1 Create a VLAN and add interfaces to it.
# Create VLAN 10, and add 10GE1/0/1, 10GE1/0/2, 10GE1/0/3, and 10GE1/0/4 to
it.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10
[DeviceA] interface 10GE 1/0/1
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10GE 1/0/2
[DeviceA-10GE1/0/2] port link-type access
[DeviceA-10GE1/0/2] port default vlan 10
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10GE 1/0/3
[DeviceA-10GE1/0/3] port link-type access
[DeviceA-10GE1/0/3] port default vlan 10
[DeviceA-10GE1/0/3] quit
[DeviceA-10GE1/0/4] interface 10GE 1/0/4
[DeviceA-10GE1/0/4] port link-type trunk
[DeviceA-10GE1/0/4] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/4] quit
Step 2 Enable DAI and the alarm function for ARP messages discarded by DAI.
# Enable DAI and the alarm function for ARP messages discarded by DAI on
10GE1/0/1, 10GE1/0/2, and 10GE1/0/3.
[DeviceA] interface 10GE 1/0/1
[DeviceA-10GE1/0/1] arp anti-attack check user-bind enable
[DeviceA-10GE1/0/1] arp anti-attack check user-bind alarm enable
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10GE 1/0/2
[DeviceA-10GE1/0/2] arp anti-attack check user-bind enable
[DeviceA-10GE1/0/2] arp anti-attack check user-bind alarm enable
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10GE 1/0/3
[DeviceA-10GE1/0/3] arp anti-attack check user-bind enable
[DeviceA-10GE1/0/3] arp anti-attack check user-bind alarm enable
[DeviceA-10GE1/0/3] quit
# Enable DHCP snooping and configure 10GE1/0/4 connected to the DHCP server
as a trusted interface.
[DeviceA] dhcp enable
[DeviceA] dhcp snooping enable
[DeviceA] vlan 10
[DeviceA-vlan10] dhcp snooping enable
[DeviceA-vlan10] quit
[DeviceA] interface 10GE 1/0/4
----End
# Run the display arp anti-attack statistics check user-bind interface command
to check the number of ARP messages discarded by DAI. 10GE1/0/1 is used as an
example.
[DeviceA] display arp anti-attack statistics check user-bind interface 10GE 1/0/1
--------------------------------------------------------------------------------
Type View Total Dropped Last Dropped
--------------------------------------------------------------------------------
Interface 10GE1/0/1 966 605
--------------------------------------------------------------------------------
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10
#
dhcp enable
#
dhcp snooping enable
user-bind static ip-address 10.0.0.2 mac-address 00e0-fc12-3456 interface 10GE1/0/3 vlan 10
#
vlan 10
dhcp snooping enable
#
interface 10GE1/0/1
port link-type access
port default vlan 10
arp anti-attack check user-bind enable
arp anti-attack check user-bind alarm enable
#
interface 10GE1/0/2
port link-type access
port default vlan 10
arp anti-attack check user-bind enable
arp anti-attack check user-bind alarm enable
#
interface 10GE1/0/3
port link-type access
port default vlan 10
arp anti-attack check user-bind enable
arp anti-attack check user-bind alarm enable
#
interface 10GE1/0/4
port link-type trunk
3.1.7.2 DHCPv4
Networking Requirements
As shown in Figure 3-52, DeviceA functions as a DHCPv4 server; the PCs on
network segment 10.1.1.0/24 are fixed terminals; network segment 10.1.2.0/24 is
used for the terminals' temporary access. To facilitate unified management, the
administrator requires the terminals to automatically obtain IPv4 addresses and
the IPv4 address of the DNS server (if users need to access the network using
domain names, a DNS server must be configured). A PC named Client_1 requires a
fixed IPv4 address of 10.1.1.100/24 to meet service requirements.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Set an IPv4 address lease to 30 days for the PCs (Client_1 to Client_n) on
network segment 10.1.1.0/24, and allocate a fixed IPv4 address of
10.1.1.100/24 to Client_1 statically.
2. Set an IPv4 address lease to two days for the PCs (Client_s to Client_t) on
network segment 10.1.2.0/24 for temporary access.
Procedure
Step 1 Enable DHCPv4.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] dhcp enable
----End
-------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------
10.1.1.1 10.1.1.254 253 100 153(0) 0 0
-------------------------------------------------------------------------------
[DeviceA] display ip pool interface vlanif11
Pool-name : Vlanif11
Pool-No :1
Lease : 2 Days 0 Hours 0 Minutes
Domain-name : huawei.com
DNS-server0 : 10.1.3.1
NBNS-server0 :-
Netbios-type :-
Position : Interface
Status : Unlocked
Gateway-0 : 10.1.2.1
Network : 10.1.2.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :253 Used :3
Idle :250 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------
10.1.2.1 10.1.1.254 253 3 250(0) 0 0
-------------------------------------------------------------------------------
# Check IPv4 address information on Client_1. You can check that Client_1 has
obtained the IPv4 address 10.1.1.100/24.
# Check IPv4 address information on other DHCPv4 clients. You can check that the
clients have obtained IPv4 addresses.
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10 11
#
dhcp enable
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
dhcp select interface
dhcp server gateway-list 10.1.1.1
dhcp server static-bind ip-address 10.1.1.100 mac-address 00e0-fc12-3456
dhcp server lease day 30 hour 0 minute 0
dhcp server dns-list 10.1.3.1
dhcp server domain-name huawei.com
#
interface Vlanif11
ip address 10.1.2.1 255.255.255.0
dhcp select interface
dhcp server gateway-list 10.1.2.1
dhcp server lease day 2 hour 0 minute 0
dhcp server dns-list 10.1.3.1
dhcp server domain-name huawei.com
#
interface 10GE1/0/1
port default vlan 10
#
interface 10GE1/0/2
port default vlan 11
#
return
3.1.7.2.2 Example for Configuring a DHCPv4 Server Based on a Global Address Pool
(Using a Layer 3 Ethernet Interface)
Networking Requirements
As shown in Figure 3-53, DeviceA functions as a DHCPv4 server; the PCs on
network segment 10.1.1.0/24 are fixed terminals; network segment 10.1.2.0/24 is
used for the terminals' temporary access. To facilitate unified management, the
administrator requires the terminals to automatically obtain IPv4 addresses and
the IPv4 address of the DNS server (if users need to access the network using
domain names, a DNS server must be configured). A PC named Client_1 requires a
fixed IPv4 address of 10.1.1.100/24 to meet service requirements.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Set an IPv4 address lease to 30 days for the PCs (Client_1 to Client_n) on
network segment 10.1.1.0/24, and allocate a fixed IPv4 address of
10.1.1.100/24 to Client_1 statically.
2. Set an IPv4 address lease to two days for the PCs (Client_s to Client_t) on
network segment 10.1.2.0/24 for temporary access.
Procedure
Step 1 Enable DHCPv4.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] dhcp enable
Step 4 Enable the DHCPv4 server function based on global address pools on Layer 3
Ethernet interfaces.
[DeviceA] interface 10GE 1/0/1
[DeviceA-10GE1/0/1] dhcp select global
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10GE 1/0/2
[DeviceA-10GE1/0/2] dhcp select global
[DeviceA-10GE1/0/2] quit
----End
Pool-name : pool1
Pool-No :7
Lease : 30 Days 0 Hours 0 Minutes
Domain-name : huawei.com
DNS-server0 : 10.1.3.1
NBNS-server0 :-
Netbios-type :-
Position : Local
Status : Unlocked
Gateway-0 : 10.1.1.1
Network : 10.1.1.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :253 Used :1
Idle :252 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
10.1.1.1 10.1.1.254 253 1 252(0) 0 0
-------------------------------------------------------------------------------------
[DeviceA] display ip pool name pool2
Pool-name : pool2
Pool-No :8
Lease : 2 Days 0 Hours 0 Minutes
Domain-name : huawei.com
DNS-server0 : 10.1.3.1
NBNS-server0 :-
Netbios-type :-
Position : Local
Status : Unlocked
Gateway-0 : 10.1.2.1
Network : 10.1.2.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :253 Used :0
Idle :253 Expired :0
Conflict :0 Disabled :0
-------------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------------
10.1.2.1 10.1.2.254 253 0 253(0) 0 0
-------------------------------------------------------------------------------------
# Check IPv4 address information on Client_1. You can check that Client_1 has
obtained the IPv4 address 10.1.1.100/24.
# Check IPv4 address information on other DHCPv4 clients. You can check that the
clients have obtained IPv4 addresses.
Configuration Scripts
DeviceA
#
sysname DeviceA
#
dhcp enable
#
ip pool pool1
gateway-list 10.1.1.1
network 10.1.1.0 mask 255.255.255.0
static-bind ip-address 10.1.1.100 mac-address 00e0-fc12-3456
lease day 30 hour 0 minute 0
dns-list 10.1.3.1
domain-name huawei.com
#
ip pool pool2
gateway-list 10.1.2.1
network 10.1.2.0 mask 255.255.255.0
lease day 2 hour 0 minute 0
dns-list 10.1.3.1
domain-name huawei.com
#
interface 10GE1/0/1
undo portswitch
ip address 10.1.1.1 255.255.255.0
dhcp select global
#
interface 10GE1/0/2
undo portswitch
ip address 10.1.2.1 255.255.255.0
dhcp select global
#
return
Networking Requirements
As shown in Figure 3-54, DeviceA functions as a DHCPv4 client and needs to
obtain information such as an IPv4 address, DNS server address, and gateway
address from DeviceB functioning as a DHCPv4 server.
Procedure
Step 1 Configure the DHCPv4 client function on DeviceA.
# Create VLAN 10 and add 10GE 1/0/1 to VLAN 10.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
Step 2 Create a global address pool on DeviceB and configure network parameters.
1. Enable DHCPv4.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] dhcp enable
4. Enable the DHCPv4 server function based on the global address pool on
VLANIF 10.
[DeviceB] interface vlanif 10
[DeviceB-Vlanif10] ip address 192.168.1.1 24
[DeviceB-Vlanif10] dhcp select global
[DeviceB-Vlanif10] quit
----End
# Run the display ip pool name pool1 command on DeviceB to check IPv4
address allocation in the global address pool. The Used field value indicates the
number of allocated IPv4 addresses.
[DeviceB] display ip pool name pool1
Pool-name : pool1
Pool-No :0
Lease : 1 Days 0 Hours 0 Minutes
Domain-name :-
DNS-server0 : 192.168.1.2
NBNS-server0 :-
Netbios-type :-
Position : Local
Status : Unlocked
Gateway-0 : 192.168.1.126
Network : 192.168.1.0
Mask : 255.255.255.0
VPN instance : --
Logging : Disable
Conflicted address recycle interval: -
Address Statistic: Total :253 Used :1
Idle :251 Expired :0
Conflict :0 Disabled :1
-------------------------------------------------------------------------------
Network section
Start End Total Used Idle(Expired) Conflict Disabled
-------------------------------------------------------------------------------
192.168.1.1 192.168.1.254 253 1 251(0) 0 1
-------------------------------------------------------------------------------
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 10
#
interface Vlanif10
ip address dhcp-alloc
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 10
#
dhcp enable
#
ip pool pool1
gateway-list 192.168.1.126
network 192.168.1.0 mask 255.255.255.0
excluded-ip-address 192.168.1.1 192.168.1.2
dns-list 192.168.1.2
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
dhcp select global
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
Context
As shown in Figure 3-55, the DHCPv4 server and clients are on different network
segments. A DHCPv4 relay agent must be configured to enable the DHCPv4 clients
to dynamically obtain IPv4 addresses.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Configure connectivity between devices.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 100 200
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type hybrid
[DeviceA-10GE1/0/1] port hybrid pvid vlan 200
[DeviceA-10GE1/0/1] port hybrid untagged vlan 200
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type hybrid
[DeviceA-10GE1/0/2] port hybrid pvid vlan 100
[DeviceA-10GE1/0/2] port hybrid untagged vlan 100
[DeviceA-10GE1/0/2] quit
[DeviceA] interface vlanif 200
[DeviceA-Vlanif200] ip address 10.10.20.1 24
[DeviceA-Vlanif200] quit
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 200
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type hybrid
[DeviceB-10GE1/0/1] port hybrid pvid vlan 200
[DeviceB-10GE1/0/1] port hybrid untagged vlan 200
[DeviceB-10GE1/0/1] quit
[DeviceB] interface vlanif 200
[DeviceB-Vlanif200] ip address 10.10.20.2 24
[DeviceB-Vlanif200] quit
----End
# Check IPv4 address information on DHCPv4 clients to confirm that they have
obtained IPv4 addresses.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 100 200
#
dhcp enable
#
interface Vlanif100
ip address 10.20.20.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.10.20.2
#
interface Vlanif200
ip address 10.10.20.1 255.255.255.0
#
interface 10GE1/0/1
port link-type hybrid
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface 10GE1/0/2
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
ip route-static 0.0.0.0 0.0.0.0 10.10.20.2
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 200
#
dhcp enable
#
ip pool pool1
gateway-list 10.20.20.1
network 10.20.20.0 mask 255.255.255.0
option121 ip-address 10.10.20.0 24 10.20.20.1
#
interface Vlanif200
ip address 10.10.20.2 255.255.255.0
dhcp select global
#
interface 10GE1/0/1
port link-type hybrid
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
ip route-static 10.20.20.0 255.255.255.0 10.10.20.1
#
return
Networking Requirements
As shown in Figure 3-56, a host (DHCPv4 client) in an enterprise is dual-homed
to DeviceA and DeviceB through DeviceC. DeviceA is the master device and
functions as a DHCPv4 server to allocate IPv4 addresses to clients. If DeviceA fails,
the client needs to obtain an IPv4 address through DeviceB (backup device).
In this example, interface 1, interface 2, interface 3, and interface 4 represent 10GE 1/0/1,
10GE 1/0/2, 10GE 1/0/3, and 10GE 1/0/4, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure IPv4 addresses for interfaces on DeviceA and DeviceB, and
configure Layer 2 transparent transmission on DeviceC to ensure network-
layer connectivity.
2. Configure a VRRP group on DeviceA and DeviceB. Configure a high priority for
DeviceA so that it functions as the master device to allocate IPv4 addresses to
clients. Configure a low priority for DeviceB so that it functions as the backup
device.
3. Create global address pools on DeviceA and DeviceB and configure attributes
for the address pools.
4. Configure a loop avoidance protocol (STP is used in this example) on DeviceA,
DeviceB, and DeviceC.
Procedure
Step 1 Configure connectivity between devices.
# Configure IPv4 addresses for interfaces on DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 100
[DeviceA] interface 10GE 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 100
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10GE 1/0/4
[DeviceA-10GE1/0/4] portswitch
[DeviceA-10GE1/0/4] port link-type trunk
[DeviceA-10GE1/0/4] port trunk allow-pass vlan 100
[DeviceA-10GE1/0/4] quit
[DeviceA] interface vlanif 100
[DeviceA-Vlanif100] ip address 10.1.1.1 24
[DeviceA-Vlanif100] quit
NOTE
Information about the address pool on the master device cannot be backed up to the
backup device in real time. To prevent IPv4 address conflicts after a master/backup device
switchover, the address pool ranges on the master and backup devices must not overlap.
[DeviceA] dhcp enable
[DeviceA] ip pool pool1
[DeviceA-ip-pool-pool1] network 10.1.1.0 mask 255.255.255.0
[DeviceA-ip-pool-pool1] gateway-list 10.1.1.111
[DeviceA-ip-pool-pool1] excluded-ip-address 10.1.1.1
[DeviceA-ip-pool-pool1] excluded-ip-address 10.1.1.129 10.1.1.254
[DeviceA-ip-pool-pool1] lease day 10
[DeviceA-ip-pool-pool1] quit
# Create VRRP group 1 on DeviceB, set the priority of DeviceB in the VRRP group
to 100, and configure clients to obtain IPv4 addresses from the global address
pool.
[DeviceB] interface vlanif 100
[DeviceB-Vlanif100] vrrp vrid 1 virtual-ip 10.1.1.111
[DeviceB-Vlanif100] vrrp vrid 1 authentication-mode md5 YsH_2022
[DeviceB-Vlanif100] dhcp select global
[DeviceB-Vlanif100] quit
# Disable STP on DeviceC's 10GE 1/0/3 and set the path cost of 10GE 1/0/1 to
20000.
[DeviceC] interface 10GE 1/0/3
[DeviceC-10GE1/0/3] stp disable
[DeviceC-10GE1/0/3] quit
[DeviceC] interface 10GE 1/0/1
[DeviceC-10GE1/0/1] stp cost 20000
[DeviceC-10GE1/0/1] quit
----End
State : Master
Virtual IP : 10.1.1.111
Master IP : 10.1.1.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0s Remain : --
Hold Multiplier: 3
TimerRun : 1s
TimerConfig : 1s
Auth Type : MD5 Auth Key :
******
Virtual MAC : 00e-fc00-0101
Check TTL : YES
Config Type : Normal
Create Time : 2020-05-12 16:22:11
Last Change Time : 2020-05-12 16:22:11
[DeviceB] display vrrp verbose
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.111
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0s Remain : --
Hold Multiplier: 3
TimerRun : 1s
TimerConfig : 1s
Auth Type : MD5 Auth Key :
******
Virtual MAC : 00e-fc00-0101
Check TTL : YES
Config Type : Normal
Create Time : 2020-05-12 16:22:11
Last Change Time : 2020-05-12 16:22:11
# Run the display ip pool command on DeviceA and DeviceB to check IPv4
address allocation in the address pools. The command outputs show that DeviceA
has allocated an IPv4 address to the DHCPv4 client but DeviceB does not.
[DeviceA] display ip pool
-------------------------------------------------------------------------------
Pool-name : pool1
Pool-No :0
Lease : 10 Days 0 Hours 0 Minutes
Position : Local
Status : Unlocked
Gateway-0 : 10.1.1.111
Network : 10.1.1.0
Mask : 255.255.255.0
VPN instance : --
Conflicted address recycle interval: -
Address Statistic: Total :253 Used :1
Idle :125 Expired :0
Conflict :0 Disabled :127
IP address Statistic
Total :253
Used :1 Idle :125
Expired :0 Conflict :0 Disabled :127
[DeviceB] display ip pool
-------------------------------------------------------------------------------
Pool-name : pool1
Pool-No :0
Lease : 10 Days 0 Hours 0 Minutes
Position : Local
Status : Unlocked
Gateway-0 : 10.1.1.111
Network : 10.1.1.0
Mask : 255.255.255.0
VPN instance : --
Address Statistic: Total :253 Used :0
Idle :125 Expired :0
Conflict :0 Disabled :128
IP address Statistic
Total :253
Used :0 Idle :125
Expired :0 Conflict :0 Disabled :128
# Run the shutdown command on DeviceA's 10GE 1/0/2 and 10GE 1/0/4 to
simulate a fault on DeviceA. Then, run the display vrrp command on DeviceB to
check the VRRP status. The command output shows that the VRRP status of
DeviceB is Master.
[DeviceA] interface 10GE 1/0/2
[DeviceA-10GE1/0/2] shutdown
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10GE 1/0/4
[DeviceA-10GE1/0/4] shutdown
[DeviceA-10GE1/0/4] quit
[DeviceB] display vrrp verbose
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.111
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0s Remain : --
Hold Multiplier: 3
TimerRun : 1s
TimerConfig : 1s
Auth Type : NONE
Virtual MAC : 00e-fc00-0101
Check TTL : YES
Config Type : Normal
Create Time : 2020-05-12 16:27:11
Last Change Time : 2020-05-12 16:27:11
# Run the display ip pool command on DeviceB to check the configuration of the
global address pool.
[DeviceB] display ip pool
-------------------------------------------------------------------------------
Pool-name : pool1
Pool-No :0
Lease : 10 Days 0 Hours 0 Minutes
Position : Local
Status : Unlocked
Gateway-0 : 10.1.1.111
Network : 10.1.1.0
Mask : 255.255.255.0
VPN instance : --
Address Statistic: Total :253 Used :1
Idle :124 Expired :0
Conflict :0 Disabled :128
IP address Statistic
Total :253
Used :1 Idle :124
Expired :0 Conflict :0 Disabled :128
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 100
#
dhcp enable
#
ip pool pool1
gateway-list 10.1.1.111
network 10.1.1.0 mask 255.255.255.0
excluded-ip-address 10.1.1.1
excluded-ip-address 10.1.1.129 10.1.1.254
lease day 10 hour 0 minute 0
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.111
vrrp vrid 1 priority 120
vrrp vrid 1 authentication-mode md5 %+%##!!!!!!!!!"!!!!"!!!!*!!!!%M)\5[{0vYb}
[6P0eY{3bKEQAGvMD,>,NTS!!!!!2jp5!!!!!!9!!!!h*0u$6>G#Qrhz@F'+1JTXy!#3i=0.F!!!!!!!!!!%+%#
dhcp select global
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 100
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 100
#
dhcp enable
#
ip pool pool1
gateway-list 10.1.1.111
network 10.1.1.0 mask 255.255.255.0
excluded-ip-address 10.1.1.1 10.1.1.110
excluded-ip-address 10.1.1.112 10.1.1.129
lease day 10 hour 0 minute 0
#
interface Vlanif100
ip address 10.1.1.129 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.111
vrrp vrid 1 authentication-mode md5 %+%##!!!!!!!!!"!!!!"!!!!*!!!!%M)\5[{0vYb}
[6P0eY{3bKEQAGvMD,>,NTS!!!!!2jp5!!!!!!9!!!!h*0u$6>G#Qrhz@F'+1JTXy!#3i=0.F!!!!!!!!!!%+%#
dhcp select global
#
interface 10GE1/0/2
port link-type trunk
port trunk allow vlan 100
#
interface 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 100
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 100
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
stp instance 0 cost 20000
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/3
port link-type access
port default vlan 100
stp disable
#
return
Networking Requirements
As shown in Figure 3-57, DeviceA and DeviceB are Layer 2 switches, and DeviceC
is the user gateway that functions as the DHCP relay agent to forward DHCP
messages to the DHCP server, so that DHCP clients can obtain IP addresses and
related configurations from the DHCP server.
● Bogus DHCP server attack: An attacker deploys a DHCP server on the network
to allocate IP addresses and other network parameters to clients. If the DHCP
server allocates incorrect IP addresses and other network parameters to
clients, the network will be greatly affected.
● DHCP flood attack: If an attacker sends a large number of DHCP messages to
a device in a short period, device performance is impacted, and the device
may stop working.
● Bogus DHCP message attack: If an attacker pretends to be an authorized user
and continuously sends DHCPREQUEST messages to the DHCP server to
renew the IP address lease, the expired IP addresses cannot be reclaimed. As a
result, authorized users can no longer obtain IP addresses. If an attacker
pretends to be an authorized user and sends a DHCPRELEASE message to the
DHCP server, the authorized user will be disconnected unexpectedly.
● DHCP server DoS attack: If a large number of attackers apply for IP addresses
or an attacker continuously changes the CHADDR field to apply for IP
addresses from the DHCP server, IP addresses on the DHCP server are quickly
exhausted and authorized users can no longer obtain IP addresses.
To defend against DHCP attacks and provide a high-quality service for DHCP
users, configure the DHCP snooping function.
In this example, interfaces 1, 2, and 3 represent 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3,
respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure DHCP relay so that DeviceC forwards DHCP messages from
different network segments to the DHCP server.
2. Configure the basic DHCP snooping functions to prevent bogus DHCP server
attacks. Enable association between ARP and DHCP snooping to ensure that
the binding table is updated in real time when DHCP users are disconnected
unexpectedly. Configure the device to discard DHCP messages in which the
GIADDR field value is not 0 to prevent attacks initiated by unauthorized users.
3. Set the maximum rate of DHCP messages sent to the DHCP message
processing unit to prevent DHCP flood attacks. Enable the packet discarding
alarm function so that an alarm is generated when the number of discarded
DHCP messages reaches the alarm threshold.
4. Enable the device to check DHCP messages against the binding table to
prevent bogus DHCP message attacks. Configure the device to generate an
alarm when the number of DHCP messages discarded because they do not
match the binding table reaches the threshold.
5. Configure the maximum number of access users and enable the device to
check whether the CHADDR field value is the same as the source MAC
address in the header of a DHCPREQUEST message to prevent DHCP server
DoS attacks.
In this example, only the configuration on DeviceC is provided. The example does
not include detailed configurations for the DHCP server.
Procedure
1. Configure DHCP relay.
# Configure DHCP relay.
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
Configuration Scripts
DeviceC
#
sysname DeviceC
#
vlan batch 10 20
#
dhcp enable
#
dhcp snooping enable
#
interface Vlanif 10
ip address 10.0.0.1 255.255.255.0
dhcp select relay
#
interface Vlanif 20
ip address 10.1.1.1 255.255.255.0
#
interface 10GE 1/0/1
port default vlan 10
dhcp snooping enable
dhcp snooping check dhcp-giaddr enable
dhcp snooping check dhcp-request enable
dhcp snooping check dhcp-chaddr enable
dhcp snooping user-bind max-number 20
#
interface 10GE 1/0/2
port default vlan 10
dhcp snooping enable
dhcp snooping check dhcp-giaddr enable
dhcp snooping check dhcp-request enable
dhcp snooping check dhcp-chaddr enable
dhcp snooping user-bind max-number 20
#
interface 10GE 1/0/3
port default vlan 20
#
ip route-static 0.0.0.0 0.0.0.0 10.1.1.1
#
return
3.1.8 IP Routing
3.1.8.1.1 Example for Configuring Static Routes for Interworking Between Different
Network Segments
Precautions
● Communication between two devices is bidirectional. Therefore, reachable
routes must be available in both directions. To enable two devices to
communicate through static routes, configure a static route on the local
device and then configure a return route on the peer device.
● On an enterprise network with two egresses, two equal-cost static routes can
be configured for load balancing so that traffic can be evenly balanced
between two different links. Alternatively, two unequal-cost static routes can
be configured to work in primary/backup mode; if the primary link fails,
traffic is switched to the backup link.
Networking Requirements
On the network shown in Figure 3-58, hosts on different network segments are
connected through several Switches. It is required that any two hosts on different
network segments can communicate with each other when no dynamic routing
protocols are configured.
NOTE
In this example, interface1, interface2, and interface3 represent 10GE1/0/1, 10GE1/0/2, and
10GE1/0/3, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs, add interfaces to the VLANs, and configure IP addresses for
VLANIF interfaces, so that neighboring devices can communicate with each
other.
2. Configure an IP default gateway on each PC, and configure IPv4 static routes
or default static routes on the Devices so that any two PCs on different
network segments can communicate with each other.
Procedure
Step 1 Configure VLANs that interfaces belong to.
# Configure DeviceA. The configurations of DeviceB and DeviceC are similar to the
configuration of DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 30
[DeviceA] interface 10GE1/0/1
[[DeviceA]-10GE1/0/1] port link-type trunk
[[DeviceA]-10GE1/0/1] port trunk allow-pass vlan 10
[[DeviceA]-10GE1/0/1] quit
[[DeviceA]] interface 10GE1/0/2
[[DeviceA]-10GE1/0/2] port link-type access
[[DeviceA]-10GE1/0/2] port default vlan 30
[[DeviceA]-10GE1/0/2] quit
Set the default gateway addresses of PC1, PC2, and PC3 to 10.1.1.1, 10.1.2.1, and
10.1.3.1 respectively.
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 10 30
#
interface Vlanif10
ip address 10.1.4.1 255.255.255.252
#
interface Vlanif30
ip address 10.1.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 10
#
interface 10GE1/0/2
port link-type access
port default vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 10 20 40
#
interface Vlanif10
ip address 10.1.4.2 255.255.255.252
#
interface Vlanif20
ip address 10.1.4.5 255.255.255.252
#
interface Vlanif40
ip address 10.1.2.1 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 10
#
interface 10GE1/0/2
port link-type access
port default vlan 20
#
interface 10GE1/0/3
port link-type access
port default vlan 40
#
ip route-static 10.1.1.0 255.255.255.0 10.1.4.1
ip route-static 10.1.3.0 255.255.255.0 10.1.4.6
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 20 50
#
interface Vlanif20
ip address 10.1.4.6 255.255.255.252
#
interface Vlanif50
ip address 10.1.3.1 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 20
#
interface 10GE1/0/2
port link-type access
port default vlan 50
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.5
#
return
3.1.8.1.2 Example for Configuring IPv4 Static Routes to Implement Load Balancing
Networking Requirements
On the network shown in Figure 3-59, PC1 and PC2 are connected through four
Devices. As shown in the topology, data traffic can be transmitted from PC1 to
PC2 through two links: PC1 -> DeviceA -> DeviceB -> DeviceC -> PC2 and PC1 ->
DeviceA -> DeviceD -> DeviceC -> PC2. To fully use the links, it is required that the
data traffic from PC1 to PC2 be evenly distributed to the two links. If one link fails,
the data traffic is automatically switched to the other link.
NOTE
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Precautions
● Communication between two devices is bidirectional. Therefore, reachable
routes must be available in both directions. To enable two devices to
communicate through static routes, configure a static route on the local
device and then configure a return route on the peer device.
● On an enterprise network with two egresses, two equal-cost static routes can
be configured for load balancing so that traffic can be evenly balanced
between two different links. Alternatively, two unequal-cost static routes can
be configured to work in primary/backup mode; if the primary link fails,
traffic is switched to the backup link.
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs, add interfaces to the VLANs, and assign IP addresses to VLANIF
interfaces.
2. Configure round-trip static routes for data traffic forwarding.
3. Configure an IP address and default gateway on each host.
Procedure
Step 1 Configure VLANs that interfaces belong to.
# Configure DeviceA. The configurations of DeviceB, DeviceC, and DeviceD are
similar to the configuration of DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 100 400
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 100
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] port link-type trunk
[DeviceA-10GE1/0/3] port trunk allow-pass vlan 400
[DeviceA-10GE1/0/3] quit
Step 3 Configure static routes for traffic forwarding from PC1 to PC2.
# On DeviceA, configure two equal-cost static routes — one with the next hop
being DeviceB and the other with the next hop being DeviceD — to implement
load balancing.
[DeviceA] ip route-static 10.1.2.0 24 192.168.12.2
[DeviceA] ip route-static 10.1.2.0 24 192.168.14.2
# Configure DeviceB.
# Configure DeviceD.
[DeviceD] ip route-static 10.1.2.0 24 192.168.34.1
Step 4 Configure static routes for traffic forwarding from PC2 to PC1.
# On DeviceC, configure two equal-cost static routes — one with the next hop
being DeviceB and the other with the next hop being DeviceD — to implement
load balancing.
[DeviceC] ip route-static 10.1.1.0 24 192.168.23.1
[DeviceC] ip route-static 10.1.1.0 24 192.168.34.2
# Configure DeviceB.
[DeviceB] ip route-static 10.1.1.0 24 192.168.12.1
# Configure DeviceD.
[DeviceD] ip route-static 10.1.1.0 24 192.168.14.1
The IP routing table of DeviceA shows that there are two equal-cost routes to
network segment 10.1.2.0/24. In this case, data traffic is evenly distributed to the
two links, implementing load balancing.
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 10 100 400
#
interface Vlanif10
● DeviceD
#
sysname DeviceD
#
vlan batch 300 400
#
interface Vlanif300
ip address 192.168.34.2 255.255.255.0
#
interface Vlanif400
ip address 192.168.14.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 400
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 300
#
ip route-static 10.1.1.0 255.255.255.0 192.168.14.1
ip route-static 10.1.2.0 255.255.255.0 192.168.34.1
#
return
3.1.9 VPN
3.1.9.1.1 Example for Configuring Mutual Access Between Local IPv4 L3VPNs
Networking Requirements
As shown in Figure 3-60, CE1 and CE2 are connected to PE1. CE1 belongs to vpna,
and CE2 belongs to vpnb. It is required that Site 1 and Site 2 communicate with
each other. To meet this requirement, configure mutual access between local
VPNs.
In this example, interface 1 and interface 2 represent VLANIF 100 and VLANIF 200, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure VPN instances on PE1 and different VPN targets for the instances to
isolate VPNs.
2. On PE1, bind the interfaces connected to CEs to the VPN instances to provide
access for VPN users.
3. Import direct routes destined for local CEs into the VPN routing tables on PE1.
On each CE connected to PE1, configure a static route to the other local CE so
that both CEs can communicate with each other.
Procedure
Step 1 Configure VPN instances on PE1 and bind PE1 interfaces connected to CEs to the
corresponding VPN instances.
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 export-extcommunity
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 222:2 import-extcommunity
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] ip vpn-instance vpnb
[PE1-vpn-instance-vpnb] ipv4-family
[PE1-vpn-instance-vpnb-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 export-extcommunity
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 111:1 import-extcommunity
[PE1-vpn-instance-vpnb-af-ipv4] quit
[PE1-vpn-instance-vpnb] quit
[PE1] vlan batch 100 200
[PE1] interface 10ge 1/0/1
[PE1-10GE1/0/1] port link-type trunk
[PE1-10GE1/0/1] port trunk allow-pass vlan 100
[PE1-10GE1/0/1] quit
[PE1] interface Vlanif 100
[PE1-Vlanif100] ip binding vpn-instance vpna
[PE1-Vlanif100] ip address 10.1.1.2 24
[PE1-Vlanif100] quit
The PE can ping its connected CE. The following uses the ping between PE1 and
CE1 as an example.
[PE1] ping -vpn-instance vpna 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=2 ms
Step 2 Configure BGP and import the local direct routes destined for CEs to the VPN
routing table on PE1.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1-bgp-vpna] import-route direct
[PE1-bgp-vpna] quit
[PE1-bgp] ipv4-family vpn-instance vpnb
[PE1-bgp-vpnb] import-route direct
[PE1-bgp-vpnb] quit
[PE1-bgp] quit
# Configure CE2.
[CE2] ip route-static 10.1.1.0 24 10.2.1.2
----End
Configuration Scripts
● PE1
#
sysname PE1
#
vlan batch 100 200
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
vpn-target 222:2 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
● CE1
#
sysname CE1
#
vlan batch 100
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
ip route-static 10.2.1.0 255.255.255.0 10.1.1.2
#
return
● CE2
#
sysname CE2
#
vlan batch 100
#
interface Vlanif100
ip address 10.2.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
ip route-static 10.1.1.0 255.255.255.0 10.2.1.2
#
return
Networking Requirements
On the network shown in Figure 3-61:
● CE1 and CE3 belong to vpna.
● CE2 and CE4 belong to vpnb.
● The VPN targets of vpna are 111:1, and those of vpnb are 222:2.
Users in the same VPN can communicate with each other, but users in different
VPNs cannot.
In this example, interface 1, interface 2, and interface 3 represent VLANIF 100, VLANIF 200, and
VLANIF 300, respectively.
Precautions
Note the following during the configuration:
● On the same VPN, the export VPN target list of a site shares VPN targets with
the import VPN target lists of the other sites. Conversely, the import VPN
target list of a site shares VPN targets with the export VPN target lists of the
other sites.
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable OSPF on the backbone network to ensure that PEs can communicate.
2. Configure basic MPLS capabilities and MPLS LDP to establish LDP LSPs on the
backbone network.
3. Configure a VPN instance on each PE, enable the IPv4 address family for the
instance, and bind the interface that connects each PE to a CE to the VPN
instance on that PE.
4. Enable MP-IBGP on PEs to exchange VPN routing information.
5. Configure EBGP between CEs and PEs to exchange VPN routing information.
Procedure
Step 1 Configure IGP to achieve connectivity between devices, including PEs and the P, on
the MPLS backbone network. OSPF is used as IGP in this example.
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] vlan batch 100 200 300
[PE1] interface 10GE1/0/3
[PE1-10GE1/0/3] port link-type trunk
[PE1-10GE1/0/3] port trunk allow-pass vlan 300
[PE1-10GE1/0/3] quit
[PE1] interface Vlanif 300
[PE1-Vlanif300] ip address 11.11.11.1 24
[PE1-Vlanif300] quit
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 11.11.11.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure the P.
<HUAWEI> system-view
[HUAWEI] sysname P
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.9 32
[P-LoopBack1] quit
[P] vlan batch 100 200
[P] interface 10ge 1/0/1
[P-10GE1/0/1] port link-type trunk
[P-10GE1/0/1] port trunk allow-pass vlan 100
[P-10GE1/0/1] quit
[P] interface Vlanif 100
[P-Vlanif100] ip address 11.11.11.2 24
[P-Vlanif100] quit
[P] interface 10GE1/0/2
[P-10GE1/0/2] port link-type trunk
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.9 32
[PE2-LoopBack1] quit
[PE2] vlan batch 100 200 300
[PE2] interface 10GE1/0/3
[PE2-10GE1/0/3] port link-type trunk
[PE2-10GE1/0/3] port trunk allow-pass vlan 300
[PE2-10GE1/0/3] quit
[PE2] interface Vlanif 300
[PE2-Vlanif300] ip address 12.12.12.2 24
[PE2-Vlanif300] quit
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 12.12.12.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
Step 2 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
to establish LDP LSPs.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface Vlanif 300
[PE1-Vlanif300] mpls
[PE1-Vlanif300] mpls ldp
[PE1-Vlanif300] quit
# Configure the P.
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface Vlanif 100
[P-Vlanif100] mpls
[P-Vlanif100] mpls ldp
[P-Vlanif100] quit
[P] interface Vlanif 200
[P-Vlanif200] mpls
[P-Vlanif200] mpls ldp
[P-Vlanif200] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface Vlanif 300
[PE2-Vlanif300] mpls
[PE2-Vlanif300] mpls ldp
[PE2-Vlanif300] quit
After the configuration is complete, LDP sessions are established between PE1 and
the P and between PE2 and the P. Run the display mpls ldp session command.
The command output shows that the session status is Operational. Then, run the
display mpls ldp lsp command. The command output shows that LDP LSPs have
been established.
The following example uses the command output on PE1.
[PE1] display mpls ldp session
Step 3 On PEs, create VPN instances, enable the IPv4 address family for these instances,
and bind the interfaces connected to CEs to the VPN instances.
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] ip vpn-instance vpnb
[PE1-vpn-instance-vpnb] ipv4-family
[PE1-vpn-instance-vpnb-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[PE1-vpn-instance-vpnb-af-ipv4] quit
[PE1-vpn-instance-vpnb] quit
[PE1] interface 10ge 1/0/1
[PE1-10GE1/0/1] port link-type trunk
[PE1-10GE1/0/1] port trunk allow-pass vlan 100
[PE1-10GE1/0/1] quit
[PE1] interface vlanif 100
[PE1-Vlanif100] ip binding vpn-instance vpna
[PE1-Vlanif100] ip address 10.1.1.2 24
[PE1-Vlanif100] quit
[PE1] interface 10GE1/0/2
[PE1-10GE1/0/2] port link-type trunk
[PE1-10GE1/0/2] port trunk allow-pass vlan 200
[PE1-10GE1/0/2] quit
[PE1] interface vlanif 200
[PE1-Vlanif200] ip binding vpn-instance vpnb
[PE1-Vlanif200] ip address 10.2.1.2 24
[PE1-Vlanif200] quit
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] ip vpn-instance vpnb
[PE2-vpn-instance-vpnb] ipv4-family
[PE2-vpn-instance-vpnb-af-ipv4] route-distinguisher 200:2
[PE2-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[PE2-vpn-instance-vpnb-af-ipv4] quit
[PE2-vpn-instance-vpnb] quit
[PE2] interface 10ge 1/0/1
[PE2-10GE1/0/1] port link-type trunk
[PE2-10GE1/0/1] port trunk allow-pass vlan 100
[PE2-10GE1/0/1] quit
[PE2] interface vlanif 100
[PE2-Vlanif100] ip binding vpn-instance vpna
[PE2-Vlanif100] ip address 10.3.1.2 24
[PE2-Vlanif100] quit
[PE2] interface 10GE1/0/2
[PE2-10GE1/0/2] port link-type trunk
[PE2-10GE1/0/2] port trunk allow-pass vlan 200
[PE2-10GE1/0/2] quit
[PE2] interface vlanif 200
[PE2-Vlanif200] ip binding vpn-instance vpnb
[PE2-Vlanif200] ip address 10.4.1.2 24
[PE2-Vlanif200] quit
NOTE
If a PE has multiple interfaces bound to the same VPN instance, use the -a source-ip-
address parameter to specify a source IP address when running the ping -vpn-instance
vpn-instance-name -a source-ip-address dest-ip-address command to ping the CE
connected to the remote PE. If the source IP address is not specified, the ping operation
may fail.
Step 4 Establish an EBGP peer relationship between each PE and its connected CE.
# Configure CE1.
[CE1] interface loopback 1
[CE1-LoopBack1] ip address 11.11.11.11 32
[CE1-LoopBack1] quit
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] network 11.11.11.11 32
[CE1-bgp] quit
NOTE
The configurations of CE2, CE3, and CE4 are similar to the configuration of CE1. For
detailed configurations, see Configuration Scripts.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1-bgp-vpna] peer 10.1.1.1 as-number 65410
[PE1-bgp-vpna] import-route direct
[PE1-bgp-vpna] quit
[PE1-bgp] ipv4-family vpn-instance vpnb
[PE1-bgp-vpnb] peer 10.2.1.1 as-number 65420
[PE1-bgp-vpnb] import-route direct
[PE1-bgp-vpnb] quit
[PE1-bgp] quit
NOTE
The configuration of PE2 is similar to the configuration of PE1. For detailed configurations,
see Configuration Scripts.
After completing the configuration, run the display bgp vpnv4 vpn-instance peer
command on each PE to check the BGP peer relationships between each PE and
its connected CE. The command output shows that the BGP peer relationship is in
the Established state.
The following example uses the peer relationship between PE1 and CE1.
[PE1] display bgp vpnv4 vpn-instance vpna peer
Status codes: * - Dynamic
BGP local router ID : 1.1.1.9
Local AS number : 100
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] peer 3.3.3.9 as-number 100
[PE1-bgp] peer 3.3.3.9 connect-interface loopback 1
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 3.3.3.9 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configuration is complete, run the display bgp peer or display bgp
vpnv4 all peer command on the PEs. The command outputs show that the BGP
peer relationship have been established between the PEs and are in the
Established state.
[PE1] display bgp peer
Status codes: * - Dynamic
BGP local router ID : 1.1.1.9
Local AS number : 100
Total number of peers : 1
Peers in established state : 1
Total number of dynamic peers : 0
----End
CEs on the same VPN can ping each other, but CEs on different VPNs cannot.
For example, CE1 can ping CE3 at 10.3.1.1, but cannot ping CE4 at 10.4.1.1.
[CE1] ping -a 11.11.11.11 33.33.33.33
PING 33.33.33.33: 56 data bytes, press CTRL_C to break
Reply from 33.33.33.33: bytes=56 Sequence=1 ttl=251 time=72 ms
Reply from 33.33.33.33: bytes=56 Sequence=2 ttl=251 time=34 ms
Reply from 33.33.33.33: bytes=56 Sequence=3 ttl=251 time=50 ms
Reply from 33.33.33.33: bytes=56 Sequence=4 ttl=251 time=50 ms
Reply from 33.33.33.33: bytes=56 Sequence=5 ttl=251 time=34 ms
--- 33.33.33.33 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/48/72 ms
[CE1] ping -a 11.11.11.11 44.44.44.44
PING 44.44.44.44: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 44.44.44.44 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
Configuration Scripts
● PE1
#
sysname PE1
#
vlan batch 100 200 300
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
● P
#
sysname P
#
vlan batch 100 200
#
mpls lsr-id 2.2.2.9
#
mpls
#
mpls ldp
#
interface Vlanif100
ip address 11.11.11.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif200
ip address 12.12.12.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 11.11.11.0 0.0.0.255
network 12.12.12.0 0.0.0.255
network 2.2.2.9 0.0.0.0
#
return
● PE2
#
sysname PE2
#
vlan batch 100 200 300
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 3.3.3.9
#
mpls
#
mpls ldp
#
interface Vlanif100
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.0
#
interface Vlanif200
ip binding vpn-instance vpnb
● CE1
#
sysname CE1
#
vlan batch 100
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ip address 11.11.11.11 255.255.255.255
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
network 11.11.11.11 255.255.255.255
peer 10.1.1.2 enable
#
return
● CE2
#
sysname CE2
#
vlan batch 100
#
interface Vlanif100
ip address 10.2.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ip address 22.22.22.22 255.255.255.255
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
network 22.22.22.22 255.255.255.255
peer 10.2.1.2 enable
#
return
● CE3
#
sysname CE3
#
vlan batch 100
#
interface Vlanif100
ip address 10.3.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ip address 33.33.33.33 255.255.255.255
#
bgp 65430
peer 10.3.1.2 as-number 100
#
ipv4-family unicast
network 33.33.33.33 255.255.255.255
peer 10.3.1.2 enable
#
return
● CE4
#
sysname CE4
#
vlan batch 100
#
interface Vlanif100
ip address 10.4.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ip address 44.44.44.44 255.255.255.255
#
bgp 65440
peer 10.4.1.2 as-number 100
#
ipv4-family unicast
network 44.44.44.44 255.255.255.255
peer 10.4.1.2 enable
#
return
3.1.9.1.3 Example for Configuring Hub-Spoke (Double Links Between the Hub-PE
and Hub-CE)
Networking Requirements
On the network shown in Figure 3-62, the communication between the Spoke-
CEs is controlled by the Hub-CE at the central site. In other words, the traffic
between Spoke-CEs is forwarded also through the Hub-CE, not only through the
Hub-PE. The Hub-CE accesses the Hub-PE over double links.
In this example, interface 1, interface 2, interface 3, and interface 4 represent VLANIF 100,
VLANIF 200, VLANIF 300, and VLANIF 400, respectively.
Precautions
Note the following during the configuration:
● The import and export VPN targets configured on a Spoke-PE are different.
● Two VPN instances (vpn_in and vpn_out) are created on the Hub-PE. The
VPN targets received by vpn_in are the VPN targets advertised by the two
Spoke-PEs; the VPN targets advertised by vpn_out are the VPN targets
received by the two Spoke-PEs and are different from the VPN targets
received by vpn_in.
● The Hub-PE is configured to accept the routes with AS numbers repeated
once in the AS_Path attribute.
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable OSPF on the backbone network to ensure that PEs can communicate.
2. Configure basic MPLS capabilities and MPLS LDP to establish LDP LSPs on the
backbone network.
3. Configure a VPN instance on each PE, enable the IPv4 address family for the
instance, and bind the interface that connects each PE to a CE to the VPN
instance on that PE.
4. Enable MP-IBGP on PEs to exchange VPN routing information.
5. Configure EBGP between CEs and PEs to exchange VPN routing information.
Procedure
Step 1 Configure IGP on the backbone network for the Hub-PE and Spoke-PEs to
communicate.
OSPF is used as IGP in this example. For detailed configurations, see Configuration
Scripts.
Step 2 Configure basic MPLS capabilities and MPLS LDP to establish LDP LSPs on the
backbone network.
Step 3 Configure a VPN instance on each PE, enable the IPv4 address family for the
instance, and bind the interface that connects each PE to a CE to the VPN instance
on that PE.
NOTE
The import VPN target list of a VPN instance on the Hub-PE must contain the export VPN
targets of all Spoke-PEs.
The export VPN target list of the other VPN instance on the Hub-PE must contain the
import VPN targets of all Spoke-PEs.
# Configure Spoke-PE1.
<Spoke-PE1> system-view
[Spoke-PE1] ip vpn-instance vpna
[Spoke-PE1-vpn-instance-vpna] ipv4-family
[Spoke-PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[Spoke-PE1-vpn-instance-vpna-af-ipv4] vpn-target 100:1 export-extcommunity
[Spoke-PE1-vpn-instance-vpna-af-ipv4] vpn-target 200:1 import-extcommunity
[Spoke-PE1-vpn-instance-vpna-af-ipv4] quit
[Spoke-PE1-vpn-instance-vpna] quit
[Spoke-PE1] interface Vlanif 100
[Spoke-PE1-Vlanif100] ip binding vpn-instance vpna
[Spoke-PE1-Vlanif100] ip address 10.1.1.2 24
[Spoke-PE1-Vlanif100] quit
# Configure Spoke-PE2.
<Spoke-PE2> system-view
[Spoke-PE2] ip vpn-instance vpna
[Spoke-PE2-vpn-instance-vpna] ipv4-family
[Spoke-PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 100:3
[Spoke-PE2-vpn-instance-vpna-af-ipv4] vpn-target 100:1 export-extcommunity
[Spoke-PE2-vpn-instance-vpna-af-ipv4] vpn-target 200:1 import-extcommunity
[Spoke-PE2-vpn-instance-vpna-af-ipv4] quit
[Spoke-PE2-vpn-instance-vpna] quit
[Spoke-PE2] interface Vlanif 100
[Spoke-PE2-Vlanif100] ip binding vpn-instance vpna
[Spoke-PE2-Vlanif100] ip address 10.4.1.2 24
[Spoke-PE2-Vlanif100] quit
NOTE
If a PE has multiple interfaces bound to the same VPN instance, use the -a source-ip-
address parameter to specify a source IP address when running the ping -vpn-instance
vpn-instance-name -a source-ip-address dest-ip-address command to ping the CE
connected to the remote PE. If the source IP address is not specified, the ping operation
may fail.
Step 4 Establish EBGP peer relationships between PEs and CEs to import VPN routes.
NOTE
Configure the Hub-PE to allow AS numbers to be repeated once in the AS_Path attribute, so
that it can receive the routes advertised by the Hub-CE.
You do not need to configure the Spoke-PEs to allow AS numbers to be repeated once,
because the device does not check the AS_Path attributes in routes received from IBGP
peers.
# Configure Spoke-CE1.
[Spoke-CE1] interface loopback 1
[Spoke-CE1-Loopback1] ip address 11.11.11.11 32
[Spoke-CE1-Loopback1] quit
[Spoke-CE1] bgp 65410
[Spoke-CE1-bgp] peer 10.1.1.2 as-number 100
[Spoke-CE1-bgp] network 11.11.11.11 32
[Spoke-CE1-bgp] quit
# Configure Spoke-PE1.
[Spoke-PE1] bgp 100
[Spoke-PE1-bgp] ipv4-family vpn-instance vpna
[Spoke-PE1-bgp-vpna] peer 10.1.1.1 as-number 65410
[Spoke-PE1-bgp-vpna] quit
[Spoke-PE1-bgp] quit
# Configure Spoke-CE2.
[Spoke-CE2] interface loopback 1
[Spoke-CE2-Loopback1] ip address 22.22.22.22 32
[Spoke-CE2-Loopback1] quit
[Spoke-CE2] bgp 65420
[Spoke-CE2-bgp] peer 10.4.1.2 as-number 100
[Spoke-CE2-bgp] network 22.22.22.22 32
[Spoke-CE2-bgp] quit
# Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] ipv4-family vpn-instance vpna
[Spoke-PE2-bgp-vpna] peer 10.4.1.1 as-number 65420
[Spoke-PE2-bgp-vpna] quit
[Spoke-PE2-bgp] quit
After completing the configuration, run the display bgp vpnv4 all peer command
on each PE. The command output shows that BGP peer relationships have been
established between the PEs and CEs and are in Established state.
Step 5 Establish MP-IBGP peer relationships between the PEs.
# Configure Spoke-PE1.
[Spoke-PE1] bgp 100
[Spoke-PE1-bgp] peer 2.2.2.9 as-number 100
[Spoke-PE1-bgp] peer 2.2.2.9 connect-interface loopback 1
[Spoke-PE1-bgp] ipv4-family vpnv4
[Spoke-PE1-bgp-af-vpnv4] peer 2.2.2.9 enable
[Spoke-PE1-bgp-af-vpnv4] quit
# Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] peer 2.2.2.9 as-number 100
[Spoke-PE2-bgp] peer 2.2.2.9 connect-interface loopback 1
[Spoke-PE2-bgp] ipv4-family vpnv4
[Spoke-PE2-bgp-af-vpnv4] peer 2.2.2.9 enable
[Spoke-PE2-bgp-af-vpnv4] quit
After completing the configuration, run the display bgp peer or display bgp
vpnv4 all peer command on PEs. The command output shows that BGP peer
relationships have been established between PEs and are in the Established state.
----End
Run the display bgp routing-table command on each Spoke-CE. The command
output shows that there are repetitive AS numbers in the AS_Path attributes of the
BGP routes to the peer Spoke-CE.
The following example uses the command output on Spoke-CE1.
<Spoke-CE1> display bgp routing-table
Configuration Scripts
● Spoke-CE1
#
sysname Spoke-CE1
#
vlan batch 100
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface Loopback 1
ip address 11.11.11.11 255.255.255.255
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
network 11.11.11.11 255.255.255.255
peer 10.1.1.2 enable
#
return
● Spoke-PE1
#
sysname Spoke-PE1
#
vlan batch 100 200
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 100:1 export-extcommunity
vpn-target 200:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
#
mpls
#
mpls ldp
#
interface Vlanif100
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface Vlanif200
ip address 20.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpna
peer 10.1.1.1 as-number 65410
#
ospf 1
area 0.0.0.0
network 20.1.1.0 0.0.0.255
network 1.1.1.9 0.0.0.0
#
return
● Spoke-PE2
#
sysname Spoke-PE2
#
vlan batch 100 200
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:3
vpn-target 100:1 export-extcommunity
vpn-target 200:1 import-extcommunity
#
mpls lsr-id 3.3.3.9
#
mpls
#
mpls ldp
#
interface Vlanif100
ip binding vpn-instance vpna
ip address 10.4.1.2 255.255.255.0
#
interface Vlanif200
ip address 11.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpna
peer 10.4.1.1 as-number 65420
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 11.1.1.0 0.0.0.255
#
return
● Spoke-CE2
#
sysname Spoke-CE2
#
vlan batch 100
#
interface Vlanif100
ip address 10.4.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface Loopback 1
ip address 22.22.22.22 255.255.255.255
#
bgp 65420
peer 10.4.1.2 as-number 100
#
ipv4-family unicast
network 22.22.22.22 255.255.255.255
peer 10.4.1.2 enable
#
return
● Hub-CE
#
sysname Hub-CE
#
vlan batch 100 200
#
interface Vlanif100
ip address 10.2.1.1 255.255.255.0
#
interface Vlanif200
ip address 10.3.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface Loopback 1
ip address 33.33.33.33 255.255.255.255
#
bgp 65430
peer 10.2.1.2 as-number 100
peer 10.3.1.2 as-number 100
#
ipv4-family unicast
peer 10.3.1.2 enable
network 33.33.33.33 255.255.255.255
peer 10.2.1.2 enable
#
return
● Hub-PE
#
sysname Hub-PE
#
vlan batch 100 200 300 400
#
ip vpn-instance vpn_in
ipv4-family
route-distinguisher 100:21
vpn-target 100:1 import-extcommunity
#
ip vpn-instance vpn_out
ipv4-family
route-distinguisher 100:22
vpn-target 200:1 export-extcommunity
#
mpls lsr-id 2.2.2.9
#
mpls
#
mpls ldp
#
interface Vlanif100
ip address 20.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif200
ip address 11.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif300
ip binding vpn-instance vpn_in
ip address 10.2.1.2 255.255.255.0
#
interface Vlanif400
Networking Requirements
As shown in Figure 3-63, CE1 and CE2 belong to vpna, and CE1 is dual-homed to
PE1 and PE2 through PE4. The user requirements are as follows:
● In most cases, CE1 communicates with CE2 through PE1 (the default
gateway). If PE1 fails, PE2 functions as the gateway to implement gateway
redundancy.
● After PE1 recovers, it preempts to be the master to transmit data after a
preemption delay of 20s.
In this example, interface 1, interface 2, interface 3, and interface 5 represent 10GE 1/0/1, 10GE
1/0/2, 10GE 1/0/3, and 10GE 1/0/5, respectively.
Precautions
Note the following during the configuration:
● On the same VPN, the export VPN target list of a site shares VPN targets with
the import VPN target lists of the other sites. Conversely, the import VPN
target list of a site shares VPN targets with the export VPN target lists of the
other sites.
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable OSPF on the backbone network to ensure that PEs can communicate.
2. Configure basic MPLS capabilities and MPLS LDP on the backbone network to
establish LDP LSPs.
3. Configure a VPN instance on each PE, enable the IPv4 address family for the
instance, and bind the interface that connects each PE to a CE to the VPN
instance on that PE.
4. Enable MP-IBGP on PEs to exchange VPN routing information.
5. Configure EBGP between CEs and PEs to exchange VPN routing information.
Procedure
Step 1 Configure IGP on the MPLS backbone network to achieve connectivity between
PEs on the backbone network.
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan 300
[PE1-vlan300] quit
[PE1] interface 10GE1/0/1
[PE1-10GE1/0/1] port link-type hybrid
[PE1-10GE1/0/1] port hybrid pvid vlan 300
[PE1-10GE1/0/1] port hybrid untagged vlan 300
[PE1-10GE1/0/1] quit
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] interface vlanif 300
[PE1-Vlanif300] ip address 192.168.1.1 24
[PE1-Vlanif300] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan 200
[PE2-vlan200] quit
[PE2] interface 10GE1/0/1
[PE2-10GE1/0/1] port link-type hybrid
[PE2-10GE1/0/1] port hybrid pvid vlan 200
[PE2-10GE1/0/1] port hybrid untagged vlan 200
[PE2-10GE1/0/1] quit
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 2.2.2.2 32
[PE2-LoopBack1] quit
[PE2] interface vlanif 200
# Configure PE3.
<HUAWEI> system-view
[HUAWEI] sysname PE3
[PE3] vlan batch 200 300
[PE3] interface 10GE1/0/1
[PE3-10GE1/0/1] port link-type hybrid
[PE3-10GE1/0/1] port hybrid pvid vlan 300
[PE3-10GE1/0/1] port hybrid untagged vlan 300
[PE3-10GE1/0/1] quit
[PE3] interface 10GE1/0/2
[PE3-10GE1/0/2] port link-type hybrid
[PE3-10GE1/0/2] port hybrid pvid vlan 200
[PE3-10GE1/0/2] port hybrid untagged vlan 200
[PE3-10GE1/0/2] quit
[PE3] interface loopback 1
[PE3-LoopBack1] ip address 3.3.3.3 32
[PE3-LoopBack1] quit
[PE3] interface vlanif 200
[PE3-Vlanif200] ip address 192.168.2.2 24
[PE3-Vlanif200] quit
[PE3] interface vlanif 300
[PE3-Vlanif300] ip address 192.168.1.2 24
[PE3-Vlanif300] quit
[PE3] ospf 1
[PE3-ospf-1] area 0
[PE3-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE3-ospf-1-area-0.0.0.0] quit
[PE3-ospf-1] quit
Step 2 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
to establish LDP LSPs.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface vlanif 300
[PE1-Vlanif300] mpls
[PE1-Vlanif300] mpls ldp
[PE1-Vlanif300] quit
# Configure PE2.
[PE2] mpls lsr-id 2.2.2.2
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 200
[PE2-Vlanif200] mpls
[PE2-Vlanif200] mpls ldp
[PE2-Vlanif200] quit
# Configure PE3.
Step 3 Configure VPN instances on the PEs and bind the instances to the CE interfaces.
# Configure PE4.
<HUAWEI> system-view
[HUAWEI] sysname PE4
[PE4] vlan 100
[PE4-vlan100] quit
[PE4] interface 10GE1/0/1
[PE4-10GE1/0/1] port link-type hybrid
[PE4-10GE1/0/1] port hybrid pvid vlan 100
[PE4-10GE1/0/1] port hybrid untagged vlan 100
[PE4-10GE1/0/1] quit
[PE4] interface 10GE1/0/2
[PE4-10GE1/0/2] port link-type hybrid
[PE4-10GE1/0/2] port hybrid pvid vlan 100
[PE4-10GE1/0/2] port hybrid untagged vlan 100
[PE4-10GE1/0/2] quit
[PE4] interface 10GE1/0/3
[PE4-10GE1/0/3] port link-type hybrid
[PE4-10GE1/0/3] port hybrid pvid vlan 100
[PE4-10GE1/0/3] port hybrid untagged vlan 100
[PE4-10GE1/0/3] quit
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] vlan 100
[PE1-vlan100] quit
[PE1] interface 10GE1/0/2
[PE1-10GE1/0/2] port link-type hybrid
[PE1-10GE1/0/2] port hybrid pvid vlan 100
[PE1-10GE1/0/2] port hybrid untagged vlan 100
[PE1-10GE1/0/2] quit
[PE1] interface 10GE1/0/5
[PE1-10GE1/0/5] port link-type hybrid
[PE1-10GE1/0/5] port hybrid pvid vlan 100
[PE1-10GE1/0/5] port hybrid untagged vlan 100
[PE1-10GE1/0/5] quit
[PE1] interface vlanif 100
[PE1-Vlanif100] ip binding vpn-instance vpna
[PE1-Vlanif100] ip address 10.1.1.1 24
[PE1-Vlanif100] quit
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] route-distinguisher 100:1
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] vlan 100
[PE2-vlan100] quit
[PE2] interface 10GE1/0/2
[PE2-10GE1/0/2] port link-type hybrid
[PE2-10GE1/0/2] port hybrid pvid vlan 100
[PE2-10GE1/0/2] port hybrid untagged vlan 100
[PE2-10GE1/0/2] quit
[PE2] interface 10GE1/0/5
[PE2-10GE1/0/5] port link-type hybrid
[PE2-10GE1/0/5] port hybrid pvid vlan 100
[PE2-10GE1/0/5] port hybrid untagged vlan 100
[PE2-10GE1/0/5] quit
[PE2] interface vlanif 100
[PE2-Vlanif100] ip binding vpn-instance vpna
[PE2-Vlanif100] ip address 10.1.1.2 24
[PE2-Vlanif100] quit
# Configure PE3.
[PE3] ip vpn-instance vpna
[PE3-vpn-instance-vpna] route-distinguisher 100:1
[PE3-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE3-vpn-instance-vpna-af-ipv4] quit
[PE3-vpn-instance-vpna] quit
[PE3] vlan 400
[PE3-vlan400] quit
[PE3] interface 10GE1/0/3
[PE3-10GE1/0/3] port link-type hybrid
[PE3-10GE1/0/3] port hybrid pvid vlan 400
[PE3-10GE1/0/3] port hybrid untagged vlan 400
[PE3-10GE1/0/3] quit
[PE3] interface vlanif 400
[PE3-Vlanif400] ip binding vpn-instance vpna
[PE3-Vlanif400] ip address 172.16.1.100 24
[PE3-Vlanif400] quit
# Configure CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan 100
[CE1-vlan100] quit
[CE1] interface 10GE1/0/3
[CE1-10GE1/0/3] port link-type hybrid
[CE1-10GE1/0/3] port hybrid pvid vlan 100
[CE1-10GE1/0/3] port hybrid untagged vlan 100
[CE1-10GE1/0/3] quit
[CE1] interface vlanif 100
[CE1-Vlanif100] ip address 10.1.1.100 24
[CE1-Vlanif100] quit
# Configure CE2.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan 400
[CE2-vlan400] quit
[CE2] interface 10GE1/0/3
[CE2-10GE1/0/3] port link-type hybrid
[CE2-10GE1/0/3] port hybrid pvid vlan 400
[CE2-10GE1/0/3] port hybrid untagged vlan 400
[CE2-10GE1/0/3] quit
[CE2] interface vlanif 400
[CE2-Vlanif400] ip address 172.16.1.200 24
[CE2-Vlanif400] quit
Step 4 Establish EBGP peer relationships between PEs and CEs and import VPN routes.
# Configure CE1.
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.111 as-number 100
# Configure CE2.
[CE2] bgp 65430
[CE2-bgp] peer 172.16.1.100 as-number 100
[CE2-bgp] import-route direct
[CE2-bgp] quit
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1-bgp-vpna] peer 10.1.1.100 as-number 65410
[PE1-bgp-vpna] import-route direct
[PE1-bgp-vpna] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpna
[PE2-bgp-vpna] peer 10.1.1.100 as-number 65410
[PE2-bgp-vpna] import-route direct
[PE2-bgp-vpna] quit
[PE2-bgp] quit
# Configure PE3.
[PE3] bgp 100
[PE3-bgp] ipv4-family vpn-instance vpna
[PE3-bgp-vpna] peer 172.16.1.200 as-number 65430
[PE3-bgp-vpna] import-route direct
[PE3-bgp-vpna] quit
[PE3-bgp] quit
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] peer 3.3.3.3 as-number 100
[PE1-bgp] peer 3.3.3.3 connect-interface loopback 1
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 3.3.3.3 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 3.3.3.3 as-number 100
[PE2-bgp] peer 3.3.3.3 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 3.3.3.3 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
# Configure PE3.
[PE3] bgp 100
[PE3-bgp] peer 1.1.1.1 as-number 100
[PE3-bgp] peer 2.2.2.2 as-number 100
[PE3-bgp] peer 1.1.1.1 connect-interface loopback 1
[PE3-bgp] peer 2.2.2.2 connect-interface loopback 1
[PE3-bgp] ipv4-family vpnv4
[PE3-bgp-af-vpnv4] peer 1.1.1.1 enable
[PE3-bgp-af-vpnv4] peer 2.2.2.2 enable
[PE3-bgp-af-vpnv4] quit
[PE3-bgp] quit
Step 6 Configure MSTP to block the link between PE2 and PE4 for loop protection.
# Configure the MSTP mode on PE1. The MSTP mode is enabled by default.
[PE1] stp mode mstp
# Configure the MSTP mode on PE2. The MSTP mode is enabled by default.
[PE2] stp mode mstp
# Configure the MSTP mode on PE4. The MSTP mode is enabled by default.
[PE4] stp mode mstp
# Set the path cost of the interfaces connecting PE2 and PE4 to 400000 so that
the link between PE2 and PE4 can be blocked.
[PE2] interface 10GE1/0/2
[PE2-10GE1/0/2] stp cost 400000
[PE2-10GE1/0/2] quit
[PE4] interface 10GE1/0/2
[PE4-10GE1/0/2] stp cost 400000
[PE4-10GE1/0/2] quit
# After the configuration is complete, run the display stp brief command on PE4
to view the interface status. The command output shows that 10GE 1/0/2
becomes an alternate interface and is in DISCARDING state.
[PE4] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 ROOT FORWARDING NONE 2000 enable
0 10GE1/0/2 ALTE DISCARDING NONE 400000 enable
# Create VRRP group 1 on PE2, and set the VRRP priority of PE2 to 100.
[PE2] interface vlanif 100
[PE2-Vlanif100] vrrp vrid 1 virtual-ip 10.1.1.111
[PE2-Vlanif100] quit
----End
# Run the shutdown command on 10GE 1/0/2 and 10GE 1/0/5 of PE1 to simulate
a fault on PE1.
[PE1] interface 10GE1/0/2
[PE1-10GE1/0/2] shutdown
[PE1-10GE1/0/2] quit
[PE1] interface 10GE1/0/5
[PE1-10GE1/0/5] shutdown
[PE1-10GE1/0/5] quit
# Run the display vrrp verbose command on PE2 to view the VRRP status. The
command output shows that PE2 becomes the VRRP master.
[PE2] display vrrp verbose
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.111
Master IP : 10.1.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s Remain : --
Hold Multiplier: 3
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:18:40
# Run the undo shutdown command on 10GE 1/0/2 and 10GE 1/0/5 of PE1. After
20 seconds, run the display vrrp verbose command on PE1 to view the VRRP
status. The command output shows that PE1 is the VRRP master.
[PE1] interface 10GE1/0/2
[PE1-10GE1/0/2] undo shutdown
[PE1-10GE1/0/2] quit
[PE1] interface 10GE1/0/5
[PE1-10GE1/0/5] undo shutdown
[PE1-10GE1/0/5] quit
[PE1] display vrrp verbose
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.111
Master IP : 10.1.1.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s Remain : --
Hold Multiplier: 3
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:20:56
Configuration Scripts
● PE1
#
sysname PE1
#
vlan batch 100 300
#
stp instance 0 root primary
stp enable
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 2.2.2.2
#
mpls
#
mpls ldp
#
interface Vlanif100
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.111
#
interface Vlanif200
ip address 192.168.2.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type hybrid
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface 10GE1/0/2
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
stp instance 0 cost 400000
#
interface 10GE1/0/5
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.3 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.1.1.100 as-number 65410
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 192.168.2.0 0.0.0.255
#
return
● PE3
#
sysname PE3
#
vlan batch 200 300 400
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface Vlanif200
ip address 192.168.2.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif300
ip address 192.168.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif400
ip binding vpn-instance vpna
ip address 172.16.1.100 255.255.255.0
#
interface 10GE1/0/1
port link-type hybrid
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface 10GE1/0/2
port link-type hybrid
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface 10GE1/0/3
port link-type hybrid
port hybrid pvid vlan 400
port hybrid untagged vlan 400
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
peer 2.2.2.2 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
peer 2.2.2.2 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 172.16.1.200 as-number 65430
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return
● PE4
#
sysname PE4
#
vlan batch 100
#
stp enable #
interface 10GE1/0/1
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
interface 10GE1/0/2
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
stp instance 0 cost 400000
#
interface 10GE1/0/3
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
stp disable
#
return
● CE1
#
sysname CE1
#
vlan batch 100
#
interface Vlanif100
ip address 10.1.1.100 255.255.255.0
#
interface 10GE1/0/3
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
bgp 65410
peer 10.1.1.111 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.111 enable
#
return
● CE2
#
sysname CE2
#
vlan batch 400
#
interface Vlanif400
ip address 172.16.1.200 255.255.255.0
#
interface 10GE1/0/3
port link-type hybrid
port hybrid pvid vlan 400
port hybrid untagged vlan 400
#
bgp 65430
peer 172.16.1.100 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
Networking Requirements
On the network shown in Figure 3-64, CE1 is connected to the enterprise branch
Site 1, and CE2 is connected to the enterprise branch Site 2. Site 1 and Site 2
communicate across the ISP backbone network. To meet service requirements, the
enterprise requires that users on some network segments between Site 1 and Site
2 can securely communicate with each other.
In this example, interface 1 and interface 2 represent VLANIF 10 and VLANIF 100 respectively.
Precautions
Note the following during the configuration:
● On the same VPN, the export VPN target list of a site shares VPN targets with
the import VPN target lists of the other sites. Conversely, the import VPN
target list of a site shares VPN targets with the export VPN target lists of the
other sites.
● After a PE interface connected to a CE is bound to a VPN instance, Layer 3
configurations on this interface are automatically deleted. Such configurations
include IP address and routing protocol configurations, and must be added
again if needed.
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure IGP on the MPLS backbone network to achieve connectivity between
PEs on the backbone network.
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] vlan batch 10 100
[PE1] interface 10GE 1/0/1
[PE1-10GE1/0/1] port link-type trunk
[PE1-10GE1/0/1] port trunk allow-pass vlan 10
[PE1-10GE1/0/1] quit
[PE1] interface 10GE 1/0/7
[PE1-10GE1/0/7] port link-type trunk
[PE1-10GE1/0/7] port trunk allow-pass vlan 100
[PE1-10GE1/0/7] quit
[PE1] interface vlanif 100
[PE1-Vlanif100] ip address 172.10.1.1 24
[PE1-Vlanif100] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 172.10.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 2.2.2.9 32
[PE2-LoopBack1] quit
[PE2] vlan batch 10 100
[PE2] interface 10GE 1/0/1
[PE2-10GE1/0/1] port link-type trunk
[PE2-10GE1/0/1] port trunk allow-pass vlan 10
[PE2-10GE1/0/1] quit
[PE2] interface 10GE 1/0/7
[PE2-10GE1/0/7] port link-type trunk
[PE2-10GE1/0/7] port trunk allow-pass vlan 100
[PE2-10GE1/0/7] quit
# Configure PE2.
[PE2] mpls lsr-id 2.2.2.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 100
[PE2-Vlanif100] mpls
[PE2-Vlanif100] mpls ldp
[PE2-Vlanif100] quit
After the configuration is complete, run the display mpls ldp session command.
The command output shows that an LDP session has been established between
PE1 and PE2 and its state is Operational.
Step 3 Configure VPN instances on the PEs and bind the instances to the CE interfaces.
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] interface vlanif 10
[PE1-Vlanif10] ip binding vpn-instance vpna
[PE1-Vlanif10] ip address 192.168.1.1 24
[PE1-Vlanif10] quit
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] route-distinguisher 200:1
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 222:1 both
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] interface vlanif 10
[PE2-Vlanif10] ip binding vpn-instance vpna
[PE2-Vlanif10] ip address 192.168.2.1 24
[PE2-Vlanif10] quit
NOTE
If a PE has multiple interfaces bound to the same VPN instance, use the -a source-ip-
address parameter to specify a source IP address when running the ping -vpn-instance
vpn-instance-name -a source-ip-address dest-ip-address command to ping the CE
connected to the remote PE. If the source IP address is not specified, the ping operation
may fail.
# Configure PE1.
[PE1] ip ip-prefix ipPrefix1 index 10 permit 192.168.1.0 24 greater-equal 24 less-equal 32
[PE1] route-policy vpnroute permit node 1
[PE1-route-policy] if-match ip-prefix ipPrefix1
[PE1-route-policy] apply extcommunity rt 222:1
[PE1-route-policy] quit
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] export route-policy vpnroute
[PE1-vpn-instance-vpna] quit
# Configure PE2.
[PE2] ip ip-prefix ipPrefix1 index 10 permit 192.168.2.0 24 greater-equal 24 less-equal 32
[PE2] route-policy vpnroute permit node 1
[PE2-route-policy] if-match ip-prefix ipPrefix1
[PE2-route-policy] apply extcommunity rt 111:1
[PE2-route-policy] quit
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] export route-policy vpnroute
[PE2-vpn-instance-vpna] quit
Step 5 Establish EBGP peer relationships between PEs and CEs and import VPN routes.
# Configure CE1. The configuration of CE2 is similar to that of CE1, and is not
mentioned here.
[CE1] bgp 65410
[CE1-bgp] peer 192.168.1.1 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure PE1. The configuration of PE2 is similar to that of PE1, and is not
mentioned here.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1-bgp-vpna] peer 192.168.1.2 as-number 65410
[PE1-bgp-vpna] import-route direct
[PE1-bgp-vpna] quit
[PE1-bgp] quit
After the configuration is complete, run the display bgp vpnv4 vpn-instance
vpna peer command on the PEs. The command output shows that BGP peer
relationships have been established between the PEs and CEs and are in the
Established state.
Step 6 Establish MP-IBGP peer relationships between PEs.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] peer 2.2.2.9 as-number 100
[PE1-bgp] peer 2.2.2.9 connect-interface loopback 1
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 2.2.2.9 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configuration is complete, run the display bgp peer or display bgp
vpnv4 all peer command on the PEs. The command output shows that the BGP
peer relationship has been established between the PEs and is in the Established
state.
----End
Configuration Scripts
● PE1
#
sysname PE1
#
vlan batch 10 100
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
export route-policy vpnroute
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface Vlanif10
ip binding vpn-instance vpna
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif100
ip address 172.10.1.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/7
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 192.168.1.2 as-number 65410
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.10.1.0 0.0.0.255
#
#
ip ip-prefix ipPrefix1 index 10 permit 192.168.2.0 24 greater-equal 24 less-equal 32
#
return
● PE2
#
sysname PE2
#
vlan batch 10 100
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
export route-policy vpnroute
vpn-target 222:1 export-extcommunity
vpn-target 222:1 import-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface Vlanif10
ip binding vpn-instance vpna
ip address 192.168.2.1 255.255.255.0
#
interface Vlanif100
ip address 172.10.1.2 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/7
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 192.168.2.2 as-number 65420
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.10.1.0 0.0.0.255
#
route-policy vpnroute permit node 1
if-match ip-prefix ipPrefix1
apply extcommunity rt 111:1
#
ip ip-prefix ipPrefix1 index 10 permit 192.168.2.0 24 greater-equal 24 less-equal 32
#
return
● CE1
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 192.168.1.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
bgp 65410
peer 192.168.1.1 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 192.168.1.1 enable
#
return
● CE2
#
sysname CE2
#
vlan batch 10
#
interface Vlanif10
ip address 192.168.2.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
bgp 65420
peer 192.168.2.1 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 192.168.2.1 enable
#
return
Networking Requirements
IPv6 L3VPN applies to scenarios where different user sites communicate through
the public network without letting the public network detect their internal routing
information. IPv6 L3VPN can isolate VPN services from each other by allowing
intra-VPN access and prohibiting inter-VPN access.
On the network shown in Figure 3-65, CE1 and CE3 belong to VPNA, and CE2 and
CE4 belong to VPNB. It is required that IPv6 L3VPN be configured to allow the
sites in VPNA and those in VPNB to communicate with each other through an
MPLS backbone network instead of directly communicating with each other. It is
also required that different methods be used to exchange routes between PEs and
CEs:
● BGP4+ between PE1 and CE1, and between PE2 and CE4
● IPv6 static route between PE1 and CE2
● OSPFv3 between PE2 and CE3
In this example, interface 1, interface 2, and interface 3 represent VLANIF 100, VLANIF 200,
and VLANIF 300, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
Data Plan
To complete the configuration, you need the following data:
● AS numbers of PEs and CEs
● VPN instance names
● Attributes of the VPN instance IPv6 address family, such as the RD and VPN
targets
Procedure
Step 1 Configure IPv4 or IPv6 addresses for device interfaces.
# Configure an IPv6 address for the interface on CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 100
[CE1] interface 10GE 1/0/1
[CE1-10GE1/0/1] port link-type trunk
[CE1-10GE1/0/1] port trunk allow-pass vlan 100
[CE1-10GE1/0/1] quit
[CE1] interface Vlanif 100
[CE1-Vlanif100] ipv6 enable
[CE1-Vlanif100] ipv6 address 2001:db8:1::1 64
[CE1-Vlanif100] quit
The configurations of CE2, CE3, CE4, PE1, PE2, and the P are similar to the
configuration of CE1. For detailed configurations, see Configuration Scripts.
Step 2 Configure IGP on the IPv4 backbone network for PEs to communicate. IS-IS is used
as IGP in this example.
# Configure PE1.
[PE1] isis 1
[PE1-isis-1] network-entity 10.1111.1111.1111.00
[PE1-isis-1] quit
[PE1] interface Vlanif 300
[PE1-Vlanif300] isis enable 1
[PE1-Vlanif300] quit
[PE1] interface loopback 1
[PE1-LoopBack1] isis enable 1
[PE1-LoopBack1] quit
The configurations of the P and PE2 are similar to the configuration of PE1. For
detailed configurations, see Configuration Scripts.
After the configuration is complete, PE1, PE2, and the P can learn routes, including
the routes to loopback interfaces, from one another. You can run the display ip
routing-table command to check route information. The following example uses
the command output on PE1.
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table: _public_
Destinations : 11 Routes : 11
Step 3 Enable MPLS and MPLS LDP both globally and per interface on each device of the
IPv4 backbone network to establish an LDP LSP between PE1 and PE2.
The configurations of the P and PE2 are similar to the configuration of PE1. For
detailed configurations, see Configuration Scripts.
After the configuration is complete, an LDP LSP should exist between PE1 and
PE2. Run the display mpls ldp lsp command. The command output shows that an
LDP LSP has been established. The following example uses the command output
on PE1.
[PE1] display mpls ldp lsp
LDP LSP Information
-------------------------------------------------------------------------------
Flag after Out IF: (I) - RLFA Iterated LSP, (I*) - Normal and RLFA Iterated LSP
-------------------------------------------------------------------------------
DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface
-------------------------------------------------------------------------------
1.1.1.9/32 3/NULL 2.2.2.9 127.0.0.1 InLoop0
*1.1.1.9/32 Liberal/1024 DS/2.2.2.9
2.2.2.9/32 NULL/3 - 10.11.11.2 Vlanif300
2.2.2.9/32 1024/3 2.2.2.9 10.11.11.2 Vlanif300
3.3.3.9/32 NULL/1025 - 10.11.11.2 Vlanif300
3.3.3.9/32 1025/1025 2.2.2.9 10.11.11.2 Vlanif300
-------------------------------------------------------------------------------
TOTAL: 5 Normal LSP(s) Found.
TOTAL: 1 Liberal LSP(s) Found.
TOTAL: 0 Frr LSP(s) Found.
An asterisk (*) before an LSP means the LSP is not established
An asterisk (*) before a Label means the USCB or DSCB is stale
An asterisk (*) before an UpstreamPeer means the session is stale
An asterisk (*) before a DS means the session is stale
An asterisk (*) before a NextHop means the LSP is FRR LSP
# Bind the interface that directly connects PE1 to CE1 to the VPN instance named
vpna.
[PE1] interface Vlanif 100
[PE1-Vlanif100] ip binding vpn-instance vpna
[PE1-Vlanif100] ipv6 enable
[PE1-Vlanif100] ipv6 address 2001:db8:1::2 64
[PE1-Vlanif100] quit
# Bind the interface that directly connects PE1 to CE2 to the VPN instance named
vpnb.
[PE1] interface Vlanif 200
[PE1-Vlanif200] ip binding vpn-instance vpnb
[PE1-Vlanif200] ipv6 enable
[PE1-Vlanif200] ipv6 address 2001:db8:3::2 64
[PE1-Vlanif200] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv6-family vpnv6
[PE2-bgp-af-vpnv6] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv6] quit
[PE2-bgp] quit
After completing the configuration, run the display bgp vpnv6 all peer command
on each PE to check the VPNv6 peer relationship status. The following example
uses the command output on PE1.
[PE1] display bgp vpnv6 all peer
BGP local router ID : 1.1.1.9
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
The command output shows that State is Established, indicating that the VPNv6
peer relationship between PE1 and PE2 has been established.
Step 6 Configure BGP4+ on PE1 and CE1.
# Configure EBGP on PE1.
[PE1] bgp 100
[PE1-bgp] ipv6-family vpn-instance vpna
[PE1-bgp6-vpna] peer 2001:db8:1::1 as-number 65410
[PE1-bgp6-vpna] quit
[PE1-bgp] quit
The configurations between PE2 and CE4 are similar to the configurations
between PE1 and CE1. For detailed configurations, see Configuration Scripts.
After completing the configuration, run the display bgp vpnv6 vpn-instance vpn-
instance-name peer command on each PE to check whether the peer relationship
is established. The following example uses the command output on PE1.
[PE1] display bgp vpnv6 vpn-instance vpna peer
BGP local router ID : 1.1.1.9
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
----End
Configuration Scripts
● PE1
#
sysname PE1
#
vlan batch 100 200 300
#
ip vpn-instance vpna
ipv6-family
route-distinguisher 100:1
vpn-target 22:22 export-extcommunity
vpn-target 33:33 import-extcommunity
#
ip vpn-instance vpnb
ipv6-family
route-distinguisher 100:3
vpn-target 44:44 export-extcommunity
vpn-target 55:55 import-extcommunity
#
mpls lsr-id 1.1.1.9
#
mpls
#
mpls ldp
#
isis 1
network-entity 10.1111.1111.1111.00
#
interface Vlanif100
ip binding vpn-instance vpna
ipv6 enable
ipv6 address 2001:db8:1::2/64
#
interface Vlanif200
ip binding vpn-instance vpnb
ipv6 enable
ipv6 address 2001:db8:3::2/64
#
interface Vlanif300
ip address 10.11.11.1 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 300
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
isis enable 1
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
peer 3.3.3.9 enable
#
ipv6-family vpnv6
policy vpn-target
peer 3.3.3.9 enable
#
ipv6-family vpn-instance vpna
peer 2001:db8:1::1 as-number 65410
#
ipv6-family vpn-instance vpnb
import-route static
#
ipv6 route-static vpn-instance vpnb 2001:db8:8:: 64 2001:db8:3::1
#
return
● P
#
sysname P
#
vlan batch 100 200
#
mpls lsr-id 2.2.2.9
#
mpls
#
mpls ldp
#
isis 1
network-entity 20.2222.2222.2222.00
#
interface Vlanif100
ip address 10.11.11.2 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface Vlanif200
ip address 10.12.12.1 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
isis enable 1
#
return
● PE2
#
sysname PE2
#
vlan batch 100 200 300
#
ip vpn-instance vpna
ipv6-family
route-distinguisher 100:2
vpn-target 33:33 export-extcommunity
vpn-target 22:22 import-extcommunity
#
ip vpn-instance vpnb
ipv6-family
route-distinguisher 100:4
vpn-target 55:55 export-extcommunity
vpn-target 44:44 import-extcommunity
#
mpls lsr-id 3.3.3.9
#
mpls
#
mpls ldp
#
isis 1
network-entity 30.3333.3333.3333.00
#
ospfv3 1 vpn-instance vpna
router-id 10.10.11.11
import-route bgp
area 0.0.0.0
#
interface Vlanif100
ip binding vpn-instance vpnb
ipv6 enable
ipv6 address 2001:db8:5::2/64
#
interface Vlanif200
ip binding vpn-instance vpna
ipv6 enable
ipv6 address 2001:db8:4::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif300
ip address 10.12.12.2 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 300
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
isis enable 1
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
peer 1.1.1.9 enable
#
ipv6-family vpnv6
policy vpn-target
peer 1.1.1.9 enable
#
ipv6-family vpn-instance vpna
import-route ospfv3 1
#
ipv6-family vpn-instance vpnb
peer 2001:db8:5::1 as-number 65420
#
return
● CE1
#
sysname CE1
#
vlan batch 100
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:db8:1::1/64
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:8::1/64
#
bgp 65410
router-id 10.10.10.10
peer 2001:db8:1::2 as-number 100
#
ipv4-family unicast
#
ipv6-family unicast
network 2001:db8:8:: 64
import-route direct
peer 2001:db8:1::2 enable
#
return
● CE2
#
sysname CE2
#
vlan batch 100
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:db8:3::1/64
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:8::1/64
#
ipv6 route-static :: 0 2001:db8:3::2
#
return
● CE3
#
sysname CE3
#
vlan batch 100
#
ospfv3 1
router-id 22.22.22.22
area 0.0.0.0
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:db8:4::1/64
ospfv3 1 area 0.0.0.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:9::1/64
ospfv3 1 area 0.0.0.0
#
return
● CE4
#
sysname CE4
#
vlan batch 100
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:db8:5::1/64
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:9::1/64
#
bgp 65420
router-id 33.33.33.33
peer 2001:db8:5::2 as-number 100
#
ipv4-family unicast
#
ipv6-family unicast
import-route direct
peer 2001:db8:5::2 enable
#
return
Networking Requirements
On the network shown in Figure 3-66, the communication between the Spoke-
CEs is controlled by the Hub-CE at the central site. In other words, the traffic
between Spoke-CEs is forwarded also through the Hub-CE, not only through the
Hub-PE.
In this example, interface 1, interface 2, interface 3, and interface 4 represent VLANIF 100,
VLANIF 200, VLANIF 300, and VLANIF 400, respectively.
Precautions
During the configuration, note the following:
● The import and export VPN targets configured on a Spoke-PE are different.
● Two VPN instances (vpn_in and vpn_out) are created on the Hub-PE. The
VPN targets received by vpn_in are the VPN targets advertised by the two
Spoke-PEs; the VPN targets advertised by vpn_out are the VPN targets
received by the two Spoke-PEs and are different from the VPN targets
received by vpn_in.
● The Hub-PE is configured to accept the routes with AS numbers repeated
once in the AS_Path attribute.
Configuration Roadmap
The configuration roadmap is as follows:
1. Establish MP-IBGP peer relationships between the Hub-PE and Spoke-PEs.
There is no need to establish an MP-IBGP peer relationship or exchange VPN
routing information between the two Spoke-PEs.
2. Create VPN instances and VPN targets on PEs.
3. Configure EBGP connections between CEs and PEs.
Procedure
Step 1 Configure IGP on the backbone network for the Hub-PE and Spoke-PEs to
communicate.
OSPF is used as IGP in this example. For detailed configurations, see Configuration
Scripts.
Step 2 Configure basic MPLS capabilities and MPLS LDP to establish LDP LSPs on the
backbone network.
The import VPN target list of a VPN instance on the Hub-PE must contain the export VPN
targets of all Spoke-PEs.
The export VPN target list of the other VPN instance on the Hub-PE must contain the
import VPN targets of all Spoke-PEs.
# Configure Spoke-PE1.
<Spoke-PE1> system-view
[Spoke-PE1] ip vpn-instance vpna
[Spoke-PE1-vpn-instance-vpna] ipv6-family
[Spoke-PE1-vpn-instance-vpna-af-ipv6] route-distinguisher 100:1
[Spoke-PE1-vpn-instance-vpna-af-ipv6] vpn-target 100:1 export-extcommunity
[Spoke-PE1-vpn-instance-vpna-af-ipv6] vpn-target 200:1 import-extcommunity
[Spoke-PE1-vpn-instance-vpna-af-ipv6] quit
[Spoke-PE1] interface Vlanif100
[Spoke-PE1-Vlanif100] ip binding vpn-instance vpna
[Spoke-PE1-Vlanif100] ipv6 enable
[Spoke-PE1-Vlanif100] ipv6 address 2001:db8:1::2 64
[Spoke-PE1-Vlanif100] quit
# Configure Spoke-PE2.
<Spoke-PE2> system-view
[Spoke-PE2] ip vpn-instance vpna
[Spoke-PE2-vpn-instance-vpna] ipv6-family
[Spoke-PE2-vpn-instance-vpna-af-ipv6] route-distinguisher 100:3
[Spoke-PE2-vpn-instance-vpna-af-ipv6] vpn-target 100:1 export-extcommunity
[Spoke-PE2-vpn-instance-vpna-af-ipv6] vpn-target 200:1 import-extcommunity
[Spoke-PE2-vpn-instance-vpna-af-ipv6] quit
[Spoke-PE2] interface Vlanif100
[Spoke-PE2-Vlanif100] ip binding vpn-instance vpna
[Spoke-PE2-Vlanif100] ipv6 enable
[Spoke-PE2-Vlanif100] ipv6 address 2001:db8:2::2 64
[Spoke-PE2-Vlanif100] quit
Step 4 Establish EBGP peer relationships between PEs and CEs to import VPN routes.
NOTE
Configure the Hub-PE to allow AS numbers to be repeated once in the AS_Path attribute, so
that it can receive the routes advertised by the Hub-CE.
You do not need to configure the Spoke-PEs to allow AS numbers to be repeated once,
because the device does not check the AS_Path attributes in routes received from IBGP
peers.
# Configure Spoke-CE1.
[Spoke-CE1] interface loopback 1
[Spoke-CE1-Loopback1] ipv6 enable
[Spoke-CE1-Loopback1] ipv6 address 2001:db8:11::1 128
[Spoke-CE1-Loopback1] quit
[Spoke-CE1] bgp 65410
[Spoke-CE1-bgp] ipv6-family unicast
[Spoke-CE1-bgp-af-ipv6] peer 2001:db8:1::2 as-number 100
[Spoke-CE1-bgp-af-ipv6] network 2001:db8:11::1 128
[Spoke-CE1-bgp-af-ipv6] quit
[Spoke-CE1-bgp] quit
# Configure Spoke-PE1.
[Spoke-PE1] bgp 100
[Spoke-PE1-bgp] ipv6-family vpn-instance vpna
[Spoke-PE1-bgp-6-vpna] peer 2001:db8:1::1 as-number 65410
[Spoke-PE1-bgp-6-vpna] quit
[Spoke-PE1-bgp] quit
# Configure Spoke-CE2.
# Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] ipv6-family vpn-instance vpna
[Spoke-PE2-bgp-6-vpna] peer 2001:db8:2::1 as-number 65420
[Spoke-PE2-bgp-6-vpna] quit
[Spoke-PE2-bgp] quit
After completing the configuration, run the display bgp vpnv6 all peer command
on each PE. The command output shows that BGP peer relationships have been
established between the PEs and CEs and are in Established state.
Step 5 Establish MP-IBGP peer relationships between the PEs.
# Configure Spoke-PE1.
[Spoke-PE1] bgp 100
[Spoke-PE1-bgp] peer 2.2.2.9 as-number 100
[Spoke-PE1-bgp] peer 2.2.2.9 connect-interface loopback 1
[Spoke-PE1-bgp] ipv6-family vpnv6
[Spoke-PE1-bgp-af-vpnv6] peer 2.2.2.9 enable
[Spoke-PE1-bgp-af-vpnv6] quit
# Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] peer 2.2.2.9 as-number 100
[Spoke-PE2-bgp] peer 2.2.2.9 connect-interface loopback 1
[Spoke-PE2-bgp] ipv6-family vpnv6
[Spoke-PE2-bgp-af-vpnv6] peer 2.2.2.9 enable
[Spoke-PE2-bgp-af-vpnv6] quit
After completing the configuration, run the display bgp peer or display bgp
vpnv6 all peer command on PEs. The command output shows that BGP peer
relationships have been established between PEs and are in Established state.
----End
Run the display bgp ipv6 routing-table command on the Spoke-CEs. The
command output shows that there are repetitive AS numbers in the AS_Path
attributes of the BGP routes to the peer Spoke-CE.
The following example uses the command output on Spoke-CE1.
<Spoke-CE1> display bgp ipv6 routing-table
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped, x - best external,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Configuration Scripts
● Spoke-CE1
#
sysname Spoke-CE1
#
vlan batch 100
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:db8:1::1/64
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:11::1/128
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
bgp 65410
router-id 1.1.1.1
peer 2001:db8:1::2 as-number 100
#
ipv6-family unicast
network 2001:db8:11::1 128
peer 2001:db8:1::2 enable
#
return
● Spoke-PE1
#
sysname Spoke-PE1
#
vlan batch 100 200
#
ip vpn-instance vpna
ipv6-family
route-distinguisher 100:1
vpn-target 100:1 export-extcommunity
vpn-target 200:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
#
mpls
#
mpls ldp
#
interface Vlanif100
ip binding vpn-instance vpna
ipv6 enable
ipv6 address 2001:db8:1::2/64
#
interface Vlanif200
ip address 10.2.1.1 255.255.255.0
mpls
mpls ldp
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
● Spoke-CE2
#
sysname Spoke-CE2
#
vlan batch 100
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:db8:2::1/64
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:12::2/128
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
bgp 65420
router-id 3.3.3.3
peer 2001:db8:2::2 as-number 100
#
ipv6-family unicast
network 2001:db8:12::2 128
peer 2001:db8:2::2 enable
#
return
● Hub-CE
#
sysname Hub-CE
#
vlan batch 100 200
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:db8:3::1/64
#
interface Vlanif200
ipv6 enable
ipv6 address 2001:db8:4::1/64
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:13::3/128
#
bgp 65430
router-id 2.2.2.2
peer 2001:db8:3::2 as-number 100
peer 2001:db8:4::2 as-number 100
#
ipv6-family unicast
network 2001:db8:13::3 128
peer 2001:db8:3::2 enable
peer 2001:db8:4::2 enable
#
return
● Hub-PE
#
sysname Hub-PE
#
vlan batch 100 200 300 400
#
ip vpn-instance vpn_in
ipv6-family
route-distinguisher 100:21
vpn-target 100:1 import-extcommunity
#
ip vpn-instance vpn_out
ipv6-family
route-distinguisher 100:22
vpn-target 200:1 export-extcommunity
#
mpls lsr-id 2.2.2.9
#
mpls
#
mpls ldp
#
interface Vlanif100
ip address 10.2.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif200
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif300
ip binding vpn-instance vpn_in
ipv6 enable
ipv6 address 2001:db8:3::2/64
#
interface Vlanif400
ip binding vpn-instance vpn_out
ipv6 enable
ipv6 address 2001:db8:4::2/64
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 300
#
interface 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 400
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
peer 1.1.1.9 enable
peer 3.3.3.9 enable
#
ipv6-family vpnv6
policy vpn-target
peer 1.1.1.9 enable
peer 3.3.3.9 enable
#
ipv6-family vpn-instance vpn_in
peer 2001:db8:3::1 as-number 65430
#
ipv6-family vpn-instance vpn_out
peer 2001:db8:4::1 as-number 65430
peer 2001:db8:4::1 allow-as-loop
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 10.2.1.0 0.0.0.255
network 10.1.1.0 0.0.0.255
#
return
Networking Requirements
NOTE
This configuration is supported only by the S5755-H, S6730-H-V2 and S5732-H-V2 series.
As shown in Figure 3-67, PE1, P, and PE2 belong to the same AS. A bidirectional
SRv6 BE path needs to be deployed between PE1 and PE2 to carry EVPN L3VPNv4
services. In addition, to guarantee the service SLAs of the VPN instance vpn1
between CE1 and CE2, a network slice (slice ID: 10) needs to be created on the
public network and used to carry vpn1's services. And to guarantee the service
SLAs of the VPN instance vpn2 between CE3 and CE4, another network slice (slice
ID: 20) needs to be created on the public network and used to carry vpn2's
services.
In this example, interface 1, interface 2, and interface 3 represent VLANIF 100, VLANIF 200, and
VLANIF 300, respectively.
Precautions
1. If you want to use the route color to steer SRv6 BE traffic to a network slice,
you first need to configure the route color (extended community attribute) in
the import or export route-policy.
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable IPv6 forwarding and configure an IPv6 address for interfaces on PE1,
the P, and PE2.
2. Enable OSPFv3 on PE1, the P, and PE2.
3. Configure EVPN L3VPN instances on each PE and bind the instances to the
corresponding access-side interfaces.
4. Establish an EBGP peer relationship between each PE and its connected CE.
5. Establish a BGP EVPN peer relationship between the PEs.
6. Configure SRv6 BE and enable OSPFv3 SRv6 on the PEs.
7. Create network slice instances and configure a base interface on PE1, the P,
and PE2.
Procedure
Step 1 Enable IPv6 forwarding and configure an IPv6 address for each interface. The
following example uses the configuration of PE1. The configurations of other
devices are similar to the configuration of PE1. For detailed configurations, see
Configuration Scripts.
[PE1] vlan batch 100 200 300
[PE1] interface vlanif 100
[PE1-Vlanif100] ipv6 enable
[PE1-Vlanif100] ipv6 address 2001:DB8:10::1 64
[PE1-Vlanif100] quit
[PE1] interface 10ge 1/0/1
[PE1-10GE1/0/1] port link-type access
[PE1-10GE1/0/1] port default vlan 100
[PE1-10GE1/0/1] quit
[PE1] interface LoopBack 1
[PE1-LoopBack1] ipv6 enable
[PE1-LoopBack1] ipv6 address 2001:DB8:1::1 128
[PE1-LoopBack1] quit
# Configure PE1.
[PE1] ospfv3 1
[PE1-ospfv3-1] router-id 1.1.1.1
[PE1-ospfv3-1] area 0
[PE1-ospfv3-1-area-0.0.0.0] quit
[PE1-ospfv3-1] quit
[PE1] interface vlanif 100
[PE1-Vlanif100] ospfv3 1 area 0.0.0.0
[PE1-Vlanif100] quit
[PE1] interface loopback1
[PE1-LoopBack1] ospfv3 1 area 0.0.0.0
[PE1-LoopBack1] quit
# Configure the P.
[P] ospfv3 1
[P-ospfv3-1] router-id 2.2.2.2
[P-ospfv3-1] area 0
[P-ospfv3-1-area-0.0.0.0] quit
[P-ospfv3-1] quit
[P] interface vlanif 100
[P-Vlanif100] ospfv3 1 area 0.0.0.0
[P-Vlanif100] quit
[P] interface vlanif 200
[P-Vlanif200] ospfv3 1 area 0.0.0.0
[P-Vlanif200] quit
[P] interface loopback1
[P-LoopBack1] ospfv3 1 area 0.0.0.0
[P-LoopBack1] quit
# Configure PE2.
[PE2] ospfv3 1
[PE2-ospfv3-1] router-id 3.3.3.3
[PE2-ospfv3-1] area 0
[PE2-ospfv3-1-area-0.0.0.0] quit
[PE2-ospfv3-1] quit
[PE2] interface vlanif 200
[PE2-Vlanif200] ospfv3 1 area 0.0.0.0
[PE2-Vlanif200] quit
[PE2] interface loopback1
Step 3 Configure EVPN L3VPN instances on each PE and bind the instances to the
corresponding access-side interfaces.
# Configure PE1.
[PE1] evpn-overlay enable
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 1:1 evpn both
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
[PE1] ip vpn-instance vpn2
[PE1-vpn-instance-vpn2] ipv4-family
[PE1-vpn-instance-vpn2-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpn2-af-ipv4] vpn-target 2:2 evpn both
[PE1-vpn-instance-vpn2-af-ipv4] quit
[PE1-vpn-instance-vpn2] quit
[PE1] vlan batch 200 300
[PE1] interface Vlanif 200
[PE1-Vlanif200] ip binding vpn-instance vpn1
[PE1-Vlanif200] ip address 10.1.1.1 24
[PE1-Vlanif200] quit
[PE1] interface Vlanif 300
[PE1-Vlanif300] ip binding vpn-instance vpn2
[PE1-Vlanif300] ip address 10.3.1.1 24
[PE1-Vlanif300] quit
[PE1] interface 10ge 1/0/2
[PE1-10GE1/0/2] port link-type access
[PE1-10GE1/0/2] port default vlan 200
[PE1-10GE1/0/2] quit
[PE1] interface 10ge 1/0/3
[PE1-10GE1/0/3] port link-type access
[PE1-10GE1/0/3] port default vlan 300
[PE1-10GE1/0/3] quit
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] advertise l2vpn evpn
[PE1-bgp-vpn1] quit
[PE1-bgp] ipv4-family vpn-instance vpn2
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] advertise l2vpn evpn
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] evpn-overlay enable
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
Step 4 Establish an EBGP peer relationship between each PE and its connected CE.
# Configure CE1.
[CE1] interface loopback 1
[CE1-LoopBack1] ip address 192.168.11.1 32
[CE1-LoopBack1] quit
[CE1] bgp 65410
[CE1-bgp] router-id 192.168.11.1
[CE1-bgp] peer 10.1.1.1 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure CE3.
[CE3] interface loopback 1
[CE3-LoopBack1] ip address 192.168.33.1 32
[CE3-LoopBack1] quit
[CE3] bgp 65430
[CE3-bgp] router-id 192.168.33.1
[CE3-bgp] peer 10.3.1.1 as-number 100
[CE3-bgp] import-route direct
[CE3-bgp] quit
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] router-id 1.1.1.1
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] peer 10.1.1.2 as-number 65410
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] quit
[PE1-bgp] ipv4-family vpn-instance vpn2
# Configure CE2.
[CE2] interface loopback 1
[CE2-LoopBack1] ip address 192.168.22.1 32
[CE2-LoopBack1] quit
[CE2] bgp 65420
[CE2-bgp] peer 10.2.1.1 as-number 100
[CE2-bgp] import-route direct
[CE2-bgp] quit
# Configure CE4.
[CE4] interface loopback 1
[CE4-LoopBack1] ip address 192.168.44.1 32
[CE4-LoopBack1] quit
[CE4] bgp 65440
[CE4-bgp] peer 10.4.1.1 as-number 100
[CE4-bgp] import-route direct
[CE4-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] router-id 3.3.3.3
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] peer 10.2.1.2 as-number 65420
[PE2-bgp-vpn1] import-route direct
[PE2-bgp] ipv4-family vpn-instance vpn2
[PE2-bgp-vpn2] peer 10.4.1.2 as-number 65440
[PE2-bgp-vpn2] import-route direct
[PE2-bgp-vpn2] quit
[PE2-bgp] quit
After completing the configuration, run the display bgp vpnv4 vpn-instance peer
command on the PEs to check whether BGP peer relationships have been
established between the PEs and CEs. If the Established state is displayed in the
command output, the BGP peer relationships have been established successfully.
The following uses PE1 as an example to show that a peer relationship has been
established between PE1 and CE1.
[PE1] display bgp vpnv4 vpn-instance vpn1 peer
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 2001:DB8:1::1 as-number 100
[PE2-bgp] peer 2001:DB8:1::1 connect-interface loopback 1
[PE2-bgp] l2vpn-family evpn
[PE2-bgp-af-evpn] peer 2001:DB8:1::1 enable
[PE2-bgp-af-evpn] quit
[PE2-bgp] quit
After completing the configuration, run the display bgp evpn peer command on
the PEs to check whether a BGP EVPN peer relationship has been established
between the PEs. If the Established state is displayed in the command output, the
BGP EVPN peer relationship has been established successfully.
Step 6 Configure SRv6 BE on the PEs.
# Configure PE1.
[PE1] segment-routing ipv6
[PE1-segment-routing-ipv6] encapsulation source-address 2001:DB8:1::1
[PE1-segment-routing-ipv6] locator PE1 ipv6-prefix 2001:DB8:100:: 64 static 32
[PE1-segment-routing-ipv6-locator] opcode ::100 end-dt4 vpn-instance vpn1 evpn
[PE1-segment-routing-ipv6-locator] quit
[PE1-segment-routing-ipv6] quit
[PE1] ospfv3 1
[PE1-ospfv3-1] segment-routing ipv6 locator PE1 auto-sid-disable
[PE1-ospfv3-1] quit
[PE1] bgp 100
[PE1-bgp] l2vpn-family evpn
[PE1-bgp-af-evpn] peer 2001:DB8:3::3 advertise encap-type srv6
[PE1-bgp-af-evpn] quit
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] segment-routing ipv6 locator PE1 evpn
[PE1-bgp-vpn1] segment-routing ipv6 best-effort evpn
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] segment-routing ipv6
[PE2-segment-routing-ipv6] encapsulation source-address 2001:DB8:3::3
[PE2-segment-routing-ipv6] locator PE2 ipv6-prefix 2001:DB8:130:: 64 static 32
[PE2-segment-routing-ipv6-locator] opcode ::200 end-dt4 vpn-instance vpn1 evpn
[PE2-segment-routing-ipv6-locator] quit
[PE2-segment-routing-ipv6] quit
[PE2] ospfv3 1
[PE2-ospfv3-1] segment-routing ipv6 locator PE2 auto-sid-disable
[PE2-ospfv3-1] quit
[PE2] bgp 100
[PE2-bgp] l2vpn-family evpn
[PE2-bgp-af-evpn] peer 2001:DB8:1::1 advertise encap-type srv6
[PE2-bgp-af-evpn] quit
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] segment-routing ipv6 locator PE2 evpn
[PE2-bgp-vpn1] segment-routing ipv6 best-effort evpn
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
----End
Configuration Scripts
● PE1
#
sysname PE1
#
evpn-overlay enable
#
vlan batch 100 200 300
#
ip vpn-instance vpn1
traffic-policy p1 inbound
ipv4-family
route-distinguisher 100:1
vpn-target 1:1 export-extcommunity evpn
vpn-target 1:1 import-extcommunity evpn
#
ip vpn-instance vpn2
traffic-policy p2 inbound
ipv4-family
route-distinguisher 100:2
vpn-target 2:2 export-extcommunity evpn
vpn-target 2:2 import-extcommunity evpn
#
traffic classifier c1 type or
if-match any
#
traffic classifier c2 type or
if-match any
#
traffic behavior b1
network-slice-instance 10
#
traffic behavior b2
network-slice-instance 20
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
traffic policy p2
classifier c2 behavior b2 precedence 5
#
network-slice instance 10
network-slice instance 20
#
segment-routing ipv6
encapsulation source-address 2001:DB8:1::1
locator PE1 ipv6-prefix 2001:DB8:100:: 64 static 32
opcode ::100 end-dt4 vpn-instance vpn1 evpn
#
ospfv3 1
router-id 1.1.1.1
segment-routing ipv6 locator PE1 auto-sid-disable
area 0.0.0.0
#
interface Vlanif100
ipv6 enable
ipv6 address 2001:DB8:10::1/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif200
ip binding vpn-instance vpn1
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif300
ip binding vpn-instance vpn2
ip address 10.3.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 100
network-slice 10 flex-channel 1000
network-slice 20 flex-channel 1000
#
interface 10GE1/0/2
port link-type access
port default vlan 200
#
interface 10GE1/0/3
port link-type access
interface LoopBack1
ipv6 enable
ipv6 address 2001:DB8:2::2/128
ospfv3 1 area 0.0.0.0
#
return
● PE2
#
sysname PE2
#
evpn-overlay enable
#
vlan batch 100 200 300
#
network-slice instance 10
network-slice instance 20
#
ip vpn-instance vpn1
traffic-policy p1 inbound
ipv4-family
route-distinguisher 200:1
vpn-target 1:1 export-extcommunity evpn
vpn-target 1:1 import-extcommunity evpn
#
ip vpn-instance vpn2
traffic-policy p2 inbound
ipv4-family
route-distinguisher 200:2
vpn-target 2:2 export-extcommunity evpn
vpn-target 2:2 import-extcommunity evpn
#
traffic classifier c1 type or
if-match any
#
traffic classifier c2 type or
if-match any
#
traffic behavior b1
network-slice-instance 10
#
traffic behavior b2
network-slice-instance 20
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
traffic policy p2
classifier c2 behavior b2 precedence 5
#
network-slice instance 10
network-slice instance 20
#
segment-routing ipv6
encapsulation source-address 2001:DB8:3::3
locator PE2 ipv6-prefix 2001:DB8:130:: 64 static 32
opcode ::200 end-dt4 vpn-instance vpn1 evpn
#
ospfv3 1
router-id 3.3.3.3
segment-routing ipv6 locator PE1 auto-sid-disable
area 0.0.0.0
#
interface Vlanif 100
ip binding vpn-instance vpn1
ip address 10.2.1.1 255.255.255.0
#
interface Vlanif 200
ipv6 enable
ipv6 address 2001:DB8:20::2/64
interface Vlanif300
ip address 10.4.1.2 255.255.255.0
#
interface 10GE1/0/1
port link-type access
port default vlan 300
#
interface LoopBack1
ip address 192.168.44.1 255.255.255.255
#
bgp 65440
peer 10.4.1.1 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.4.1.1 enable
#
return
Networking Requirements
As shown in Figure 3-68, PE1 and PE2 communicate through VLANs. To guarantee
the service SLAs of VLAN 10 between CE1 and CE2, a network slice (slice ID: 10)
needs to be created on the public network and used to carry VLAN 10's services.
And to guarantee the service SLAs of VLAN 20 between CE3 and CE4, another
network slice (slice ID: 20) needs to be created on the public network and used to
carry VLAN 20's services.
In this example, Interface1, Interface2, and Interface3 represent 10GE1/0/1, 10GE1/0/2, and
10GE1/0/3, respectively.
Precautions
To prevent VLAN slicing information from flowing into other networks and
therefore affecting traffic forwarding, configure a termination mode for VLAN
slicing at the egresses of the slices, for example, interface 2 and interface 3 of the
PEs.
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Create VLANs on the devices.
After the configuration is complete, you can check information about interfaces in
the VLANs.
[PE1] display vlan 10
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
MAC-LRN: MAC-address learning; STAT: Statistic;
BC: Broadcast; MC: Multicast; UC: Unknown-unicast;
FWD: Forward; DSD: Discard;
--------------------------------------------------------------------------------
VID Ports
--------------------------------------------------------------------------------
10 TG:10GE1/0/1(U) 10GE1/0/2(U)
VID Type Status Property MAC-LRN STAT BC MC UC Description
--------------------------------------------------------------------------------
10 common enable default enable disable FWD FWD FWD VLAN 0010
# Configure CE2.
[CE2] interface 10ge 1/0/1
[CE2-10GE1/0/1] port link-type trunk
[CE2-10GE1/0/1] port trunk allow-pass vlan 10
[CE2-10GE1/0/1] quit
# Configure CE3.
[CE3] interface 10ge 1/0/1
[CE3-10GE1/0/1] port link-type trunk
[CE3-10GE1/0/1] port trunk allow-pass vlan 20
[CE3-10GE1/0/1] quit
# Configure CE4.
[CE4] interface 10ge 1/0/1
[CE4-10GE1/0/1] port link-type trunk
[CE4-10GE1/0/1] port trunk allow-pass vlan 20
[CE4-10GE1/0/1] quit
# Configure PE2.
[PE2] interface 10ge 1/0/1
[PE2-10GE1/0/1] traffic-policy p1 inbound
[PE2-10GE1/0/1] quit
[PE2] interface 10ge 1/0/2
[PE2-10GE1/0/2] traffic-policy p1 inbound
[PE2-10GE1/0/2] quit
[PE2] interface 10ge 1/0/3
[PE2-10GE1/0/3] traffic-policy p1 inbound
[PE2-10GE1/0/3] quit
Check the traffic policy configuration. The following example uses the command
output on PE1.
[PE1] display traffic-policy applied-record
Total records : 1
--------------------------------------------------------------------------------
Policy Type/Name Apply Parameter Slot State
--------------------------------------------------------------------------------
p1 10GE1/0/1(IN) 1 success
10GE1/0/2(IN) 1 success
10GE1/0/3(IN) 1 success
--------------------------------------------------------------------------------
----End
Configuration Scripts
● PE1
#
sysname PE1
#
vlan batch 10 20
#
traffic classifier c1 type or
if-match vlan 10
#
traffic classifier c2 type or
if-match vlan 20
#
traffic behavior b1
network-slice-instance 10
#
traffic behavior b2
network-slice-instance 20
#
traffic policy p1
classifier c1 behavior b1 precedence 5
classifier c2 behavior b2 precedence 5
#
network-slice instance 10
network-slice instance 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
traffic-policy p1 inbound
network-slice 10 flex-channel 1000
network-slice 20 flex-channel 1000
#
interface 10GE1/0/2
port link-type trunk
traffic-policy p1 inbound
port trunk allow-pass vlan 10
network-slice 10 flex-channel 100 end-mode
#
interface 10GE1/0/3
port link-type trunk
traffic-policy p1 inbound
port trunk allow-pass vlan 20
network-slice 20 flex-channel 100 end-mode
#
network-slice enable
#
network-slice vlan-encapsulate enable
#
return
● PE2
#
sysname PE2
#
vlan batch 10 20
#
traffic-policy p1 global inbound
#
traffic classifier c1 type or
if-match vlan 10
#
traffic classifier c2 type or
if-match vlan 20
#
traffic behavior b1
network-slice-instance 10
#
traffic behavior b2
network-slice-instance 20
#
traffic policy p1
classifier c1 behavior b1 precedence 5
classifier c2 behavior b2 precedence 5
#
network-slice instance 10
network-slice instance 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
traffic-policy p1 inbound
network-slice 10 flex-channel 1000
network-slice 20 flex-channel 1000
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 10
traffic-policy p1 inbound
network-slice 10 flex-channel 100 end-mode
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 20
traffic-policy p1 inbound
network-slice 20 flex-channel 100 end-mode
#
network-slice enable
#
network-slice vlan-encapsulate enable
#
return
● CE1
#
sysname CE1
#
vlan batch 10
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
● CE2
#
sysname CE2
#
vlan batch 10
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
● CE3
#
sysname CE3
#
vlan batch 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
return
● CE4
#
sysname CE4
#
vlan batch 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
return
3.1.11.1 VRRP
Networking Requirements
Figure 1 Networking diagram of configuring VRRP to ensure reliable
multicast data transmission shows a campus network on which DeviceA and
DeviceB serve as egress gateways, and DeviceC and DeviceD serve as core devices.
The multicast source connects to the campus network through routers. On this
network, key nodes work in redundancy mode to improve network reliability, and
the egress gateways and core devices are fully meshed to implement link
redundancy. Configuring VRRP enables the multicast data to be securely and
reliably transmitted to downstream networks.
Precautions
1. VRRP groups must use different virtual IP addresses. The virtual IP address of
a VRRP group must be on the same network segment as the IP address of the
interface where the VRRP group is configured.
2. Devices in a VRRP group must be configured with the same VRID.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure link aggregation. Configure link aggregation between DeviceA and
DeviceB, and between DeviceC and DeviceD to ensure that VRRP packets can
be exchanged and VRRP can run properly.
2. Configure VLANs. Create VLANs on the devices and add their interfaces to
respective VLANs. Configure IP addresses for the corresponding VLANIF
interfaces to make local network segments reachable.
NOTE
Procedure
1. Configure link aggregation. On DeviceA, create an Eth-Trunk interface and
add a member interface to it. The configurations of DeviceB, DeviceC, and
DeviceD are similar to the configuration of DeviceA. For detailed
configurations, see Configuration Scripts.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] trunkport 10ge 1/0/2 to 1/0/4
[DeviceA-Eth-Trunk1] quit
2. Configure VLANs.
a. On DeviceA, create VLANs and add interfaces to them. The configurations
of DeviceB, DeviceC, and DeviceD are similar to the configuration of
DeviceA. For detailed configurations, see Configuration Scripts.
[DeviceA] vlan batch 100 200 301 302
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 100
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/5
[DeviceA-10GE1/0/5] port link-type trunk
[DeviceA-10GE1/0/5] port trunk allow-pass vlan 301
[DeviceA-10GE1/0/5] quit
[DeviceA] interface 10ge 1/0/6
[DeviceA-10GE1/0/6] port link-type trunk
[DeviceA-10GE1/0/6] port trunk allow-pass vlan 302
[DeviceA-10GE1/0/6] quit
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] port link-type trunk
[DeviceA-Eth-Trunk1] port trunk allow-pass vlan 100 200
[DeviceA-Eth-Trunk1] quit
3. Configure OSPF. Enable OSPF on DeviceA, add the device to area 0, and
advertise local network segments in area 0. The configurations of DeviceB,
DeviceC, and DeviceD are similar to the configuration of DeviceA. For detailed
configurations, see Configuration Scripts.
[DeviceA] ospf
[DeviceA-ospf-1] area 0
[DeviceA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] network 10.10.1.1 0.0.0.0
[DeviceA-ospf-1-area-0.0.0.0] quit
[DeviceA-ospf-1] quit
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] interface vlanif 100
[DeviceB-Vlanif100] vrrp vrid 1 virtual-ip 10.1.1.253
[DeviceB-Vlanif100] quit
# Configure DeviceB.
6. Configure BFD.
a. Enable BFD globally on DeviceA. The configurations of DeviceB, DeviceC,
and DeviceD are similar to the configuration of DeviceA. For detailed
configurations, see Configuration Scripts.
[DeviceA] bfd
[DeviceA-bfd] quit
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Create time : 2012-12-31 10:35:39 UTC-08:00
Last change time : 2012-12-31 10:35:43 UTC-08:00
# Run the display vrrp verbose command on DeviceB. The command output
shows that DeviceB is the backup device in VRRP group 1 and the master
device in VRRP group 2.
[DeviceB] display vrrp verbose
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.253
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2012-12-31 10:34:23 UTC-08:00
Last change time : 2012-12-31 10:34:26 UTC-08:00
● According to the dynamic RP election rules, if C-RP interfaces have the same IP
address mask, priority, and hash calculation result, the interface with a larger IP
address is selected as the RP interface. Therefore, Loopback1 of DeviceD becomes
the RP interface.
● According to the reverse path check (RPF) rules, if two equal-cost optimal routes
are available in the IP routing table, the route with a larger next hop address is
selected as the RPF route. Therefore, DeviceD selects the route with the next hop
address 10.1.4.1 and destination network segment 10.1.1.0/24 as the RPF route to
the destination network segment 10.1.1.0/24.
[DeviceB] display pim routing-table
VPN-Instance: public net
Total 0 (*, G) entry; 1 (S, G) entry
(10.100.1.1, 225.0.0.10)
RP: 10.4.4.4
Protocol: pim-sm, Flag: SPT ACT
UpTime: 00:00:42
Upstream interface: Vlanif100
Upstream neighbor: 10.1.1.3
RPF prime neighbor: 10.1.1.3
Downstream interface(s) information:
Total number of downstreams: 1
1: Vlanif303
Protocol: pim-sm, UpTime: 00:00:42, Expires:-
[DeviceD] display pim routing-table
VPN-Instance: public net
Total 0 (*, G) entry; 1 (S, G) entry
(10.100.1.1, 225.0.0.10)
RP: 10.4.4.4
Protocol: pim-sm, Flag: SPT ACT
UpTime: 00:00:42
Upstream interface: Vlanif303
Upstream neighbor: 10.1.4.1
RPF prime neighbor: 10.1.4.1
Downstream interface(s) information:
Total number of downstreams: 1
1: Vlanif400
Protocol: pim-sm, UpTime: 00:00:42, Expires:-
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 100 200 301 302
#
multicast routing-enable
#
bfd
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.253
vrrp vrid 1 priority 120
vrrp vrid 1 preempt timer delay 20
vrrp vrid 2 virtual-ip 10.1.1.254
pim sm
pim bfd enable
ospf bfd enable
#
interface Vlanif301
ip address 10.1.2.1 255.255.255.0
pim sm
pim bfd enable
ospf bfd enable
#
interface Vlanif302
ip address 10.1.3.1 255.255.255.0
pim sm
pim bfd enable
ospf bfd enable
#
interface Eth-Trunk1
trunkport 10GE1/0/2 to 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 100 200
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
eth-trunk 1
#
interface 10GE1/0/3
eth-trunk 1
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
port link-type trunk
port trunk allow-pass vlan 301
#
interface 10GE1/0/6
port link-type trunk
port trunk allow-pass vlan 302
#
interface LoopBack1
ip address 10.10.1.1 255.255.255.255
pim sm
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
network 10.10.1.1 0.0.0.0
#
return
● DeviceB
#
sysname DeviceB
#
vlan batch 100 200 303 304
#
multicast routing-enable
#
bfd
#
interface Vlanif100
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.253
vrrp vrid 2 virtual-ip 10.1.1.254
vrrp vrid 2 priority 120
vrrp vrid 2 preempt timer delay 20
pim sm
pim bfd enable
ospf bfd enable
#
interface Vlanif303
ip address 10.1.4.1 255.255.255.0
pim sm
pim bfd enable
ospf bfd enable
#
interface Vlanif304
ip address 10.1.5.1 255.255.255.0
pim sm
pim bfd enable
ospf bfd enable
#
interface Eth-Trunk1
trunkport 10GE1/0/2 to 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 100 200
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
eth-trunk 1
#
interface 10GE1/0/3
eth-trunk 1
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
port link-type trunk
port trunk allow-pass vlan 303
#
interface 10GE1/0/6
port link-type trunk
port trunk allow-pass vlan 304
#
interface LoopBack1
ip address 10.2.2.2 255.255.255.255
pim sm
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.4.0 0.0.0.255
network 10.1.5.0 0.0.0.255
network 10.2.2.2 0.0.0.0
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 301 304 400 500
#
multicast routing-enable
#
bfd
#
interface Vlanif301
ip address 10.1.2.2 255.255.255.0
pim sm
pim bfd enable
ospf bfd enable
#
interface Vlanif304
ip address 10.1.5.2 255.255.255.0
pim sm
pim bfd enable
ospf bfd enable
#
interface Vlanif400
ip address 10.1.6.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.6.253
vrrp vrid 1 priority 120
vrrp vrid 1 preempt timer delay 20
vrrp vrid 2 virtual-ip 10.1.6.254
pim sm
pim bfd enable
igmp enable
ospf bfd enable
#
interface Eth-Trunk1
trunkport 10GE1/0/2 to 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 400 500
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 400
stp disable
#
interface 10GE1/0/2
eth-trunk 1
#
interface 10GE1/0/3
eth-trunk 1
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
port link-type trunk
port trunk allow-pass vlan 301
#
interface 10GE1/0/6
port link-type trunk
port trunk allow-pass vlan 304
#
interface LoopBack1
ip address 10.3.3.3 255.255.255.255
pim sm
#
ospf 1
area 0.0.0.0
network 10.1.2.0 0.0.0.255
interface LoopBack1
ip address 10.4.4.4 255.255.255.255
pim sm
#
ospf 1
area 0.0.0.0
network 10.1.3.0 0.0.0.255
network 10.1.4.0 0.0.0.255
network 10.1.6.0 0.0.0.255
network 10.4.4.4 0.0.0.0
#
pim
c-bsr LoopBack1
c-rp LoopBack1
#
return
3.1.11.2 M-LAG
Networking Requirements
In Figure 3-70, a server is dual-homed to a Layer 2 network through an M-LAG.
As link aggregation between hosts and access devices only achieves link-level
reliability, a fault on an access device may cause service interruption. As such, this
cannot fulfill service reliability requirements. To address this problem, an M-LAG
can be configured. When both M-LAG master and backup devices work properly,
traffic is load balanced to them. In addition, services will not be affected if any of
the two devices fails. As such, high service reliability is ensured. On an Ethernet
network, a blocked interface cannot transmit DAD packets between M-LAG
master and backup devices; therefore, a DFS group is configured and bound to the
IP address of the Ethernet management interface on each of the two devices to
ensure normal forwarding of DAD packets.
Configuration Roadmap
1. Configure DeviceA and DeviceB as root bridges with the same bridge MAC
address to ensure that both devices function as the root bridge on the Layer 2
network.
2. Configure IP addresses for the Ethernet management interface on DeviceA
and DeviceB to ensure their Layer 3 connectivity so that DAD packets can be
forwarded between them.
3. Configure M-LAG on DeviceA and DeviceB so that the server can be dual-
homed to the M-LAG set up by DeviceA and DeviceB.
Procedure
Step 1 Configure DeviceA and DeviceB as root bridges with the same bridge MAC
address.
NOTE
If the downstream device dual-homed to the M-LAG member devices is a network device, root
protection must be configured.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] stp root primary
[DeviceA] stp bridge-address 00e0-fc12-3458 //Configure the bridge MAC address of the root bridge
(MAC address of the M-LAG master device).
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] trunkport 10ge 1/0/2
[DeviceA-Eth-Trunk1] trunkport 10ge 1/0/5
[DeviceA-Eth-Trunk1] stp edged-port enable
[DeviceA-Eth-Trunk1] quit
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
Step 2 Configure an IP address for the Ethernet management interface on DeviceA and
DeviceB, respectively.
Ensure that DeviceA and DeviceB can communicate at Layer 3 through their
Ethernet management interfaces.
# Configure DeviceA.
[DeviceA] interface meth 0/0/0
[DeviceA-MEth0/0/0] ip address 10.1.1.1 24
[DeviceA-MEth0/0/0] quit
# Configure DeviceB.
[DeviceB] interface meth 0/0/0
[DeviceB-MEth0/0/0] ip address 10.1.1.2 24
[DeviceB-MEth0/0/0] quit
Step 3 Create a DFS group on DeviceA and DeviceB and bind the IP address of the
Ethernet management interface on each of the two devices to the DFS group.
# Configure DeviceA.
[DeviceA] dfs-group 1
[DeviceA-dfs-group-1] dual-active detection source ip 10.1.1.1 peer 10.1.1.2
[DeviceA-dfs-group-1] priority 150
[DeviceA-dfs-group-1] authentication-mode hmac-sha256 password YsHsjx_202206
[DeviceA-dfs-group-1] quit
# Configure DeviceB.
[DeviceB] dfs-group 1
[DeviceB-dfs-group-1] dual-active detection source ip 10.1.1.2 peer 10.1.1.1
[DeviceB-dfs-group-1] priority 120
[DeviceB-dfs-group-1] authentication-mode hmac-sha256 password YsHsjx_202206
[DeviceB-dfs-group-1] quit
# Configure DeviceB.
[DeviceB] interface eth-trunk 0
[DeviceB-Eth-Trunk0] mode lacp-static
[DeviceB-Eth-Trunk0] trunkport 10ge 1/0/3
[DeviceB-Eth-Trunk0] trunkport 10ge 1/0/4
[DeviceB-Eth-Trunk0] undo stp enable
[DeviceB-Eth-Trunk0] peer-link 1
[DeviceB-Eth-Trunk0] quit
Step 5 Add the Eth-Trunk interfaces connecting DeviceA to the server and DeviceB to the
server to VLAN 11 and bind the interfaces to the DFS group.
The uplink interfaces that connect the server to DeviceA and DeviceB must be
added to an Eth-Trunk interface, and the working mode of the Eth-Trunk interface
must be the same as that of the Eth-Trunk interfaces on both devices. In this
example, the Eth-Trunk interfaces on both devices are configured to work in static
LACP mode.
# Configure DeviceA.
[DeviceA] vlan batch 11
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] mode lacp-static
[DeviceA-Eth-Trunk1] port link-type access
[DeviceA-Eth-Trunk1] port default vlan 11
[DeviceA-Eth-Trunk1] dfs-group 1 m-lag 1
[DeviceA-Eth-Trunk1] quit
# Configure DeviceB.
[DeviceB] vlan batch 11
[DeviceB] interface eth-trunk 1
[DeviceB-Eth-Trunk1] mode lacp-static
[DeviceB-Eth-Trunk1] port link-type access
[DeviceB-Eth-Trunk1] port default vlan 11
[DeviceB-Eth-Trunk1] dfs-group 1 m-lag 1
[DeviceB-Eth-Trunk1] quit
Step 6 Configure the link between DeviceA and DeviceC and the link between DeviceB
and DeviceD, and configure the interface type and allowed VLAN.
# Configure DeviceA.
[DeviceA] interface eth-trunk 2
[DeviceA-Eth-Trunk2] mode lacp-static
[DeviceA-Eth-Trunk2] port link-type trunk
[DeviceA-Eth-Trunk2] port trunk allow-pass vlan 11
[DeviceA-Eth-Trunk2] trunkport 10ge 1/0/1
[DeviceA-Eth-Trunk2] trunkport 10ge 1/0/7
[DeviceA-Eth-Trunk2] quit
# Configure DeviceB.
[DeviceB] interface eth-trunk 2
[DeviceB-Eth-Trunk2] mode lacp-static
[DeviceB-Eth-Trunk2] port link-type trunk
[DeviceB-Eth-Trunk2] port trunk allow-pass vlan 11
[DeviceB-Eth-Trunk2] trunkport 10ge 1/0/1
[DeviceB-Eth-Trunk2] trunkport 10ge 1/0/7
[DeviceB-Eth-Trunk2] quit
# Configure DeviceC.
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
[DeviceC] vlan batch 11
[DeviceC] interface eth-trunk 2
[DeviceC-Eth-Trunk2] mode lacp-static
[DeviceC-Eth-Trunk2] port link-type trunk
[DeviceC-Eth-Trunk2] port trunk allow-pass vlan 11
[DeviceC-Eth-Trunk2] trunkport 10ge 1/0/1
[DeviceC-Eth-Trunk2] trunkport 10ge 1/0/2
[DeviceC-Eth-Trunk2] quit
# Configure DeviceD.
<HUAWEI> system-view
[HUAWEI] sysname DeviceD
[DeviceD] vlan batch 11
[DeviceD] interface eth-trunk 2
----End
In the preceding command output, the Heart beat state field displays OK,
indicating that the heartbeat status is normal. DeviceA is node 1 with a priority of
150 and serves as the M-LAG master device (the State field displays Master),
whereas DeviceB is node 2 with a priority of 120 and serves as the M-LAG backup
device (the State field displays Backup). In addition, the Causation field displays
-, indicating that the M-LAG is set up successfully.
# Display M-LAG information on DeviceA.
[DeviceA] display dfs-group 1 node 1 m-lag brief
* - Local node
Failed reason:
1 -- Relationship between vlan and port is inconsistent
2 -- STP configuration under the port is inconsistent
3 -- STP port priority configuration is inconsistent
4 -- LACP mode of M-LAG is inconsistent
5 -- M-LAG configuration is inconsistent
6 -- The number of M-LAG members is inconsistent
7 -- LACP system-id of M-LAG is inconsistent
8 -- LACP priority of M-LAG is inconsistent
9 -- STP port edged configuration is inconsistent
10 -- M-LAG mode configuration is inconsistent
Failed reason:
1 -- Relationship between vlan and port is inconsistent
2 -- STP configuration under the port is inconsistent
3 -- STP port priority configuration is inconsistent
4 -- LACP mode of M-LAG is inconsistent
5 -- M-LAG configuration is inconsistent
6 -- The number of M-LAG members is inconsistent
7 -- LACP system-id of M-LAG is inconsistent
8 -- LACP priority of M-LAG is inconsistent
9 -- STP port edged configuration is inconsistent
10 -- M-LAG mode configuration is inconsistent
In the preceding command outputs, the Port State fields of node 1 and node 2
display Up, and the M-LAG status of node 1 and node 2 is active, indicating that
the M-LAG configuration is correct.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
dfs-group 1
priority 150
dual-active detection source ip 10.1.1.1 peer 10.1.1.2
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11
#
stp bridge-address 00e0-fc12-3458
stp root primary
#
interface MEth0/0/0
ip address 10.1.1.1 255.255.255.0
#
interface Eth-Trunk0
mode lacp-static
stp disable
peer-link 1
#
interface Eth-Trunk1
port default vlan 11
stp edged-port enable
mode lacp-static
dfs-group 1 m-lag 1
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 2
#
interface 10GE1/0/7
eth-trunk 2
#
interface 10GE1/0/3
eth-trunk 0
#
interface 10GE1/0/4
eth-trunk 0
#
interface 10GE1/0/5
eth-trunk 1
#
interface 10GE1/0/2
eth-trunk 1
#
return
● DeviceB
#
sysname DeviceB
#
dfs-group 1
priority 120
dual-active detection source ip 10.1.1.2 peer 10.1.1.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!=I9f8>C{!P_bhB31@7r-=jrS8c|
_"(Bn~#[email protected](wAt/IQXl6>[g{6YlOi9$!!!!!!!!!!%+%#
#
vlan batch 11
#
stp bridge-address 00e0-fc12-3458
stp root primary
#
interface MEth0/0/0
ip address 10.1.1.2 255.255.255.0
#
interface Eth-Trunk0
mode lacp-static
stp disable
peer-link 1
#
interface Eth-Trunk1
port default vlan 11
stp edged-port enable
mode lacp-static
dfs-group 1 m-lag 1
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 2
#
interface 10GE1/0/7
eth-trunk 2
#
interface 10GE1/0/3
eth-trunk 0
#
interface 10GE1/0/4
eth-trunk 0
#
interface 10GE1/0/5
eth-trunk 1
#
interface 10GE1/0/2
eth-trunk 1
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 11
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 2
#
interface 10GE1/0/2
eth-trunk 2
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 11
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 2
#
interface 10GE1/0/2
eth-trunk 2
#
return
Networking Requirements
In Figure 3-71, a device is dual-homed to a Layer 3 network through an M-LAG,
with the following requirements:
● High reliability: If one access link fails, traffic needs to be quickly switched to
the other link.
● High bandwidth utilization: Both access links are in active state and can load
balance traffic.
Configuration Roadmap
The configuration roadmap is as follows:
1. On DeviceD, bind uplink interfaces to an Eth-Trunk interface.
2. On DeviceA and DeviceB, configure V-STP, create a DFS group, bind IP
addresses of management interfaces to the DFS group, and configure peer-
link interfaces and M-LAG member interfaces.
3. On DeviceA and DeviceB, configure IP and MAC addresses for VLANIF
interfaces so that DeviceA and DeviceB function as dual-active gateways for
access devices.
4. On DeviceA, DeviceB, and DeviceC, configure OSPF to ensure Layer 3
connectivity.
NOTE
Procedure
Step 1 On DeviceD, bind uplink interfaces to an Eth-Trunk interface.
# Configure DeviceD.
<HUAWEI> system-view
[HUAWEI] sysname DeviceD
[DeviceD] vlan batch 11
[DeviceD] interface eth-trunk 20
[DeviceD-Eth-Trunk20] mode lacp-static
[DeviceD-Eth-Trunk20] port link-type trunk
[DeviceD-Eth-Trunk20] port trunk allow-pass vlan 11
[DeviceD-Eth-Trunk20] trunkport 10ge 1/0/1 to 1/0/4
[DeviceD-Eth-Trunk20] quit
Step 2 On DeviceA and DeviceB, configure V-STP, create a DFS group, bind IP addresses of
management interfaces to the DFS group, and configure peer-link interfaces and
M-LAG member interfaces.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] stp mode rstp
[DeviceA] stp v-stp enable
[DeviceA] interface meth 0/0/0
[DeviceA-MEth0/0/0] ip address 10.200.1.1 24
[DeviceA-MEth0/0/0] quit
[DeviceA] dfs-group 1
[DeviceA-dfs-group-1] dual-active detection source ip 10.200.1.1 peer 10.200.1.2
[DeviceA-dfs-group-1] priority 150
[DeviceA-dfs-group-1] authentication-mode hmac-sha256 password YsHsjx_202206
[DeviceA-dfs-group-1] quit
[DeviceA] interface eth-trunk 1
[DeviceA-Eth-Trunk1] trunkport 10ge 1/0/4
[DeviceA-Eth-Trunk1] trunkport 10ge 1/0/5
[DeviceA-Eth-Trunk1] mode lacp-static
[DeviceA-Eth-Trunk1] peer-link 1
[DeviceA-Eth-Trunk1] port vlan exclude 1
[DeviceA-Eth-Trunk1] quit
[DeviceA] vlan batch 11
[DeviceA] interface eth-trunk 10
[DeviceA-Eth-Trunk10] mode lacp-static
[DeviceA-Eth-Trunk10] port link-type trunk
[DeviceA-Eth-Trunk10] port trunk allow-pass vlan 11
[DeviceA-Eth-Trunk10] trunkport 10ge 1/0/2
[DeviceA-Eth-Trunk10] trunkport 10ge 1/0/3
[DeviceA-Eth-Trunk10] dfs-group 1 m-lag 1
[DeviceA-Eth-Trunk10] quit
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] stp mode rstp
[DeviceB] stp v-stp enable
[DeviceB] interface meth 0/0/0
[DeviceB-MEth0/0/0] ip address 10.200.1.2 24
[DeviceB-MEth0/0/0] quit
[DeviceB] dfs-group 1
[DeviceB-dfs-group-1] dual-active detection source ip 10.200.1.2 peer 10.200.1.1
[DeviceB-dfs-group-1] priority 120
[DeviceB-dfs-group-1] authentication-mode hmac-sha256 password YsHsjx_202206
[DeviceB-dfs-group-1] quit
[DeviceB] interface eth-trunk 1
[DeviceB-Eth-Trunk1] trunkport 10ge 1/0/4
[DeviceB-Eth-Trunk1] trunkport 10ge 1/0/5
[DeviceB-Eth-Trunk1] mode lacp-static
[DeviceB-Eth-Trunk1] peer-link 1
[DeviceB-Eth-Trunk1] port vlan exclude 1
[DeviceB-Eth-Trunk1] quit
[DeviceB] vlan batch 11
[DeviceB] interface eth-trunk 10
[DeviceB-Eth-Trunk10] mode lacp-static
Step 3 On DeviceA and DeviceB, configure IP and MAC addresses for VLANIF interfaces so
that DeviceA and DeviceB function as dual-active gateways for access devices.
DeviceA and DeviceB must be configured with the same virtual IP address and
virtual MAC address.
# Configure DeviceA.
[DeviceA] interface vlanif 11
[DeviceA-Vlanif11] ip address 10.2.1.1 24
[DeviceA-Vlanif11] mac-address 0000-5e00-0101
[DeviceA-Vlanif11] quit
# Configure DeviceB.
[DeviceB] interface vlanif 11
[DeviceB-Vlanif11] ip address 10.2.1.1 24
[DeviceB-Vlanif11] mac-address 0000-5e00-0101
[DeviceB-Vlanif11] quit
Step 4 On DeviceA, DeviceB, and DeviceC, configure OSPF to ensure Layer 3 connectivity.
The ID of the OSPF area to which DeviceA, DeviceB, and DeviceC belong must be
different from the ID of the OSPF area to which DeviceA, DeviceB, and DeviceD
belong.
# Configure DeviceA.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] undo portswitch
[DeviceA-10GE1/0/1] ip address 10.3.1.1 24
[DeviceA-10GE1/0/1] quit
[DeviceA] ospf 1
[DeviceA-ospf-1] area 0
[DeviceA-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] quit
[DeviceA-ospf-1] area 1
[DeviceA-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.1] quit
[DeviceA-ospf-1] quit
# Configure DeviceB.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] undo portswitch
[DeviceB-10GE1/0/1] ip address 10.4.1.1 24
[DeviceB-10GE1/0/1] quit
[DeviceB] ospf 1
[DeviceB-ospf-1] area 0
[DeviceB-ospf-1-area-0.0.0.0] network 10.4.1.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.0] quit
[DeviceB-ospf-1] area 1
[DeviceB-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.1] quit
[DeviceB-ospf-1] quit
# Configure DeviceC.
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
[DeviceC] interface 10ge 1/0/1
[DeviceC-10GE1/0/1] undo portswitch
[DeviceC-10GE1/0/1] ip address 10.3.1.2 24
[DeviceC-10GE1/0/1] quit
[DeviceC] interface 10ge 1/0/2
Step 5 On DeviceA and DeviceB, add uplink and downlink interfaces to a Monitor Link
group.
# Configure DeviceA.
[DeviceA] monitor-link group 1
[DeviceA-mtlk-group1] port 10ge 1/0/1 uplink
[DeviceA-mtlk-group1] port eth-trunk 10 downlink 1
[DeviceA-mtlk-group1] quit
# Configure DeviceB.
[DeviceB] monitor-link group 1
[DeviceB-mtlk-group1] port 10ge 1/0/1 uplink
[DeviceB-mtlk-group1] port eth-trunk 10 downlink 1
[DeviceB-mtlk-group1] quit
----End
In the preceding command output, the Heart beat state field displays OK,
indicating that the heartbeat status is normal. DeviceA is node 1 with a priority of
150 and serves as the M-LAG master device (the State field displays Master),
whereas DeviceB is node 2 with a priority of 120 and serves as the M-LAG backup
device (the State field displays Backup). In addition, the Causation field displays
-, indicating that the M-LAG is set up successfully.
# Display M-LAG information on DeviceA.
[DeviceA] display dfs-group 1 node 1 m-lag brief
* - Local node
Failed reason:
1 -- Relationship between vlan and port is inconsistent
2 -- STP configuration under the port is inconsistent
3 -- STP port priority configuration is inconsistent
4 -- LACP mode of M-LAG is inconsistent
5 -- M-LAG configuration is inconsistent
6 -- The number of M-LAG members is inconsistent
7 -- LACP system-id of M-LAG is inconsistent
8 -- LACP priority of M-LAG is inconsistent
9 -- STP port edged configuration is inconsistent
10 -- M-LAG mode configuration is inconsistent
Failed reason:
1 -- Relationship between vlan and port is inconsistent
2 -- STP configuration under the port is inconsistent
3 -- STP port priority configuration is inconsistent
4 -- LACP mode of M-LAG is inconsistent
5 -- M-LAG configuration is inconsistent
6 -- The number of M-LAG members is inconsistent
7 -- LACP system-id of M-LAG is inconsistent
8 -- LACP priority of M-LAG is inconsistent
9 -- STP port edged configuration is inconsistent
10 -- M-LAG mode configuration is inconsistent
In the preceding command outputs, the Port State fields of node 1 and node 2
display Up, and the M-LAG status of node 1 and node 2 is active, indicating that
the M-LAG configuration is correct.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
dfs-group 1
priority 150
dual-active detection source ip 10.200.1.1 peer 10.200.1.2
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp
stp v-stp enable
#
interface Vlanif11
ip address 10.2.1.1 255.255.255.0
mac-address 0000-5e00-0101
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
port vlan exclude 1
#
interface Eth-Trunk10
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
dfs-group 1 m-lag 1
#
interface MEth0/0/0
ip address 10.200.1.1 255.255.255.0
#
interface 10GE1/0/1
undo portswitch
ip address 10.3.1.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/3
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
monitor-link group 1
port 10GE1/0/1 uplink
port Eth-Trunk10 downlink 1
#
ospf 1
area 0.0.0.0
network 10.3.1.0 0.0.0.255
area 0.0.0.1
network 10.2.1.0 0.0.0.255
#
return
● DeviceB
#
sysname DeviceB
#
dfs-group 1
priority 120
dual-active detection source ip 10.200.1.2 peer 10.200.1.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!=I9f8>C{!P_bhB31@7r-=jrS8c|
_"(Bn~#[email protected](wAt/IQXl6>[g{6YlOi9$!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp
stp v-stp enable
#
interface Vlanif11
ip address 10.2.1.1 255.255.255.0
mac-address 0000-5e00-0101
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
port vlan exclude 1
#
interface Eth-Trunk10
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
dfs-group 1 m-lag 1
#
interface MEth0/0/0
ip address 10.200.1.2 255.255.255.0
#
interface 10GE1/0/1
undo portswitch
ip address 10.4.1.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/3
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
monitor-link group 1
port 10GE1/0/1 uplink
port Eth-Trunk10 downlink 1
#
ospf 1
area 0.0.0.0
network 10.4.1.0 0.0.0.255
area 0.0.0.1
network 10.2.1.0 0.0.0.255
#
return
● DeviceC
#
sysname DeviceC
#
interface 10GE1/0/1
undo portswitch
ip address 10.3.1.2 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
ip address 10.4.1.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.3.1.0 0.0.0.255
network 10.4.1.0 0.0.0.255
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 11
#
interface Eth-Trunk20
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 20
#
interface 10GE1/0/2
eth-trunk 20
#
interface 10GE1/0/3
eth-trunk 20
#
interface 10GE1/0/4
eth-trunk 20
#
return
Networking Requirements
On the network shown in Figure 3-72, DeviceA, DeviceB, and DeviceC constitute
an M-LAG. The M-LAG member interfaces on DeviceB and DeviceC support
dynamic routing protocols. A dynamic routing protocol is configured on servers so
that they can communicate with the M-LAG through Layer 3 routes.
Figure 3-72 Network diagram for configuring a dynamic routing protocol for
communication with an M-LAG
NOTE
In this example, interface 1 and interface 2 on DeviceA represent 10GE 1/0/1 and 10GE
1/0/2, respectively.
In this example, interface 1, interface 2, interface 4, and interface 5 on DeviceB represent
10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/4, and 10GE 1/0/5, respectively.
In this example, interface 1, interface 2, interface 4, and interface 5 on DeviceC represent
10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/4, and 10GE 1/0/5, respectively.
In this example, interface 1 and interface 2 on DeviceD represent 10GE 1/0/1 and 10GE
1/0/2, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on DeviceB, DeviceC, and DeviceD to implement
Layer 3 connectivity.
2. Create Eth-Trunk interfaces.
3. Configure V-STP.
4. Configure an M-LAG.
– Configure a DFS group on DeviceB and DeviceC respectively, and bind IP
addresses of management interfaces to the DFS group.
– Configure the link between DeviceB and DeviceC as the peer-link.
– Bind the user-side Eth-Trunk interface to the DFS group on DeviceB and
DeviceC, respectively.
5. Configure an IP address for OSPF over M-LAG.
6. Configure M-LAG member devices to use the specified IP address to establish
OSPF neighbor relationships with DeviceA.
Procedure
Step 1 Configure a routing protocol.
# Configure DeviceB. The configurations of DeviceC and DeviceD are similar to the
configuration of DeviceB. When configuring OSPF, configure the devices to
advertise the 32-bit IP addresses of loopback interfaces.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] interface loopback 2
[DeviceB-LoopBack2] ip address 10.3.3.3 32
[DeviceB-LoopBack2] quit
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] undo portswitch
[DeviceB-10GE1/0/1] ip address 192.168.1.1 24
[DeviceB-10GE1/0/1] quit
[DeviceB] ospf 1 router-id 10.11.1.1
[DeviceB-ospf-1] area 0
[DeviceB-ospf-1-area-0.0.0.0] network 10.3.3.3 0.0.0.0
[DeviceB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.0] quit
[DeviceB-ospf-1] quit
After OSPF is configured successfully, DeviceB, DeviceC, and DeviceD can learn the
IP addresses of each other's loopback interface through OSPF and successfully
ping each other.
Step 2 Create Eth-Trunk interfaces and add physical Ethernet interfaces to them.
The uplink interfaces that connect the server to DeviceB and DeviceC must be
added to an Eth-Trunk interface, and the working mode of the Eth-Trunk interface
must be the same as that of the Eth-Trunk interfaces on both devices.
# Create Eth-Trunk interfaces in LACP mode on DeviceB and add member
interfaces to the Eth-Trunk interfaces. The configuration of DeviceC is similar to
that of DeviceB.
[DeviceB] interface eth-trunk 1
[DeviceB-Eth-Trunk1] mode lacp-static
# Configure DeviceC.
[DeviceC] stp mode rstp
[DeviceC] stp v-stp enable
Step 4 Configure a DFS group on DeviceB and DeviceC respectively, and bind IP addresses
of management interfaces to the DFS group.
Ensure that DeviceB and DeviceC can communicate at Layer 3 through their
management interfaces.
# Configure DeviceB. The configuration of DeviceC is similar to that of DeviceB.
[DeviceB] interface meth 0/0/0
[DeviceB-MEth0/0/0] ip address 10.200.1.1 24
[DeviceB-MEth0/0/0] quit
[DeviceB] dfs-group 1
[DeviceB-dfs-group-1] dual-active detection source ip 10.200.1.1 peer 10.200.2.1
[DeviceB-dfs-group-1] authentication-mode hmac-sha256 password YsHsjx_202206
[DeviceB-dfs-group-1] quit
Step 5 Configure the link between DeviceB and DeviceC as the peer-link.
# Configure DeviceB. The configuration of DeviceC is similar to that of DeviceB.
[DeviceB] interface eth-trunk 1
[DeviceB-Eth-Trunk1] peer-link 1
[DeviceB-Eth-Trunk1] quit
Step 6 Bind the user-side Eth-Trunk interface to the DFS group on DeviceB and DeviceC,
respectively.
# Configure DeviceB. The configuration of DeviceC is similar to that of DeviceB.
[DeviceB] interface eth-trunk 10
[DeviceB-Eth-Trunk10] dfs-group 1 m-lag 1
[DeviceB-Eth-Trunk10] quit
Step 7 Configure an IP address for OSPF over M-LAG on DeviceB and DeviceC,
respectively.
# Configure DeviceB. The configuration of DeviceC is similar to that of DeviceB.
[DeviceB] vlan 100
[DeviceB-vlan100] quit
[DeviceB] interface vlanif 100
[DeviceB-Vlanif100] ip address 10.100.0.1 255.255.255.0
[DeviceB-Vlanif100] ospf source sub-address 10.100.0.3
[DeviceB-Vlanif100] m-lag ip address 10.100.0.3 255.255.255.0
[DeviceB-Vlanif100] mac-address 0000-5e00-0101
[DeviceB-Vlanif100] arp proxy enable
[DeviceB-Vlanif100] quit
Step 8 Configure M-LAG member devices to use the specified IP address to establish
OSPF neighbor relationships with DeviceA. The ID of the OSPF area to which
DeviceA, DeviceB, and DeviceC belong must be different from the ID of the OSPF
area to which DeviceB, DeviceC, and DeviceD belong.
# Configure DeviceB. The configuration of DeviceC is similar to that of DeviceB.
[DeviceB] ospf
[DeviceB-ospf-1] area 1
[DeviceB-ospf-1-area-0.0.0.1] network 10.100.0.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.1] quit
[DeviceB-ospf-1] quit
# Configure DeviceA.
[DeviceA] vlan 100
[DeviceA-vlan100] quit
[DeviceA] interface vlanif 100
[DeviceA-Vlanif100] ip address 10.100.0.2 255.255.255.0
[DeviceA-Vlanif100] quit
[DeviceA] ospf 1 router-id 10.11.4.4
[DeviceA-ospf-1] area 1
[DeviceA-ospf-1-area-0.0.0.1] network 10.100.0.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.1] quit
[DeviceA-ospf-1] quit
----End
Failed reason:
1 -- Relationship between vlan and port is inconsistent
Failed reason:
1 -- Relationship between vlan and port is inconsistent
2 -- STP configuration under the port is inconsistent
3 -- STP port priority configuration is inconsistent
4 -- LACP mode of M-LAG is inconsistent
5 -- M-LAG configuration is inconsistent
6 -- The number of M-LAG members is inconsistent
7 -- LACP system-id of M-LAG is inconsistent
8 -- LACP priority of M-LAG is inconsistent
9 -- STP port edged configuration is inconsistent
10 -- M-LAG mode configuration is inconsistent
Run the display ospf peer brief command on DeviceB, DeviceC, and DeviceA to
check OSPF neighbor information.
# Check OSPF neighbor information on DeviceB.
[DeviceB] display ospf peer brief
(M) Indicates MADJ interface
OSPF Process 1 with Router ID 10.11.1.1
Peer Statistic Information
Total number of peer(s): 3
Peer(s) in full state: 3
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 10GE1/0/1 10.11.3.3 Full
0.0.0.0 Vlanif100 10.11.2.2 Full
0.0.0.1 Vlanif100 10.11.4.4 Full
Configuration Scripts
● DeviceB
#
sysname DeviceB
#
dfs-group 1
dual-active detection source ip 10.200.1.1 peer 10.200.2.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 100
#
stp mode rstp
stp v-stp enable
#
interface Vlanif100
ip address 10.100.0.1 255.255.255.0
ospf source sub-address 10.100.0.3
mac-address 0000-5e00-0101
m-lag ip address 10.100.0.3 255.255.255.0
arp proxy enable
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
#
interface Eth-Trunk10
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
mode lacp-static
lacp mixed-rate link enable
dfs-group 1 m-lag 1
#
interface MEth0/0/0
ip address 10.200.1.1 255.255.255.0
#
interface 10GE1/0/1
undo portswitch
ip address 192.168.1.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
interface LoopBack2
ip address 10.3.3.3 255.255.255.255
#
ospf 1 router-id 10.11.1.1
area 0.0.0.0
network 10.3.3.3 0.0.0.0
network 192.168.1.0 0.0.0.255
area 0.0.0.1
network 10.100.0.0 0.0.0.255
#
return
● DeviceC
#
sysname DeviceC
#
dfs-group 1
dual-active detection source ip 10.200.2.1 peer 10.200.1.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!=I9f8>C{!P_bhB31@7r-=jrS8c|
_"(Bn~#[email protected](wAt/IQXl6>[g{6YlOi9$!!!!!!!!!!%+%#
#
vlan batch 100
#
stp mode rstp
stp v-stp enable
#
interface Vlanif100
ip address 10.100.0.1 255.255.255.0
ospf source sub-address 10.100.0.4
mac-address 0000-5e00-0101
m-lag ip address 10.100.0.4 255.255.255.0
arp proxy enable
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
#
interface Eth-Trunk10
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
mode lacp-static
lacp mixed-rate link enable
dfs-group 1 m-lag 1
#
interface MEth0/0/0
ip address 10.200.2.1 255.255.255.0
#
interface 10GE1/0/1
undo portswitch
ip address 192.168.2.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
interface LoopBack2
ip address 10.4.4.4 255.255.255.255
#
ospf 1 router-id 10.11.2.2
area 0.0.0.0
network 10.4.4.4 0.0.0.0
network 192.168.2.0 0.0.0.255
area 0.0.0.1
network 10.100.0.0 0.0.0.255
#
return
● DeviceD
#
sysname DeviceD
#
interface 10GE1/0/1
undo portswitch
ip address 192.168.1.2 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
● DeviceA
#
sysname DeviceA
#
vlan batch 100
#
interface Vlanif100
ip address 10.100.0.2 255.255.255.0
#
interface Eth-Trunk10
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
mode lacp-static
lacp mixed-rate link enable
#
interface 10GE1/0/1
eth-trunk 10
#
interface 10GE1/0/2
eth-trunk 10
#
ospf 1 router-id 10.11.4.4
area 0.0.0.1
network 10.100.0.0 0.0.0.255
#
return
Networking Requirements
In Figure 3-73, multi-level M-LAG ensures reliability, improves link utilization, and
expands the network scale in dual-homing mode, meeting customer requirements.
In addition, aggregation devices function as dual-active gateways, and core and
aggregation devices are cross-connected to ensure device-level reliability. A server
is connected to access devices in load balancing or active/standby mode. If load
balancing mode is used for server access, you are advised to configure the M-LAG
to work in dual-active mode. If active/standby mode is used for server access, you
are advised to configure the M-LAG to work in active/standby mode. In this
example, the server is connected to access devices in load balancing mode. M-LAG
devices at the access and aggregation layers use independent links as DAD links to
improve reliability.
10GE1/0/2 10.5.1.1/24 -
10GE1/0/5 10.2.1.1/24 -
10GE1/0/2 10.7.1.1/24 -
10GE1/0/5 10.2.1.2/24 -
10GE1/0/2 10.7.1.2/24 -
10GE1/0/2 10.5.1.2/24 -
Configuration Roadmap
The configuration roadmap is as follows:
1. On DeviceA and DeviceB at the access layer, configure M-LAG, links between
the access and aggregation layers, and server access.
2. On DeviceC and DeviceD at the aggregation layer, configure M-LAG, links
between the aggregation and access layers, Layer 3 gateways, and the egress
network.
3. On DeviceE and DeviceF at the core layer, configure interface IP addresses and
enable OSPF to implement Layer 3 communication with the aggregation
layer.
Procedure
Step 1 Configure DeviceA and DeviceB at the access layer.
1. Configure M-LAG.
# Configure M-LAG in V-STP mode.
Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] stp mode rstp
[DeviceA] stp v-stp enable
Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
Configure DeviceB.
[DeviceB] interface 10GE1/0/4
[DeviceB-10GE1/0/4] undo portswitch
[DeviceB-10GE1/0/4] ip address 10.1.1.2 24
[DeviceB-10GE1/0/4] m-lag unpaired-port reserved
[DeviceB-10GE1/0/4] quit
Configure DeviceB.
[DeviceA] dfs-group 1
[DeviceA-dfs-group-1] priority 120
[DeviceA-dfs-group-1] dual-active detection source ip 10.1.1.2 peer 10.1.1.1
[DeviceA-dfs-group-1] authentication-mode hmac-sha256 password YsHsjx_202206
[DeviceA-dfs-group-1] quit
Configure DeviceB.
[DeviceB] interface Eth-Trunk0
[DeviceB-Eth-Trunk0] trunkport 10GE1/0/5
[DeviceB-Eth-Trunk0] trunkport 10GE1/0/6
[DeviceB-Eth-Trunk0] mode lacp-static
[DeviceB-Eth-Trunk0] peer-link 1
[DeviceB-Eth-Trunk0] port vlan exclude 1
[DeviceB-Eth-Trunk0] quit
# Configure DeviceB.
[DeviceB] vlan batch 11
[DeviceB] interface Eth-Trunk10
[DeviceB-Eth-Trunk10] trunkport 10GE1/0/1
[DeviceB-Eth-Trunk10] trunkport 10GE1/0/2
[DeviceB-Eth-Trunk10] mode lacp-static
[DeviceB-Eth-Trunk10] port link-type trunk
[DeviceB-Eth-Trunk10] undo port trunk allow-pass vlan 1
[DeviceB-Eth-Trunk10] port trunk allow-pass vlan 11
[DeviceB-Eth-Trunk10] dfs-group 1 m-lag 10
[DeviceB-Eth-Trunk10] quit
# Configure DeviceB.
[DeviceB] interface Eth-Trunk1
[DeviceB-Eth-Trunk1] trunkport 10GE1/0/3
[DeviceB-Eth-Trunk1] mode lacp-static
[DeviceB-Eth-Trunk1] port link-type trunk
[DeviceB-Eth-Trunk1] undo port trunk allow-pass vlan 1
[DeviceB-Eth-Trunk1] port trunk allow-pass vlan 11
[DeviceB-Eth-Trunk1] dfs-group 1 m-lag 1
[DeviceB-Eth-Trunk10] quit
Configure DeviceD.
<HUAWEI> system-view
[HUAWEI] sysname DeviceD
[DeviceD] stp mode rstp
[DeviceD] stp v-stp enable
Configure DeviceD.
[DeviceD] interface 10GE1/0/5
[DeviceD-10GE1/0/5] undo portswitch
[DeviceD-10GE1/0/5] ip address 10.2.1.2 24
[DeviceD-10GE1/0/5] m-lag unpaired-port reserved
[DeviceD-10GE1/0/5] quit
Configure DeviceD.
[DeviceD] dfs-group 1
[DeviceD-dfs-group-1] priority 120
[DeviceD-dfs-group-1] dual-active detection source ip 10.2.1.2 peer 10.2.1.1
[DeviceD-dfs-group-1] authentication-mode hmac-sha256 password YsHsjx_202206
[DeviceD-dfs-group-1] quit
Configure DeviceD.
[DeviceD] interface Eth-Trunk0
[DeviceD-Eth-Trunk0] trunkport 10GE1/0/6
[DeviceD-Eth-Trunk0] trunkport 10GE1/0/7
[DeviceD-Eth-Trunk0] mode lacp-static
[DeviceD-Eth-Trunk0] peer-link 1
[DeviceD-Eth-Trunk0] port vlan exclude 1
[DeviceD-Eth-Trunk0] quit
# Configure DeviceD.
[DeviceD] vlan batch 11
[DeviceD] interface Eth-Trunk10
# Configure DeviceD.
[DeviceD] interface vlanif 11
[DeviceD-Vlanif11] ip address 10.3.1.1 24
[DeviceD-Vlanif11] mac-address 0000-5e00-0110
[DeviceD-Vlanif11] quit
# Configure DeviceD.
[DeviceD] interface 10GE1/0/1
[DeviceD-10GE1/0/1] undo portswitch
[DeviceD-10GE1/0/1] ip address 10.6.1.1 24
[DeviceD-10GE1/0/1] quit
[DeviceD] interface 10GE1/0/2
[DeviceD-10GE1/0/2] undo portswitch
[DeviceD-10GE1/0/2] ip address 10.7.1.1 24
[DeviceD-10GE1/0/2] quit
[DeviceD] interface vlanif 100
[DeviceD-Vlanif100] ip address 10.10.10.2 30
[DeviceD-Vlanif100] ospf cost 10000
[DeviceD-Vlanif100] quit
[DeviceD] ospf 1
[DeviceD-ospf-1] area 0
[DeviceD-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255
[DeviceD-ospf-1-area-0.0.0.0] network 10.6.1.0 0.0.0.255
[DeviceD-ospf-1-area-0.0.0.0] network 10.7.1.0 0.0.0.255
[DeviceD-ospf-1-area-0.0.0.0] network 10.10.10.0 0.0.0.3
[DeviceD-ospf-1-area-0.0.0.0] quit
[DeviceD-ospf-1] quit
# Configure DeviceF.
<HUAWEI> system-view
[HUAWEI] sysname DeviceF
[DeviceF] interface 10GE1/0/1
[DeviceF-10GE1/0/1] undo portswitch
[DeviceF-10GE1/0/1] ip address 10.6.1.2 24
[DeviceF-10GE1/0/1] quit
[DeviceF] interface 10GE1/0/2
[DeviceF-10GE1/0/2] undo portswitch
[DeviceF-10GE1/0/2] ip address 10.5.1.2 24
[DeviceF-10GE1/0/2] quit
[DeviceF] ospf 1
[DeviceF-ospf-1] area 0
[DeviceF-ospf-1-area-0.0.0.0] network 10.5.1.0 0.0.0.255
[DeviceF-ospf-1-area-0.0.0.0] network 10.6.1.0 0.0.0.255
[DeviceF-ospf-1-area-0.0.0.0] quit
[DeviceF-ospf-1] quit
----End
System ID : 00e0-fc12-3457
SysName : DeviceA
Version : V600R023C00
Device Type : S6730-H-V2
Node 2
Dfs-Group ID :1
Priority : 120
Dual-active Address : 10.1.1.2
VPN-Instance : public net
State : Backup
Causation :-
System ID : 00e0-fc12-3458
SysName : DeviceB
Version : V600R023C00
Device Type : S6730-H-V2
# Check the M-LAG status at the aggregation layer.
[DeviceC] display dfs-group 1 m-lag
* : Local node
Heart beat state : OK
Node 1 *
Dfs-Group ID :1
Priority : 150
Dual-active Address : 10.2.1.1
VPN-Instance : public net
State : Master
Causation :-
System ID : 00e0-fc12-3459
SysName : DeviceC
Version : V600R023C00
Device Type : S6730-H-V2
Node 2
Dfs-Group ID :1
Priority : 120
Dual-active Address : 10.2.1.2
VPN-Instance : public net
State : Backup
Causation :-
System ID : 00e0-fc12-3460
SysName : DeviceD
Version : V600R023C00
Device Type : S6730-H-V2
● Run the display dfs-group 1 node 1 m-lag [ brief ] command to check the
M-LAG Eth-Trunk status.
# Check the M-LAG Eth-Trunk status on DeviceA.
[DeviceA] display dfs-group 1 node 1 m-lag brief
* - Local node
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
dfs-group 1
priority 150
dual-active detection source ip 10.1.1.1 peer 10.1.1.2
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp
stp v-stp enable
#
interface Eth-Trunk0
mode lacp-static
peer-link 1
port vlan exclude 1
#
interface Eth-Trunk1
mode lacp-static
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 11
dfs-group 1 m-lag 1
#
interface Eth-Trunk10
mode lacp-static
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 11
dfs-group 1 m-lag 10
#
interface 10GE1/0/1
eth-trunk 10
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/3
eth-trunk 1
#
interface 10GE1/0/4
undo portswitch
ip address 10.1.1.1 255.255.255.0
m-lag unpaired-port reserved
#
interface 10GE1/0/5
eth-trunk 0
#
interface 10GE1/0/6
eth-trunk 0
#
return
● DeviceB
#
sysname DeviceB
#
dfs-group 1
priority 120
dual-active detection source ip 10.1.1.2 peer 10.1.1.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp
stp v-stp enable
#
interface Eth-Trunk0
mode lacp-static
peer-link 1
● DeviceC
#
sysname DeviceC
#
dfs-group 1
priority 150
dual-active detection source ip 10.2.1.1 peer 10.2.1.2
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11 100
#
stp mode rstp
stp v-stp enable
#
interface Vlanif11
ip address 10.3.1.1 255.255.255.0
mac-address 0000-5e00-0110
#
interface Vlanif100
ip address 10.10.10.1 255.255.255.252
ospf cost 10000
#
interface Eth-Trunk0
mode lacp-static
peer-link 1
port vlan exclude 1
#
interface Eth-Trunk10
mode lacp-static
port link-type trunk
undo port trunk allow-pass vlan 1
● DeviceD
#
sysname DeviceD
#
dfs-group 1
priority 120
dual-active detection source ip 10.2.1.2 peer 10.2.1.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11 100
#
stp mode rstp
stp v-stp enable
#
interface Vlanif11
ip address 10.3.1.1 255.255.255.0
mac-address 0000-5e00-0110
#
interface Vlanif100
ip address 10.10.10.2 255.255.255.252
ospf cost 10000
#
interface Eth-Trunk0
mode lacp-static
peer-link 1
port vlan exclude 1
#
interface Eth-Trunk10
mode lacp-static
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 11
dfs-group 1 m-lag 10
#
interface 10GE1/0/1
undo portswitch
ip address 10.6.1.1 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
ip address 10.7.1.1 255.255.255.0
#
interface 10GE1/0/3
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 10
#
interface 10GE1/0/5
undo portswitch
ip address 10.2.1.2 255.255.255.0
m-lag unpaired-port reserved
#
interface 10GE1/0/6
eth-trunk 0
#
interface 10GE1/0/7
eth-trunk 0
#
ospf 1
area 0.0.0.0
network 10.3.1.0 0.0.0.255
network 10.6.1.0 0.0.0.255
network 10.7.1.0 0.0.0.255
network 10.10.10.0 0.0.0.3
#
return
● DeviceE
#
sysname DeviceE
#
interface 10GE1/0/1
undo portswitch
ip address 10.4.1.2 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
ip address 10.7.1.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.4.1.0 0.0.0.255
network 10.7.1.0 0.0.0.255
#
return
● DeviceF
#
sysname DeviceF
#
interface 10GE1/0/1
undo portswitch
ip address 10.5.1.2 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
ip address 10.6.1.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.5.1.0 0.0.0.255
Networking Requirements
In Figure 3-74, DeviceA and DeviceB form an M-LAG, through which DeviceD
connects to the Layer 3 network. DHCPv4 relay needs to be deployed on DeviceA
and DeviceB so that the DHCPv4 server can assign an IPv4 address to DeviceD.
Configuration Roadmap
1. Configure M-LAG active-active gateways. For configuration details, see
3.1.11.2.2 Example for Configuring Dual-Homing of a Device to a Layer 3
Network Through an M-LAG in V-STP Mode.
Procedure
Step 1 Configure DHCPv4 relay on DeviceA and DeviceB.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface loopback 0
[DeviceA-LoopBack0] ip address 5.5.5.5 32
[DeviceA-LoopBack0] quit
[DeviceA] interface vlanif 11
[DeviceA-Vlanif11] dhcp select relay
[DeviceA-Vlanif11] dhcp relay server-ip 192.168.1.1
[DeviceA-Vlanif11] dhcp relay information enable
[DeviceA-Vlanif11] dhcp relay giaddr source-interface loopback0
[DeviceA-Vlanif11] dhcp option82 link-selection insert enable
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] interface loopback 0
[DeviceB-LoopBack0] ip address 6.6.6.6 32
[DeviceB-LoopBack0] quit
[DeviceB] interface vlanif 11
[DeviceB-Vlanif11] dhcp select relay
[DeviceB-Vlanif11] dhcp relay server-ip 192.168.1.1
[DeviceB-Vlanif11] dhcp relay information enable
[DeviceB-Vlanif11] dhcp relay giaddr source-interface loopback0
[DeviceB-Vlanif11] dhcp option82 link-selection insert enable
Step 2 Configure DeviceA and DeviceB to advertise routes destined for the local loopback
addresses.
# Configure DeviceA.
[DeviceA] ospf 1
[DeviceA-ospf-1] area 0
[DeviceA-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0
[DeviceA-ospf-1-area-0.0.0.0] quit
[DeviceA-ospf-1] quit
# Configure DeviceB.
[DeviceB] ospf 1
[DeviceB-ospf-1] area 0
[DeviceB-ospf-1-area-0.0.0.0] network 6.6.6.6 0.0.0.0
[DeviceB-ospf-1-area-0.0.0.0] quit
[DeviceB-ospf-1] quit
Step 3 On DeviceC, configure the route to the DHCPv4 server (whose IP address is
192.168.1.1).
[DeviceA] ospf 1
[DeviceA-ospf-1] area 0
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
dfs-group 1
priority 150
dual-active detection source ip 10.200.1.1 peer 10.200.1.2
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp stp v-stp enable
#
interface Vlanif11
ip address 10.2.1.1 255.255.255.0
mac-address 0000-5e00-0101
dhcp select relay
dhcp relay information enable
dhcp relay server-ip 192.168.1.1
dhcp relay giaddr source-interface loopback 0
dhcp option82 link-selection insert enable
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
#
interface Eth-Trunk10
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
dfs-group 1 m-lag 1
#
interface 10GE1/0/1
undo portswitch
ip address 10.3.1.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/3
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
#
monitor-link group 1
port 10GE1/0/1 uplink
port Eth-Trunk10 downlink 1
#
ospf 1
area 0.0.0.0
network 5.5.5.5 0.0.0.0
network 10.2.1.0 0.0.0.255
network 10.3.1.0 0.0.0.255
#
return
● DeviceB
#
sysname DeviceB
#
dfs-group 1
priority 120
dual-active detection source ip 10.200.1.2 peer 10.200.1.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!=I9f8>C{!P_bhB31@7r-=jrS8c|
_"(Bn~#[email protected](wAt/IQXl6>[g{6YlOi9$!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp stp v-stp enable
#
interface Vlanif11
ip address 10.2.1.1 255.255.255.0
mac-address 0000-5e00-0101
dhcp select relay
dhcp relay information enable
dhcp relay server-ip 192.168.1.1
dhcp relay giaddr source-interface loopback 0
dhcp option82 link-selection insert enable
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
#
interface Eth-Trunk10
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
dfs-group 1 m-lag 1
#
interface 10GE1/0/1
undo portswitch
ip address 10.4.1.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/3
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
#
monitor-link group 1
port 10GE1/0/1 uplink
port Eth-Trunk10 downlink 1
#
ospf 1
area 0.0.0.0
network 6.6.6.6 0.0.0.0
network 10.2.1.0 0.0.0.255
network 10.4.1.0 0.0.0.255
#
return
● DeviceC
#
sysname DeviceC
#
interface 10GE1/0/1
undo portswitch
ip address 10.3.1.2 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
ip address 10.4.1.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.3.1.0 0.0.0.255
network 10.4.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 11
#
interface Eth-Trunk20
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 20
#
interface 10GE1/0/2
eth-trunk 20
#
interface 10GE1/0/3
eth-trunk 20
#
interface 10GE1/0/4
eth-trunk 20
#
return
Networking Requirements
In Figure 3-75, DeviceA and DeviceB form an M-LAG, through which DeviceD
connects to the Layer 3 network. DHCPv4 relay needs to be deployed on DeviceA
and DeviceB so that the DHCPv4 server can assign an IPv4 address to DeviceD.
Configuration Roadmap
1. Configure M-LAG active-active gateways. For configuration details, see
3.1.11.2.2 Example for Configuring Dual-Homing of a Device to a Layer 3
Network Through an M-LAG in V-STP Mode.
2. Configure DHCPv4 relay on the M-LAG active-active gateways DeviceA and
DeviceB. Specifically:
a. Enable DHCPv4 relay.
Procedure
Step 1 Configure DHCPv4 relay on DeviceA and DeviceB.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] interface loopback 0
[DeviceA-LoopBack0] ip address 5.5.5.5 32
[DeviceA-LoopBack0] quit
[DeviceA] interface vlanif 11
[DeviceA-Vlanif11] dhcp select relay
[DeviceA-Vlanif11] dhcp relay server-ip 192.168.1.1
[DeviceA-Vlanif11] dhcp relay information enable
[DeviceA-Vlanif11] dhcp option82 vendor-specific format vendor-sub-option 2 source-ip-address 5.5.5.5
# Configure DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] interface loopback 0
[DeviceB-LoopBack0] ip address 6.6.6.6 32
[DeviceB-LoopBack0] quit
[DeviceB] interface vlanif 11
[DeviceB-Vlanif11] dhcp select relay
[DeviceB-Vlanif11] dhcp relay server-ip 192.168.1.1
[DeviceB-Vlanif11] dhcp relay information enable
[DeviceB-Vlanif11] dhcp option82 vendor-specific format vendor-sub-option 2 source-ip-address 6.6.6.6
Step 2 Configure DeviceA and DeviceB to advertise routes destined for the local loopback
addresses.
# Configure DeviceA.
[DeviceA] ospf 1
[DeviceA-ospf-1] area 0
[DeviceA-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0
[DeviceA-ospf-1-area-0.0.0.0] quit
[DeviceA-ospf-1] quit
# Configure DeviceB.
[DeviceB] ospf 1
[DeviceB-ospf-1] area 0
[DeviceB-ospf-1-area-0.0.0.0] network 6.6.6.6 0.0.0.0
[DeviceB-ospf-1-area-0.0.0.0] quit
[DeviceB-ospf-1] quit
Step 3 On DeviceC, configure the route to the DHCPv4 server (whose IP address is
192.168.1.1).
[DeviceA] ospf 1
[DeviceA-ospf-1] area 0
[DeviceA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] quit
[DeviceA-ospf-1] quit
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
dfs-group 1
priority 150
dual-active detection source ip 10.200.1.1 peer 10.200.1.2
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!C+tR0CW9x*eB&pWp`t),Azgw-h
\o8#4LZPD!!!!!!!!!!!!!!!9!!!!>fwJ)I0E{=:%,*,XRhbH&t0MCy_8=7!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp stp v-stp enable
#
interface Vlanif11
ip address 10.2.1.1 255.255.255.0
mac-address 0000-5e00-0101
dhcp select relay
dhcp relay information enable
dhcp relay server-ip 192.168.1.1
dhcp option82 vendor-specific format vendor-sub-option 2 source-ip-address 5.5.5.5
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
#
interface Eth-Trunk10
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
dfs-group 1 m-lag 1
#
interface 10GE1/0/1
undo portswitch
ip address 10.3.1.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/3
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
#
monitor-link group 1
port 10GE1/0/1 uplink
port Eth-Trunk10 downlink 1
#
ospf 1
area 0.0.0.0
network 5.5.5.5 0.0.0.0
network 10.2.1.0 0.0.0.255
network 10.3.1.0 0.0.0.255
#
return
● DeviceB
#
sysname DeviceB
#
dfs-group 1
priority 120
dual-active detection source ip 10.200.1.2 peer 10.200.1.1
authentication-mode hmac-sha256 password %+%##!!!!!!!!!"!!!!"!!!!*!!!!=I9f8>C{!P_bhB31@7r-=jrS8c|
_"(Bn~#[email protected](wAt/IQXl6>[g{6YlOi9$!!!!!!!!!!%+%#
#
vlan batch 11
#
stp mode rstp stp v-stp enable
#
interface Vlanif11
ip address 10.2.1.1 255.255.255.0
mac-address 0000-5e00-0101
dhcp select relay
dhcp relay information enable
dhcp relay server-ip 192.168.1.1
dhcp option82 vendor-specific format vendor-sub-option 2 source-ip-address 6.6.6.6
#
interface Eth-Trunk1
mode lacp-static
peer-link 1
#
interface Eth-Trunk10
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
dfs-group 1 m-lag 1
#
interface 10GE1/0/1
undo portswitch
ip address 10.4.1.1 255.255.255.0
#
interface 10GE1/0/2
eth-trunk 10
#
interface 10GE1/0/3
eth-trunk 10
#
interface 10GE1/0/4
eth-trunk 1
#
interface 10GE1/0/5
eth-trunk 1
#
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
#
monitor-link group 1
port 10GE1/0/1 uplink
● DeviceC
#
sysname DeviceC
#
interface 10GE1/0/1
undo portswitch
ip address 10.3.1.2 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
ip address 10.4.1.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.3.1.0 0.0.0.255
network 10.4.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 11
#
interface Eth-Trunk20
port link-type trunk
port trunk allow-pass vlan 11
mode lacp-static
#
interface 10GE1/0/1
eth-trunk 20
#
interface 10GE1/0/2
eth-trunk 20
#
interface 10GE1/0/3
eth-trunk 20
#
interface 10GE1/0/4
eth-trunk 20
#
return
3.1.12.1 AAA
Networking Requirements
In Figure 3-76, the enterprise requires that the administrator use AAA local
authentication to log in to the device through STelnet. The specific requirements
are as follows:
1. The administrator can log in to the device through STelnet only after entering
a correct user name and password.
2. After the administrator logs in to the device through STelnet, the privilege
level 3 is authorized to the administrator.
Configuration Roadmap
1. Configure STelnet login on DeviceA: Set the authentication mode for
accessing VTY user interfaces to AAA, enable the STelnet service, and
configure the authentication mode and service type for SSH users.
2. Configure AAA local authentication: Configure a user name and password, set
the user access type, and set the user privilege level.
Precautions
Ensure that there are reachable routes between the user terminal and DeviceA
before the configuration.
Procedure
Step 1 Configure IP addresses for interfaces.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 192.168.10.1 24
[DeviceA-Vlanif10] quit
# Set the authentication mode and protocol for accessing VTY user interfaces 0 to
4 to AAA and SSH, respectively.
[DeviceA] user-interface vty 0 4
[DeviceA-ui-vty0-4] authentication-mode aaa
[DeviceA-ui-vty0-4] protocol inbound ssh
[DeviceA-ui-vty0-4] quit
# Set the authentication mode of all SSH users to password authentication and
the service type to STelnet.
[DeviceA] ssh authentication-type default password
----End
Configuration Scripts
#
sysname DeviceA
#
aaa
local-user user1-huawei password irreversible-cipher $1d$OwseVRh@LH}ZeTBm$1nH4$ab>d(N{-%0!
ab48y=Ic*xEUR4pVhR2"9-~,$
local-user user1-huawei privilege level 3
local-user user1-huawei service-type ssh
#
vlan batch 10
#
interface Vlanif10
ip address 192.168.10.1 24
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
stelnet server enable
ssh server-source -i Vlanif 10
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
return
Networking Requirements
In Figure 3-77, an HWTACACS server is deployed on an enterprise network. The
enterprise requires that the administrator use HWTACACS authentication to log in
to DeviceA through STelnet.
1. The administrator can log in to the device through STelnet only after entering
a correct user name and password.
2. After the administrator logs in to the device through STelnet, the privilege
level 3 is authorized to the administrator, the commands that the
administrator can execute are limited, and the commands that the
administrator has executed are recorded.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Configuration Roadmap
1. Configure STelnet login on DeviceA: Set the authentication mode for
accessing VTY user interfaces to AAA, enable the STelnet service, and
configure the authentication mode and service type for SSH users.
2. Configure HWTACACS authentication on DeviceA: Create an HWTACACS
server template, configure AAA schemes and recording scheme, and enable
command authorization.
3. Configure an HWTACACS server.
Precautions
Ensure that there are reachable routes between the user terminal and DeviceA
before the configuration.
Procedure
Step 1 Configure IP addresses for interfaces.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 10.1.1.2 255.255.255.0
[DeviceA-Vlanif10] quit
[DeviceA] interface vlanif 20
[DeviceA-Vlanif20] ip address 10.1.6.2 255.255.255.0
[DeviceA-Vlanif20] quit
# Set the authentication mode and protocol for accessing VTY user interfaces 0 to
4 to AAA and SSH, respectively.
[DeviceA] user-interface vty 0 4
[DeviceA-ui-vty0-4] authentication-mode aaa
[DeviceA-ui-vty0-4] protocol inbound ssh
[DeviceA-ui-vty0-4] quit
# Set the authentication mode and service type of all SSH users to password
authentication and STelnet, respectively.
[DeviceA] ssh authentication-type default password
# Create an authentication scheme named sch1 and set the authentication mode
to HWTACACS authentication.
[DeviceA] aaa
[DeviceA-aaa] authentication-scheme sch1
[DeviceA-aaa-authen-sch1] authentication-mode hwtacacs
[DeviceA-aaa-authen-sch1] quit
# Create a recording scheme named sch0 to record the commands that the
administrator has executed.
[DeviceA-aaa] recording-scheme sch0
[DeviceA-aaa-recording-sch0] recording-mode hwtacacs template1
[DeviceA-aaa-recording-sch0] quit
[DeviceA-aaa] cmd recording-scheme sch0
# Create an accounting scheme named sch3 and set the accounting mode to
HWTACACS accounting.
[DeviceA-aaa] accounting-scheme sch3
[DeviceA-aaa-accounting-sch3] accounting-mode hwtacacs
[DeviceA-aaa-accounting-sch3] quit
# Apply the HWTACACS server template and AAA schemes to the domain
huawei.com.
[DeviceA-aaa] domain huawei.com
[DeviceA-aaa-domain-huawei.com] hwtacacs-server template1
[DeviceA-aaa-domain-huawei.com] authentication-scheme sch1
[DeviceA-aaa-domain-huawei.com] authorization-scheme sch2
[DeviceA-aaa-domain-huawei.com] accounting-scheme sch3
[DeviceA-aaa-domain-huawei.com] quit
[DeviceA-aaa] quit
Step 4 Configure an HWTACACS server. Here, the Secure ACS is used as an example.
The configuration includes the following steps: add a device, add an administrator
account, set the administrator privilege level to 3, and configure command
authorization. Note that the reset hwtacacs-server statistics all command
cannot be configured.
You can check logs recording command execution successes and failures of all
users including non-HWTACACS-authenticated users under Reports and Activity
> TACACS+ Administration.
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
hwtacacs-server template template1
hwtacacs-server authentication 10.1.6.6
hwtacacs-server authorization 10.1.6.6
hwtacacs-server accounting 10.1.6.6
hwtacacs-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs."u,S-6a-X1'[X=L"cpF!5Oz`1!!!!!2jp5!!!!!!
A!!!!Ix>cM8i{y6!);(8Dr9:dK`&BHfE(H2=.:SH{@pT%+%#
#
aaa
authentication-scheme sch1
authentication-mode hwtacacs
authorization-scheme sch2
authorization-mode hwtacacs
authorization-cmd 3 hwtacacs
accounting-scheme sch3
accounting-mode hwtacacs
recording-scheme sch0
recording-mode hwtacacs template1
cmd recording-scheme sch0
domain huawei.com
authentication-scheme sch1
accounting-scheme sch3
authorization-scheme sch2
hwtacacs-server template1
#
domain huawei.com admin
#
vlan batch 10 20
#
interface Vlanif10
ip address 10.1.1.2 255.255.255.0
#
interface Vlanif20
ip address 10.1.6.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
stelnet server enable
ssh server-source -i Vlanif10
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
return
Networking Requirements
In Figure 3-78, a RADIUS server is deployed on an enterprise network. The
enterprise requires that the administrator use RADIUS authentication to log in to
DeviceA through STelnet. The specific requirements are as follows:
1. The administrator can log in to the device through STelnet only after entering
a correct user name and password.
2. After the administrator logs in to the device through STelnet, the privilege
level 3 is authorized to the administrator.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Configuration Roadmap
1. Configure STelnet login on DeviceA: Set the authentication mode for
accessing VTY user interfaces to AAA, enable the STelnet service, and
configure the authentication mode and service type for SSH users.
2. Configure RADIUS authentication on DeviceA: Create a RADIUS server
template and AAA schemes, and apply the server template and AAA schemes
to a domain.
3. Configure a RADIUS server.
Precautions
● Ensure that there are reachable routes between the user terminal and
DeviceA before the configuration.
● Ensure that the shared key in the RADIUS server template is the same as that
configured on the RADIUS server.
● After the domain is set as the global default administrative domain and the
user name of the administrator contains the domain name or does not
contain any domain name, the administrator uses AAA configuration in the
global default administrative domain.
● If the RADIUS server does not support the user name containing a domain
name, run the undo radius-server user-name domain-included command in
the RADIUS server template view to configure the device to send packets that
do not contain a domain name to the RADIUS server.
● After the undo radius-server user-name domain-included command is run,
the device changes only the user name format in the sent packet, without
affecting the domain to which the user belongs. For example, after this
command is run, the user with the user name [email protected] still
uses AAA configuration in the domain named huawei.com.
● When the extended RADIUS attribute HW-Exec-Privilege (26-29) is used to
authorize the priority of an administrator, the value ranges from 0 to 3. The
value greater than or equal to 4 is invalid.
Procedure
Step 1 Configure IP addresses for interfaces.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 10.1.1.2 255.255.255.0
[DeviceA-Vlanif10] quit
[DeviceA] interface vlanif 20
[DeviceA-Vlanif20] ip address 10.1.6.2 255.255.255.0
[DeviceA-Vlanif20] quit
# Set the authentication mode and protocol for accessing VTY user interfaces 0 to
4 to AAA and SSH, respectively.
[DeviceA] user-interface vty 0 4
[DeviceA-ui-vty0-4] authentication-mode aaa
[DeviceA-ui-vty0-4] protocol inbound ssh
[DeviceA-ui-vty0-4] quit
# Set the authentication mode and service type of all SSH users to password
authentication and STelnet, respectively.
[DeviceA] ssh authentication-type default password
# Configure an AAA accounting scheme named acc1 and set the accounting mode
to RADIUS accounting.
[DeviceA-aaa] accounting-scheme acc1
[DeviceA-aaa-accounting-acc1] accounting-mode radius
[DeviceA-aaa-accounting-acc1] quit
Step 4 Configure the domain to which the administrator belongs as the global default
administrative domain so that the administrator does not need to enter the
domain name during an STelnet login to DeviceA.
[DeviceA] domain huawei.com admin
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
radius-server template 1
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.3t@/5k|BENhEu>W(3\~XG!!D;!!!!!2jp5!!!!!!
A!!!!3"pK8qv!}9M#(4$jGWvQF/R[CNe/+:W^jk8HUe&W%+%#
radius-server authentication 10.1.6.6 1812 weight 80
radius-server accounting 10.1.6.6 1813 weight 80
#
aaa
authentication-scheme auth1
authentication-mode radius
accounting-scheme acc1
accounting-mode radius
domain huawei.com
authentication-scheme auth1
accounting-scheme acc1
radius-server 1
#
domain huawei.com admin
#
vlan batch 10 20
#
interface Vlanif10
ip address 10.1.1.2 255.255.255.0
#
interface Vlanif20
ip address 10.1.6.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
3.1.12.2 NAC
Networking Requirements
In Figure 3-79, terminals in a company's office area are connected to the
company's intranet through DeviceA. The downlink interfaces (for example, 10GE
1/0/2) of DeviceA are directly connected to terminals in the office area, and the
uplink interface 10GE 1/0/1 of DeviceA is connected to the RADIUS server through
the intranet.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Configure network connectivity.
# Create the authentication scheme abc and set the authentication mode to
RADIUS authentication.
[DeviceA] aaa
[DeviceA-aaa] authentication-scheme abc
[DeviceA-aaa-authen-abc] authentication-mode radius
[DeviceA-aaa-authen-abc] quit
# Check whether a user can pass RADIUS authentication. (The test user test and
password Example2012 have been configured on the RADIUS server.)
[DeviceA] test-aaa test Example2012 radius-template rd1
Info: Account test succeeded.
NOTE
By default, an 802.1X access profile uses EAP authentication. Ensure that the RADIUS server
supports the EAP protocol. Otherwise, the RADIUS server cannot process 802.1X
authentication requests.
# Configure the authentication profile p1, bind the 802.1X access profile d1 to the
authentication profile, and configure the forcible authentication domain
example.com for users using the authentication profile.
[DeviceA] authentication-profile name p1
[DeviceA-authen-profile-p1] dot1x-access-profile d1
[DeviceA-authen-profile-p1] access-domain example.com force
[DeviceA-authen-profile-p1] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
authentication-profile name p1
dot1x-access-profile d1
access-domain example.com force
#
vlan batch 10 to 20
#
aaa
authentication-scheme abc
authentication-mode radius
domain example.com
authentication-scheme abc
radius-server rd1
#
radius-server template rd1
radius-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.3t@/5k|BENhEu>W(3\~XG!!D;!!!!!2jp5!!!!!!
A!!!!3"pK8qv!}9M#(4$jGWvQF/R[CNe/+:W^jk8HUe&W%+%#
radius-server authentication 192.168.1.30 1812 weight 80
#
dot1x-access-profile name d1
dot1x timer client-timeout 30
#
interface Vlanif10
Networking Requirements
In Figure 3-80, terminals in a company's office area are connected to the
company's intranet through DeviceA. The downlink interface (for example 10GE
1/0/2) of DeviceA is directly connected to terminals in the office area.
To meet the company's high security requirements, 802.1X authentication and
local authentication need to be configured to authenticate terminals in the office
area. Additionally, authentication points need to be deployed on DeviceA's
interfaces (for example, 10GE 1/0/2) that are directly connected to the terminals.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Configure network connectivity.
# Create VLANs, configure the allowed VLANs on interfaces, and configure IP
addresses for interfaces.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 192.168.1.10 24
[DeviceA-Vlanif10] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type access
[DeviceA-10GE1/0/2] port default vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface vlanif 20
[DeviceA-Vlanif20] ip address 192.168.2.10 24
[DeviceA-Vlanif20] quit
# Configure the authorization scheme b1 and set the authorization mode to local
authorization.
[DeviceA-aaa] authorization-scheme b1
[DeviceA-aaa-author-b1] authorization-mode local
[DeviceA-aaa-author-b1] quit
# Configure the user name, password, and access type of a local user.
NOTE
Configure a terminal's MAC address as the local user name, set the password to Example@123,
and set the access type to MAC address authentication (dot1x). The following assumes that the
MAC address of printer 1 is 00e0-fcd4-8828.
[DeviceA-aaa] local-access-user 00e0-fcd4-8828
[DeviceA-aaa-access-user-00e0-fcd4-8828] password cipher Example@123
[DeviceA-aaa-access-user-00e0-fcd4-8828] service-type dot1x
[DeviceA-aaa-access-user-00e0-fcd4-8828] quit
# Configure the service scheme s1. In the service scheme s1, set the maximum
number of users who are allowed to access the network using the same user
name to 15.
[DeviceA-aaa] service-scheme s1
[DeviceA-aaa-service-s1] access-limit user-name max-num 15
[DeviceA-aaa-service-s1] quit
# Configure the domain example.com, and apply the authentication scheme a1,
authorization scheme b1, and service scheme s1 to the domain.
[DeviceA-aaa] domain example.com
[DeviceA-aaa-domain-example.com] authentication-scheme a1
[DeviceA-aaa-domain-example.com] authorization-scheme b1
[DeviceA-aaa-domain-example.com] service-scheme s1
[DeviceA-aaa-domain-example.com] quit
[DeviceA-aaa] quit
# Configure the authentication profile p1, bind the 802.1X access profile d1 to the
authentication profile, and configure the forcible authentication domain
example.com for users using the authentication profile.
[DeviceA] authentication-profile name p1
[DeviceA-authen-profile-p1] dot1x-access-profile d1
[DeviceA-authen-profile-p1] access-domain example.com force
[DeviceA-authen-profile-p1] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
authentication-profile name p1
dot1x-access-profile d1
access-domain example.com force
#
vlan batch 10 to 20
#
aaa
authentication-scheme a1
authentication-mode local
authorization-scheme b1
authorization-mode local
service-scheme s1
access-limit user-name max-num 15
domain example.com
authentication-scheme a1
authorization-scheme b1
service-scheme s1
local-access-user 00e0-fcd4-8828
password cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.<FvBB,.w;M75IN5Z>'!L8G:n-!!!!!2jp5!!!!!!<!!!!
k9&fPO<BSRW}jPT(,ewKyfIL"zVtM1~=>e.!!!!!%+%#
service-type dot1x
#
dot1x-access-profile name d1
dot1x timer client-timeout 30
#
interface Vlanif10
ip address 192.168.1.10 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.10 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
authentication-profile p1
#
interface 10GE1/0/2
port default vlan 20
#
return
3.1.13 Security
3.1.13.1 IPSG
Networking Requirements
In Figure 3-81, PC1 and PC2 access the network through DeviceA, and they both
use static IP addresses. The administrator wants users to use fixed IP addresses to
access the Internet.
Figure 3-81 Network diagram of configuring IPSG based on a static binding table
on an interface
NOTE
In this example, interface1 and interface2 represent 10GE1/0/1 and 10GE1/0/2, respectively.
Procedure
Step 1 Create static binding entries on Device A.
# Create static binding entries on Device A.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] user-bind static ip-address 10.0.0.1 mac-address 00e0-fc12-3456
[DeviceA] user-bind static ip-address 10.0.0.11 mac-address 00e0-fc12-3478
----End
Configuration Files
DeviceA
#
sysname DeviceA
#
user-bind static ip-address 10.0.0.1 mac-address 00e0-fc12-3456
user-bind static ip-address 10.0.0.11 mac-address 00e0-fc12-3478
#
interface 10GE1/0/1
ipv4 source check user-bind enable
#
interface 10GE1/0/2
ipv4 source check user-bind enable
#
return
3.1.13.1.2 Example for Configuring IPSG Based on a Static Binding Table in a VLAN
Networking Requirements
In Figure 3-82, PC1 and PC2 access the network through DeviceA, and they both
use static IP addresses. The Gateway functions as the enterprise egress gateway.
The administrator wants the PCs to use fixed IP addresses to access the Internet
through fixed interfaces. For security purposes, the administrator does not allow
external hosts to access the intranet without permission.
Figure 3-82 Network diagram of configuring IPSG based on a static binding table
in a VLAN
NOTE
Procedure
Step 1 Create a VLAN and add interfaces to the VLAN.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10
[DeviceA] interface 10GE 1/0/1
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10GE 1/0/2
[DeviceA-10GE1/0/2] port link-type access
[DeviceA-10GE1/0/2] port default vlan 10
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10GE 1/0/3
[DeviceA-10GE1/0/3] port link-type access
[DeviceA-10GE1/0/3] port default vlan 10
[DeviceA-10GE1/0/3] quit
[DeviceA] interface 10GE 1/0/4
[DeviceA-10GE1/0/4] port link-type trunk
[DeviceA-10GE1/0/4] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/4] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
dhcp enable
#
dhcp snooping enable
user-bind static ip-address 10.0.0.1 mac-address 00e0-fc12-3456 interface 10GE1/0/1
user-bind static ip-address 10.0.0.2 mac-address 00e0-fc12-3478 interface 10GE1/0/2
#
vlan batch 10
#
vlan 10
ipv4 source check user-bind enable
#
interface 10GE1/0/1
port default vlan 10
#
interface 10GE1/0/2
port default vlan 10
#
interface 10GE1/0/3
port default vlan 10
#
interface 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 10
dhcp snooping trusted
#
return
Networking Requirements
In Figure 3-83, PC1, PC2, and PC3 connect to the network through DeviceA,
DeviceB functions as a DHCP server to dynamically assign IP addresses to PC1 and
PC2, PC3 uses a static IP address, and Gateway is the enterprise egress gateway.
The administrator hopes that the PCs cannot access the network using static IP
addresses configured without permission.
NOTE
Figure 3-83 Network diagram of configuring IPSG to prevent hosts with DHCP-
assigned IP addresses from changing their own IP addresses
Procedure
Step 1 Configure the DHCP server function on DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
# Enable DHCP snooping and configure 10GE1/0/4 for connecting to the DHCP
server as a trusted interface.
[DeviceA] dhcp enable
[DeviceA] dhcp snooping enable
[DeviceA] vlan 10
[DeviceA-vlan10] dhcp snooping enable
[DeviceA-vlan10] dhcp snooping trusted interface 10GE 1/0/4
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10
#
dhcp enable
#
dhcp snooping enable
user-bind static ip-address 10.1.1.2 mac-address 00e0-fc12-3489 interface 10GE 1/0/3 vlan 10
#
vlan 10
dhcp snooping enable
dhcp snooping trusted interface 10GE 1/0/4
ipv4 source check user-bind enable
#
interface 10GE 1/0/1
port link-type access
port default vlan 10
#
interface 10GE 1/0/2
port link-type access
port default vlan 10
#
interface 10GE 1/0/3
port link-type access
port default vlan 10
#
interface 10GE 1/0/4
port link-type trunk
port trunk allow-pass vlan 10
#
return
DeviceB
#
sysname DeviceB
#
vlan batch 10
#
dhcp enable
#
ip pool 10
gateway-list 10.1.1.1
network 10.1.1.0 mask 255.255.255.0
#
interface Vlanif10
Networking Requirements
In Figure 3-84, PC1 and PC2 access the network through DeviceA. The
administrator wants the PCs to use dynamically allocated IP addresses to access
the Internet and deny the access to the Internet if statically configured IP
addresses are used.
In this example, interface1, interface2, and interface3 represent 10GE1/0/1, 10GE1/0/2, and
10GE1/0/3, respectively.
Procedure
Step 1 Create a VLAN and add interfaces to the VLAN.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10
[DeviceA] interface 10GE 1/0/1
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10GE 1/0/2
Step 2 Enable DHCP snooping and configure 10GE1/0/3 for connecting to the DHCP
server as a trusted interface.
[DeviceA] dhcp enable
[DeviceA] dhcp snooping enable
[DeviceA] vlan 10
[DeviceA-vlan10] dhcp snooping enable
[DeviceA-vlan10] dhcp snooping trusted interface 10GE 1/0/3
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10
#
dhcp enable
#
dhcp snooping enable
#
vlan 10
dhcp snooping enable
dhcp snooping trusted interface 10GE1/0/3
ipv4 source check user-bind enable
#
interface 10GE1/0/1
port default vlan 10
#
interface 10GE1/0/2
port default vlan 10
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 10
#
return
Networking Requirements
As shown in Figure 3-85, PC1, PC2, and PC3 can communicate with each other in
VLAN 10, and connect to the company network through DeviceA. For security
purposes, only PC1, PC2, and PC3 can access the company network, and external
users cannot access the company network.
In this example, interface1, interface2, and interface3 represent 10GE1/0/1, 10GE1/0/2, and
10GE1/0/3, respectively.
Configuration Roadmap
1. Configure a VLAN to enable employee PCs to communicate with each other.
2. Enable port security and limit the number of MAC addresses learned on an
interface, so that external users cannot access the company network.
Procedure
Step 1 Configure a VLAN.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10
[DeviceA-vlan10] quit
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type access
----End
Configuration Scripts
#
sysname DeviceA
#
vlan batch 10
#
interface 10GE1/0/1
port default vlan 10
port-security enable maximum 1
port-security mac-address sticky
#
interface 10GE1/0/2
port default vlan 10
port-security enable maximum 1
port-security mac-address sticky
#
interface 10GE1/0/3
port default vlan 10
port-security enable maximum 1
port-security mac-address sticky
#
return
3.1.14 QoS
3.1.14.1.1 Example for Configuring Access Control Based on Source MAC Addresses
Networking Requirements
In Figure 3-86, users of an enterprise access the Internet through DeviceA. The
enterprise does not allow some hosts on the LAN to access the Internet. However,
users can still access the Internet from these hosts by changing host IP addresses,
and firewalls cannot prevent such unauthorized access. Access control based on
source MAC addresses can be configured to solve this problem. In this example,
some hosts can be prevented from accessing the Internet but can access DeviceA.
Procedure
Step 1 Create a VLAN and configure interfaces.
# On DeviceA, create VLAN 10, configure VLANIF 10, and add 10GE 1/0/1 to the
VLAN.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan 10
[DeviceA-vlan10] quit
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 10.1.1.1 255.255.255.0
# On DeviceA, create a traffic behavior b2 and configure the deny action in the
traffic behavior.
[DeviceA] traffic behavior b2
[DeviceA-behavior-b2] deny
[DeviceA-behavior-b2] quit
Step 5 Configure a traffic policy and apply it to the inbound direction of an interface.
# On DeviceA, create a traffic policy p1 and bind traffic classifiers to traffic
behaviors in the traffic policy.
[DeviceA] traffic policy p1
[DeviceA-trafficpolicy-p1] classifier c1 behavior b1 precedence 5
[DeviceA-trafficpolicy-p1] classifier c2 behavior b2 precedence 10
[DeviceA-trafficpolicy-p1] classifier c3 behavior b2 precedence 15
[DeviceA-trafficpolicy-p1] classifier c4 behavior b2 precedence 20
[DeviceA-trafficpolicy-p1] quit
----End
Classifier: c1
Type: AND
Rule(s):
if-match acl 3001
<DeviceA> display traffic classifier c2
Traffic Classifier Information:
Classifier: c2
Type: AND
Rule(s):
if-match source-mac 00e0-fc0d-0001
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan 10
#
interface 10ge 1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface vlanif 10
ip address 10.1.1.1 255.255.255.0
#
acl 3001
rule 1 permit ip destination 10.1.1.0 0.0.0.255
#
traffic classifier c1 type and
if-match acl 3001
#
traffic classifier c2 type and
if-match source-mac 00e0-fc0d-0001
#
traffic classifier c3 type and
if-match source-mac 00e0-fc0d-0002
#
traffic classifier c4 type and
if-match source-mac 00e0-fc0d-0003
#
traffic behavior b1
permit
#
traffic behavior b2
deny
#
traffic policy p1
classifier c1 behavior b1 precedence 5
classifier c2 behavior b2 precedence 10
classifier c3 behavior b2 precedence 15
classifier c4 behavior b2 precedence 20
#
interface vlanif 10
traffic-policy p1 inbound
#
return
Networking Requirements
In Figure 3-87, Host1, Host2, and Host3 communicate with each other through
DeviceA. For specific reasons, Host1 is allowed to receive traffic from Host2
through DeviceA but is not allowed to receive traffic from Host3.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure an ACL rule.
# On DeviceA, create ACL 3001 to match the traffic with source IP address
192.168.3.1 and destination IP address 192.168.1.1 (traffic from Host3 to Host1).
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] acl 3001
[DeviceA-acl4-advance-3001] rule permit ip destination 192.168.1.1 24 source 192.168.3.1 24
[DeviceA-acl4-advance-3001] quit
# On DeviceA, create traffic classifier c1 and reference ACL 3001 in the traffic
classifier.
[DeviceA] traffic classifier c1
[DeviceA-classifier-c1] if-match acl 3001
[DeviceA-classifier-c1] quit
Step 4 Configure a traffic policy and apply it to the outbound direction of 10GE 1/0/1.
# On DeviceA, create traffic policy p1, in which traffic classifier c1 is associated
with traffic behavior b1.
[DeviceA] traffic policy p1
[DeviceA-trafficpolicy-p1] classifier c1 behavior b1
[DeviceA-trafficpolicy-p1] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
acl number 3001
rule 5 permit ip source 192.168.3.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
#
traffic classifier c1 type or
if-match acl 3001
#
traffic behavior b1
deny
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
interface 10GE1/0/1
traffic-policy p1 outbound
#
return
Networking Requirements
In Figure 3-88, Host1 sends packets with the 802.1p value of 6 to DeviceA.
Statistics on service packets need to be collected to properly allocate bandwidth
resources.
Procedure
Step 1 Configure an ACL rule.
# On DeviceA, create Layer 2 ACL 4000 to match packets with the 802.1p value of
6.
[DeviceA] acl 4000
[DeviceA-acl-L2-4000] rule permit 8021p 6
[DeviceA-acl-L2-4000] quit
----End
CAR 0 0 0 0
-------------------------------------------------------------------------------
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 100
#
acl number 4000
rule 5 permit 8021p 6
#
traffic classifier c1 type or
if-match acl 4000
#
traffic behavior b1
statistics enable
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
interface 10GE1/0/1
traffic-policy p1 inbound
#
return
3.1.14.3 Redirection
Networking Requirements
In Figure 3-89, the server connects to the Internet through DeviceA, DeviceB, and
DeviceD. All traffic from the Internet needs to be redirected to DeviceC for filtering
to ensure the security of traffic to the server.
In this example, interface 1, interface 2, interface 3, and interface 4 represent 10GE 1/0/1, 10GE 1/0/2, 10GE
1/0/3, and 10GE 1/0/4, respectively.
Procedure
Step 1 Create VLANs and configure interfaces to ensure Layer 2 connectivity.
# Configure 10GE 1/0/1 on DeviceB as a trunk interface and add it to VLAN 200
and VLAN 300. Configure 10GE 1/0/2 and 10GE 1/0/3 on DeviceB as access
interfaces, and add 10GE 1/0/2 to VLAN 200 and 10GE 1/0/3 to VLAN 300.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 200 300
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] portswitch
[DeviceB-10GE1/0/2] port link-type access
[DeviceB-10GE1/0/2] port default vlan 200
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] portswitch
[DeviceB-10GE1/0/3] port link-type access
[DeviceB-10GE1/0/3] port default vlan 300
[DeviceB-10GE1/0/3] quit
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 200 300
# Configure 10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/3, and 10GE 1/0/4 on DeviceA as
trunk interfaces and add them to VLAN 200 and VLAN 300. To prevent loops, add
10GE 1/0/3 and 10GE 1/0/4 to the same port isolation group and disable MAC
address learning on 10GE 1/0/4 to prevent MAC address flapping.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 200 300
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 200 300
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port link-type trunk
[DeviceA-10GE1/0/3] port trunk allow-pass vlan 200 300
[DeviceA-10GE1/0/3] port-isolate enable group 1
[DeviceA-10GE1/0/3] quit
[DeviceA] interface 10ge 1/0/4
[DeviceA-10GE1/0/4] portswitch
[DeviceA-10GE1/0/4] port link-type trunk
[DeviceA-10GE1/0/4] port trunk allow-pass vlan 200 300
[DeviceA-10GE1/0/4] port-isolate enable group 1
[DeviceA-10GE1/0/4] mac-address learning disable
[DeviceA-10GE1/0/4] quit
# Create a traffic policy p1, and bind the traffic classifier c1 and traffic behavior
b1 to the traffic policy.
[DeviceA] traffic policy p1
[DeviceA-trafficpolicy-p1] classifier c1 behavior b1
[DeviceA-trafficpolicy-p1] quit
----End
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 200 300
#
traffic classifier c1 type or
if-match any
#
traffic behavior b1
redirect interface 10GE 1/0/3
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 200 300
traffic-policy p1 inbound
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200 300
#
interface 10GE1/0/3
● DeviceB
#
sysname DeviceB
#
vlan batch 200 300
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 200 300
#
interface 10GE1/0/2
port default vlan 200
#
interface 10GE1/0/3
port default vlan 300
#
return
Networking Requirements
In Figure 3-90, DeviceA functioning as a Layer 3 forwarding device is routable to
NetworkA and is connected to the Internet through two links. One uplink is a
high-speed link with the gateway at 10.1.20.1/24, and the other is a low-speed
link with the gateway at 10.1.30.1/24. The user requires that DeviceA forward
packets from network segments 192.168.100.0/24 and 192.168.101.0/24 to the
Internet through the high-speed link and low-speed link, respectively.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 10, VLAN 20, and VLAN 30 on DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20 30
# Configure 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3 on DeviceA as trunk
interfaces and add them to corresponding VLANs.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port link-type trunk
[DeviceA-10GE1/0/3] port trunk allow-pass vlan 30
[DeviceA-10GE1/0/3] quit
# Create VLANIF 10, VLANIF 20, and VLANIF 30 and configure IP addresses for
them.
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 10.1.10.2 24
[DeviceA-Vlanif10] quit
[DeviceA] interface vlanif 20
[DeviceA-Vlanif20] ip address 10.1.20.2 24
[DeviceA-Vlanif20] quit
[DeviceA] interface vlanif 30
[DeviceA-Vlanif30] ip address 10.1.30.2 24
[DeviceA-Vlanif30] quit
----End
Classifier: c2
Type: OR
Rule(s):
if-match acl 3002
Classifier: c2
Type: OR
Behavior: b2
Redirect:
Redirect nexthop
10.1.30.1
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10 20 30
#
acl number 3001
rule 5 permit ip source 192.168.100.0 0.0.0.255
#
acl number 3002
rule 5 permit ip source 192.168.101.0 0.0.0.255
#
traffic classifier c1 type or
if-match acl 3001
#
traffic classifier c2 type or
if-match acl 3002
#
traffic behavior b1
redirect nexthop 10.1.20.1
#
traffic behavior b2
redirect nexthop 10.1.30.1
#
traffic policy p1
classifier c1 behavior b1 precedence 5
classifier c2 behavior b2 precedence 10
#
interface Vlanif10
ip address 10.1.10.2 255.255.255.0
#
interface Vlanif20
ip address 10.1.20.2 255.255.255.0
#
interface Vlanif30
ip address 10.1.30.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
traffic-policy p1 inbound
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 30
#
return
Networking Requirements
In Figure 3-91, DeviceA is the upper-layer device of DeviceB and DeviceB is the
user gateway. There are reachable routes between DeviceA and DeviceB. DeviceA
is connected to the Internet through two links: high-speed link with the gateway
at 10.1.20.1/24 and low-speed link with the gateway at 10.1.30.1/24. A default
route has been configured on DeviceA to ensure that traffic is transmitted through
the high-speed link by default. The customer requirements are as follows:
● Packets from the network segment 192.168.101.0/24 are redirected to the
low-speed link for transmission, alleviating the bandwidth pressure of the
high-speed link.
● If the low-speed link fails, packets from the network segment
192.168.101.0/24 can be rapidly switched back to the high-speed link to
minimize communication interruption caused by the link fault.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Create VLANs and configure interfaces.
# Configure DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20 30
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port link-type trunk
[DeviceA-10GE1/0/3] port trunk allow-pass vlan 30
[DeviceA-10GE1/0/3] quit
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 10.1.20.2 24
[DeviceA-Vlanif10] quit
[DeviceA] interface vlanif 20
[DeviceA-Vlanif20] ip address 10.1.30.2 24
[DeviceA-Vlanif20] quit
[DeviceA] interface vlanif 30
[DeviceA-Vlanif30] ip address 10.1.10.2 24
[DeviceA-Vlanif30] quit
# Configure DeviceC.
<HUAWEI> system-view
[HUAWEI] sysname DeviceC
[DeviceC] vlan batch 10
[DeviceC] interface 10ge 1/0/1
[DeviceC-10GE1/0/1] portswitch
[DeviceC-10GE1/0/1] port link-type trunk
# Configure DeviceD.
<HUAWEI> system-view
[HUAWEI] sysname DeviceD
[DeviceD] vlan batch 20
[DeviceD] interface 10ge 1/0/1
[DeviceD-10GE1/0/1] portswitch
[DeviceD-10GE1/0/1] port link-type trunk
[DeviceD-10GE1/0/1] port trunk allow-pass vlan 20
[DeviceD-10GE1/0/1] quit
[DeviceD] interface vlanif 20
[DeviceD-Vlanif20] ip address 10.1.30.1 24
[DeviceD-Vlanif20] quit
# Create advanced ACL 3001 on DeviceA to allow packets from the network
segment 192.168.101.0/24 to pass through.
[DeviceA] acl 3001
[DeviceA-acl4-advance-3001] rule permit ip source 192.168.101.0 0.0.0.255
[DeviceA-acl4-advance-3001] quit
# Create a traffic policy p1 on DeviceA, and bind the traffic classifier c1 and traffic
behavior b1 to the traffic policy.
[DeviceA] traffic policy p1
[DeviceA-trafficpolicy-p1] classifier c1 behavior b1
[DeviceA-trafficpolicy-p1] quit
----End
# Check the NQA test result. If "Completion:success" and "Lost packet ratio: 0 %"
are displayed, the NQA test succeeds and the link is normal.
<DeviceA> display nqa results test-instance user test
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 10 20 30
#
acl number 3001
rule 5 permit ip source 192.168.101.0 0.0.0.255
#
traffic classifier c1 type or
if-match acl 3001
#
traffic behavior b1
redirect nexthop 10.1.30.1 track nqa user test
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
interface Vlanif10
ip address 10.1.20.2 255.255.255.0
#
interface Vlanif20
ip address 10.1.30.2 255.255.255.0
#
interface Vlanif30
ip address 10.1.10.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 30
traffic-policy p1 inbound
#
nqa test-instance user test
test-type icmp
destination-address ipv4 10.1.30.1
interval seconds 5
timeout 4
probe-count 2
frequency 11
start now
#
return
● DeviceC
#
sysname DeviceC
#
vlan batch 10
#
interface Vlanif10
ip address 10.1.20.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
● DeviceD
#
sysname DeviceD
#
vlan batch 20
#
interface Vlanif20
ip address 10.1.30.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
return
Networking Requirements
In Figure 3-92, the PC needs to access the server through link A, link B, and link C
(is used by default) in descending order of priority.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a dynamic routing protocol to generate a route or configure a static
route destined for the server and specify 10.1.1.2/24 as the next-hop address
so that packets pass through link A.
2. Redirect the packets that match the network segment where the server
resides to the next-hop address 10.1.2.2/24 and allow the packets to pass
through link B; specify low-preference for redirection to a next-hop address;
configure a high priority for the traffic classifier when binding the traffic
classifier and the traffic behavior to the traffic policy. In this way, packets
preferentially pass through link A.
3. Configure the device to redirect the packets matching all network segments
to the next-hop address 10.1.3.2/24 instead of sending packets through the
default route, and allow the packets to pass through link C; specify low-
preference for redirection to a next-hop address; configure a low priority for
the traffic classifier when binding the traffic classifier and the traffic behavior
to the traffic policy. In this way, packets preferentially pass through links A
and B.
After the configuration is complete, DeviceA handles packets in one of the
following ways (listed in descending order of priority): forwards packets according
to the route generated by a routing protocol or static route > redirects packets
matching the network segment where the server resides to a next-hop address >
redirects packets matching the entire network segment to a next-hop address.
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLANs 10, 20, and 30 on DeviceA.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20 30
# Configure 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3 on DeviceA as trunk
interfaces and add them to VLAN 10, VLAN 20, and VLAN 30, respectively.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port link-type trunk
[DeviceA-10GE1/0/3] port trunk allow-pass vlan 30
[DeviceA-10GE1/0/3] quit
# Create VLANIF 10, VLANIF 20, and VLANIF 30 and configure IP addresses for
them.
[DeviceA] interface vlanif 10
[DeviceA-Vlanif10] ip address 10.1.1.1 24
[DeviceA-Vlanif10] quit
[DeviceA] interface vlanif 20
[DeviceA-Vlanif20] ip address 10.1.2.1 24
[DeviceA-Vlanif20] quit
[DeviceA] interface vlanif 30
[DeviceA-Vlanif30] ip address 10.1.3.1 24
[DeviceA-Vlanif30] quit
# On DeviceA, create traffic classifiers c1 and c2 that match ACLs 3001 and 3002
respectively, and specify a higher priority for c1 than that for c2.
[DeviceA] traffic classifier c1
[DeviceA-classifier-c1] if-match acl 3001
[DeviceA-classifier-c1] quit
[DeviceA] traffic classifier c2
[DeviceA-classifier-c2] if-match acl 3002
[DeviceA-classifier-c2] quit
# Apply the traffic policy p1 to the system. After the configuration is complete, all
packets received by DeviceA match the traffic policy p1.
[DeviceA] traffic-policy p1 global inbound
[DeviceA] quit
----End
Classifier: c2
Type: OR
Rule(s):
if-match acl 3002
Classifier: c2
Type: OR
Behavior: b2
Redirect:
Redirect nexthop
10.1.3.2
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10 20 30
#
3.1.14.4 Re-marking
Networking Requirements
On the network shown in Figure 3-93, packets sent from Host1 and Host2 to
DeviceB are identified by different VLAN IDs (10 and 20, respectively). DeviceB re-
marks the VLAN packets received from Host1 and Host2 so that the internal
priority of the packets sent by Host1 is higher than that of the packets sent by
Host2 on DeviceA. This ensures the experience of services on Host1.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Create VLANs and configure interfaces so that DeviceB can communicate with
Host1, Host2, and DeviceA.
# Create VLAN 10, VLAN 20, and VLAN 30 on DeviceB.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 10 20 30
# Configure 10GE 1/0/1 as a trunk interface and add it to VLAN 30. Configure
10GE 1/0/2 and 10GE 1/0/3 as access interfaces and add them to VLAN 10 and
VLAN 20, respectively.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 30
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] portswitch
[DeviceB-10GE1/0/2] port link-type access
[DeviceB-10GE1/0/2] port default vlan 10
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] portswitch
[DeviceB-10GE1/0/3] port link-type access
[DeviceB-10GE1/0/3] port default vlan 20
[DeviceB-10GE1/0/3] quit
# Create VLANIF 10, VLANIF 20, and VLANIF 30, and configure IP addresses for
them.
[DeviceB] interface vlanif 10
[DeviceB-Vlanif10] ip address 192.168.10.1 24
[DeviceB-Vlanif10] quit
[DeviceB] interface vlanif 20
[DeviceB-Vlanif20] ip address 192.168.20.1 24
[DeviceB-Vlanif20] quit
[DeviceB] interface vlanif 30
[DeviceB-Vlanif30] ip address 192.168.100.1 24
[DeviceB-Vlanif30] quit
----End
if-match vlan 10
Classifier: c2
Type: OR
Rule(s):
if-match vlan 20
Policy: p2
Classifier: c2
Type: OR
Behavior: b2
Remark:
Remark 8021p 2
Configuration Scripts
DeviceB
#
sysname DeviceB
#
vlan batch 10 20 30
#
traffic classifier c1 type or
if-match vlan 10
#
traffic classifier c2 type or
if-match vlan 20
#
traffic behavior b1
remark 8021p 4
#
traffic behavior b2
remark 8021p 2
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
traffic policy p2
classifier c2 behavior b2 precedence 5
#
interface Vlanif10
3.1.14.5.1 Example for Configuring Traffic Shaping to Limit the Rate of Different
Services
Networking Requirements
In Figure 3-94, three servers are deployed to provide voice, video, and data
services, and service packets traverse DeviceA, DeviceB, and DeviceC to reach the
external network. The interface connected to the voice service host joins VLAN 10;
the interface connected to the video service host joins VLAN 20; the interface
connected to the data service host joins VLAN 30.
In this example, interface 1, interface 2, interface 3, and interface 4 represent 10GE 1/0/1,
10GE 1/0/2, 10GE 1/0/3, and 10GE 1/0/4, respectively.
Packets of voice, video, and data services are identified by 802.1p priorities 5, 3,
and 2 respectively. However, jitter may occur when packets from interface 2 on
DeviceB reach DeviceC. Table 3-2 lists the bandwidth requirements to limit jitter
and ensure services.
Procedure
Step 1 On DeviceB, create VLANs and add interfaces to these VLANs so that users can
access the network through DeviceB.
# Create VLANs 10, 20, and 30.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 10 20 30
# Set the access mode of interfaces 10GE 1/0/1 and 10GE 1/0/2 to trunk, and add
them to VLANs 10, 20, and 30.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
Step 2 Set priorities for DeviceA's interfaces connected to the hosts to differentiate
packets of different services.
# On DeviceA, set the priorities of 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3 to 5, 3,
and 2, respectively, and add 10GE 1/0/4 to VLANs 10, 20, and 30.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20 30
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] port priority 5
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port default vlan 20
[DeviceA-10GE1/0/2] port priority 3
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port default vlan 30
[DeviceA-10GE1/0/3] port priority 2
[DeviceA-10GE1/0/3] quit
[DeviceA] interface 10ge 1/0/4
[DeviceA-10GE1/0/4] portswitch
[DeviceA-10GE1/0/4] port link-type trunk
[DeviceA-10GE1/0/4] port trunk allow-pass vlan 10 20 30
[DeviceA-10GE1/0/4] quit
Step 3 Configure queue-based traffic shaping to limit the bandwidth of voice, video, and
data services.
# Configure queue-based traffic shaping on DeviceB. Set the CIR values of voice,
video, and data services to 3000 kbit/s, 5000 kbit/s, and 2000 kbit/s, respectively.
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] qos queue 5 shaping cir 3000 pir 5000 kpbs
[DeviceB-10GE1/0/2] qos queue 3 shaping cir 5000 pir 8000 kpbs
[DeviceB-10GE1/0/2] qos queue 2 shaping cir 2000 pir 3000 kpbs
[DeviceB-10GE1/0/2] quit
----End
----------------------------------------------------------------------------------------------
2 2000 54584 0 0 0 -
3000 5676736 0 0 0
----------------------------------------------------------------------------------------------
3 5000 49648 0 0 0 -
8000 5163392 0 0 0
----------------------------------------------------------------------------------------------
4 0 0 0 0 0 -
10000000 0 0 0 0
----------------------------------------------------------------------------------------------
5 3000 49998 0 0 0 -
5000 5199792 0 0 0
----------------------------------------------------------------------------------------------
6 0 0 0 0 0 -
10000000 0 0 0 0
----------------------------------------------------------------------------------------------
7 0 0 0 0 0 -
10000000 0 0 0 0
----------------------------------------------------------------------------------------------
Configuration Scripts
● DeviceB
#
sysname DeviceB
#
vlan batch 10 20 30
#
interface 10GE1/0/1
portswitch
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
interface 10GE1/0/2
portswitch
port link-type trunk
port trunk allow-pass vlan 10 20 30
qos queue 2 shaping cir 2000 kbps pir 3000 kbps
qos queue 3 shaping cir 5000 kbps pir 8000 kbps
qos queue 5 shaping cir 3000 kbps pir 5000 kbps
#
return
● DeviceA
#
sysname DeviceA
#
vlan batch 10 20 30
#
interface 10GE1/0/1
portswitch
port default vlan 10
port priority 5
#
interface 10GE1/0/2
portswitch
port default vlan 20
port priority 3
#
interface 10GE1/0/3
portswitch
port default vlan 30
port priority 2
#
interface 10GE1/0/4
portswitch
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
return
Networking Requirements
In Figure 3-95, packets of voice, video, and data services from the user side
traverse DeviceA, DeviceB, and DeviceC to reach the external network.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Packets of voice, video, and data services are identified by 802.1p priorities 6, 5,
and 2, respectively. The interface bandwidth is limited to 10000 kbit/s. However,
jitter may occur when packets from interface 2 on DeviceB reach DeviceC. To
reduce jitter and ensure the bandwidth for various services, the following
bandwidth requirements must be met:
Procedure
Step 1 On DeviceB, create a VLAN and configure interfaces so that users can access the
network through DeviceB.
# Create VLAN 10.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 10
----End
Configuration Scripts
● DeviceB
#
sysname DeviceB
#
vlan batch 10
#
diffserv domain ds1
8021p-inbound 6 phb cs7
8021p-inbound 5 phb ef
8021p-inbound 2 phb af2
#
interface 10GE1/0/1
portswitch
port link-type trunk
port trunk allow-pass vlan 10
trust upstream ds1
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 10
qos lr cir 10000 outbound
qos queue 2 shaping cir 2000 pir 3000
qos queue 5 shaping cir 5000 pir 8000
qos queue 7 shaping cir 3000 pir 5000
#
return
Networking Requirements
In Figure 3-95, packets of voice, video, and data services from the user side
traverse DeviceA, DeviceB, and DeviceC to reach the external network.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Packets of voice, video, and data services are identified by 802.1p priorities 6, 5,
and 2, respectively. The interface bandwidth is limited to 10000 kbit/s. However,
jitter may occur when packets from interface 2 on DeviceB reach DeviceC. To
reduce jitter and ensure the bandwidth for various services, the following
bandwidth requirements must be met:
Procedure
Step 1 On DeviceB, create a VLAN and configure interfaces so that users can access the
network through DeviceB.
# Create VLAN 10.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 10
----End
5000 5199792 0 0 0
----------------------------------------------------------------------------------------------
7 0 0 0 0 0 -
10000000 0 0 0 0
----------------------------------------------------------------------------------------------
Configuration Scripts
● DeviceB
#
sysname DeviceB
#
vlan batch 10
#
interface 10GE1/0/1
portswitch
port link-type trunk
port trunk allow-pass vlan 10
trust 8021p outer
#
interface 10GE1/0/1
trust 8021p outer
#
interface 10GE1/0/2
portswitch
port link-type trunk
port trunk allow-pass vlan 10
qos lr cir 10000 outbound
qos queue 2 shaping cir 2000 pir 3000
qos queue 5 shaping cir 5000 pir 8000
qos queue 6 shaping cir 3000 pir 5000
1/0/1
#
return
3.1.14.5.4 Example for Configuring Traffic Policing to Limit the Rate of Each IP
Address on a Network Segment
Networking Requirements
Users on an enterprise network send packets through DeviceA and DeviceB, and
access the external network through DeviceC. Users reside on two different
network segments. It is required that the rate of traffic from each IP address on
network segment 192.168.1.0/24 be limited to 64 kbit/s and the rate of traffic
from each IP address on network segment 192.168.2.0/24 be limited to 128
kbit/s.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Create VLANs and configure interfaces so that enterprise users can access the
network through DeviceB.
# Create VLANs 10 and 20 on DeviceB and add 10GE 1/0/1 to the VLANs.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 10 20
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 10 20
[DeviceB-10GE1/0/1] quit
[DeviceB-behavior-b1] quit
[DeviceB] traffic behavior b2
[DeviceB-behavior-b2] car cir 128
[DeviceB-behavior-b2] quit
# On DeviceB, create traffic policy p1, bind traffic classifiers to traffic behaviors in
the traffic policy, and apply the traffic policy to the inbound direction of 10GE
1/0/1 to perform traffic policing for packets from two different network segments.
[DeviceB] traffic policy p1
[DeviceB-trafficpolicy-p1] classifier c1 behavior b1
[DeviceB-trafficpolicy-p1] classifier c2 behavior b2
[DeviceB-trafficpolicy-p1] quit
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] traffic-policy p1 inbound
[DeviceB-10GE1/0/1] quit
----End
Classifier: c2
Type: OR
Rule(s):
if-match acl 2002
Classifier: c2
Type: OR
Behavior: b2
Committed Access Rate:
CIR 128 (Kbps), PIR 128 (Kbps), CBS 10000 (Bytes), PBS 10000 (Bytes)
Color Mode: color blind
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
Configuration Scripts
● DeviceB
#
sysname DeviceB
#
vlan batch 10 20
#
acl 2001
rule permit source 192.168.1.0 0.0.0.255
#
acl 2002
rule permit source 192.168.2.0 0.0.0.255
#
traffic classifier c1 type or
if-match acl 2001
#
traffic classifier c2 type or
if-match acl 2002
#
traffic behavior b1
car cir 64
#
traffic behavior b2
car cir 128
#
traffic policy p1
classifier c1 behavior b1
classifier c2 behavior b2
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
#
interface 10GE1/0/1
portswitch
port link-type trunk
port trunk allow-pass vlan 10 20
traffic-policy p1 inbound
#
return
Networking Requirements
In Figure 3-98, the host sends packets through DeviceA. It is required that the
bandwidth of the packets sent by the host should not exceed 100 Mbit/s.
Procedure
Step 1 Configure a CAR profile.
# On DeviceA, create a CAR profile named car1 to police traffic from the host.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] qos car car1 cir 100000
----End
# Send packets to 10GE 1/0/1 at the rates of 60000 kbit/s and 110000 kbit/s,
respectively, and then run the display qos car statistics command to check the
traffic statistics. If the configuration is successful, all packets are successfully
forwarded when they are sent to 10GE 1/0/1 at 60000 kbit/s; however, some
packets are discarded when packets are sent to 10GE 1/0/1 at 110000 kbit/s.
Configuration Scripts
DeviceA
#
sysname DeviceA
#
qos car car1 cir 100000 kbps
#
interface 10GE1/0/1
qos car inbound car1
#
return
Networking Requirements
In Figure 3-99, packets sent by Host1, Host2, and Host3 traverse DeviceA,
DeviceB, and DeviceC to reach the external network. Interface 1 (connected to
Host1), interface 2 (connected to Host2), and interface 3 (connected to Host3)
join VLAN 10, VLAN 20, and VLAN 30, respectively.
In this example, interface 1, interface 2, interface 3, and interface 4 represent 10GE 1/0/1,
10GE 1/0/2, 10GE 1/0/3, and 10GE 1/0/4, respectively.
The rates of traffic from tenants must be limited within proper ranges on DeviceB.
Table 3-5 lists the required CIR values for uplink traffic from tenants.
Table 3-5 CIR values for uplink traffic from tenants on DeviceB
Host1 2000
Host2 4000
Host3 8000
Procedure
Step 1 Create VLANs and configure interfaces so that hosts can access the network
through DeviceB.
# Create VLANs 10, 20, and 30 on DeviceA and add interfaces to the
corresponding VLANs.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10 20 30
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port default vlan 20
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] portswitch
[DeviceA-10GE1/0/3] port default vlan 30
[DeviceA-10GE1/0/3] quit
[DeviceA] interface 10ge 1/0/4
[DeviceA-10GE1/0/4] portswitch
[DeviceA-10GE1/0/4] port link-type trunk
[DeviceA-10GE1/0/4] port trunk allow-pass vlan 10 20 30
[DeviceA-10GE1/0/4] quit
# Create VLANs 10, 20, and 30 on DeviceB and add 10GE 1/0/1 to the VLANs.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 10 20 30
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] portswitch
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 10 20 30
[DeviceB-10GE1/0/1] quit
# On DeviceB, configure traffic classifiers c1, c2, and c3 to match service flows
from different hosts based on VLAN IDs.
[DeviceB] traffic classifier c1
[DeviceB-classifier-c1] if-match vlan 10
[DeviceB-classifier-c1] quit
[DeviceB] traffic classifier c2
[DeviceB-classifier-c2] if-match vlan 20
[DeviceB-classifier-c2] quit
[DeviceB] traffic classifier c3
[DeviceB-classifier-c3] if-match vlan 30
[DeviceB-classifier-c3] quit
----End
Classifier: c2
Type: OR
Rule(s):
if-match vlan 20
Classifier: c3
Type: OR
Rule(s):
if-match vlan 30
Classifier: c2
Type: OR
Behavior: b2
Committed Access Rate:
CIR 4000 (Kbps), PIR 4000 (Kbps), CBS 32000 (Bytes), PBS 32000 (Bytes)
Color Mode: color blind
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
Statistics: enable
Classifier: c3
Type: OR
Behavior: b3
Committed Access Rate:
CIR 8000 (Kbps), PIR 8000 (Kbps), CBS 64000 (Bytes), PBS 64000 (Bytes)
Color Mode: color blind
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
Statistics: enable
The preceding command output shows that the traffic policy p1 is applied to 10GE
1/0/1.
Configuration Scripts
● DeviceB
#
sysname DeviceB
#
vlan batch 10 20 30
#
traffic classifier c1 type or
if-match vlan 10
#
traffic classifier c2 type or
if-match vlan 20
#
traffic classifier c3 type or
if-match vlan 30
#
traffic behavior b1
statistics enable
car cir 2000 kbps
#
traffic behavior b2
statistics enable
car cir 4000 kbps
#
traffic behavior b3
statistics enable
car cir 8000 kbps
#
traffic policy p1
classifier c1 behavior b1 precedence 5
classifier c2 behavior b2 precedence 10
classifier c3 behavior b3 precedence 15
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
#
interface Vlanif30
ip address 192.168.3.1 255.255.255.0
#
interface 10GE1/0/1
portswitch
port link-type trunk
port trunk allow-pass vlan 10 20 30
traffic-policy p1 inbound
#
return
● DeviceA
#
sysname DeviceA
#
vlan batch 10 20 30
#
interface 10GE1/0/1
portswitch
port default vlan 10
#
interface 10GE1/0/2
portswitch
port default vlan 20
#
interface 10GE1/0/3
portswitch
port default vlan 30
#
interface 10GE1/0/4
portswitch
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
return
Networking Requirements
Host1 and Host2 provide voice, video, and data services, for which traffic is
transmitted through DeviceB and then DeviceA. To reduce the impact of network
congestion and guarantee high-priority, latency-sensitive services, set congestion
avoidance parameters according to Table 3-6.
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure VLANs for interfaces so that devices can communicate with each other
at the link layer.
# Configure 10GE 1/0/3 on DeviceB as a trunk interface. Add 10GE 1/0/1 to VLAN
100, 10GE 1/0/2 to VLAN 200, and 10GE 1/0/3 to VLAN 100 and VLAN 200.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan batch 100 200
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] port default vlan 100
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] port default vlan 200
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] port link-type trunk
[DeviceB-10GE1/0/3] port trunk allow-pass vlan 100 200
[DeviceB-10GE1/0/3] quit
Step 2 Configure priority mapping to map 802.1p values in voice, data, and video packets
to different CoS values and colors.
# Create the DiffServ domain ds1, map 802.1p values 6, 5, and 2 to CoS values EF,
AF3, and AF1, respectively, and color packets green, yellow, and red.
[DeviceB] diffserv domain ds1
[DeviceB-dsdomain-ds1] 8021p-inbound 6 phb ef green
[DeviceB-dsdomain-ds1] 8021p-inbound 5 phb af3 yellow
[DeviceB-dsdomain-ds1] 8021p-inbound 2 phb af1 red
[DeviceB-dsdomain-ds1] quit
# Bind the DiffServ domain to the inbound interfaces 10GE 1/0/1 and 10GE 1/0/2
on DeviceB.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] trust upstream ds1
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] trust upstream ds1
[DeviceB-10GE1/0/2] quit
# Apply the WRED drop profile wred1 to queues on the outbound interface of
DeviceB.
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] qos queue 5 wred wred1
[DeviceB-10GE1/0/3] qos queue 3 wred wred1
[DeviceB-10GE1/0/3] qos queue 1 wred wred1
[DeviceB-10GE1/0/3] quit
----End
# Check the configuration of the WRED drop profile wred1. You can see WRED
parameter settings of green, yellow, and red packets in this profile.
<DeviceB> display drop-profile wred1
Drop-profile[1]: wred1
Color Mode Low-limit High-limit Unit Discard(%)
-----------------------------------------------------------------
Green Percentage 80 100 % 10
Yellow Percentage 60 80 % 20
Red Percentage 40 60 % 40
-----------------------------------------------------------------
# Check the configuration of 10GE 1/0/3. You can see the scheduling parameters
of queues with different CoS values.
<DeviceB> display qos configuration interface 10GE 1/0/3
interface 10GE1/0/3
--------------------------------------------------------------------------
trust flag : outer 8021p
diffserv domain : default
dei enable : disable
port priority :0
phb marking 8021p : enable
phb marking dscp : disable
phb marking exp : -
port wred :-
port lr : cir = -, cbs = -
port car inbound : -
port car outbound : -
schedule profile : -
--------------------------------------------------------------------------
queue shaping schedule wred
cir pir
cbs pbs
--------------------------------------------------------------------------
0 - - pq -
- -
1 - - pq wred1
- -
2 - - pq -
- -
3 - - pq wred1
- -
4 - - pq -
- -
5 - - pq wred1
- -
6 - - pq -
- -
7 - - pq -
- -
--------------------------------------------------------------------------
Configuration Scripts
DeviceB
#
sysname DeviceB
#
drop-profile wred1
color green low-limit 80 high-limit 100 discard-percentage 10
color yellow low-limit 60 high-limit 80 discard-percentage 20
color red low-limit 40 high-limit 60 discard-percentage 40
#
vlan batch 100 200
#
diffserv domain ds1
8021p-inbound 2 phb af1 red
8021p-inbound 5 phb af3 yellow
8021p-inbound 6 phb ef green
#
interface 10GE1/0/1
port default vlan 100
trust upstream ds1
#
interface 10GE1/0/2
port default vlan 200
trust upstream ds1
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 100 200
qos queue 1 wred wred1
qos queue 3 wred wred1
qos queue 5 wred wred1
#
return
Networking Requirements
Host1 and Host2 provide voice, video, and data services. Traffic from these
services is transmitted through DeviceB and then DeviceA. To reduce the impact of
network congestion and guarantee high-priority services that require low latency,
set congestion management parameters according to Table 3-7.
Voice Green EF PQ -
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure VLANs for each interface so that devices can communicate with each
other at the link layer.
Step 2 Configure priority mapping to map 802.1p values in voice, video, and data packets
to different CoS values and colors.
# Create DiffServ domain ds1, map 802.1p values 6, 5, and 2 to CoS values EF,
AF3, and AF1, respectively, and color the packets green, yellow, and red,
respectively.
[DeviceB] diffserv domain ds1
[DeviceB-dsdomain-ds1] 8021p-inbound 6 phb ef green
[DeviceB-dsdomain-ds1] 8021p-inbound 5 phb af3 yellow
[DeviceB-dsdomain-ds1] 8021p-inbound 2 phb af1 red
[DeviceB-dsdomain-ds1] quit
# Bind the DiffServ domain to the inbound interfaces 10GE 1/0/1 and 10GE 1/0/2
on DeviceB.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] trust 8021p outer
[DeviceB-10GE1/0/1] trust upstream ds1
[DeviceB-10GE1/0/1] quit
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] trust 8021p outer
[DeviceB-10GE1/0/2] trust upstream ds1
[DeviceB-10GE1/0/2] quit
----End
In the DiffServ domain, 802.1p values 6, 5, and 2 are mapped to CoS values EF,
AF3, and AF1, respectively, and packets are colored green, yellow, and red,
respectively.
# Check the configuration of 10GE 1/0/3. You can see the scheduling parameters
of queues with different CoS values.
1 - - drr -
- - weight = 50
2 - - drr -
- - weight = 1
3 - - drr -
- - weight = 100
4 - - drr -
- - weight = 1
5 - - pq -
- -
6 - - pq -
- -
7 - - pq -
- -
--------------------------------------------------------------------------
Configuration Scripts
DeviceB
#
sysname DeviceB
#
vlan batch 100 200
#
diffserv domain ds1
8021p-inbound 2 phb af1 red
8021p-inbound 5 phb af3 yellow
8021p-inbound 6 phb ef green
#
interface 10GE1/0/1
port default vlan 100
trust upstream ds1
#
interface 10GE1/0/2
port default vlan 200
trust upstream ds1
#
interface 10GE1/0/3
Networking Requirements
DeviceB is connected to DeviceA through interface 1. The 802.1p priorities of
voice, video, and data service packets from the Internet are 6, 5, and 2,
respectively. Packets of these services can reach users through DeviceA and
DeviceB, as shown in Figure 3-102. Because the rate of the inbound interface
interface 1 on DeviceB is higher than the rates of outbound interfaces interface 2
and interface 3, congestion may occur on the two outbound interfaces.
Video Yellow 60 80 20
Data Red 40 60 40
Voice EF 0
Data AF1 50
In this example, interface 1, interface 2, and interface 3 represent 10GE 1/0/1, 10GE 1/0/2,
and 10GE 1/0/3, respectively.
Procedure
Step 1 Configure VLANs for each interface so that devices can communicate with each
other at the link layer.
Step 2 Configure priority mapping to map 802.1p values in voice, video, and data packets
to different CoS values and colors.
# Create DiffServ domain ds1, map 802.1p values 6, 5, and 2 to CoS values EF,
AF3, and AF1, respectively, and color the packets green, yellow, and red,
respectively.
[DeviceB] diffserv domain ds1
[DeviceB-dsdomain-ds1] 8021p-inbound 6 phb ef green
[DeviceB-dsdomain-ds1] 8021p-inbound 5 phb af3 yellow
# Bind the DiffServ domain to the inbound interface 10GE 1/0/1 of DeviceB.
[DeviceB] interface 10ge 1/0/1
[DeviceB-10GE1/0/1] trust 8021p inner
[DeviceB-10GE1/0/1] trust upstream ds1
[DeviceB-10GE1/0/1] quit
# On DeviceB, create WRED drop profile wred1 and set parameters for green,
yellow, and red packets in the WRED drop profile.
[DeviceB] drop-profile wred1
[DeviceB-drop-wred1] color green low-limit 80 high-limit 100 discard-percentage 10 //Configure the
WRED drop profile and set the upper and lower drop thresholds and maximum drop probability for green
packets.
[DeviceB-drop-wred1] color yellow low-limit 60 high-limit 80 discard-percentage 20 //Configure the
device to discard packets with the maximum drop probability of 20% when the percentage of the yellow
packet length to the queue length reaches 60%. Configure the device to discard all newly arrived packets
when the percentage of the yellow packet length to the queue length reaches 80%.
[DeviceB-drop-wred1] color red low-limit 40 high-limit 60 discard-percentage 40
[DeviceB-drop-wred1] quit
# Apply WRED drop profile wred1 to outbound interfaces 10GE 1/0/2 and 10GE
1/0/3 on DeviceB.
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] qos queue 5 wred wred1
[DeviceB-10GE1/0/2] qos queue 3 wred wred1
[DeviceB-10GE1/0/2] qos queue 1 wred wred1
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] qos queue 5 wred wred1
[DeviceB-10GE1/0/3] qos queue 3 wred wred1
[DeviceB-10GE1/0/3] qos queue 1 wred wred1
[DeviceB-10GE1/0/3] quit
# Set scheduling parameters for queues with different CoS values on outbound
interfaces 10GE 1/0/2 and 10GE 1/0/3 on DeviceB.
[DeviceB] interface 10ge 1/0/2
[DeviceB-10GE1/0/2] qos pq 5 to 7 drr 0 to 4 //Configure PQ scheduling for queues 5 to 7 and WDRR
scheduling for queues 0 to 4.
[DeviceB-10GE1/0/2] qos queue 3 drr weight 100 //Set the WDRR scheduling weight of queue 3 to 100.
[DeviceB-10GE1/0/2] qos queue 1 drr weight 50 //Set the WDRR scheduling weight of queue 1 to 50.
According to the preceding configurations, packets in queue 1 and queue 3 are scheduled based on the
ratio of 1:2.
[DeviceB-10GE1/0/2] quit
[DeviceB] interface 10ge 1/0/3
[DeviceB-10GE1/0/3] qos pq 5 to 7 drr 0 to 4 //Configure PQ scheduling for queues 5 to 7 and WDRR
scheduling for queues 0 to 4.
[DeviceB-10GE1/0/3] qos queue 3 drr weight 100
[DeviceB-10GE1/0/3] qos queue 1 drr weight 50
[DeviceB-10GE1/0/3] quit
[DeviceB] quit
----End
In the DiffServ domain, 802.1p values 6, 5, and 2 are mapped to CoS values EF,
AF3, and AF1, respectively, and packets are colored green, yellow, and red,
respectively.
Configuration Scripts
DeviceB
#
sysname DeviceB
#
vlan batch 2 5 to 6
#
diffserv domain ds1
8021p-inbound 2 phb af1 red
8021p-inbound 5 phb af3 yellow
8021p-inbound 6 phb ef green
#
drop-profile wred1
color green low-limit 80 high-limit 100 discard-percentage 10
color yellow low-limit 60 high-limit 80 discard-percentage 20
color red low-limit 40 high-limit 60 discard-percentage 40
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 5 to 6
qos pq 5 to 7 drr 0 to 4
qos queue 1 drr weight 50
qos queue 3 drr weight 100
qos queue 1 wred wred1
qos queue 3 wred wred1
qos queue 5 wred wred1
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 2 5 to 6
qos pq 5 to 7 drr 0 to 4
Networking Requirements
Enterprises A and B use BGP/MPLS IP VPN to connect their headquarters and
branches. In Figure 3-103, CE1 and CE3 connect to the headquarters and branch
of enterprise A, and CE2 and CE4 connect to the headquarters and branch of
enterprise B. Enterprise A uses VPN vpna, and enterprise B uses VPN vpnb.
Enterprise A has a high service level and requires better QoS guarantee.
In this example, interface1, interface2, and interface3 represent 1/0/1, 1/0/2, and 1/0/3,
respectively.
Configuration Roadmap
Configure MPLS QoS on PE1 and PE2, enable the pipe mode for VPNs vpna and
vpnb, and set the MPLS EXP values of VPNs vpna and vpnb to 4 and 3,
respectively, to provide better QoS guarantee for services of enterprise A.
Procedure
Step 1 Configure OSPF on the MPLS backbone network so that the PEs and P on the
backbone network can communicate with each other.
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface 10ge 1/0/3
[PE1-10GE1/0/3] ip address 172.16.1.1 24
[PE1-10GE1/0/3] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
<HUAWEI> system-view
[HUAWEI] sysname P
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.9 32
[PE2-LoopBack1] quit
[PE2] interface 10ge 1/0/3
[PE2-10GE1/0/3] ip address 172.17.1.2 24
[PE2-10GE1/0/3] quit
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 172.17.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Configure P.
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface 10ge 1/0/1
[P-10GE1/0/1] mpls
[P-10GE1/0/1] mpls ldp
[P-10GE1/0/1] quit
[P] interface 10ge 1/0/2
[P-10GE1/0/2] mpls
[P-10GE1/0/2] mpls ldp
[P-10GE1/0/2] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface 10ge 1/0/3
[PE2-10GE1/0/3] mpls
[PE2-10GE1/0/3] mpls ldp
[PE2-10GE1/0/3] quit
After the configuration is complete, LDP sessions can be established between PE1
and P and between P and PE2. Run the display mpls ldp session command. The
command output shows that the Status field displays Operational.
The following example uses the command output on PE1.
[PE1] display mpls ldp session
LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.9:0 Operational DU Active 0000:00:01 6/6
------------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] ip vpn-instance vpnb
[PE2-vpn-instance-vpnb] ipv4-family
[PE2-vpn-instance-vpnb-af-ipv4] route-distinguisher 200:2
[PE2-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[PE2-vpn-instance-vpnb-af-ipv4] quit
[PE2-vpn-instance-vpnb] quit
[PE2] interface 10ge 1/0/1
[PE2-10GE1/0/1] ip binding vpn-instance vpna
NOTE
If multiple interfaces on a PE are bound to the same VPN, you need to specify the source IP
address when running the ping -vpn-instance command to ping the CE connected to the
remote PE. That is, you need to specify the -a source-ip-address parameter when running
the ping -vpn-instance vpn-instance-name -a source-ip-address command. Otherwise, the
ping may fail.
The following example uses the command output on PE1 to show that PE1 can
ping CE1.
[PE1] ping -vpn-instance vpna 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=5 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=3 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=3 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=3 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=16 ms
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configuration is complete, run the display bgp peer command on PEs.
The command output shows that a BGP peer relationship has been established
between PEs and is in Established state.
[PE1] display bgp peer
Step 5 Establish EBGP peer relationships between PEs and CEs and import VPN routes.
# Configure CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] import-route direct
The configurations of CE2, CE3, and CE4 are similar to the configuration of CE1,
and are not mentioned here.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1-bgp-vpna] peer 10.1.1.1 as-number 65410
[PE1-bgp-vpna] import-route direct
[PE1-bgp-vpna] quit
[PE1-bgp] ipv4-family vpn-instance vpnb
[PE1-bgp-vpnb] peer 10.2.1.1 as-number 65420
[PE1-bgp-vpnb] import-route direct
[PE1-bgp-vpnb] quit
[PE1-bgp] quit
The configuration of PE2 is similar to that of PE1, and is not mentioned here.
After the configuration is complete, run the display bgp vpnv4 vpn-instance peer
command on PEs. The command output shows that BGP peer relationships have
been established between PEs and CEs and are in Established state.
The following example uses the command output on PE1 to show that a peer
relationship has been established between PE1 and CE1.
[PE1] display bgp vpnv4 vpn-instance vpna peer
# Configure PE2.
----End
Configuration Scripts
● PE1
#
sysname PE1
#
mpls-qos ingress use vpn-label-exp
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
diffserv-mode pipe mpls-exp 4
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
diffserv-mode pipe mpls-exp 3
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface 10ge 1/0/1
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface 10ge 1/0/2
ip binding vpn-instance vpnb
ip address 10.2.1.2 255.255.255.0
#
interface 10ge 1/0/3
ip address 172.16.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.1.1.1 as-number 65410
#
ipv4-family vpn-instance vpnb
import-route direct
peer 10.2.1.1 as-number 65420
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.16.1.0 0.0.0.255
#
return
● P
#
sysname P
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface 10ge 1/0/1
ip address 172.16.1.2 255.255.255.0
mpls
mpls ldp
#
interface 10ge 1/0/2
ip address 172.17.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.16.1.0 0.0.0.255
network 172.17.1.0 0.0.0.255
#
return
● PE2
#
sysname PE2
#
mpls-qos ingress use vpn-label-exp
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
diffserv-mode pipe mpls-exp 4
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
diffserv-mode pipe mpls-exp 3
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface 10ge 1/0/1
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.0
#
interface 10ge 1/0/2
ip binding vpn-instance vpnb
ip address 10.4.1.2 255.255.255.0
#
interface 10ge 1/0/3
ip address 172.17.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.3.1.1 as-number 65430
#
ipv4-family vpn-instance vpnb
import-route direct
peer 10.4.1.1 as-number 65440
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.17.1.0 0.0.0.255
#
return
● CE1 at the headquarters egress of enterprise A
#
sysname CE1
#
interface 10ge 1/0/1
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
● CE2 at the headquarters egress of enterprise B
#
sysname CE2
#
interface 10ge 1/0/1
ip address 10.2.1.1 255.255.255.0
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.2.1.2 enable
#
return
3.1.15.1 Mirroring
Networking Requirements
On the network shown in Figure 3-104, the marketing department, R&D
department, and administration department of an enterprise access the Internet
through DeviceA, and the Server acting as a monitoring device is directly
connected to DeviceA. Internet access traffic of the three departments needs to be
monitored through the Server.
In this example, interfaces 1, 2, 3, 4, and 5 represent 10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/3,
10GE 1/0/4, and 10GE 1/0/5 respectively.
Procedure
Step 1 Configure 10GE1/0/4 on DeviceA as a local observing port.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] observe-port 1 interface 10ge 1/0/4
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
observe-port 1 interface 10GE1/0/4
#
interface 10GE1/0/1
port-mirroring observe-port 1 inbound
#
interface 10GE1/0/2
port-mirroring observe-port 1 inbound
#
interface 10GE1/0/3
port-mirroring observe-port 1 inbound
#
return
Networking Requirements
On the network shown in Figure 3-105, the administration department of an
enterprise accesses the Internet through DeviceA, and the Server acting as a
monitoring device is directly connected to DeviceA. Internet access traffic of the
administration department needs to be monitored through the Server.
In this example, interfaces 1, 2, and 3 represent 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3,
respectively.
Procedure
Step 1 Configure 10GE1/0/2 on DeviceA as a local observing port.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] observe-port 1 interface 10ge 1/0/2
Step 2 On DeviceA, configure 10GE1/0/1 as a mirrored port to monitor the packets sent
by the administration department.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] port-mirroring observe-port 1 inbound
[DeviceA-10GE1/0/1] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
observe-port 1 interface 10GE1/0/2
#
interface 10GE1/0/1
port-mirroring observe-port 1 inbound
#
return
3.1.15.1.3 Example for Configuring Local 1:N Port Mirroring (Using an Observing
Port)
Networking Requirements
On the network shown in Figure 3-106, hosts access the Internet through
DeviceA, which is directly connected to three monitoring devices: ServerA, ServerB,
and ServerC. Internet access traffic of the hosts needs to be mirrored to different
servers for monitoring and analysis purposes.
In this example, interfaces 1, 2, 3, and 4 indicate 10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/3, and
10GE 1/0/4, respectively.
Procedure
Step 1 Configure 10GE 1/0/2, 10GE 1/0/3, and 10GE 1/0/4 on DeviceA as observing ports.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] observe-port 1 interface 10ge 1/0/2
[DeviceA] observe-port 2 interface 10ge 1/0/3
[DeviceA] observe-port 3 interface 10ge 1/0/4
Step 2 Configure 10GE 1/0/1 on DeviceA as a mirrored port to copy incoming traffic to
observing ports 1, 2, and 3.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] port-mirroring observe-port 1 inbound
[DeviceA-10GE1/0/1] port-mirroring observe-port 2 inbound
[DeviceA-10GE1/0/1] port-mirroring observe-port 3 inbound
[DeviceA-10GE1/0/1] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
observe-port 1 interface 10GE1/0/2
observe-port 2 interface 10GE1/0/3
observe-port 3 interface 10GE1/0/4
#
interface 10GE1/0/1
port-mirroring observe-port 1 inbound
port-mirroring observe-port 2 inbound
port-mirroring observe-port 3 inbound
#
return
3.1.15.1.4 Example for Configuring Local 1:N Port Mirroring (Using an Observing
Port Group)
Networking Requirements
On the network shown in Figure 3-107, hosts access the Internet through
DeviceA, which is directly connected to three monitoring devices: ServerA, ServerB,
and ServerC. Internet access traffic of the hosts needs to be mirrored to different
servers for monitoring and analysis purposes.
In this example, interfaces 1, 2, 3, and 4 indicate 10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/3, and
10GE 1/0/4, respectively.
Procedure
Step 1 Configure an observing port group on DeviceA and add 10GE 1/0/2, 10GE 1/0/3,
and 10GE 1/0/4 to the observing port group.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] observe-port group 1
[DeviceA-observe-port-group-1] group-member 10ge 1/0/2 to 10ge 1/0/4
[DeviceA-observe-port-group-1] quit
Step 2 Configure 10GE 1/0/1 on DeviceA as a mirrored port to copy incoming traffic to
observing port group 1.
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
observe-port group 1
group-member 10GE1/0/2
group-member 10GE1/0/3
group-member 10GE1/0/4
#
interface 10GE1/0/1
port-mirroring observe-port group 1 inbound
#
return
Networking Requirements
On the network shown in Figure 3-108, hosts access the Internet through
DeviceA, which is directly connected to monitoring devices ServerA and ServerB.
Internet access traffic of the hosts needs to be mirrored to ServerA and ServerB for
monitoring and analysis purposes.
In this example, interfaces 1, 2, 3, 4, and 5 represent 10GE 1/0/1, 10GE 1/0/2, 10GE 1/0/3,
10GE 1/0/4, and 10GE 1/0/5 respectively.
Procedure
Step 1 Configure an observing port group on DeviceA, and add 10GE 1/0/4 and 10GE
1/0/5 to the observing port group.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] observe-port group 1
[DeviceA-observe-port-group-1] group-member 10ge 1/0/4 to 10ge 1/0/5
[DeviceA-observe-port-group-1] quit
Step 2 Configure 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3 on DeviceA as mirrored ports
to copy incoming traffic to observing port group 1.
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] port-mirroring observe-port group 1 inbound
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] port-mirroring observe-port group 1 inbound
[DeviceA-10GE1/0/2] quit
[DeviceA] interface 10ge 1/0/3
[DeviceA-10GE1/0/3] port-mirroring observe-port group 1 inbound
[DeviceA-10GE1/0/3] quit
----End
Index : 1
Interface: 10GE1/0/1
-----------------------------------------------------------------------------
Index : 2
Interface: 10GE1/0/2
-----------------------------------------------------------------------------
GroupId MemberPorts
-----------------------------------------------------------------------------
1 10GE1/0/4 10GE1/0/5
-----------------------------------------------------------------------------
Configuration Scripts
DeviceA
#
sysname DeviceA
#
observe-port group 1
group-member 10GE1/0/4
group-member 10GE1/0/5
#
interface 10GE1/0/1
port-mirroring observe-port group 1 inbound
#
interface 10GE1/0/2
port-mirroring observe-port group 1 inbound
#
interface 10GE1/0/3
port-mirroring observe-port group 1 inbound
#
return
Networking Requirements
On the network shown in Figure 3-109, the R&D and marketing departments of
an enterprise use the 192.168.1.0/24 and 192.168.2.0/24 network segments
respectively to communicate with each other through DeviceA. The Server acting
as a monitoring device is directly connected to DeviceA. The traffic sent from the
R&D department to the marketing department needs to be monitored by the
Server.
In this example, interfaces 1, 2, and 3 represent 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3,
respectively.
Procedure
Step 1 Configure 10GE1/0/2 on DeviceA as an observing port.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] observe-port 1 interface 10ge 1/0/2
Step 2 On DeviceA, create traffic classifier c1 and configure a rule to match packets with
the source address 192.168.1.0/24 and destination address 192.168.2.0/24.
[DeviceA] acl number 3000
[DeviceA-acl4-advance-3000] rule permit ip source 192.168.1.0 24 destination 192.168.2.0 24
[DeviceA-acl4-advance-3000] quit
[DeviceA] traffic classifier c1
[DeviceA-classifier-c1] if-match acl 3000
[DeviceA-classifier-c1] quit
Step 3 On DeviceA, create traffic behavior b1 and configure the flow mirroring action.
[DeviceA] traffic behavior b1
[DeviceA-behavior-b1] mirroring observe-port 1
[DeviceA-behavior-b1] quit
Step 4 On DeviceA, create traffic policy p1 and bind the traffic classifier and traffic
behavior to the traffic policy. Apply the traffic policy to the inbound direction of
10GE1/0/1 to monitor the packets sent from the R&D department to the
marketing department.
[DeviceA] traffic policy p1
[DeviceA-trafficpolicy-p1] classifier c1 behavior b1
[DeviceA-trafficpolicy-p1] quit
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] traffic-policy p1 inbound
[DeviceA-10GE1/0/1] quit
----End
Configuration Scripts
DeviceA
#
sysname DeviceA
#
observe-port 1 interface 10GE1/0/2
#
acl number 3000
rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
#
traffic classifier c1 type or
if-match acl 3000
#
traffic behavior b1
mirroring observe-port 1
#
traffic policy p1
classifier c1 behavior b1 precedence 5
#
interface 10GE1/0/1
traffic-policy p1 inbound
#
return
Networking Requirements
On the network shown in Figure 3-110, HostA and HostB belong to VLAN 10 and
access the Internet through DeviceA, which is directly connected to the monitoring
device Server. Internet access traffic of hosts in VLAN 10 needs to be monitored on
the Server.
In this example, interfaces 1, 2, and 3 represent 10GE 1/0/1, 10GE 1/0/2, and 10GE 1/0/3,
respectively.
Procedure
Step 1 Create VLAN 10 on DeviceA, and add 10GE 1/0/1 and 10GE 1/0/2 to VLAN 10.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 10
[DeviceA] interface 10ge 1/0/1
[DeviceA-10GE1/0/1] portswitch
[DeviceA-10GE1/0/1] port link-type access
[DeviceA-10GE1/0/1] port default vlan 10
[DeviceA-10GE1/0/1] quit
[DeviceA] interface 10ge 1/0/2
[DeviceA-10GE1/0/2] portswitch
[DeviceA-10GE1/0/2] port link-type access
[DeviceA-10GE1/0/2] port default vlan 10
[DeviceA-10GE1/0/2] quit
----End
-----------------------------------------------------------------------------
VLAN Direction ObservePort : Interface
-----------------------------------------------------------------------------
VLAN 10 Inbound 1 : 10GE1/0/3
-----------------------------------------------------------------------------
Configuration Scripts
DeviceA
#
sysname DeviceA
#
vlan batch 10
#
observe-port 1 interface 10GE1/0/3
#
vlan 10
mirroring observe-port 1 inbound
#
interface 10GE1/0/1
port default vlan 10
#
interface 10GE1/0/2
port default vlan 10
#
return
3.1.15.2 NetStream
Networking Requirements
On the network shown in Figure 3-111, Host1 and Host2 communicate with
DeviceA through DeviceB. To support network planning, the network administrator
wants the NetStream server to collect statistics about the traffic transmitted
between the hosts and DeviceA.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Configure IP addresses for interfaces on DeviceB according to Figure 3-111.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan 110
[DeviceB-vlan110] quit
[DeviceB] interface vlanif 110
[DeviceB-Vlanif110] ip address 10.1.1.1 24
[DeviceB-Vlanif110] quit
[DeviceB] interface 10ge1/0/1
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk pvid vlan 110
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 110
[DeviceB-10GE1/0/1] quit
[DeviceB] vlan 120
[DeviceB-vlan120] quit
[DeviceB] interface vlanif 120
[DeviceB-Vlanif120] ip address 10.1.2.1 24
[DeviceB-Vlanif120] quit
[DeviceB] interface 10ge1/0/2
[DeviceB-10GE1/0/2] port link-type trunk
[DeviceB-10GE1/0/2] port trunk pvid vlan 120
[DeviceB-10GE1/0/2] port trunk allow-pass vlan 120
[DeviceB-10GE1/0/2] quit
# Configure NetStream sampling for the incoming and outgoing traffic on 10GE
1/0/1 and set the sampling rate to 8192.
[DeviceB] interface 10ge1/0/1
[DeviceB-10GE1/0/1] netstream sampler ip random-packets 8192 inbound
[DeviceB-10GE1/0/1] netstream sampler ip random-packets 8192 outbound
[DeviceB-10GE1/0/1] quit
# Set the inactive flow aging time to 100 seconds, and enable FIN- and RST-based
aging.
[DeviceB] netstream timeout ip inactive 100
[DeviceB] netstream timeout ip tcp-session
# Set the source IP address of the exported packets carrying original flow statistics
to 10.1.2.1, destination IP address to 10.1.2.2, destination port number to 6000,
and DSCP value to 0.
[DeviceB] netstream export ip source 10.1.2.1
[DeviceB] netstream export ip host 10.1.2.2 6000 dscp 0
----End
Configuration Scripts
DeviceB
#
sysname DeviceB
#
vlan batch 110 120
#
netstream timeout ip inactive 100
netstream timeout ip tcp-session
netstream export ip source 10.1.2.1
netstream export ip host 10.1.2.2 6000 dscp 0
assign forward enp netstream enable
#
interface Vlanif110
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif120
ip address 10.1.2.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk pvid vlan 110
port trunk allow-pass vlan 110
netstream inbound ip
netstream outbound ip
netstream sampler ip random-packets 8192 inbound
netstream sampler ip random-packets 8192 outbound
#
interface 10GE1/0/2
port link-type trunk
port trunk pvid vlan 120
port trunk allow-pass vlan 120
#
return
Networking Requirements
On the network shown in Figure 3-112, Host1 and Host2 communicate with
DeviceA through DeviceB. To support network planning, the network administrator
wants the NetStream server to collect statistics about the traffic transmitted
between the hosts and DeviceA.
In this example, interface 1 and interface 2 represent 10GE 1/0/1 and 10GE 1/0/2,
respectively.
Procedure
Step 1 Configure IP addresses for interfaces on DeviceB according to Figure 3-112.
<HUAWEI> system-view
[HUAWEI] sysname DeviceB
[DeviceB] vlan 110
[DeviceB-vlan110] quit
[DeviceB] interface vlanif 110
[DeviceB-Vlanif110] ip address 10.1.1.1 24
[DeviceB-Vlanif110] quit
[DeviceB] interface 10ge1/0/1
[DeviceB-10GE1/0/1] port link-type trunk
[DeviceB-10GE1/0/1] port trunk pvid vlan 110
[DeviceB-10GE1/0/1] port trunk allow-pass vlan 110
[DeviceB-10GE1/0/1] quit
[DeviceB] vlan 120
[DeviceB-vlan120] quit
[DeviceB] interface vlanif 120
[DeviceB-Vlanif120] ip address 10.1.2.1 24
[DeviceB-Vlanif120] quit
[DeviceB] interface 10ge1/0/2
[DeviceB-10GE1/0/2] port link-type trunk
[DeviceB-10GE1/0/2] port trunk pvid vlan 120
[DeviceB-10GE1/0/2] port trunk allow-pass vlan 120
[DeviceB-10GE1/0/2] quit
-------------------------------------------------------------------------------
Packet Length : Number
-------------------------------------------------------------------------------
1 ~ 64 : 15
65 ~ 128 : 14
129 ~ 256 : 1
257 ~ 512 : 0
513 ~ 1024 : 0
1025 ~ 1500 : 0
longer than 1500 : 0
-------------------------------------------------------------------------------
StreamType
Current Aged Created Exported Exported
(streams) (streams) (streams) (streams) (Packets)
-------------------------------------------------------------------------------
origin
0 0 0 0 0
-------------------------------------------------------------------------------
record1
2 2 4 2 2
-------------------------------------------------------------------------------
----End
Configuration Scripts
DeviceB
#
sysname DeviceB
#
vlan batch 110 120
#
netstream export ip source 10.1.2.1
netstream export ip host 10.1.2.2 6000 dscp 0
assign forward enp netstream enable
#
netstream record record1 ip
collect counter bytes
collect counter packets
match ip destination-address
match ip source-address
#
interface Vlanif110
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif120
ip address 10.1.2.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk pvid vlan 110
port trunk allow-pass vlan 110
netstream inbound ip
netstream outbound ip
netstream sampler ip random-packets 1024 inbound
netstream sampler ip random-packets 1024 outbound
netstream record record1 ip inbound
netstream record record1 ip outbound
#
interface 10GE1/0/2
port link-type trunk
port trunk pvid vlan 120
port trunk allow-pass vlan 120
#
return
3.1.15.3 IFIT
Networking Requirements
On the network shown in Figure 3-113, users want to use the NMS to monitor
network traffic in real time to quickly detect abnormal traffic and locate faults.
You can configure IFIT measurement on devices so that the devices can
periodically send packet loss and delay measurement information to the NMS for
summary, analysis, and display.
In this example, interface1 and interface2 represent 10GE1/0/1 and 10GE1/0/2, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure packet loss and delay measurement on the link between DeviceA
and DeviceC to periodically collect packet loss and delay measurement data.
– Enable IFIT measurement on DeviceA, define a measurement flow based
on the 5-tuple, bind a whitelist rule to the inbound interface of DeviceA,
and configure the color bit and measurement interval.
– Bind a whitelist rule to the outbound interface on DeviceA and interfaces
on DeviceB and DeviceC, and ensure that the color bit and measurement
interval configured on DeviceB and DeviceC are the same as those
configured on the inbound interface of DeviceA.
2. Configure the function of periodically reporting traffic measurement
information to iMaster NCE-CampusInsight through telemetry.
NOTE
Procedure
1. Configure packet loss and delay measurement on the link between DeviceA
and DeviceC to periodically collect packet loss and delay measurement data.
# Configure IFIT measurement on devices. The following example describes
the configuration of DeviceA. The configurations of DeviceB and DeviceC are
similar to the configuration of DeviceA, excluding the measurement point
types and directions configured for native IP flow learning bound to different
device interfaces. For details, see Configuration Scripts.
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 100 200
[DeviceA] interface 10GE 1/0/1
[DeviceA-10GE1/0/1] port link-type trunk
[DeviceA-10GE1/0/1] port trunk allow-pass vlan 100
[DeviceA-10GE1/0/1] quit
[DeviceA] interface vlanif 100
[DeviceA-Vlanif100] ip address 10.1.1.1 24
[DeviceA-Vlanif100] quit
[DeviceA] interface 10GE 1/0/2
[DeviceA-10GE1/0/2] port link-type trunk
[DeviceA-10GE1/0/2] port trunk allow-pass vlan 200
[DeviceA-10GE1/0/2] quit
[DeviceA] interface vlanif 200
[DeviceA-Vlanif200] ip address 10.1.2.1 24
[DeviceA-Vlanif200] quit
[DeviceA] ifit
[DeviceA-ifit] whitelist-group ntvifit mode native-ip
[DeviceA-ifit-whitelist-group-ntvifit] rule 1to100 ipv4 source 192.168.1.0 32 destination
192.168.100.0 32 protocol tcp source-port 2000 to 6000
[DeviceA-ifit-whitelist-group-ntvifit] quit
[DeviceA-ifit] flow-learning native-ip
[DeviceA-ifit-native-ip] color-flag tos-bit bit3
[DeviceA-ifit-native-ip] interval 10
[DeviceA-ifit-native-ip] flow-learning interface 10GE 1/0/1 rule 1to100 ingress bidirectional
[DeviceA-ifit-native-ip] flow-learning interface 10GE 1/0/2 rule 1to100 transit-output bidirectional
[DeviceA-ifit-native-ip] quit
[DeviceA-ifit] quit
2. Configure devices to periodically report traffic measurement information to
iMaster NCE-CampusInsight. The following example describes the
configuration of DeviceA. The configurations of DeviceB and DeviceC are
similar to the configuration of DeviceA.
[DeviceA] telemetry
[DeviceA-telemetry] destination-group ifit
[DeviceA-telemetry-destination-group-ifit] ipv4-address 10.10.10.10 port 10001 protocol grpc
[DeviceA-telemetry-destination-group-ifit] quit
[DeviceA-telemetry] sensor-group ifit
[DeviceA-telemetry-sensor-group-ifit] sensor-path huawei-ifit:ifit/huawei-ifit-statistics:flow-native-
ip-statistics/flow-native-ip-statistic
[DeviceA-telemetry-sensor-group-ifit-path] quit
[DeviceA-telemetry-sensor-group-ifit] quit
[DeviceA-telemetry] subscription ifit
NOTE
You are advised to configure devices to send data using the secure TLS encryption
mode. For details, see Telemetry Configuration.
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
vlan batch 100 200
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif200
ip address 10.1.2.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
ifit
whitelist-group ntvifit mode native-ip
rule 1to100 ipv4 source 192.168.1.0 32 destination 192.168.100.0 32 protocol tcp source-port 2000
to 6000
flow-learning native-ip
color-flag tos-bit bit3
interval 10
flow-learning interface 10GE1/0/1 rule 1to100 ingress bidirectional
flow-learning interface 10GE1/0/2 rule 1to100 transit-output bidirectional
#
telemetry
#
sensor-group ifit
sensor-path huawei-ifit:ifit/huawei-ifit-statistics:flow-native-ip-statistics/flow-native-ip-statistic
#
destination-group ifit
ipv4-address 10.10.10.10 port 10001 protocol grpc
#
subscription ifit
sensor-group ifit
destination-group ifit
#
● DeviceB
#
sysname DeviceB
#
vlan batch 100 200
#
interface Vlanif100
ip address 10.1.2.2 255.255.255.0
#
interface Vlanif200
ip address 10.1.3.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
ifit
whitelist-group ntvifit mode native-ip
rule 1to100 ipv4 source 192.168.1.0 32 destination 192.168.100.0 32 protocol tcp source-port 2000
to 6000
flow-learning native-ip
color-flag tos-bit bit3
interval 10
flow-learning interface 10GE1/0/2 rule 1to100 transit-input bidirectional
flow-learning interface 10GE1/0/1 rule 1to100 transit-output bidirectional
#
telemetry
#
sensor-group ifit
sensor-path huawei-ifit:ifit/huawei-ifit-statistics:flow-native-ip-statistics/flow-native-ip-statistic
#
destination-group ifit
ipv4-address 10.10.10.10 port 10001 protocol grpc
#
subscription ifit
sensor-group ifit
destination-group ifit
#
return
● DeviceC
#
sysname DeviceC
#
interface Vlanif100
ip address 10.1.3.3 255.255.255.0
#
interface Vlanif200
ip address 10.1.4.3 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
ifit
whitelist-group ntvifit mode native-ip
rule 1to100 ipv4 source 192.168.1.0 32 destination 192.168.100.0 32 protocol tcp source-port 2000
to 6000
flow-learning native-ip
color-flag tos-bit bit3
interval 10
flow-learning interface 10GE1/0/1 rule 1to100 transit-input bidirectional
flow-learning interface 10GE1/0/2 rule 1to100 egress bidirectional
#
telemetry
#
sensor-group ifit
sensor-path huawei-ifit:ifit/huawei-ifit-statistics:flow-native-ip-statistics/flow-native-ip-statistic
#
destination-group ifit
ipv4-address 10.10.10.10 port 10001 protocol grpc
#
subscription ifit
sensor-group ifit
destination-group ifit
#
return