HCIP-Datacom-Core Technology V1.0 Lab Guide
HCIP-Datacom-Core Technology V1.0 Lab Guide
HCIP-Datacom-Core Technology
Lab Guide
Issue: 1.0
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/
HCIP-Datacom-Core Technology Lab Guide Page 1
Overview
This document is an HCIP-Datacom-Core Technology certification training course. It is
intended for trainees who are going to take the HCIP-Datacom-Core Technology exams
or readers who want to learn advanced technologies, such as routing, Ethernet switching,
large-scale WLAN networking, multicast, IPv6, network security, network reliability, and
network service and management.
Symbol Conventions
HCIP-Datacom-Core Technology Lab Guide Page 4
Lab Environment
Networking
This lab environment is intended for datacom network engineers who are preparing for
the HCIP-Datacom-Core Technology exam. Each lab environment includes three switches
(not supporting PoE), two PoE switches, two APs, five routers, and one firewall.
Device Introduction
To meet exercise requirements, the recommended configurations of the environment are
as follows:
The following table describes the mapping among devices, models, and versions.
Device
Device Model Software version
Name
CloudEngine S5731-
Switch V200R019C00 or later
H24T4XC
CloudEngine S5731-
PoE switch V200R019C00 or later
H24P4XC
Contents
Overview ............................................................................................................................................................................................. 3
Background Knowledge Required .............................................................................................................................................. 3
Symbol Conventions ....................................................................................................................................................................... 3
Lab Environment .............................................................................................................................................................................. 4
1 Basic OSPF Configurations ................................................................................................... 8
1.1 Lab 1: Single-Area OSPF ........................................................................................................................................................ 8
1.1.1 Introduction............................................................................................................................................................................. 8
1.1.2 Lab Configuration ................................................................................................................................................................. 9
1.1.3 Quiz ..........................................................................................................................................................................................22
1.1.4 Configuration Reference ...................................................................................................................................................22
1.2 Lab 2: Multi-Area OSPF........................................................................................................................................................23
1.2.1 Introduction...........................................................................................................................................................................23
1.2.2 Lab Configuration ...............................................................................................................................................................25
1.2.3 Quiz ..........................................................................................................................................................................................37
1.2.4 Configuration Reference ...................................................................................................................................................37
1.3 Lab 3: OSPF Adjacencies and LSAs ..................................................................................................................................40
1.3.1 Introduction...........................................................................................................................................................................40
1.3.2 Lab Configuration ...............................................................................................................................................................41
1.3.3 Quiz ..........................................................................................................................................................................................57
1.3.4 Configuration Reference ...................................................................................................................................................57
1.4 Lab 4: OSPF Stub Area and NSSA ....................................................................................................................................59
1.4.1 Introduction...........................................................................................................................................................................59
1.4.2 Lab Configuration ...............................................................................................................................................................60
1.4.3 Quiz ..........................................................................................................................................................................................73
1.4.4 Configuration Reference ...................................................................................................................................................73
2 IS-IS Basics Experiment .......................................................................................................76
2.1 IS-IS Configuration Experiment .........................................................................................................................................76
2.1.1 Introduction...........................................................................................................................................................................76
2.1.2 Lab Configuration ...............................................................................................................................................................77
2.1.3 Quiz ..........................................................................................................................................................................................87
2.1.4 Configuration Reference ...................................................................................................................................................87
3 BGP Configurations ..............................................................................................................90
3.1 Lab 1: Basic BGP Configurations .......................................................................................................................................90
3.1.1 Introduction...........................................................................................................................................................................90
3.1.2 Lab Configuration ...............................................................................................................................................................91
HCIP-Datacom-Core Technology Lab Guide Page 6
R1, R2, and R3 are connected through S1, and their interfaces and IP addresses are shown
in the figure. Loopback0 is created on each of R1, R2, and R3, and its IP address is in the
format of 10.0.x.x/24, where x indicates the device number.
All interfaces of R1, R2, and R3 belong to area 0, and OSPF is activated on the
interconnection and Loopback0 interfaces.
HCIP-Datacom-Core Technology Lab Guide Page 9
1.1.1.3 Background
You are a network administrator of a company. Currently, there are three AR routers on
the company's network, which communicate with each other through an Ethernet. On
broadcast multi-access networks such as Ethernet, there may be security risks. To prevent
malicious routing attacks, you choose to use OSPF area authentication.
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet 0/0/3
[R1-GigabitEthernet0/0/3] ip address 10.0.123.1 24
[R1-GigabitEthernet0/0/3] quit
[R1]interface LoopBack 0
[R1-LoopBack0] ip address 10.0.1.1 24
[R1-LoopBack0] quit
<R2>system-view
Enter system view, return user view with Ctrl+Z.
HCIP-Datacom-Core Technology Lab Guide Page 10
<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface GigabitEthernet 0/0/4
[R3-GigabitEthernet0/0/4] ip address 10.0.123.3 24
[R3-GigabitEthernet0/0/4] quit
[R3]interface LoopBack 0
[R3-LoopBack0] ip address 10.0.3.3 24
[R3-LoopBack0] quit
<R1>ping -c 1 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=2 ms
# Configure the Loopback0 IP addresses of R1, R2, and R3 as their OSPF router IDs, and
set the OSPF process ID to 1.
# Activate OSPF on the interconnection and Loopback0 interfaces of R1, R2, and R3.
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0] network 10.0.123.1 0.0.0.0
HCIP-Datacom-Core Technology Lab Guide Page 11
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0] network 10.0.123.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0] network 10.0.2.2 0.0.0.0
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0] network 10.0.123.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.0.3.3 0.0.0.0
# To ensure security, configure OSPF area authentication, use the cleartext mode, and set
the password to huawei.
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0] authentication-mode simple plain huawei
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0] authentication-mode simple plain huawei
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0] authentication-mode simple plain huawei
The command output shows that R1 has established OSPF neighbor relationships with R2
and R3.
HCIP-Datacom-Core Technology Lab Guide Page 12
The command output shows that R2 has established OSPF neighbor relationships with R1
and R3.
The command output shows that R3 has established OSPF neighbor relationships with R1
and R2.
# Check the OSPF routing tables of R1, R2, and R3.
Routing Tables
Total Nets: 4
Intra Area: 4 Inter Area: 0 ASE: 0 NSSA: 0
The command output shows that R1 has learned the Loopback0 routes from R2 and R3.
Total Nets: 4
Intra Area: 4 Inter Area: 0 ASE: 0 NSSA: 0
The command output shows that R2 has learned the Loopback0 routes from R1 and R3.
Total Nets: 4
Intra Area: 4 Inter Area: 0 ASE: 0 NSSA: 0
The command output shows that R3 has learned the Loopback0 routes from R1 and R2.
# Check the connectivity between the loopback interfaces.
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 50/50/50 ms
On R1, use the IP address of Loopback0 as the source address to ping the Loopback0
interfaces of R2 and R3.
# Check the OSPF LSDB on R1.
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 468 48 80000005 0
Router 10.0.2.2 10.0.2.2 472 48 8000000B 0
Router 10.0.1.1 10.0.1.1 467 48 8000000D 0
Network 10.0.123.1 10.0.1.1 467 36 80000008 0
The command output shows four LSAs, among which the first three are Type 1 LSAs
generated by R1, R2, and R3 separately. The AdvRouter field for each LSA indicates the
router that generates the LSA. The fourth LSA is a Type 2 LSA, which is generated by the
DR on a network segment. In this scenario, R1 is the DR on the network segment
10.0.123.0/24. Therefore, the AdvRouter field value of the Type 2 LSA is 10.0.1.1.
# Check the Type 1 LSA generated by R1.
Type : Router
Ls id : 10.0.1.1
Adv rtr : 10.0.1.1
Ls age : 430
Len : 48
Options : E
seq# : 80000009
chksum : 0x8188
Link count : 2
* Link ID : 10.0.1.1
HCIP-Datacom-Core Technology Lab Guide Page 15
Data : 255.255.255.255
Link Type: StubNet
Metric : 0
Priority : Medium
* Link ID : 10.0.123.1
Data : 10.0.123.1
Link Type: TransNet
Metric : 1
The command output shows that this LSA describes two Links. The first Link indicates the
network segment where the loopback interface resides. The value of Link Type is
StubNet, and the values of Link ID and Data are the IP address and mask of the stub
network segment, respectively. The second Link describes the network segment on which
the three routers are interconnected. The value of Link Type is TransNet. The value of
Link ID is the DR's interface address 10.0.123.1, and the value of Data is the IP address of
the local interface on the network segment, 10.0.123.1.
# Check the Type 2 LSA generated by R1.
Type : Network
Ls id : 10.0.123.1
Adv rtr : 10.0.1.1
Ls age : 1662
Len : 36
Options : E
seq# : 80000005
chksum : 0x3d58
Netmask : 255.255.255.0
Priority : Low
Attached Router 10.0.1.1
Attached Router 10.0.2.2
Attached Router 10.0.3.3
The Attached Router field in the Type 2 LSA describes the neighbor information of the
network segment where the DR resides.
Based on the preceding OSPF neighbor information, the interface IP address of the DR is
10.0.123.1, which is different from the expected result obtained based on DR election
rules. In OSPF, the non-preemption mode is used for DR election. When a DR or BDR
exists on a network, a newly deployed router on the network cannot preempt the role of
the DR or BDR. However, if OSPF is configured at different time on the network devices,
the elected DR may be the device that starts first.
To prevent this issue, you can shut down the interconnection interfaces of R1, R2, and R3,
and run the debugging ospf 1 event command to observe the process of establishing
the OSPF neighbor relationships. Then, try to re-enable the interfaces of R1, R2, and R3
HCIP-Datacom-Core Technology Lab Guide Page 16
at the same time, and check the DR and BDR election process based on the debugging
information.
# Shut down the interconnection interfaces of R1, R2, and R3.
# Enable the debugging function on R1, R2, and R3, and enable OSPF event debugging.
<R1>terminal debugging
Info: Current terminal debugging is on.
<R1>terminal monitor
<R1>debugging ospf 1 event
The operations on R2 and R3 are the same as that on R1, and are not provided here.
# Re-enable the interconnection interfaces of R1, R2, and R3.
When OSPF is enabled almost at the same time, the debugging information shows that
R3 has become the DR.
# Observe the debugging information on R2.
# In the OSPF routing table on R1, check the Loopback0 routes learned from R2 and R3.
Destination : 10.0.2.2/32
AdverRouter : 10.0.2.2 Area : 0.0.0.0
Cost :1 Type : Stub
NextHop : 10.0.123.2 Interface : GigabitEthernet0/0/3
Priority : Medium Age : 00h09m02s
Destination : 10.0.3.3/32
AdverRouter : 10.0.3.3 Area : 0.0.0.0
Cost :1 Type : Stub
NextHop : 10.0.123.3 Interface : GigabitEthernet0/0/3
Priority : Medium Age : 00h09m13s
The command output shows that the masks of the Loopback0 routes are both 32 bits,
not 24 bits.
# Take R2 as an example, and check the Type 1 LSA on R2.
Type : Router
Ls id : 10.0.2.2
Adv rtr : 10.0.2.2
Ls age : 1528
Len : 48
Options : E
seq# : 80000020
chksum : 0x9653
Link count : 2
* Link ID : 10.0.2.2
Data : 255.255.255.255
Link Type : StubNet
Metric : 0
Priority : Medium
* Link ID : 10.0.123.3
Data : 10.0.123.2
Link Type : TransNet
Metric : 1
The command output shows that the mask of the LSA describing Loopback0 on R2 has
been set to 32 bits. OSPF considers a loopback interface as a stub network, which is
connected to only one node. Therefore, no matter how many bits are actually set for the
network mask of the loopback interface, OSPF uses a 32-bit network mask (host mask)
when advertising the Type 1 LSA to describe this interface.
For details about OSPF loopback interfaces, see section 9.1 in RFC 2328.
# Change the network type of Loopback0 on R2.
HCIP-Datacom-Core Technology Lab Guide Page 20
[R2]interface LoopBack 0
[R2-LoopBack0] ospf network-type broadcast
After the network type of the loopback interface is changed to broadcast, OSPF uses the
actual mask of the interface to advertise its network information. In this example, OSPF
uses Loopback0's actual mask length of 24 bits.
# In the OSPF routing table on R1, check the Loopback0 route learned from R2 again.
Destination : 10.0.2.0/24
AdverRouter : 10.0.2.2 Area : 0.0.0.0
Cost : 1 Type : Stub
NextHop : 10.0.123.2 Interface : GigabitEthernet0/0/3
Priority : Low Age : 00h04m10s
The command output shows that the mask length of the route has changed to 24 bits.
# In the OSPF routing table on R1, check the Loopback0 route learned from R3.
Destination : 10.0.3.3/32
AdverRouter : 10.0.3.3 Area : 0.0.0.0
Cost : 1 Type : Stub
NextHop : 10.0.123.3 Interface : GigabitEthernet0/0/3
Priority : Medium Age : 00h46m56s
[R1]interface GigabitEthernet0/0/3
[R1-GigabitEthernet0/0/3] ospf cost 20
[R3]interface GigabitEthernet0/0/4
[R3-GigabitEthernet0/0/4] ospf cost 10
# In the OSPF routing table on R1, check the Loopback0 route learned from R2 again.
Destination : 10.0.2.0/24
AdverRouter : 10.0.2.2 Area : 0.0.0.0
Cost : 20 Type : Stub
NextHop : 10.0.123.2 Interface : GigabitEthernet0/0/3
Priority : Low Age : 00h04m19s
HCIP-Datacom-Core Technology Lab Guide Page 21
Destination : 10.0.1.1/32
AdverRouter : 10.0.1.1 Area : 0.0.0.0
Cost : 10 Type : Stub
NextHop : 10.0.123.1 Interface : GigabitEthernet0/0/4
Priority : Medium Age : 00h06m07s
[R1]ospf 1
[R1-ospf-1] silent-interface GigabitEthernet 0/0/3
The command output shows that the interface is configured as a silent interface and no
Hello packet exists on the interface.
# Delete the silent interface configuration on R1.
The configuration details are not provided.
# Configure the Loopback0 interfaces on R2 and R3 as silent interfaces.
HCIP-Datacom-Core Technology Lab Guide Page 22
[R2]ospf 1
[R2-ospf-1] silent-interface LoopBack 0
[R3]ospf 1
[R3-ospf-1] silent-interface LoopBack 0
Total Nets: 4
Intra Area: 4 Inter Area: 0 ASE: 0 NSSA: 0
The command output shows that routes the Loopback0 routes learned from R2 and R3
still exist.
----End
1.1.3 Quiz
Analyze which interfaces can be configured as silent interfaces in actual networking
scenarios.
#
sysname R1
#
interface GigabitEthernet0/0/3
ip address 10.0.123.1 255.255.255.0
ospf cost 20
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
#
ospf 1 router-id 10.0.1.1
area 0.0.0.0
authentication-mode simple plain huawei
network 10.0.123.1 0.0.0.0
network 10.0.1.1 0.0.0.0
#
return
HCIP-Datacom-Core Technology Lab Guide Page 23
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/4
ip address 10.0.123.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.2.2
silent-interface LoopBack0
area 0.0.0.0
authentication-mode simple plain huawei
network 10.0.123.2 0.0.0.0
network 10.0.2.2 0.0.0.0
#
return
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/4
ip address 10.0.123.3 255.255.255.0
ospf cost 10
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
#
ospf 1 router-id 10.0.3.3
silent-interface LoopBack0
area 0.0.0.0
authentication-mode simple plain huawei
network 10.0.3.3 0.0.0.0
network 10.0.123.3 0.0.0.0
user-interface vty 16 20
#
Return
The preceding figure shows the interconnection interfaces and their IP addresses.
Loopback0 is created on each device, and its IP address is in the format of 10.0.x.x/24,
where x indicates the device number.
All interfaces of R1 and R3 and GE0/0/4 of R2 belong to OSPF area 2. The Loopback0 and
interconnection interfaces between R2 and R4 belong to OSPF area 0. The
interconnection interfaces between R4 and R5 and the loopback interfaces 0, 1, and 2 of
R5 belong to OSPF area 1.
Loopback1 and Loopback2 are created on R2 to simulate external network segments.
1.2.1.3 Background
You are a network administrator of a company. The company's network now has five AR
routers, among which R2 and R4 reside in the headquarters, and R1, R3, and R5 reside in
branches. To control LSA flooding on the large-scale network, multi-area OSPF is
designed.
To specify the router ID of each device, the devices are configured to use fixed IP
addresses as their router IDs.
To improve the efficiency of forwarding routes on the devices, automatic route
summarization is configured on the ABR.
R1 is connected to the Internet. You need to configure a default route and import it to
the OSPF areas so that all routers in the OSPF areas know how to access the Internet.
In addition, the OSPF routing information is classifies as internal routes or external
routes. The preferences of these routes are changed to prevent potential risks.
In OSPF, the cost of a specific route is the sum of the costs of all the links that the route
passes through before reaching the destination network. The cost of a link is obtained by
HCIP-Datacom-Core Technology Lab Guide Page 25
dividing the bandwidth reference value by the interface bandwidth. The default
bandwidth reference value is 100 Mbit/s. The actual interface bandwidth may be 1000
Mbit/s, and cost values are integers. As a result, the OSPF costs of an FE interface and a
GE interface are both 1. To differentiate these links, you can set the bandwidth reference
value to 10 Gbit/s.
[R1]interface GigabitEthernet0/0/3
[R1-GigabitEthernet0/0/3] ip address 10.0.123.1 24
[R1-GigabitEthernet0/0/3] quit
[R1]interface LoopBack 0
[R1-LoopBack0] ip address 10.0.1.1 24
[R1-LoopBack0] quit
# Configure IP addresses for GE0/0/4 and GE0/0/2 as well as the loopback interfaces on
R2.
[R2]interface GigabitEthernet0/0/4
[R2-GigabitEthernet0/0/4] ip address 10.0.123.2 24
[R2-GigabitEthernet0/0/4] quit
[R2] interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.24.2 24
[R2-GigabitEthernet0/0/2] quit
[R2]interface LoopBack 0
[R2-LoopBack0] ip address 10.0.2.2 24
[R2-LoopBack0] quit
HCIP-Datacom-Core Technology Lab Guide Page 26
[R2]interface LoopBack1
[R2-LoopBack1] ip address 10.2.0.1 255.255.255.0
[R2-LoopBack1] quit
[R2]interface LoopBack2
[R2-LoopBack2] ip address 10.2.1.1 255.255.255.0
[R2-LoopBack2] quit
[R3]interface GigabitEthernet0/0/4
[R3-GigabitEthernet0/0/4] ip address 10.0.123.3 24
[R3-GigabitEthernet0/0/4] quit
[R3]interface LoopBack 0
[R3-LoopBack0] ip address 10.0.3.3 24
[R3-LoopBack0] quit
[R3]interface LoopBack 1
[R3-LoopBack1] ip address 10.3.0.1 24
[R3-LoopBack1] quit
[R3]interface LoopBack 2
[R3-LoopBack2] ip address 10.3.1.1 24
[R3-LoopBack2] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.24.4 24
[R4-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] ip address 10.0.45.4 24
[R4-GigabitEthernet0/0/2] quit
[R4]interface LoopBack 0
[R4-LoopBack0] ip address 10.0.4.4 24
[R4-LoopBack0] quit
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] ip address 10.0.45.5 24
[R5-GigabitEthernet0/0/3] quit
[R5]interface LoopBack 0
[R5-LoopBack0] ip address 10.0.5.5 24
[R5-LoopBack0] quit
[R5]interface LoopBack 1
[R5-LoopBack1] ip address 10.5.0.1 24
[R5-LoopBack1] quit
[R5]int LoopBack 2
[R5-LoopBack2] ip address 10.5.1.1 24
[R5-LoopBack2] quit
# On R2, ping the IP addresses of R1, R3, and R4 to test the connectivity.
<R2>ping -c 1 10.0.123.1
PING 10.0.123.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.1: bytes=56 Sequence=1 ttl=255 time=70 ms
HCIP-Datacom-Core Technology Lab Guide Page 27
<R2>ping -c 1 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=110 ms
<R2>ping -c 1 10.0.24.4
PING 10.0.24.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.24.4: bytes=56 Sequence=1 ttl=255 time=40 ms
<R4>ping -c 1 10.0.45.5
PING 10.0.45.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.45.5: bytes=56 Sequence=1 ttl=255 time=80 ms
# Configure OSPF on R1, activate OSPF on GE0/0/3 and Loopback0, and change the
network type of Loopback0 to broadcast.
# Configure OSPF on R2, activate OSPF on GE0/0/2, GE0/0/4, and Loopback0, and change
the network type of Loopback0 to broadcast.
HCIP-Datacom-Core Technology Lab Guide Page 28
# Configure OSPF on R4, activate OSPF on GE0/0/2, GE0/0/3, and Loopback0, and change
the network type of Loopback0 to broadcast.
# Check the brief information about neighbor relationships and the OSPF routing table
on R5.
Total Nets: 12
Intra Area: 4 Inter Area: 8 ASE: 0 NSSA: 0
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.4.4 10.0.4.4 54 48 8000000B 0
Router 10.0.2.2 10.0.2.2 54 48 80000008 0
Network 10.0.24.4 10.0.4.4 54 32 80000003 0
Sum-Net 10.3.1.0 10.0.2.2 1332 28 80000001 1
Sum-Net 10.3.0.0 10.0.2.2 1332 28 80000001 1
Sum-Net 10.5.1.0 10.0.4.4 259 28 80000002 1
Sum-Net 10.0.3.0 10.0.2.2 1332 28 80000001 1
Sum-Net 10.5.0.0 10.0.4.4 268 28 80000002 1
Sum-Net 10.0.1.0 10.0.2.2 244 28 80000001 1
Sum-Net 10.0.5.0 10.0.4.4 278 28 80000002 1
Sum-Net 10.0.45.0 10.0.4.4 500 28 80000002 1
Sum-Net 10.0.123.0 10.0.2.2 45 28 80000002 1
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 247 72 80000017 0
Router 10.0.2.2 10.0.2.2 247 36 80000008 1
Router 10.0.1.1 10.0.1.1 246 48 80000008 1
Network 10.0.123.3 10.0.3.3 247 36 80000006 0
Sum-Net 10.0.24.0 10.0.2.2 45 28 80000002 1
Sum-Net 10.5.1.0 10.0.2.2 45 28 80000002 2
Sum-Net 10.5.0.0 10.0.2.2 45 28 80000002 2
Sum-Net 10.0.2.0 10.0.2.2 45 28 80000002 0
Sum-Net 10.0.5.0 10.0.2.2 45 28 80000002 2
Sum-Net 10.0.4.0 10.0.2.2 45 28 80000002 1
Sum-Net 10.0.45.0 10.0.2.2 45 28 80000002 2
R2 functions as an ABR to maintain the LSDBs of area 0 and area 2. The LSAs in the
LSDBs are used to describe routes in these two areas.
Step 4 Configure route summarization for OSPF inter-area routes and AS external routes.
Total Nets: 12
Total Nets: 12
Intra Area: 7 Inter Area: 5 ASE: 0 NSSA: 0
The OSPF inter-area routes of Loopback1 and Loopback2 on R5 in the OSPF routing table
of R2 as well as those of Loopback1 and Loopback2 on R3 in the OSPF routing table of
R4 can be summarized before being advertised to other areas. This reduces the number
of routing entries in other areas and the possibility of route flapping.
# On R4, summarize the Loopback1 and Loopback2 routes learned from R5.
[R4]ospf 1
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1] abr-summary 10.5.0.0 255.255.254.0
HCIP-Datacom-Core Technology Lab Guide Page 32
[R4-ospf-1-area-0.0.0.1] quit
Total Nets: 11
Intra Area: 8 Inter Area: 3 ASE: 0 NSSA: 0
The command output shows that the Loopback1 and Loopback2 routes of R5 are
summarized into an inter-area summary route.
# On R2, summarize the Loopback1 and Loopback2 routes learned from R3.
[R2]ospf 1
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2] abr-summary 10.3.0.0 255.255.254.0
Total Nets: 11
Intra Area: 7 Inter Area: 4 ASE: 0 NSSA: 0
The command output shows that the Loopback1 and Loopback2 routes of R3 are
summarized into an inter-area summary route.
# Import the Loopback1 and Loopback2 routes to the OSPF routing table on R2.
[R2]ospf 1
[R2-ospf-1] import-route direct
Total Nets: 13
Intra Area: 7 Inter Area: 4 ASE: 2 NSSA: 0
The OSPF routing table of R4 contains the Loopback1 and Loopback2 routes of R2.
# Configure AS external route summarization on R2.
[R2]ospf 1
[R2-ospf-1] asbr-summary 10.2.0.0 255.255.254.0
Total Nets: 12
Intra Area: 7 Inter Area: 4 ASE: 1 NSSA: 0
The command output shows that the Loopback1 and Loopback2 routes of R2 are
summarized into an AS external summary route.
Gigabit or even 10-Gigabit Ethernet may be used in actual networking scenarios. The
default bandwidth reference value of OSPF is 100 Mbit/s, and an interface cost is an
integer. As a result, OSPF cannot distinguish an FE interface from a GE interface in terms
of bandwidth.
Multiple OSPF areas must use the same bandwidth reference value. Otherwise, OSPF
cannot work properly.
# Change the OSPF bandwidth reference value of each router to 10 Gbit/s.
[R1]ospf 1
[R1-ospf-1] bandwidth-reference 10000
[R1-ospf-1] quit
[R2]ospf 1
[R2-ospf-1] bandwidth-reference 10000
[R2-ospf-1] quit
[R3]ospf 1
[R3-ospf-1] bandwidth-reference 10000
[R3-ospf-1] quit
[R4]ospf 1
[R4-ospf-1] bandwidth-reference 10000
[R4-ospf-1] quit
[R5]ospf 1
[R5-ospf-1] bandwidth-reference 10000
[R5-ospf-1] quit
Total Nets: 11
Intra Area: 8 Inter Area: 3 ASE: 0 NSSA: 0
The command output shows that the costs of the routes have changed.
# Import the default route to the OSPF routing table and set the type of the AS external
route to Type 1.
[R1]ospf 1
[R1-ospf-1] default-route-advertise always type 1
[R1-ospf-1] quit
Total Nets: 12
Intra Area: 8 Inter Area: 3 ASE: 1 NSSA: 0
The command output shows that R2 has learned the default route with R1 as the next
hop through a Type 5 LSA.
By default, the preference of intra-area and inter-area OSPF routes is 10; the preference
of AS external routes is 150.
# On R1 and R3, change the preference of intra-area and inter-area routes to 20, and
change the preference of AS external routes to 50.
[R1]ospf 1
[R1-ospf-1] preference 20
[R1-ospf-1] preference ase 50
[R1-ospf-1] quit
[R3]ospf 1
[R3-ospf-1] preference 20
[R3-ospf-1] preference ase 50
[R3-ospf-1] quit
The operation in this step only shows how to change the preferences of internal and
external routes, and does not have actual meaning in this experiment.
# Check the OSPF routes in the IP routing table on R3.
The command output shows that the preferences of the OSPF routes have changed.
----End
1.2.3 Quiz
OSPF can import two types of AS external routes: Type 1 and Type 2. What are their
differences?
#
sysname R1
#
interface GigabitEthernet0/0/3
ip address 10.0.123.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.1.1
default-route-advertise always type 1
preference 20
preference ase 50
bandwidth-reference 10000
area 0.0.0.2
network 10.0.1.1 0.0.0.0
network 10.0.123.1 0.0.0.0
#
ip route-static 0.0.0.0 0.0.0.0 LoopBack0
#
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/2
ip address 10.0.24.2 255.255.255.0
#
interface GigabitEthernet0/0/4
ip address 10.0.123.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
HCIP-Datacom-Core Technology Lab Guide Page 38
interface LoopBack1
ip address 10.2.0.1 255.255.255.0
#
interface LoopBack2
ip address 10.2.1.1 255.255.255.0
#
ospf 1 router-id 10.0.2.2
asbr-summary 10.2.0.0 255.255.254.0
import-route direct
bandwidth-reference 10000
area 0.0.0.0
network 10.0.2.2 0.0.0.0
network 10.0.24.2 0.0.0.0
area 0.0.0.2
abr-summary 10.3.0.0 255.255.254.0
network 10.0.123.2 0.0.0.0
#
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/4
ip address 10.0.123.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
ospf network-type broadcast
#
interface LoopBack1
ip address 10.3.0.1 255.255.255.0
ospf network-type broadcast
#
interface LoopBack2
ip address 10.3.1.1 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.3.3
preference 20
preference ase 50
bandwidth-reference 10000
area 0.0.0.2
network 10.0.123.3 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.3.0.1 0.0.0.0
network 10.3.1.1 0.0.0.0
#
Configuration on R4
#
sysname R4
#
interface GigabitEthernet0/0/2
HCIP-Datacom-Core Technology Lab Guide Page 39
Configuration on R5
#
sysname R5
#
interface GigabitEthernet0/0/3
ip address 10.0.45.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.0
ospf network-type broadcast
#
interface LoopBack1
ip address 10.5.0.1 255.255.255.0
ospf network-type broadcast
#
interface LoopBack2
ip address 10.5.1.1 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.5.5
bandwidth-reference 10000
area 0.0.0.0
area 0.0.0.1
network 10.0.5.5 0.0.0.0
network 10.5.0.1 0.0.0.0
network 10.5.1.1 0.0.0.0
network 10.0.45.5 0.0.0.0
#
HCIP-Datacom-Core Technology Lab Guide Page 40
The preceding figure shows the device interconnection mode and IP address plan.
Loopback0 of R1 belongs to OSPF area 2, GE0/0/2 of R4 belongs to OSPF area 1, and the
other interfaces of R1, R2, R3, and R4 belong to OSPF area 0.
GE0/0/3 on R5 belongs to OSPF area 1, and Loopback0 on R5 does not belong to any
OSPF area.
1.3.1.3 Background
You are a network administrator of a company. The company's network has five AR
routers, among which R1, R2, R3, and R4 reside in the headquarters and are connected
through an Ethernet. R5 resides in a branch and is connected to R4 in the headquarters.
To control LSA flooding on the large-scale network, multi-area OSPF is designed.
To specify the router ID of each device, the devices are configured to use fixed IP
addresses as their router IDs.
On the network where R1, R2, R3, and R4 are interconnected, you need to intervene in
the election of the DR and BDR. In practice, R3 is defined as the DR, R2 as the BDR, and
R1 and R4 as DR others.
HCIP-Datacom-Core Technology Lab Guide Page 41
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] ip address 10.0.123.1 24
[R1-GigabitEthernet0/0/1] quit
[R1]interface LoopBack 0
[R1-LoopBack0] ip address 10.0.1.1 24
[R1-LoopBack0] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ip address 10.0.123.2 24
[R2-GigabitEthernet0/0/1] quit
[R2]interface LoopBack 0
[R2-LoopBack0] ip address 10.0.2.2 24
[R2-LoopBack0] quit
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] ip address 10.0.123.3 24
[R3-GigabitEthernet0/0/1] quit
[R3]interface LoopBack 0
[R3-LoopBack0] ip address 10.0.3.3 24
[R3-LoopBack0] quit
HCIP-Datacom-Core Technology Lab Guide Page 42
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1] ip address 10.0.123.4 24
[R4-GigabitEthernet0/0/1] quit
[R4] interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] ip address 10.0.45.4 24
[R4-GigabitEthernet0/0/2] quit
[R4]interface LoopBack 0
[R4-LoopBack0] ip address 10.0.4.4 24
[R4-LoopBack0] quit
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] ip address 10.0.45.5 24
[R5-GigabitEthernet0/0/3] quit
[R5]interface LoopBack 0
[R5-LoopBack0] ip address 10.0.5.5 24
[R5-LoopBack0] quit
# On R4, ping the IP addresses of the interconnected devices to test the connectivity.
<R4>ping -c 1 10.0.123.1
PING 10.0.123.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.1: bytes=56 Sequence=1 ttl=255 time=100 ms
<R4>ping -c 1 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=110 ms
<R4>ping -c 1 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=110 ms
<R4>ping -c 1 10.0.45.5
PING 10.0.45.5: 56 data bytes, press CTRL_C to break
HCIP-Datacom-Core Technology Lab Guide Page 43
Configure multi-area OSPF as planned and change the network type of Loopback0 to
broadcast.
# Configure R1.
# Configure R2.
# Configure R3.
# Configure R4.
# Configure R5.
The command output shows that R3 and R4 have established only a neighbor
relationship instead of an adjacency.
# Check the OSPF routing table on R4.
Total Nets: 6
Intra Area: 5 Inter Area: 1 ASE: 0 NSSA: 0
HCIP-Datacom-Core Technology Lab Guide Page 45
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 470 36 80000008 1
Router 10.0.4.4 10.0.4.4 1660 36 80000005 1
Network 10.0.45.4 10.0.4.4 1660 32 80000002 0
Sum-Net 10.0.3.0 10.0.4.4 1710 28 80000001 1
Sum-Net 10.0.2.0 10.0.4.4 1710 28 80000001 1
Sum-Net 10.0.1.0 10.0.4.4 1710 28 80000001 1
Sum-Net 10.0.4.0 10.0.4.4 1700 28 80000001 0
Sum-Net 10.0.123.0 10.0.4.4 1710 28 80000001 1
As only two routers exist in area 1, only two Type 1 LSAs exist in the LSDB of R5, and the
five Type-3 LSAs are inter-area routes advertised by R4 to R5.
# Check the OSPF LSDB on R2.
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 256 48 8000000B 1
Router 10.0.4.4 10.0.4.4 211 48 8000000A 1
Router 10.0.2.2 10.0.2.2 268 48 8000000C 1
Router 10.0.1.1 10.0.1.1 270 36 8000000B 1
Network 10.0.123.1 10.0.1.1 270 40 80000007 0
Sum-Net 10.0.1.0 10.0.1.1 399 28 80000002 0
Sum-Net 10.0.45.0 10.0.4.4 265 28 80000002 1
The LSDB on R2 contains not only four Type 1 LSAs, but also one Type 2 LSA. GE0/0/1 of
R2 connects to a broadcast network, on which the DR generates a Type 2 LSA to describe
all neighbors. Based on the AdvRouter field, the router that generates the LSA is R1,
which matches the result that R1 is the DR on this network segment.
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1] ospf dr-priority 255
[R4-GigabitEthernet0/0/1] quit
# Change the DR priority of GE0/0/1 on R3 to 254 to ensure that R3 becomes the BDR on
the network segment 10.0.123.0/24.
HCIP-Datacom-Core Technology Lab Guide Page 46
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] ospf dr-priority 254
[R3-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ospf dr-priority 0
[R2-GigabitEthernet0/0/1] quit
# Shut down and then re-enable GE0/0/1 of R1, R2, R3, and R4 to trigger DR and BDR re-
election.
To ensure that the election result is determined based on the configured priorities, you
are advised to enable the interfaces at the same time. Otherwise, the router whose
interface is enabled first may become the DR or BDR.
# Check the DR and BDR election results on R3.
R1 and R2 are both DR others, and their neighbor relationship remains in the 2-way state.
This means that R1 and R2 has established only a neighbor relationship and no
adjacency.
# Configure R5 to import the Loopback0 route to its OSPF routing table. As previously
described, R5's Loopback0 does not belong to any OSPF area.
[R5]ospf 1
[R5-ospf-1] import-route direct
Routing Tables
Total Nets: 7
Intra Area: 5 Inter Area: 1 ASE: 1 NSSA: 0
The Loopback0 route has been successfully imported to the OSPF routing table as an
external route.
# Check Type 5 LSAs on R1.
Type : External
Ls id : 10.0.5.0
Adv rtr : 10.0.5.5
Ls age : 429
Len : 36
Options :E
seq# : 80000001
chksum : 0xa904
Netmask : 255.255.255.0
TOS 0 Metric :1
Etype :2
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Low
Type : External
Ls id : 10.0.45.0
Adv rtr : 10.0.5.5
Ls age : 429
Len : 36
Options :E
seq# : 80000001
chksum : 0xef95
Netmask : 255.255.255.0
TOS 0 Metric :1
Etype :2
Forwarding Address : 0.0.0.0
HCIP-Datacom-Core Technology Lab Guide Page 49
Tag :1
Priority : Low
The command output shows two Type 5 LSAs, but there is only one external route
10.0.5.0/24 in the OSPF routing table of R1. This is because an inter-area route to the
destination 10.0.45.0/24 exists in addition to the AS external route, and the preference of
the inter-area route is higher than that of the AS external route.
# Check Type 3 LSAs on R1. (The following command output shows Type 3 LSAs only in
area 0.)
Type : Sum-Net
Ls id : 10.0.1.0
Adv rtr : 10.0.1.1
Ls age : 1487
Len : 28
Options :E
seq# : 80000003
chksum : 0x72d1
Netmask : 255.255.255.0
Tos 0 metric: 0
Priority : Low
Type : Sum-Net
Ls id : 10.0.45.0
Adv rtr : 10.0.4.4
Ls age : 1506
Len : 28
Options :E
seq# : 80000003
chksum : 0x6fa1
Netmask : 255.255.255.0
Tos 0 metric: 1
Priority : Low
The command output shows that a Type 3 LSA also describes a route to the destination
10.0.45.0/24. If the route prefixes and masks described in a Type 3 LSA and a Type 5 LSA
are the same, OSPF preferentially selects the route calculated using the Type 3 LSA and
installs the route into its routing table.
Type : Router
Ls id : 10.0.1.1
Adv rtr : 10.0.1.1
Ls age : 202
Len : 36
Options : ABR E
seq# : 80000015
chksum : 0x31e4
Link count :1
* Link ID : 10.0.123.4
Data : 10.0.123.1
Link Type : TransNet
Metric :1
Area : 0.0.0.2
Link State Database
Type : Router
Ls id : 10.0.1.1
Adv rtr : 10.0.1.1
Ls age : 180
Len : 36
Options : ABR E
seq# : 80000005
chksum : 0x1615
Link count : 1
* Link ID : 10.0.1.0
Data : 255.255.255.0
Link Type : StubNet
Metric : 0
Priority : Low
In a Type 1 LSA, the Ls id field indicates the router ID of the router that generates the
LSA.
The command output shows that R1 has generated two Type 1 LSAs: one flooded in area
0, and the other flooded in area 2.
In area 0, R1 is connected to a network segment of the transit type. The value of the Link
ID field in the LSA is the interface IP address of the DR on the network segment, and the
value of the Data field is the IP address of the local interface connected to the DR.
In area 2, R1's Loopback0 belongs to this area. The value of the Link Type field in the
LSA is StubNet, the value of the Link ID field is the IP address of the stub network
segment, and the value of the Data field is the network mask of the stub network
segment.
# Check the Type 2 LSA on R2.
Type : Network
Ls id : 10.0.123.4
Adv rtr : 10.0.4.4
Ls age : 817
Len : 40
Options : E
seq# : 80000007
chksum : 0x373d
Netmask : 255.255.255.0
Priority : Low
Attached Router 10.0.4.4
Attached Router 10.0.1.1
Attached Router 10.0.2.2
Attached Router 10.0.3.3
The Type 2 LSA is generated by the DR. This can be proved by the Adv rtr field, whose
value is 10.0.4.4 (that is, the DR). For a Type 2 LSA, the value of the Ls id field is the
interface IP address of the DR on the network segment, and the values of the Attached
Router fields are the router IDs of all routers on the network segment.
# Check Type 3 LSAs 10.0.45.0 on R1.
Type : Sum-Net
Ls id : 10.0.45.0
Adv rtr : 10.0.4.4
Ls age : 1290
Len : 28
Options :E
seq# : 80000004
chksum : 0x6da2
Netmask : 255.255.255.0
Tos 0 metric: 1
Priority : Low
Area : 0.0.0.2
Link State Database
Type : Sum-Net
Ls id : 10.0.45.0
Adv rtr : 10.0.1.1
Ls age : 1250
Len : 28
Options : E
seq# : 80000004
chksum : 0x9e76
HCIP-Datacom-Core Technology Lab Guide Page 52
Netmask : 255.255.255.0
Tos 0 metric: 2
Priority : Low
The Ls id field in a Type 3 LSA indicates a network prefix, and the Net mask field carries
the network mask. Two Type 3 LSAs are displayed on R1. One is in the LSDB of area 0.
Based on the Adv rtr field, this LSA is generated by R4, which advertises it from area 1 to
area 0. The other is in the LSDB of area 2. Based on the Adv rtr field, this LSA is
generated by R1 itself. R1 functions as the ABR connecting area 0 and area 2, and
generates the Type 3 LSA to advertise it to area 2.
# Check the Type 4 LSAs on R1.
Type : Sum-Asbr
Ls id : 10.0.5.5
Adv rtr : 10.0.4.4
Ls age : 1257
Len : 28
Options :E
seq# : 80000002
chksum : 0xea49
Tos 0 metric :1
Area: 0.0.0.2
Link State Database
Type : Sum-Asbr
Ls id : 10.0.5.5
Adv rtr : 10.0.1.1
Ls age : 1256
Len : 28
Options :E
seq# : 80000002
chksum : 0x1c1d
Tos 0 metric: 2
Type 4 LSAs are used to describe routes to ASBRs. The command output shows that R1
has two Type 4 LSAs. One is in the LSDB of area 0, and is generated by R4 based on the
Adv rtr field. The other is generated by R1 itself as the value of the Adv rtr field is R1's
own router ID. R1 functions as the ABR connecting area 0 and area 2.
By default, an OSPF router sends LSU packets at the interval of 30 minutes when the
network runs stably. To trigger OSPF to send LSR and LSU packets, cancel the OSPF
activation on Loopback0 of R4. Then, observe the OSPF packets on R1.
HCIP-Datacom-Core Technology Lab Guide Page 53
# Run the debugging ospf packet update and debugging ospf packet ack commands
on R1.
<R1>terminal debugging
Info: Current terminal debugging is on.
<R1>terminal monitor
Info: Current terminal monitor is on.
<R1>debugging ospf packet update
<R1>debugging ospf packet ack
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0] undo network 10.0.4.4 0.0.0.0
The debugging information shows three packets. The first is an LSU packet, which is sent
by R4 (the DR). The destination address of the packet is 224.0.0.5, and the packet
contains only one network segment. Therefore, the value of the Links field is 1.
The second is an LSAck packet, which is sent by R3 (the BDR). The destination address of
the packet is 224.0.0.5. The third is also an LSAck packet, which is sent by R1 to the DR
and BDR. The destination address of the packet is 224.0.0.6.
# Re-activate OSPF on the Loopback0 interface.
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0] network 10.0.4.4 0.0.0.0
The first remains an LSU packet, which is generated by R4 (the DR). The value of the
Links field is 2, indicating that a Loopback0 route is added. The second and third packets
remain the same as before: the LSAck packet replied by the BDR and that replied by R1
itself.
# Run the debugging ospf packet request command on R1, and then reset the OSPF
process.
The debugging information shows that R1 has sent LSR packets to R3 (the BDR) and R4
(the DR).
----End
1.3.3 Quiz
When does a Type 4 LSA exist, and what is its function?
#
sysname R1
#
interface GigabitEthernet0/0/1
ip address 10.0.123.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.1.1
area 0.0.0.0
network 10.0.123.1 0.0.0.0
area 0.0.0.2
network 10.0.1.1 0.0.0.0
#
HCIP-Datacom-Core Technology Lab Guide Page 58
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/1
ip address 10.0.123.2 255.255.255.0
ospf dr-priority 0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.0.123.2 0.0.0.0
network 10.0.2.2 0.0.0.0
#
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/1
ip address 10.0.123.3 255.255.255.0
ospf dr-priority 254
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.123.3 0.0.0.0
network 10.0.3.3 0.0.0.0
#
Configuration on R4
#
sysname R4
#
interface GigabitEthernet0/0/1
ip address 10.0.123.4 255.255.255.0
ospf dr-priority 255
#
interface GigabitEthernet0/0/2
ip address 10.0.45.4 255.255.255.0
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.0
ospf network-type broadcast
#
HCIP-Datacom-Core Technology Lab Guide Page 59
Configuration on R5
#
sysname R5
#
interface GigabitEthernet0/0/3
ip address 10.0.45.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.5.5
import-route direct
area 0.0.0.1
network 10.0.45.5 0.0.0.0
#
The preceding figure shows the device interconnection mode and IP address plan. The
OSPF areas are planned as follows:
1. The interconnection interfaces between R1 and R3 and R1's Loopback0 belong to
OSPF area 2.
2. The interconnection interfaces between R3 and R4 and their Loopback0 interfaces
belong to OSPF area 0.
3. The interconnection interfaces between R4 and R5 belong to OSPF area 1, and R5's
Loopback0 does not belong to any area.
4. The interconnection interfaces between R2 and R3 belong to OSPF area 3, and R2's
Loopback0 does not belong to any area.
1.4.1.3 Background
You are a network administrator of a company. The company's network has five AR
routers, among which R2, R3, and R4 reside in the headquarters. R5 and R1 reside in
different branches of the company.
To reduce the pressure on the devices in branches, area 1 is configured as an NSSA and
area 2 as a stub area.
To specify the router ID of each device, the devices are configured to use fixed IP
addresses as their router IDs.
6. Configure area 1 as an NSSA, and observe the changes of the OSPF routing table
and LSDB in area 1.
7. Check the OSPF role of R4, and observe the translation from Type 7 LSAs into Type 5
LSAs on R4.
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.0
[R1-LoopBack0] quit
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] ip address 10.0.13.1 255.255.255.0
[R1-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.23.2 255.255.255.0
[R2-GigabitEthernet0/0/2] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.0
[R2-LoopBack0] quit
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.0
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] ip address 10.0.13.3 255.255.255.0
[R3-GigabitEthernet0/0/1] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.0.34.3 255.255.255.0
[R3-GigabitEthernet0/0/2] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] ip address 10.0.23.3 255.255.255.0
[R3-GigabitEthernet0/0/3] quit
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.0
[R4-LoopBack0] quit
[R4]interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] ip address 10.0.45.4 255.255.255.0
HCIP-Datacom-Core Technology Lab Guide Page 62
[R4-GigabitEthernet0/0/2] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.34.4 255.255.255.0
[R4-GigabitEthernet0/0/3] quit
[R5]interface LoopBack0
[R5-LoopBack0] ip address 10.0.5.5 255.255.255.0
[R5-LoopBack0] quit
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] ip address 10.0.45.5 255.255.255.0
[R5-GigabitEthernet0/0/3] quit
# On R3 and R5, ping the IP addresses of the interconnected devices to test the
connectivity.
<R3>ping -c 1 10.0.13.1
PING 10.0.13.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.13.1: bytes=56 Sequence=1 ttl=255 time=40 ms
<R3>ping -c 1 10.0.23.2
PING 10.0.23.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.2: bytes=56 Sequence=1 ttl=255 time=60 ms
<R3>ping -c 1 10.0.34.4
PING 10.0.34.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.34.4: bytes=56 Sequence=1 ttl=255 time=60 ms
<R5>ping -c 1 10.0.45.4
PING 10.0.45.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.45.4: bytes=56 Sequence=1 ttl=255 time=70 ms
Configure OSPF as planned. Manually specify the IP address of Loopback0 as the OSPF
router ID on each device, and change the network type of Loopback0 to broadcast.
# Configure R1.
# Configure R2.
# Configure R3.
# Configure R4.
# Configure R5.
The command outputs show that the OSPF neighbor relationships between all devices
are normal.
# Check the OSPF routing table on R3.
Total Nets: 7
Intra Area: 6 Inter Area: 1 ASE: 0 NSSA: 0
R3 has learned the routes to all interfaces except R2's Loopback0 and R5's Loopback0
because the two Loopback0 interfaces do not have OSPF activated.
[R5] ospf 1
[R5-ospf-1] import-route direct
# Configure a default route on R2, with Loopback0 specified as the outbound interface.
Configure R2 to import the default route to its OSPF routing table, with the type of the
external route being set to type 1, cost being set to 20, and the always parameter not
specified.
Destination : 0.0.0.0/0
AdverRouter : 10.0.2.2 Tag :1
Cost : 21 Type : Type1
NextHop : 10.0.23.2 Interface : GigabitEthernet0/0/3
Priority : Low Age : 00h01m15s
Destination : 10.0.5.0/24
AdverRouter : 10.0.5.5 Tag :1
Cost : 1 Type : Type2
NextHop : 10.0.34.4 Interface : GigabitEthernet0/0/2
Priority : Low Age : 00h05m20s
<R3>ping -c 1 10.0.5.5
PING 10.0.5.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=254 time=50 ms
<R3>ping -c 1 10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=50 ms
Total Nets: 9
Intra Area: 2 Inter Area: 5 ASE: 2 NSSA: 0
The command output shows that the default route is an OSPF external route.
# Configure area 2 as a stub area on R1 and R3.
[R1] ospf 1
[R1-ospf-1] area 0.0.0.2
[R1-ospf-1-area-0.0.0.2] stub
[R3] ospf 1
[R3-ospf-1] area 0.0.0.2
[R3-ospf-1-area-0.0.0.2] stub
Total Nets: 8
Intra Area: 2 Inter Area: 6 ASE: 0 NSSA: 0
In this case, R1 does not have any OSPF external route. The original OSPF external routes
0.0.0.0/0 and 10.0.5.0/24 have been replaced by a default OSPF inter-area route.
# Check the OSPF LSDB on R1.
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 628 36 80000004 1
Router 10.0.1.1 10.0.1.1 619 48 80000007 0
Network 10.0.13.1 10.0.1.1 619 32 80000002 0
Sum-Net 0.0.0.0 10.0.3.3 631 28 80000001 1
Sum-Net 10.0.34.0 10.0.3.3 631 28 80000001 1
Sum-Net 10.0.3.0 10.0.3.3 631 28 80000001 0
Sum-Net 10.0.4.0 10.0.3.3 631 28 80000001 1
Sum-Net 10.0.45.0 10.0.3.3 631 28 80000001 2
Sum-Net 10.0.23.0 10.0.3.3 631 28 80000001 1
R1 does not have Type 4 or Type 5 LSAs. The default route carried in the Type 3 LSA
generated by the ABR is used to reach a destination outside the OSPF domain. In
addition, Type 3 LSAs destined for other areas still exist.
This proves that an ABR blocks the transmission of Type 4 and Type 5 LSAs to the area
that has been configured as a stub area and instead floods a default route destined for
the ABR itself in this area through a Type 3 LSA.
# Configure area 2 as a totally stubby area on R3.
[R3] ospf 1
[R3-ospf-1] area 0.0.0.2
[R3-ospf-1-area-0.0.0.2] stub no-summary
Total Nets: 3
Intra Area: 2 Inter Area: 1 ASE: 0 NSSA: 0
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 125 36 80000005 1
Router 10.0.1.1 10.0.1.1 121 48 8000000C 0
Network 10.0.13.1 10.0.1.1 121 32 80000002 0
Sum-Net 0.0.0.0 10.0.3.3 961 28 80000001 1
The originally multiple OSPF inter-area routes have been replaced with only one default
route 0.0.0.0/0, and the LSDB contains only one Type 3 LSA 0.0.0.0.
This proves that the ABR in a totally stubby area blocks Type 3, Type 4, and Type 5 LSAs
and instead generates a Type 3 LSA to advertise a default route destined for the ABR
itself.
Total Nets: 9
Intra Area: 4 Inter Area: 3 ASE: 2 NSSA: 0
HCIP-Datacom-Core Technology Lab Guide Page 69
The command output shows that R5 has an external route 10.0.5.0/24 described by a
Type 5 LSA.
# Check the OSPF routing table on R5.
Total Nets: 8
Intra Area: 1 Inter Area: 6 ASE: 1 NSSA: 0
The default route in the OSPF routing table of R5 is described by a Type 5 LSA, which is
generated by R2.
# Configure area 1 as an NSSA on R4 and R5.
[R4]ospf 1
[R4-ospf-1] area 0.0.0.1
[R4-ospf-1-area-0.0.0.1] nssa
[R5]ospf 1
[R5-ospf-1] area 0.0.0.1
[R5-ospf-1-area-0.0.0.1] nssa
Total Nets: 8
Intra Area: 1 Inter Area: 6 ASE: 0 NSSA: 1
The command output shows that there is no default route advertised by R2. Instead,
there is an OSPF default route described by a Type 7 LSA, which is advertised by R4.
# Check the LSDB on R5.
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 100 36 80000005 1
Router 10.0.4.4 10.0.4.4 105 36 80000005 1
Network 10.0.45.5 10.0.5.5 100 32 80000002 0
Sum-Net 10.0.34.0 10.0.4.4 151 28 80000001 1
Sum-Net 10.0.13.0 10.0.4.4 151 28 80000001 2
Sum-Net 10.0.3.0 10.0.4.4 151 28 80000001 1
Sum-Net 10.0.1.0 10.0.4.4 151 28 80000001 2
Sum-Net 10.0.4.0 10.0.4.4 151 28 80000001 0
Sum-Net 10.0.23.0 10.0.4.4 151 28 80000001 2
NSSA 10.0.5.0 10.0.5.5 143 36 80000001 1
NSSA 10.0.45.0 10.0.5.5 143 36 80000002 1
NSSA 0.0.0.0 10.0.4.4 151 36 80000001 1
The command output shows no Type 4 or Type 5 LSAs. Instead, external routes exist in
the form of Type 7 LSAs (NSSA-LSAs).
# Check the OSPF routing table on R4.
Total Nets: 9
Intra Area: 4 Inter Area: 3 ASE: 1 NSSA: 1
The Border Router field is displayed as AREA AS NSSA, indicating that R4 is both an
ABR and an ASBR and has one or more interfaces belonging to the NSSA.
# On R4, observe the process of translating Type 7 LSAs into Type 5 LSAs. The following
uses the LSA 10.0.5.0/24 as an example to describe how routing information is
transmitted.
Area: 0.0.0.1
Link State Database
Type : NSSA
Ls id : 10.0.5.0
Adv rtr : 10.0.5.5
Ls age : 587
Len : 36
Options : NP
seq# : 80000001
chksum : 0x3336
Netmask : 255.255.255.0
TOS 0 Metric: 1
Etype :2
Forwarding Address : 10.0.45.5
Tag :1
Priority : Low
In the Type 7 LSA that describes the route 10.0.5.0/24, the value of the Options field is
NP, indicating that the LSA can be translated into a Type 5 LSA by the ABR.
# Check the Type 5 LSA generated on R4 to describe the route 10.0.5.0/24.
Type : External
Ls id : 10.0.5.0
Adv rtr : 10.0.4.4
Ls age : 753
Len : 36
Options :E
seq# : 80000001
chksum : 0xb6bc
Netmask : 255.255.255.0
TOS 0 Metric: 1
Etype :2
Forwarding Address : 10.0.45.5
Tag :1
Priority : Low
The Type 5 LSA carries the same Ls id, Net mask, and Forwarding Address fields as
those in the Type 7 LSA. However, the value of the Adv rtr field is changed from 10.0.5.5
to 10.0.4.4, indicating that the Type 5 LSA is generated by R4.
----End
1.4.3 Quiz
In which scenarios is an NSSA applicable?
#
sysname R1
#
interface GigabitEthernet0/0/1
ip address 10.0.13.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.1.1
area 0.0.0.2
network 10.0.1.1 0.0.0.0
network 10.0.13.1 0.0.0.0
stub
#
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/2
HCIP-Datacom-Core Technology Lab Guide Page 74
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/1
ip address 10.0.13.3 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 10.0.34.3 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.23.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.34.3 0.0.0.0
area 0.0.0.2
network 10.0.13.3 0.0.0.0
stub no-summary
area 0.0.0.3
network 10.0.23.3 0.0.0.0
#
Configuration on R4
#
sysname R4
#
interface GigabitEthernet0/0/2
ip address 10.0.45.4 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.34.4 255.255.255.0
#
interface LoopBack0
HCIP-Datacom-Core Technology Lab Guide Page 75
Configuration on R5
#
sysname R5
#
interface GigabitEthernet0/0/3
ip address 10.0.45.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.5.5
import-route direct
area 0.0.0.1
network 10.0.45.5 0.0.0.0
nssa
#
HCIP-Datacom-Core Technology Lab Guide Page 76
The preceding figure shows the IP addresses, IS-IS areas, and IS-IS router levels. R1, R2,
and R3 belong to area 49.0001, and R4 and R5 belong to area 49.0002. Loopback0
interfaces are created on all routers, and their IP addresses are in the format of
10.0.x.x/32, where x indicates the device ID.
2.1.1.3 Background
A customer's network uses IS-IS as an IGP. R4 and R5 are Level-2 routers and run in area
49.0002. R1, R2, and R3 belong to area 49.0001. R1 is a Level-1 router, whereas R2 and
R3 are Level-1-2 routers. R5 imports an external route 192.168.1.0/24.
HCIP-Datacom-Core Technology Lab Guide Page 77
Requirements: R1 can access the destination of the external route imported by R5.
GE0/0/1 of R1 functions as the DIS. Bidirectional traffic between R1 and R5 is forwarded
along the path between R3 and R4. You can control the route selection result by
changing the cost or configuring route leaking as required.
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0] quit
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] ip address 10.0.123.1 255.255.255.0
[R1-GigabitEthernet0/0/1] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ip address 10.0.123.2 255.255.255.0
[R2-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/5
[R2-GigabitEthernet0/0/5] ip address 10.0.24.2 255.255.255.0
[R2-GigabitEthernet0/0/5] quit
HCIP-Datacom-Core Technology Lab Guide Page 78
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] ip address 10.0.123.3 255.255.255.0
[R3-GigabitEthernet0/0/1] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.0.34.3 255.255.255.0
[R3-GigabitEthernet0/0/2] quit
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0] quit
[R4]interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] ip address 10.0.45.4 255.255.255.0
[R4-GigabitEthernet0/0/2] quit
[R4]interface GigabitEthernet0/0/5
[R4-GigabitEthernet0/0/5] ip address 10.0.24.4 255.255.255.0
[R4-GigabitEthernet0/0/5] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.34.4 255.255.255.0
[R4-GigabitEthernet0/0/3] quit
[R5]interface LoopBack0
[R5-LoopBack0] ip address 10.0.5.5 255.255.255.255
[R5-LoopBack0] quit
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] ip address 10.0.45.5 255.255.255.0
[R5-GigabitEthernet0/0/3] quit
# On R1 and R4, ping the IP addresses of the interconnected devices to test the
connectivity.
<R1>ping -c 1 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=90 ms
<R1>ping -c 1 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=140 ms
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 140/140/140 ms
<R4>ping -c 1 10.0.24.2
PING 10.0.24.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.24.2: bytes=56 Sequence=1 ttl=255 time=70 ms
<R4>ping -c 1 10.0.34.3
PING 10.0.34.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.34.3: bytes=56 Sequence=1 ttl=255 time=60 ms
<R4>ping -c 1 10.0.45.5
PING 10.0.45.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.45.5: bytes=56 Sequence=1 ttl=255 time=50 ms
Configure IS-IS process 1 on each router, and use the device ID of each device when
setting NETs. For example, set the NET of R1 to 49.0001.0000.0000.0001.00.
# Configure R1.
[R1]isis 1
[R1-isis-1] is-level level-1
[R1-isis-1] network-entity 49.0001.0000.0000.0001.00
[R1-isis-1] quit
[R1]interface LoopBack0
[R1-LoopBack0] isis enable 1
[R1-LoopBack0] quit
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] isis enable 1
[R1-GigabitEthernet0/0/1] quit
# Configure R2.
[R2]isis 1
[R2-isis-1] network-entity 49.0001.0000.0000.0002.00
HCIP-Datacom-Core Technology Lab Guide Page 80
[R2-isis-1] quit
[R2]interface LoopBack0
[R2-LoopBack0] isis enable 1
[R2-LoopBack0] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] isis enable 1
[R2-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/5
[R2-GigabitEthernet0/0/5] isis enable 1
[R2-GigabitEthernet0/0/5] quit
# Configure R3.
[R3]isis
[R3-isis-1] network-entity 49.0001.0000.0000.0003.00
[R3-isis-1] quit
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] isis enable 1
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] isis enable 1
[R3-GigabitEthernet0/0/1] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] isis enable 1
[R3-GigabitEthernet0/0/2] quit
# Configure R4.
[R4]isis 1
[R4-isis-1] is-level level-2
[R4-isis-1] network-entity 49.0002.0000.0000.0004.00
[R4-isis-1] quit
[R4]interface LoopBack0
[R4-LoopBack0] isis enable 1
[R4-LoopBack0] quit
[R4]interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] isis enable 1
[R4-GigabitEthernet0/0/2] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] isis enable 1
[R4-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/5
[R4-GigabitEthernet0/0/5] isis enable 1
[R4-GigabitEthernet0/0/5] quit
# Configure R5.
[R5]isis 1
[R5-isis-1] is-level level-2
[R5-isis-1] network-entity 49.0002.0000.0000.0005.00
[R5-isis-1] quit
[R5]interface LoopBack0
[R5-LoopBack0] isis enable 1
[R5-LoopBack0] quit
HCIP-Datacom-Core Technology Lab Guide Page 81
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] isis enable 1
[R5-GigabitEthernet0/0/3] quit
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] isis authentication-mode md5 huawei
[R1-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] isis authentication-mode md5 huawei
[R2-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/5
[R2-GigabitEthernet0/0/5] isis authentication-mode md5 huawei
[R2-GigabitEthernet0/0/5] quit
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] isis authentication-mode md5 huawei
[R3-GigabitEthernet0/0/1] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] isis authentication-mode md5 huawei
[R3-GigabitEthernet0/0/2] quit
[R4]interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] isis authentication-mode md5 huawei
[R4-GigabitEthernet0/0/2] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] isis authentication-mode md5 huawei
[R4-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/5
[R4-GigabitEthernet0/0/5] isis authentication-mode md5 huawei
[R4-GigabitEthernet0/0/5] quit
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] isis authentication-mode md5 huawei
[R5-GigabitEthernet0/0/3] quit
Total Peer(s): 2
HCIP-Datacom-Core Technology Lab Guide Page 82
According to the preceding command output, R1 has established Level-1 IS-IS neighbor
relationships with R2 and R3.
Total Peer(s): 3
According to the preceding command output, R4 has established Level-2 IS-IS neighbor
relationships with R2, R3, and R5.
# Check the IS-IS routing table on R4.
According to the preceding command output, R4 has learned the routes on the entire
network, the routes to 10.0.123.0/24 and 10.0.1.1/32 are in the load balancing state.
Change the DIS priority of GE0/0/1 on R1 so that R1 is elected as the DIS among R1, R2,
and R3 that are on the same broadcast network.
# Check the IS-IS interface status on R1.
---------------------------------
Interface Id IPV4.State IPV6.State MTU Type DIS
Loop0 001 Up Down 1500 L1/L2 --
GE0/0/1 001 Up Down 1497 L1/L2 No/No
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] isis dis-priority 127
# Create Loopback1 on R5, set the IP address to 192.168.1.1, and import the route
192.168.1.1 as an external route to IS-IS.
[R5]interface LoopBack 1
[R5-LoopBack1] ip address 192.168.1.1 32
[R5-LoopBack1] quit
[R5]isis 1
[R5-isis-1] import-route direct
[R5-isis-1] quit
According to the preceding command output, the imported external route is displayed in
the routing table.
# Check the IS-IS route 192.168.1.1 on R4.
According to the preceding command output, R4 has learned the IS-IS route
192.168.1.1/32.
# Check the IS-IS routing table on R1.
According to the preceding command output, the IS-IS routing table on R1 does not
contain the route 192.168.1.1/32 because Level-1-2 routers do not leak Level-2 routes to
Level-1 routers by default. Therefore, R1 does not have the imported external route to
192.168.1.1/32. However, R1 has two default routes to the backbone area, and the two
routes are in the load balancing state.
# On R1, ping R5's Loopback1.
<R1>ping -c 1 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=253 time=90 ms
The routes from R4 to Loopback0 of R1 work in load balancing mode, and the next hops
are 10.0.24.2 and 10.0.34.3.
# Change the IS-IS cost of GE0/0/3 on R4.
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] isis cost 15
-----------------------------
According to the preceding command output, there is only one next hop (10.0.24.2) from
R4 to Loopback0 of R1.
By default, R1 does not have specific routes to the Level-2 area and forwards packets to
the Level-2 area only through the default routes advertised by Level-1-2 routers. In this
example, R1 uses R2 and R3 as equal-cost next hops to reach the Level-2 area. To divert
the traffic sent from R1 to R5 to R3, you can configure route leaking on R3 so that R3 can
leak the routes destined for the Level-2 area to the Level-1 area. In this way, R1 can learn
desired routes through IS-IS.
# Check the route to Loopback0 on R5 in the IP routing table of R1.
[R3]isis 1
[R3-isis-1] import-route isis level-2 into level-1
[R3-isis-1] quit
According to the preceding command output, the next hop of the route from R1 to
10.0.5.5 is 10.0.123.3, that is, R3. In addition, this route is a specific route rather than a
default route.
----End
2.1.3 Quiz
What are the conditions for establishing an IS-IS neighbor relationship between Ethernet
interfaces?
#
sysname R1
#
isis 1
is-level level-1
network-entity 49.0001.0000.0000.0001.00
#
interface GigabitEthernet0/0/1
ip address 10.0.123.1 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
isis dis-priority 127
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
isis enable 1
#
return
Configuration on R2
sysname R2
#
isis 1
network-entity 49.0001.0000.0000.0002.00
#
interface GigabitEthernet0/0/1
ip address 10.0.123.2 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
#
interface GigabitEthernet0/0/5
ip address 10.0.24.2 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
isis enable 1
#
HCIP-Datacom-Core Technology Lab Guide Page 88
Configuration on R3
#
sysname R3
#
isis 1
network-entity 49.0001.0000.0000.0003.00
import-route isis level-2 into level-1
#
interface GigabitEthernet0/0/1
ip address 10.0.123.3 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
#
interface GigabitEthernet0/0/2
ip address 10.0.34.3 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
isis enable 1
#
Configuration on R4
#
sysname R4
#
isis 1
is-level level-2
network-entity 49.0002.0000.0000.0004.00
#
interface GigabitEthernet0/0/2
ip address 10.0.45.4 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
#
interface GigabitEthernet0/0/3
ip address 10.0.34.4 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
isis cost 15
#
interface GigabitEthernet0/0/5
ip address 10.0.24.4 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
isis enable 1
#
Configuration on R5
HCIP-Datacom-Core Technology Lab Guide Page 89
#
sysname R5
#
isis 1
is-level level-2
network-entity 49.0002.0000.0000.0005.00
import-route direct
#
interface GigabitEthernet0/0/3
ip address 10.0.45.5 255.255.255.0
isis enable 1
isis authentication-mode md5 huawei
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
isis enable 1
isis authentication-mode md5 huawei
#
interface LoopBack1
ip address 192.168.1.1 255.255.255.255
#
HCIP-Datacom-Core Technology Lab Guide Page 90
3 BGP Configurations
The preceding figure shows the device interconnection mode, IP address plan, and BGP
AS numbers. Loopback0 is created on each device, and its IP address is in the format of
10.0.x.x/32, where x indicates the device number. The IP address of Loopback0 on each
device is used as the BGP router ID of the device. Loopback1 is configured on R1 and R5
to simulate a user network segment.
HCIP-Datacom-Core Technology Lab Guide Page 91
OSPF runs on R2, R3, and R4, and is activated on the interconnection and Loopback0
interfaces of R2, R3, and R4.
3.1.1.2 Background
You are a network administrator of a company. The company's network uses BGP as the
routing protocol. The network consists of multiple ASs, with different branches using
different AS numbers. Now, you need to complete the establishment of the company's
network. OSPF is used as the IGP in the headquarters, and private BGP AS numbers are
used in different branches. After the network is set up, you need to observe the
transmission of BGP routing information.
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[R1-GigabitEthernet0/0/2] quit
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0] quit
[R1]interface LoopBack1
[R1-LoopBack1] ip address 10.1.1.1 255.255.255.0
[R1-LoopBack1] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.23.2 255.255.255.0
HCIP-Datacom-Core Technology Lab Guide Page 92
[R2-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/3] quit
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.0.34.3 255.255.255.0
[R3-GigabitEthernet0/0/2] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] ip address 10.0.23.3 255.255.255.0
[R3-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] ip address 10.0.45.4 255.255.255.0
[R4-GigabitEthernet0/0/2] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.34.4 255.255.255.0
[R4-GigabitEthernet0/0/3] quit
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0] quit
[R5]interface LoopBack0
[R5-LoopBack0] ip address 10.0.5.5 255.255.255.255
[R5-LoopBack0] quit
[R5]interface LoopBack1
[R5-LoopBack1] ip address 10.1.5.5 255.255.255.0
[R5-LoopBack1] quit
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] ip address 10.0.45.5 255.255.255.0
[R5-GigabitEthernet0/0/3] quit
# On R2 and R4, ping the IP addresses of the interconnected devices to test the
connectivity.
<R2>ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=80 ms
<R2>ping -c 1 10.0.23.3
HCIP-Datacom-Core Technology Lab Guide Page 93
<R4>ping -c 1 10.0.34.3
PING 10.0.34.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.34.3: bytes=56 Sequence=1 ttl=255 time=50 ms
<R4>ping -c 1 10.0.45.5
PING 10.0.45.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.45.5: bytes=56 Sequence=1 ttl=255 time=30 ms
Configure the IP address of Loopback0 as the router ID on each of R2, R3, and R4.
# Configure R2, and activate OSPF on Loopback0 and GE0/0/2.
The command output shows that R3 has established OSPF neighbor relationships with R2
and R4.
# Check the OSPF routing table on R3.
Total Nets: 5
Intra Area: 5 Inter Area: 0 ASE: 0 NSSA: 0
The command output shows that R3 has learned the Loopback0 routes from R2 and R4.
Establish full-mesh IBGP peer relationships between Loopback0 interfaces of R2, R3, and
R4.
# Configure BGP on R2.
[R2]bgp 64512
[R2-bgp] router-id 10.0.2.2
[R2-bgp] peer 10.0.3.3 as-number 64512
[R2-bgp] peer 10.0.3.3 connect-interface LoopBack0
[R2-bgp] peer 10.0.4.4 as-number 64512
[R2-bgp] peer 10.0.4.4 connect-interface LoopBack0
[R3]bgp 64512
[R3-bgp] router-id 10.0.3.3
[R3-bgp] peer 10.0.2.2 as-number 64512
[R3-bgp] peer 10.0.2.2 connect-interface LoopBack0
[R3-bgp] peer 10.0.4.4 as-number 64512
[R3-bgp] peer 10.0.4.4 connect-interface LoopBack0
[R4]bgp 64512
[R4-bgp] peer 10.0.2.2 as-number 64512
[R4-bgp] peer 10.0.2.2 connect-interface LoopBack0
[R4-bgp] peer 10.0.3.3 as-number 64512
[R4-bgp] peer 10.0.3.3 connect-interface LoopBack0
# Check the status of BGP peer relationships on R2, R3, and R4.
The command outputs show that R2, R3, and R4 have established full-mesh IBGP peer
relationships with each other.
[R1]bgp 64513
[R1-bgp] router-id 10.0.1.1
[R1-bgp] peer 10.0.2.2 as-number 64512
[R1-bgp] peer 10.0.2.2 ebgp-max-hop 2
[R1-bgp] peer 10.0.2.2 connect-interface LoopBack0
[R2]bgp 64512
[R2-bgp] peer 10.0.1.1 as-number 64513
[R2-bgp] peer 10.0.1.1 ebgp-max-hop 2
[R2-bgp] peer 10.0.1.1 connect-interface LoopBack0
By default, the maximum number of hops allowed for an EBGP connection is 1. In this
case, EBGP peers can establish a peer relationship only through a direct link. To use a
HCIP-Datacom-Core Technology Lab Guide Page 97
loopback interface as the source interface to send BGP messages, you need to manually
change the maximum number of hops allowed for an EBGP connection.
# Configure an EBGP peer relationship between R4 and R5.
[R4]bgp 64512
[R4-bgp] peer 10.0.5.5 as-number 64514
[R4-bgp] peer 10.0.5.5 ebgp-max-hop 2
[R4-bgp] peer 10.0.5.5 connect-interface LoopBack0
[R5]bgp 64514
[R5-bgp] router-id 10.0.5.5
[R5-bgp] peer 10.0.4.4 as-number 64512
[R5-bgp] peer 10.0.4.4 ebgp-max-hop 2
[R5-bgp] peer 10.0.4.4 connect-interface LoopBack0
The preceding command outputs show that R1 and R2 as well as R4 and R5 have
successfully established EBGP peer relationships.
Configure R1 and R5 to advertise their Loopback1 routes to their BGP routing tables.
# Run the network command on R1 and R5 to advertise the routes.
[R1]bgp 64513
[R1-bgp] network 10.1.1.1 24
[R5]bgp 64514
[R5-bgp] network 10.1.5.5 24
The command output shows that R3 has learned the BGP routes advertised by R1 and R5,
but the routes are invalid because their next hops are unreachable to R3. To resolve this
issue, run the peer next-hop-local command on R2 and R4 to configure the devices to
change the next-hop addresses of BGP routes to the IP addresses of their source
interfaces when advertising these routes.
# Configure R2 and R4 to change the next-hop addresses of BGP routes to their own IP
addresses when advertising these routes.
[R2]bgp 64512
[R2-bgp] peer 10.0.3.3 next-hop-local
[R2-bgp] peer 10.0.4.4 next-hop-local
[R4]bgp 64512
[R4-bgp] peer 10.0.2.2 next-hop-local
[R4-bgp] peer 10.0.3.3 next-hop-local
The command output shows that the two BGP routes have become valid and the optimal.
# Check the BGP routing tables on R1 and R5.
The command outputs show that R1 and R5 have learned the Loopback1 routes from
each other.
# Test the connectivity between Loopback 1 interfaces on R1 and R5.
----End
3.1.3 Quiz
What are the advantages of using loopback interface addresses to establish EBGP peer
relationships compared with using physical interface addresses?
#
sysname R1
#
interface GigabitEthernet0/0/2
HCIP-Datacom-Core Technology Lab Guide Page 100
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/2
ip address 10.0.23.2 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
bgp 64512
router-id 10.0.2.2
peer 10.0.1.1 as-number 64513
peer 10.0.1.1 ebgp-max-hop 2
peer 10.0.1.1 connect-interface LoopBack0
peer 10.0.3.3 as-number 64512
peer 10.0.3.3 connect-interface LoopBack0
peer 10.0.4.4 as-number 64512
peer 10.0.4.4 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 10.0.1.1 enable
peer 10.0.3.3 enable
peer 10.0.3.3 next-hop-local
peer 10.0.4.4 enable
peer 10.0.4.4 next-hop-local
#
HCIP-Datacom-Core Technology Lab Guide Page 101
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/2
ip address 10.0.34.3 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.23.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
bgp 64512
router-id 10.0.3.3
peer 10.0.2.2 as-number 64512
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.4.4 as-number 64512
peer 10.0.4.4 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 10.0.2.2 enable
peer 10.0.4.4 enable
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.23.3 0.0.0.0
network 10.0.34.3 0.0.0.0
#
return
Configuration on R4
#
sysname R4
#
interface GigabitEthernet0/0/2
ip address 10.0.45.4 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.34.4 255.255.255.0
#
interface LoopBack0
HCIP-Datacom-Core Technology Lab Guide Page 102
Configuration on R5
#
sysname R5
#
interface GigabitEthernet0/0/3
ip address 10.0.45.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
#
interface LoopBack1
ip address 10.1.5.5 255.255.255.0
#
bgp 64514
router-id 10.0.5.5
peer 10.0.4.4 as-number 64512
peer 10.0.4.4 ebgp-max-hop 2
peer 10.0.4.4 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 10.1.5.0 255.255.255.0
peer 10.0.4.4 enable
#
ip route-static 10.0.4.4 255.255.255.255 10.0.45.4
HCIP-Datacom-Core Technology Lab Guide Page 103
#
Return
The preceding figure shows the BGP AS numbers and IP addresses of interconnection
interfaces. Loopback0 is created on each device, and its IP address is in the format of
10.0.x.x/32, where x indicates the device number.
R1, R2, and R3 use the IP addresses of Loopback0 as their BGP router IDs and establish
EBGP peer relationships through directly connected interfaces.
Loopback1 and Loopback2 are created on each of R1 and R3 to simulate user network
segments.
3.2.1.3 Background
You are a network administrator of a company. The company's network uses BGP as the
routing protocol. The network consists of multiple ASs, with different branches using
different AS numbers. As the network scale expands, more and more routing entries are
stored in the routing tables on the routers, making it urgent to summarize BGP routes.
After testing several methods of route summarization, you have finally selected a proper
method to implement route summarization.
3. Configure R1 to advertise its Loopback1 and Loopback2 routes to the BGP routing
table and implement automatic route summarization. Check detailed information
about the summary route on R2.
4. Configure R3 to advertise its Loopback1 and Loopback2 routes to the BGP routing
table, and manually summarize the routes on R2. Check detailed information about
the summary route on R2 and R3. Perform manual summarization on R2 again, and
this time configure the as-set parameter. Then, check detailed information about the
summary route on R2.
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[R1-GigabitEthernet0/0/2] quit
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0] quit
[R1]interface LoopBack1
[R1-LoopBack1] ip address 172.16.1.1 255.255.255.0
[R1-LoopBack1] quit
[R1]interface LoopBack2
[R1-LoopBack1] ip address 172.16.2.1 255.255.255.0
[R1-LoopBack1] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.23.2 255.255.255.0
[R2-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigaitEthernet0/0/3] quit
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] ip address 10.0.23.3 255.255.255.0
[R3-GigabitEthernet0/0/3] quit
HCIP-Datacom-Core Technology Lab Guide Page 105
[R3]interface LoopBack1
[R3-LoopBack1] ip address 172.17.1.1 255.255.255.0
[R3-LoopBack1] quit
[R3]interface LoopBack2
[R3-LoopBack1] ip address 172.17.2.1 255.255.255.0
[R3-LoopBack1] quit
# On R2, ping the IP addresses of the interconnected devices to test the connectivity.
<R2>ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=80 ms
<R2>ping -c 1 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=20 ms
Configure EBGP peer relationships between R1 and R2, and between R2 and R3 through
directly connected interfaces.
# Configure R1.
[R1]bgp 64511
[R1-bgp] router-id 10.0.1.1
[R1-bgp] peer 10.0.12.2 as-number 64512
# Configure R2.
[R2]bgp 64512
[R2-bgp] router-id 10.0.2.2
[R2-bgp] peer 10.0.12.1 as-number 64511
[R2-bgp] peer 10.0.23.3 as-number 64513
# Configure R3.
[R3]bgp 64513
[R3-bgp] router-id 10.0.3.3
[R3-bgp] peer 10.0.23.2 as-number 64512
The command output shows that EBGP peer relationships have been successfully
established between R1 and R2, and between R2 and R3.
Enable automatic BGP route summarization on R1, and configure R1 to advertise its
Loopback1 and Loopback2 routes to the BGP routing table so that R1 automatically
summarizes these routes.
# Create IP prefix list 1 to match the Loopback1 and Loopback2 routes.
# Create a route-policy named hcip, create node 10, and configure an if-match clause
with IP prefix list 1 specified.
# Configure R1 to advertise the Loopback1 and Loopback2 routes to the BGP routing
table, and enable automatic BGP route summarization on R1.
[R1]bgp 64511
[R1-bgp] import-route direct route-policy hcip
[R1-bgp] summary automatic
Info: Automatic summarization is valid only for the routes imported through the import-route command.
Automatic summarization takes effect only on the routes imported using the import-
route command.
# Check the BGP routing table on R1.
The Loopback1 and Loopback2 routes have been advertised to the BGP routing table. As
automatic BGP route summarization is enabled on R1, R1 summarizes these routes into
the summary route 172.16.0.0/16 and suppresses all the specific routes. In the routing
table, the s flag displayed before each specific route indicates that the route is
suppressed. As a result, R1 advertises only the summary route 172.16.0.0/16.
# Check the BGP routing table on R2.
The command output shows only the summary route 172.16.0.0/16 on R2.
# Check detailed information about the BGP summary route 172.16.0.0 on R2.
The path attributes of this route include the Aggregator attribute, which carries the AS
number and router ID of the device that generates the summary route.
Configure R3 to advertise its Loopback1 and Loopback2 routes to the BGP routing table.
Run the aggregate command on R2 to manually summarize these routes and suppress
the advertisement of the specific routes.
# Create IP prefix list 1 to match the Loopback1 and Loopback2 routes.
HCIP-Datacom-Core Technology Lab Guide Page 108
# Create a route-policy named hcip, create node 10, and configure an if-match clause
with IP prefix list 1 specified.
# Configure R3 to advertise its Loopback1 and Loopback2 routes to the BGP routing
table.
[R3]bgp 64513
[R3-bgp] import-route direct route-policy hcip
The BGP routing table of R2 contains the BGP routes 172.17.1.0/24 and 172.17.2.0/24
advertised by R3.
# On R2, manually summarize the routes 172.17.1.0/24 and 172.17.2.0/24 into the
summary route 172.17.0.0/22, and suppress the advertisement of the specific routes.
[R2]bgp 64512
[R2-bgp] aggregate 172.17.0.0 22 detail-suppressed
The command output shows that the AS-path field value is Nil, indicating that the
AS_Path attribute is empty. This means that the AS_Path attribute values of the specific
routes are lost. BGP depends on the AS_Path attribute to prevent routing loops.
Therefore, the loss of the AS_Path attribute value may cause a routing loop. The
command output also shows the BGP peers to which the summary route is advertised,
and these peers include the peer 10.0.23.3 (R3).
# Check the BGP routing table on R3.
[R2]bgp 64512
HCIP-Datacom-Core Technology Lab Guide Page 110
# Check detailed information about the BGP summary route 172.17.0.0/22 on R2 again.
The command output shows that the value of the AS_Path attribute in the summary
route is 64513, and the route is still advertised to the peer 10.0.23.3 (R3).
# Check the BGP routing table on R3 again.
After R3 receives the summary route 172.17.0.0/22, it finds its own AS number (64153) in
the AS_Path attribute of the route and ignores this route. In this case, the summary route
172.17.0.0/22 does not exist in the BGP routing table of R3. Therefore, using the as-set
parameter for manual route summarization effectively prevents a routing loop.
----End
3.2.3 Quiz
What are the differences between the path attributes carried in a summary route
generated using the aggregate command and that generated using the summary
automatic command?
HCIP-Datacom-Core Technology Lab Guide Page 111
#
sysname R1
#
interface GigabitEthernet0/0/2
ip address 10.0.12.1 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
interface LoopBack1
ip address 172.16.1.1 255.255.255.0
#
interface LoopBack2
ip address 172.16.2.1 255.255.255.0
#
bgp 64511
router-id 10.0.1.1
peer 10.0.12.2 as-number 64512
#
ipv4-family unicast
undo synchronization
summary automatic
import-route direct route-policy hcip
peer 10.0.12.2 enable
#
route-policy hcip permit node 10
if-match ip-prefix 1
#
ip ip-prefix 1 index 10 permit 172.16.0.0 16 greater-equal 24 less-equal 24
#
return
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/2
ip address 10.0.23.2 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
bgp 64512
router-id 10.0.2.2
peer 10.0.12.1 as-number 64511
HCIP-Datacom-Core Technology Lab Guide Page 112
Configuration on R3
#
sysname R3
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
interface LoopBack1
ip address 172.17.1.1 255.255.255.0
#
interface LoopBack2
ip address 172.17.2.1 255.255.255.0
#
bgp 64513
router-id 10.0.3.3
peer 10.0.23.2 as-number 64512
#
ipv4-family unicast
undo synchronization
import-route direct route-policy hcip
peer 10.0.23.2 enable
#
route-policy hcip permit node 10
if-match ip-prefix 1
#
ip ip-prefix 1 index 10 permit 172.17.0.0 16 greater-equal 24 less-equal 24
#
return
⚫ Analyze how the BGP path attribute Cluster_List implements routing loop prevention
in an RR environment.
R1, R2, R3, and R4 belong to AS 64511. The preceding figure shows the device
interconnection mode and IP addresses of interconnection interfaces. Loopback0 is
created on each device, and its IP address is in the format of 10.0.x.x/32, where x
indicates the device number. The Loopback1 addresses of R1 and R2 are 10.1.1.1/24 and
10.2.2.2/24, respectively. The loopback interfaces are used to simulate user network
segments.
All devices use the IP addresses of Loopback0 as their BGP router IDs. IBGP peer
relationships are established between R1 and R2, R2 and R3, R3 and R4, and R4 and R2
through directly connected interfaces. R1 is the RR client of R2, R2 is the RR client of R3,
and R3 is the RR client of R4.
3.3.1.3 Background
The headquarters network of a company uses BGP as the routing protocol. The four
routers in the headquarters establish IBGP peer relationships (not fully meshed). To
enable the four routers to learn complete BGP routes, BGP RRs need to be deployed on
the network.
5. Configure R2 to advertise its Loopback1 route to the BGP routing table, and observe
how the Originator_ID attribute is used to prevent a routing loop.
6. Configure R1 to advertise its Loopback1 route to the BGP routing table, and observe
how the Cluster_List attribute is used to prevent a routing loop.
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[R1-GigabitEthernet0/0/2] quit
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0] quit
[R1]interface LoopBack1
[R1-LoopBack1] ip address 10.1.1.1 255.255.255.0
[R1-LoopBack1] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ip address 10.0.24.2 255.255.255.0
[R2-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.23.2 255.255.255.0
[R2-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/3] quit
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.0.34.3 255.255.255.0
[R3-GigabitEthernet0/0/2] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] ip address 10.0.23.3 255.255.255.0
[R3-GigabitEthernet0/0/3] quit
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0] quit
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1] ip address 10.0.24.4 255.255.255.0
[R4-GigabitEthernet0/0/1] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.34.4 255.255.255.0
[R4-GigabitEthernet0/0/3] quit
# On R2 and R3, ping the IP addresses of the interconnected devices to test the
connectivity.
<R2>ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=40 ms
<R2>ping -c 1 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=10 ms
<R2>ping -c 1 10.0.24.4
PING 10.0.24.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.24.4: bytes=56 Sequence=1 ttl=255 time=80 ms
<R3>ping -c 1 10.0.34.4
PING 10.0.34.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.34.4: bytes=56 Sequence=1 ttl=255 time=10 ms
Configure R1, R2, R3, and R4 to use the IP addresses of Loopback0 as their router IDs,
and activate OSPF on the interconnection and Loopback0 interfaces.
# Configure R1.
# Configure R2.
# Configure R3.
# Configure R4.
# Check the brief information about OSPF neighbor relationships on R2 and R3.
----------------------------------------------------------------------------
The command outputs show that all the OSPF neighbor relationships have been
established properly.
# Check the OSPF routing table on R4.
Total Nets: 9
Intra Area: 9 Inter Area: 0 ASE: 0 NSSA: 0
The command output shows that R4 has learned the routes on the entire network.
[R1]bgp 64511
[R1-bgp] router-id 10.0.1.1
[R1-bgp] peer 10.0.12.2 as-number 64511
# Configure R2.
# Configure R3.
[R3]bgp 64511
[R3-bgp] router-id 10.0.3.3
[R3-bgp] peer 10.0.23.2 as-number 64511
[R3-bgp] peer 10.0.34.4 as-number 64511
# Configure R4.
HCIP-Datacom-Core Technology Lab Guide Page 118
[R4]bgp 64511
[R4-bgp] router-id 10.0.4.4
[R4-bgp] peer 10.0.24.2 as-number 64511
[R4-bgp] peer 10.0.34.3 as-number 64511
The command outputs show that the IBGP peer relationships have been successfully
established in the AS.
[R2]bgp 64511
[R2-bgp] peer 10.0.12.1 reflect-client
[R3]bgp 64511
[R3-bgp] peer 10.0.23.2 reflect-client
[R4]bgp 64511
[R4-bgp] peer 10.0.34.3 reflect-client
Step 5 Verify that the Originator_ID attribute can prevent routing loops.
In this step, configure R2 to advertise the BGP route 10.2.2.0/24. Observe whether the
route is advertised back to R2 after being reflected by R3 and R4 in sequence. If so, a
routing loop may occur.
HCIP-Datacom-Core Technology Lab Guide Page 119
By default, after R2 advertises a BGP route, the route is directly advertised by R2 to R4. In
addition, the route is reflected by R3 to R4. In this case, R4 preferentially selects the route
directly advertised by R2 and does not reflect the route reflected by R3 back to R2. For
the purpose of this experiment, a route-policy needs to be configured on R2 to prevent
R2 from directly advertising the route 10.2.2.0/24 to R4.
# Configure a route-policy.
# Apply the route-policy to filter routes to be advertised to the specified BGP peer.
[R2]bgp 64511
[R2-bgp] peer 10.0.24.4 route-policy bgp export
[R2]bgp 64511
[R2-bgp] network 10.2.2.0 24
The command output shows that R2 has advertised this route to R3 and R1, but not to
R4.
# Check detailed information about the BGP route 10.2.2.0/24 on R3.
RR-client route.
From : 10.0.23.2 (10.0.2.2)
Route Duration : 00h31m14s
Relay IP Nexthop : 0.0.0.0
Relay IP Out-Interface: GigabitEthernet0/0/3
Original nexthop : 10.0.23.2
Qos information : 0x0
AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255
Advertised to such 1 peers:
10.0.34.4
R3 has reflected the BGP route 10.2.2.0/24 from its RR client to the peer 10.0.34.4 (R4). In
addition, the next-hop address of the BGP route is 10.0.23.2.
# Check detailed information about the BGP route 10.2.2.0/24 on R4.
The route is received from the RR client R3. When R3 reflects the original route, the next-
hop address of the route remains unchanged, and R3 adds the Originator_ID attribute
with the value of 10.0.2.2 to the route. After receiving this route from R3, R4 reflects it to
R2.
# Check detailed information about the BGP route 10.2.2.0/24 on R2 again.
10.0.23.3
10.0.12.1
Only the locally advertised BGP route exists in the routing table, and the BGP route
advertised by R4 does not exist.
# Check detailed information about the BGP peer 10.0.24.4 on R2.
The command output shows that R2 receives an Update message from R4 and does not
send an Update message to R4 (due to routing filtering by the route-policy). However,
the BGP route 10.2.2.0/24 advertised by R4 does not exist in R2's BGP routing table.
# Trigger an import soft reset on R2 to allow R4 to re-send Update messages.
The number of received Update messages increases. R2 receives the BGP route
10.2.2.0/24 from R4.
# Check detailed information about the BGP route 10.2.2.0/24 on R2 again.
Still only the locally advertised BGP route exists in the routing table. The value of the
Originator_ID attribute of the BGP route advertised by R4 is the same as the local router
ID. As a result, R2 ignores the route advertised by R4.
Step 6 Verify that the Cluster_List attribute can prevent routing loops.
[R2]bgp 64511
[R2-bgp] undo network 10.2.2.0 255.255.255.0
HCIP-Datacom-Core Technology Lab Guide Page 123
[R1]bgp 64511
[R1-bgp] network 10.1.1.0 24
# Check detailed information about the BGP route 10.1.1.0 /24 on R1, R2, R3, and R4 in
sequence.
R2 receives the BGP route 10.1.1.0/24 from its RR client R1 and reflects it to R3
(10.0.23.3).
R3 receives the BGP route 10.1.1.0/24 from its RR client R2, which added the Cluster_List
attribute with the value of 10.0.2.2 to the route when reflecting it. R3 then reflects the
received route to R4 (10.0.34.4).
R4 receives the BGP route 10.1.1.0/24 from its RR client R3, which added the Cluster_List
attribute with the values of 10.0.3.3 and 10.0.2.2 to the route when reflecting it. R4 then
reflects the received route to R2 (10.0.24.2).
# Check the BGP routing table on R2 again.
The BGP routing table of R2 still contains only the BGP route 10.1.1.0/24 received from
the peer 10.0.12.1.
HCIP-Datacom-Core Technology Lab Guide Page 125
R2 receives an Update message from R4 and does not send an Update message to R4
(due to route filtering by the route-policy). However, the local BGP routing table does not
contain the BGP route 10.1.1.0/24 advertised by R4.
# Trigger an import soft reset on R2 to allow R4 to re-send Update messages.
The number of received Update messages increases. R2 receives the BGP route
10.1.1.0/24 from R4.
# Check detailed information about the BGP route 10.1.1.0 24 on R2 again.
Still only the BGP route advertised by R1 exists in the routing table. The Cluster_List
attribute of the BGP route advertised by R4 contains the cluster ID of R2. As a result, R2
ignores the route advertised by R4.
3.3.3 Quiz
Do the routes advertised by BGP to EBGP peers carry the Originator_ID and Cluster_List
attributes?
#
sysname R1
#
interface GigabitEthernet0/0/2
HCIP-Datacom-Core Technology Lab Guide Page 127
Configuration on R2
<R2>display current-configuration
#
sysname R2
#
acl number 2000
rule 5 permit
#
interface GigabitEthernet0/0/1
ip address 10.0.24.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 10.0.23.2 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
interface LoopBack1
ip address 10.2.2.2 255.255.255.0
#
bgp 64511
router-id 10.0.2.2
peer 10.0.12.1 as-number 64511
peer 10.0.23.3 as-number 64511
peer 10.0.24.4 as-number 64511
HCIP-Datacom-Core Technology Lab Guide Page 128
#
ipv4-family unicast
undo synchronization
peer 10.0.12.1 enable
peer 10.0.12.1 reflect-client
peer 10.0.23.3 enable
peer 10.0.24.4 enable
peer 10.0.24.4 route-policy bgp export
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.0.2.2 0.0.0.0
network 10.0.12.2 0.0.0.0
network 10.0.23.2 0.0.0.0
network 10.0.24.2 0.0.0.0
#
route-policy bgp deny node 10
if-match acl 2000
#
return
Configuration on R3
<R3>display current-configuration
#
sysname R3
#
interface GigabitEthernet0/0/2
ip address 10.0.34.3 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.23.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
bgp 64511
router-id 10.0.3.3
peer 10.0.23.2 as-number 64511
peer 10.0.34.4 as-number 64511
#
ipv4-family unicast
undo synchronization
peer 10.0.23.2 enable
peer 10.0.23.2 reflect-client
peer 10.0.34.4 enable
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.23.3 0.0.0.0
network 10.0.34.3 0.0.0.0
#
return
HCIP-Datacom-Core Technology Lab Guide Page 129
Configuration on R4
<R4>display current-configuration
#
sysname R4
#
interface GigabitEthernet0/0/1
ip address 10.0.24.4 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.34.4 255.255.255.0
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
bgp 64511
router-id 10.0.4.4
peer 10.0.24.2 as-number 64511
peer 10.0.34.3 as-number 64511
#
ipv4-family unicast
undo synchronization
peer 10.0.24.2 enable
peer 10.0.34.3 enable
peer 10.0.34.3 reflect-client
#
ospf 1 router-id 10.0.4.4
area 0.0.0.0
network 10.0.4.4 0.0.0.0
network 10.0.24.4 0.0.0.0
network 10.0.34.4 0.0.0.0
#
return
The preceding figure shows the device interconnection mode and IP addresses of
interconnection interfaces. Loopback0 is created on each device, and its IP address is in
the format of 10.0.x.x/32, where x indicates the device number. All devices use the IP
addresses of Loopback0 as their BGP router IDs.
R1 resides in AS 100; R5 resides in AS 200; R2, R3, and R4 reside in AS 64512. OSPF runs
in AS 64512, and OSPF is activated on the interconnection interfaces (excluding the
interfaces connected to external ASs) and Loopback0 interfaces.
EBGP peer relationships are established through directly connected interfaces, and IBGP
peer relationships are established through Loopback0 interfaces.
R1 and R5 share the following network segments: 172.16.1.0/24, 172.16.2.0/24,
172.16.3.0/24, and 172.16.4.0/24. R1 and R5 are configured to advertise routes destined
for these network segments to their BGP routing tables for route selection.
3.4.1.3 Background
You are a network administrator of a company. The company's network uses BGP to
access two service providers, ISP1 and ISP2. The company uses the private AS number
64512. The AS number of ISP1 is 100, and that of ISP2 is 200. The same network can be
reached through AS 100 and AS 200. You can adjust the route direction by changing
various BGP attributes.
4. On R1, configure a route-policy to change the AS_Path attribute of the BGP route
172.16.1.0/24 so that R3 preferentially selects the BGP route 172.16.1.0/24 advertised
by R5.
5. On R4, configure a route-policy to change the Local_Pref attribute of the BGP route
172.16.2.0/24 so that R3 preferentially selects the BGP route 172.16.2.0/24 advertised
by R4.
6. On R2, configure a route-policy to change the MED attribute of the BGP route
172.16.3.0/24 so that R3 preferentially selects the BGP route 172.16.3.0/24 advertised
by R5.
7. On R3, configure a route-policy to change the PrefVal attribute of the BGP route
172.16.4.0/24 so that R3 preferentially selects the BGP route 172.16.4.0/24 advertised
by R4.
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[R1-GigabitEthernet0/0/2] quit
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0] quit
# Create multiple loopback interfaces on R1 so that R1 can advertise the loopback routes
to the BGP routing table.
[R1]interface LoopBack1
[R1-LoopBack1] ip address 172.16.1.1 255.255.255.0
[R1-LoopBack1] quit
[R1]interface LoopBack2
[R1-LoopBack2] ip address 172.16.2.1 255.255.255.0
[R1-LoopBack2] quit
[R1]interface LoopBack3
[R1-LoopBack3] ip address 172.16.3.1 255.255.255.0
[R1-LoopBack3] quit
[R1]interface LoopBack4
[R1-LoopBack4] ip address 172.16.4.1 255.255.255.0
[R1-LoopBack4] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
HCIP-Datacom-Core Technology Lab Guide Page 132
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.23.2 255.255.255.0
[R2-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/3] quit
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.0.34.3 255.255.255.0
[R3-GigabitEthernet0/0/2] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] ip address 10.0.23.3 255.255.255.0
[R3-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/2
[R4-GigabitEthernet0/0/2] ip address 10.0.45.4 255.255.255.0
[R4-GigabitEthernet0/0/2] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.34.4 255.255.255.0
[R4-GigabitEthernet0/0/3] quit
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0] quit
[R5]interface LoopBack0
[R5-LoopBack0] ip address 10.0.5.5 255.255.255.255
[R5-LoopBack0] quit
[R5]interface GigabitEthernet0/0/3
[R5-GigabitEthernet0/0/3] ip address 10.0.45.5 255.255.255.0
[R5-GigabitEthernet0/0/3] quit
# Create multiple loopback interfaces on R5 so that R5 can advertise the loopback routes
to the BGP routing table.
[R5]interface LoopBack1
[R5-LoopBack1] ip address 172.16.1.1 255.255.255.0
[R5-LoopBack1] quit
[R5]interface LoopBack2
[R5-LoopBack2] ip address 172.16.2.1 255.255.255.0
[R5-LoopBack2] quit
[R5]interface LoopBack3
[R5-LoopBack3] ip address 172.16.3.1 255.255.255.0
[R5-LoopBack3] quit
[R5]interface LoopBack4
[R5-LoopBack4] ip address 172.16.4.1 255.255.255.0
[R5-LoopBack4] quit
HCIP-Datacom-Core Technology Lab Guide Page 133
# On R2 and R4, ping the IP addresses of the interconnected devices to test the
connectivity.
<R2>ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=80 ms
<R2>ping -c 1 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=20 ms
<R4>ping -c 1 10.0.34.3
PING 10.0.34.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.34.3: bytes=56 Sequence=1 ttl=255 time=50 ms
<R4>ping -c 1 10.0.45.5
PING 10.0.45.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.45.5: bytes=56 Sequence=1 ttl=255 time=30 ms
Configure R2, R3, and R4 use the IP addresses of Loopback0 as their router IDs, and
activate OSPF on the interconnection interfaces (excluding the interfaces connected to
external ASs) and Loopback0 interfaces.
# Configure R2, and activate OSPF on Loopback0 and GE0/0/2.
[R2-ospf-1-area-0.0.0.0] quit
[R2-ospf-1] quit
The command output shows that R3 has established neighbor relationships with R2 and
R4.
# Check the OSPF routing table on R3.
Total Nets: 5
Intra Area: 5 Inter Area: 0 ASE: 0 NSSA: 0
HCIP-Datacom-Core Technology Lab Guide Page 135
The command output shows that R3 has learned the Loopback0 routes from R2 and R4.
Establish IBGP peer relationships through loopback interfaces, and establish EBGP peer
relationships through interconnection interfaces.
# Configure R1.
[R1]bgp 100
[R1-bgp] router-id 10.0.1.1
[R1-bgp] peer 10.0.12.2 as 64512
# Configure R2.
[R2]bgp 64512
[R2-bgp] router-id 10.0.2.2
[R2-bgp] peer 10.0.3.3 as-number 64512
[R2-bgp] peer 10.0.3.3 connect-interface LoopBack0
[R2-bgp] peer 10.0.3.3 next-hop-local
[R2-bgp] peer 10.0.12.1 as-number 100
[R3]bgp 64512
[R3-bgp] router-id 10.0.3.3
[R3-bgp] peer 10.0.2.2 as-number 64512
[R3-bgp] peer 10.0.2.2 connect-interface LoopBack0
[R3-bgp] peer 10.0.4.4 as-number 64512
[R3-bgp] peer 10.0.4.4 connect-interface LoopBack0
# Configure R4.
[R4]bgp 64512
[R4-bgp] router-id 10.0.4.4
[R4-bgp] peer 10.0.3.3 as-number 64512
[R4-bgp] peer 10.0.3.3 connect-interface LoopBack0
[R4-bgp] peer 10.0.3.3 next-hop-local
[R4-bgp] peer 10.0.45.5 as-number 200
[R5]bgp 200
[R5-bgp] router-id 10.0.5.5
[R5-bgp] peer 10.0.45.4 as 64512
[R1]bgp 100
[R1-bgp] network 172.16.1.0 24
[R1-bgp] network 172.16.2.0 24
[R1-bgp] network 172.16.3.0 24
[R1-bgp] network 172.16.4.0 24
[R5]bgp 200
[R5-bgp] network 172.16.1.0 24
[R5-bgp] network 172.16.2.0 24
[R5-bgp] network 172.16.3.0 24
[R5-bgp] network 172.16.4.0 24
# Check the BGP routing table on R3 to check whether R3 has learned these BGP routes
successfully.
R3 has learned the routes advertised by R1 and R5, and preferentially selects the route
advertised by R2.
On R1, configure a route-policy to change the AS_Path attribute of the BGP route
172.16.1.0/24 so that R3 preferentially selects the BGP route 172.16.1.0/24 advertised by
R5.
# Create IP prefix list 1 to match the Loopback1 route.
# Create a route-policy named hcip, create node 10, configure an if-match clause with IP
prefix list 1 specified, and configure an apply clause to modify the AS_Path attribute of
the matched route.
[R1]bgp 100
[R1-bgp] peer 10.0.12.2 route-policy hcip export
R3 preferentially selects the BGP route 172.16.1.0/24 advertised by R4. This is because the
AS_Path length in the route advertised by R2 is longer than that of the route advertised
by R4.
On R4, configure a route-policy to change the Local_Pref attribute of the BGP route
172.16.2.0/24 so that R3 preferentially selects the BGP route 172.16.2.0/24 advertised by
R4.
# Create IP prefix list 1 to match the BGP route 172.16.2.0/24.
# Create a route-policy named hcip, create node 10, configure an if-match clause with IP
prefix list 1 specified, and configure an apply clause to modify the Local_Pref attribute of
the matched route.
[R4]bgp 64512
[R4-bgp] peer 10.0.3.3 route-policy hcip export
R3 preferentially selects the BGP route 172.16.2.0/24 advertised by R4. The Local_Pref
value of the BGP route advertised by R2 is 100, which is smaller than the Local_Pref value
200 of the BGP route advertised by R3. As a result, the BGP route advertised by R2 is not
preferentially selected.
On R2, configure a route-policy to change the MED attribute of the BGP route
172.16.3.0/24 so that R3 preferentially selects the BGP route 172.16.3.0/24 advertised by
R5.
# Create IP prefix list 1 to match the BGP route 172.16.3.0/24.
# Create a route-policy named hcip, create node 10, configure an if-match clause with IP
prefix list 1 specified, and configure an apply clause to modify the MED attribute of the
matched route.
[R2]bgp 64512
HCIP-Datacom-Core Technology Lab Guide Page 140
# Configure R3 to compare the MED values of the BGP routes received from peers in
different ASs.
[R3]bgp 64512
[R3-bgp] compare-different-as-med
By default, BGP does not compare the MED values of routes received from peers in
different ASs.
# Check detailed information about the BGP routes 172.16.3.0/24 on R3.
The MED value of the BGP route 172.16.3.0/24 advertised by R2 is 200, and that of the
BGP route advertised by R4 is 0. In this case, R3 preferentially selects the BGP route with
a smaller MED value. As a result, the BGP route advertised by R2 is not preferentially
selected.
On R3, configure a route-policy to change the PrefVal attribute of the BGP route
172.16.4.0/24 so that R3 preferentially selects the BGP route 172.16.4.0/24 advertised by
R4.
# Create IP prefix list 1 to match the BGP route 172.16.4.0/24.
HCIP-Datacom-Core Technology Lab Guide Page 141
# Create a route-policy named hcip, create node 10, configure an if-match clause with IP
prefix list 1 specified, and configure an apply clause to modify the PrefVal attribute of the
matched route.
[R3]bgp 64512
[R3-bgp] peer 10.0.4.4 route-policy hcip import
The PrefVal value of the BGP route 172.16.3.0/24 advertised by R4 is 300, and that of the
route advertised by R2 is 0. In this case, R3 preferentially selects the BGP route with a
larger PrefVal value. As a result, R3 preferentially selects the BGP route advertised by R4.
HCIP-Datacom-Core Technology Lab Guide Page 142
The command output show that all the routes advertised by R4 are preferentially
selected.
Step 8 (Optional) Verify that a locally originated BGP route takes precedence over a BGP route
learned from a peer.
Create Loopback1 on R2 and configure R2 to advertise the Loopback1 route to the OSPF
routing table. Then, configure R2 and R3 to advertise the Loopback1 route to their BGP
routing tables. In this case, the BGP routing table of R3 will contain two BGP routes to
Loopback1 on R2.
# Create Loopback1 on R2 and set its IP address to 10.2.2.2/32.
[R2]interface LoopBack1
[R2-LoopBack1] ip address 10.2.2.2 255.255.255.255
[R2-LoopBack1] quit
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0] quit
[R2-ospf-1] quit
Destination : 10.2.2.2/32
AdverRouter : 10.0.2.2 Area : 0.0.0.0
HCIP-Datacom-Core Technology Lab Guide Page 143
[R2]bgp 64512
[R2-bgp] network 10.2.2.2 32
[R3]bgp 64512
[R3-bgp] network 10.2.2.2 32
R3 preferentially selects the locally advertised BGP route 10.2.2.2/32. The BGP route
10.2.2.2/32 advertised by R1 is not preferentially selected because its route type is not
preferred. A locally originated route takes precedence over a route learned from a BGP
peer.
Create Loopback5 on R1 and R5, and configure the devices to advertise the Loopback5
routes to their BGP routing tables. Verify that the BGP route whose Origin attribute is IGP
takes precedence over the BGP route whose Origin attribute is Incomplete.
# Create Loopback5 on R1 and R5 and set its IP address to 172.16.5.1/24.
HCIP-Datacom-Core Technology Lab Guide Page 144
[R1]interface LoopBack 5
[R1-LoopBack5] ip address 172.16.5.1 24
[R1-LoopBack5] quit
[R5]interface LoopBack 5
[R5-LoopBack5] ip address 172.16.5.1 24
[R5-LoopBack5] quit
# Configure R1 and R5 to advertise Loopback5 routes to their BGP routing tables using
the network command.
[R1]bgp 100
[R1-bgp] network 172.16.5.0 24
[R5]bgp 200
[R5-bgp] network 172.16.5.0 24
R3 preferentially selects the BGP route 172.16.5.0/24 received from R2 (and originally
advertised by R1). In this case, the Origin attribute of the BGP routes advertised by R2
and R4 is IGP.
# Delete the Loopback5 route advertised by R1 to the BGP routing table.
[R1]bgp 100
[R1-bgp] undo network 172.16.5.0 24
# Create a route-policy named origin, create node 10, and configure an if-match clause
with IP prefix list 2 specified.
# Run the import-route direct command on R1 to advertise direct routes to the BGP
routing table, and specify route-policy origin to import only the Loopback5 route.
[R1]bgp 100
[R1-bgp] import-route direct route-policy origin
Step 10 (Optional) Verify that an EBGP route takes precedence over an IBGP route.
Create Loopback6 on R1 and R3, and configure the devices to advertise the Loopback6
routes to their BGP routing tables. Observe the route selection result on R2.
HCIP-Datacom-Core Technology Lab Guide Page 146
[R1]interface LoopBack 6
[R1-LoopBack6] ip address 172.16.6.1 24
[R1-LoopBack6] quit
[R3]interface LoopBack 6
[R3-LoopBack6] ip address 172.16.6.1 24
[R3-LoopBack6] quit
# Configure R1 and R3 to advertise their Loopback6 routes to the BGP routing tables.
[R1]bgp 100
[R1-bgp] network 172.16.6.0 24
[R3]bgp 64512
[R3-bgp]network 172.16.6.0 24
R2 preferentially selects the BGP route 172.16.6.0/24 advertised by R3 due to the AS_Path
value.
# On R3, configure a route-policy to add an AS_Path value to the BGP route
172.16.6.0/24.
[R3-route-policy] quit
[R3]route-policy as_path permit node 20
[R3]bgp 64512
[R3-bgp] peer 10.0.2.2 route-policy as_path export
The BGP route from R3 is not preferentially selected because BGP preferentially selects
the route from an EBGP peer when the other route attributes are the same.
Step 11 (Optional) Verify that BGP preferentially selects the route with the smallest IGP cost to
the next hop.
[R2]bgp 64512
[R2-bgp] peer 10.0.4.4 as-number 64512
[R2-bgp] peer 10.0.4.4 connect-interface LoopBack 0
[R4]bgp 64512
[R4-bgp] peer 10.0.2.2 as-number 64512
HCIP-Datacom-Core Technology Lab Guide Page 148
The command output shows that the IBGP peer relationship has been successfully
established.
# Create Loopback7 on R2 and R4, and configure the devices to advertise the Loopback7
routes to their BGP routing tables.
[R2]interface LoopBack 7
[R2-LoopBack7] ip address 172.16.7.1 24
[R2-LoopBack7] quit
[R2]bgp 64512
[R2-bgp] network 172.16.7.0 24
[R3]interface LoopBack 7
[R3-LoopBack7] ip address 172.16.7.1 24
[R3-LoopBack7] quit
[R3]bgp 64512
[R3-bgp] network 172.16.7.0 24
R4 preferentially selects the BGP route advertised by R3 because its IGP cost is 1, which is
lower than the IGP cost 2 of the BGP route advertised by R2.
The BGP route advertised by R2 is not preferentially selected due to the IGP cost.
----End
3.4.3 Quiz
Consider whether a routing policy can be used to delete an AS number from the AS_Path
attribute.
#
sysname R1
#
interface GigabitEthernet0/0/2
ip address 10.0.12.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
interface LoopBack1
ip address 172.16.1.1 255.255.255.0
#
interface LoopBack2
ip address 172.16.2.1 255.255.255.0
#
interface LoopBack3
ip address 172.16.3.1 255.255.255.0
#
interface LoopBack4
ip address 172.16.4.1 255.255.255.0
#
interface LoopBack5
ip address 172.16.5.1 255.255.255.0
#
interface LoopBack6
ip address 172.16.6.1 255.255.255.0
#
bgp 100
router-id 10.0.1.1
peer 10.0.12.2 as-number 64512
#
ipv4-family unicast
undo synchronization
HCIP-Datacom-Core Technology Lab Guide Page 150
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/2
ip address 10.0.23.2 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
interface LoopBack1
ip address 10.2.2.2 255.255.255.255
#
interface LoopBack7
ip address 172.16.7.1 255.255.255.0
#
bgp 64512
router-id 10.0.2.2
peer 10.0.3.3 as-number 64512
peer 10.0.3.3 connect-interface LoopBack0
peer 10.0.4.4 as-number 64512
peer 10.0.4.4 connect-interface LoopBack0
peer 10.0.12.1 as-number 100
#
ipv4-family unicast
undo synchronization
network 10.2.2.2 255.255.255.255
network 172.16.7.0 255.255.255.0
HCIP-Datacom-Core Technology Lab Guide Page 151
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/2
ip address 10.0.34.3 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.23.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
interface LoopBack6
ip address 172.16.6.1 255.255.255.0
#
interface LoopBack7
ip address 172.16.7.1 255.255.255.0
#
bgp 64512
router-id 10.0.3.3
peer 10.0.2.2 as-number 64512
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.4.4 as-number 64512
peer 10.0.4.4 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
compare-different-as-med
network 10.2.2.2 255.255.255.255
HCIP-Datacom-Core Technology Lab Guide Page 152
Configuration on R4
#
sysname R4
#
interface GigabitEthernet0/0/2
ip address 10.0.45.4 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.34.4 255.255.255.0
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
bgp 64512
router-id 10.0.4.4
peer 10.0.2.2 as-number 64512
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.3.3 as-number 64512
peer 10.0.3.3 connect-interface LoopBack0
peer 10.0.45.5 as-number 200
#
ipv4-family unicast
undo synchronization
peer 10.0.2.2 enable
HCIP-Datacom-Core Technology Lab Guide Page 153
Configuration on R5
#
sysname R5
#
interface GigabitEthernet0/0/3
ip address 10.0.45.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
#
interface LoopBack1
ip address 172.16.1.1 255.255.255.0
#
interface LoopBack2
ip address 172.16.2.1 255.255.255.0
#
interface LoopBack3
ip address 172.16.3.1 255.255.255.0
#
interface LoopBack4
ip address 172.16.4.1 255.255.255.0
#
interface LoopBack5
ip address 172.16.5.1 255.255.255.0
#
bgp 200
router-id 10.0.5.5
peer 10.0.45.4 as-number 64512
#
ipv4-family unicast
undo synchronization
network 172.16.1.0 255.255.255.0
HCIP-Datacom-Core Technology Lab Guide Page 154
The preceding figure shows the device interconnection mode and interconnection
addresses. Loopback0 is created for each device. The IP address of Loopback0 is
10.0.x.x/32, where x indicates a device ID. OSPF is configured on interconnection
interfaces and Loopback0 interfaces of R1, R2, and R3.
R3 and R4 belong to IS-IS area 49.0001 and both are Level-1 routers. The system IDs of
R3 and R4 are in the format of 0000.0000.000x, where x indicates a device ID.
On R1, there are three network segments of services A, B, and C (simulated using routes
destined for Loopback1, Loopback2, and Loopback3, respectively). On R1, direct routes
are imported to the OSPF routing table. Routers within an OSPF area, however, do not
need to import the route destined for the network segment of service C. Configure a
route-policy on R1 to filter direct routes to be imported.
R2 does not need the route destined for service A's network segment; R3 needs the
routes destined for network segments of services A and B. A filter-policy needs to be
configured on R2 to filter the routes to be accepted by OSPF.
HCIP-Datacom-Core Technology Lab Guide Page 156
Routers in the IS-IS domain need to access service A. Therefore, route re-distribution
needs to be performed on R3 to import OSPF routes to IS-IS. Routers in the IS-IS domain
do not need to access service B. Therefore, when direct routes are imported on R1, the
routes of the network segment of service B are marked with different route tags. When
re-distribution is performed on R3, the route destined for the network segment of service
B are filtered according to the route tags.
4.1.1.3 Background
The local enterprise network has two routing areas. One area runs OSPF, and the other
area runs IS-IS. The border router in the OSPF area is connected to some service network
segments of other enterprises. To allow the local enterprise network device to access
these service network segments of other enterprises, import routes destined for the
service network segments into the OSPF area. To enable devices in the IS-IS area to
access those service network segments, import OSPF external routes to the IS-IS routing
table. Different departments on the local enterprise network have different requirements
for service network segment access. Therefore, route-policies and filter-policies need to be
deployed to filter routes to be accepted and advertised.
4.1.2.2 Procedure
Step 1 Configure IP addresses for interconnection interfaces and loopback interfaces.
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[R1-GigabitEthernet0/0/2] quit
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
HCIP-Datacom-Core Technology Lab Guide Page 157
[R1-LoopBack0] quit
[R1]interface LoopBack1
[R1-LoopBack1] ip address 172.16.1.1 255.255.255.0
[R1-LoopBack1] quit
[R1]interface LoopBack2
[R1-LoopBack2] ip address 172.16.2.1 255.255.255.0
[R1-LoopBack2] quit
[R1]interface LoopBack3
[R1-LoopBack3] ip address 172.16.3.1 255.255.255.0
[R1-LoopBack3] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.23.2 255.255.255.0
[R2-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/3] quit
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.0.34.3 255.255.255.0
[R3-GigabitEthernet0/0/2] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] ip address 10.0.23.3 255.255.255.0
[R3-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.34.4 255.255.255.0
[R4-GigabitEthernet0/0/3] quit
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0] quit
<R2>ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=80 ms
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 80/80/80 ms
<R2>ping -c 1 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=20 ms
<R4>ping -c 1 10.0.34.3
PING 10.0.34.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.34.3: bytes=56 Sequence=1 ttl=255 time=50 ms
On R1, R2, and R3, use the IP address of Loopback0 as a router ID, and activate OSPF on
the interconnected interfaces and Loopback0 interfaces.
# Configure R1.
# Configure R2.
# Configure R3.
[R3]ospf 1 router-id 10.0.3.3
[R3-ospf-1] area 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0] network 10.0.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0] quit
HCIP-Datacom-Core Technology Lab Guide Page 159
[R3-ospf-1] quit
# Check brief information about OSPF neighbors on R2.
OSPF neighbor relationships have been established between R1 and R2, and between R2
and R3.
Configure IS-IS on R3 and R4. Set the area ID to 49.0001. Set a system ID in the format of
0000.0000.000x (x indicates a device ID). Configure R3 and R4 as Level-1 routers. Activate
IS-IS on the interconnected interfaces and R4's Loopback0 interface.
# Configure R3.
[R3]isis 1
[R3-isis-1] is-level level-1
[R3-isis-1] network-entity 49.0001.0000.0000.0003.00
[R3-isis-1] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] isis enable 1
[R3-GigabitEthernet0/0/2] quit
# Configure R4.
[R4]isis 1
[R4-isis-1] is-level level-1
[R4-isis-1] network-entity 49.0001.0000.0000.0004.00
[R4-isis-1] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] isis enable 1
[R4-GigabitEthernet0/0/3] quit
[R4]interface LoopBack 0
[R4-LoopBack0] isis enable 1
[R4-LoopBack0] quit
Total Peer(s): 1
HCIP-Datacom-Core Technology Lab Guide Page 160
On R1, import direct routes to the OSPF routing table, configure a route-policy to filter
out the routes destined for the network segment of service C, and add route flags 10 and
20 to the routes to the network segments of services A and B, respectively.
# Create IP prefix list 1 to match the route destined for Loopback1 (network segment of
service A).
# Create IP prefix list 2 to match the route destined for Loopback2 (network segment of
service B).
# Create a route-policy named hcip, create nodes 10 and 20, apply IP prefix lists 1 and 2
to the two nodes, respectively, and add route flags.
# Import direct routes to the OSPF routing table on R1 and apply the route-policy named
hcip.
[R1]ospf 1
[R1-ospf-1] import-route direct route-policy hcip
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 1333 48 8000000C 1
Router 10.0.4.4 10.0.4.4 1639 48 80000006 1
Router 10.0.2.2 10.0.2.2 777 60 8000000D 1
Router 10.0.12.1 10.0.12.1 1373 48 80000006 1
Router 10.0.1.1 10.0.1.1 24 48 80000008 1
Network 10.0.23.3 10.0.3.3 1643 32 80000001 0
Network 10.0.12.2 10.0.2.2 777 32 80000002 0
Network 10.0.34.4 10.0.4.4 1639 32 80000002 0
AS External Database
HCIP-Datacom-Core Technology Lab Guide Page 161
Routes to Loopback1 and Loopback2 have been imported to the OSPF routing table.
# Check the AS-external LSA 172.16.1.0 in the OSPF LSDB on R1.
Type : External
Ls id : 172.16.1.0
Adv rtr : 10.0.1.1
Ls age : 165
Len : 36
Options :E
seq# : 80000001
chksum : 0xa954
Netmask : 255.255.255.0
TOS 0 Metric : 1
Etype :2
Forwarding Address : 0.0.0.0
Tag : 10
Priority : Low
The external route destined for 172.16.1.0/24 has been tagged 10.
# Check AS-external LSA 172.16.2.0 in the OSPF LSDB on R1.
Type : External
Ls id : 172.16.2.0
Adv rtr : 10.0.1.1
Ls age : 355
Len : 36
Options :E
seq# : 80000001
chksum : 0x539f
Netmask : 255.255.255.0
TOS 0 Metric: 1
Etype :2
Forwarding Address : 0.0.0.0
Tag : 20
Priority : Low
The external route destined for 172.16.2.0/24 has been tagged 20.
HCIP-Datacom-Core Technology Lab Guide Page 162
Configure a filter-policy on R2 to filter OSPF routes to be accepted so that only the route
destined for network segment of service B can be accepted.
# Check the OSPF routing table before the filter-policy is configured.
# Check the OSPF routes in the IP routing table before the filter-policy is configured.
OSPF external routes destined for 172.16.1.0/24 and 172.16.2.0/24 are displayed in the
OSPF routing table and IP routing table.
# Configure a basic ACL.
[R2]ospf 1
[R2-ospf-1] filter-policy 2000 import
HCIP-Datacom-Core Technology Lab Guide Page 163
# Check the OSPF routes in the IP routing table after the filter-policy is configured.
The route destined for 172.16.2.0/24 does not exist in the IP routing table but exists in
the OSPF routing table. This proves that for OSPF, the filter-policy only restricts routes to
be added to the IP routing table, but does not affect the local LSDB and LSA transmission.
# Check the OSPF routes in the IP routing table on R3.
The OSPF external routes destined for 172.16.1.0/24 and 172.16.2.0/24 still exist in the IP
routing table of R3.
Import OSPF routes to the IS-IS routing table on R3. Use a route-policy to match route
flags and import only OSPF external route destined for network segment of service A.
# Create a route-policy named hcip.
# Import OSPF routes to the IS-IS routing table and apply the route-policy named hcip to
import only OSPF external routes of the network segment of service A.
[R3]isis 1
[R3-isis-1] import-route ospf 1 level-1 route-policy hcip
The Level-1 route redistribution table contains only a route destined for 172.16.1.0/24.
----End
HCIP-Datacom-Core Technology Lab Guide Page 165
4.1.3 Quiz
What are the differences when the filter-policy is used in distance-vector and link-state
routing protocols?
#
sysname R1
#
interface GigabitEthernet0/0/2
ip address 10.0.12.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
interface LoopBack1
ip address 172.16.1.1 255.255.255.0
#
interface LoopBack2
ip address 172.16.2.1 255.255.255.0
#
interface LoopBack3
ip address 172.16.3.1 255.255.255.0
#
ospf 1 router-id 10.0.1.1
import-route direct route-policy hcip
area 0.0.0.0
network 10.0.1.1 0.0.0.0
network 10.0.12.1 0.0.0.0
#
route-policy hcip permit node 10
if-match ip-prefix 1
apply tag 10
#
route-policy hcip permit node 20
if-match ip-prefix 2
apply tag 20
#
ip ip-prefix 1 index 10 permit 172.16.1.0 24 greater-equal 24 less-equal 24
ip ip-prefix 2 index 10 permit 172.16.2.0 24 greater-equal 24 less-equal 24
#
return
Configuration on R2
#
sysname R2
#
acl number 2000
rule 5 deny source 172.16.1.0 0.0.0.255
rule 10 permit
#
HCIP-Datacom-Core Technology Lab Guide Page 166
interface GigabitEthernet0/0/2
ip address 10.0.23.2 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
ospf 1 router-id 10.0.2.2
filter-policy 2000 import
area 0.0.0.0
network 10.0.2.2 0.0.0.0
network 10.0.23.2 0.0.0.0
network 10.0.12.2 0.0.0.0
#
return
Configuration on R3
#
sysname R3
#
isis 1
is-level level-1
network-entity 49.0001.0000.0000.0003.00
import-route ospf 1 level-1 route-policy hcip
#
interface GigabitEthernet0/0/2
ip address 10.0.34.3 255.255.255.0
isis enable 1
#
interface GigabitEthernet0/0/3
ip address 10.0.23.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.23.3 0.0.0.0
#
route-policy hcip permit node 10
if-match tag 10
#
return
Configuration on R4
#
sysname R4
#
isis 1
is-level level-1
HCIP-Datacom-Core Technology Lab Guide Page 167
network-entity 49.0001.0000.0000.0004.00
#
interface GigabitEthernet0/0/3
ip address 10.0.34.4 255.255.255.0
isis enable 1
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
isis enable 1
#
return
HCIP-Datacom-Core Technology Lab Guide Page 168
The preceding figure shows connections between switches. Configure RSTP and MSTP to
break Layer 2 loops, and manually specify the primary root bridge and secondary root
bridge.
5.1.1.3 Background
You are a network administrator of a company. The enterprise network uses a backup
network. To prevent loops, RSTP is deployed. All VLANs share the same STP spanning
tree. To load balancing data traffic between VLANs, MSTP needs to be deployed on the
network.
HCIP-Datacom-Core Technology Lab Guide Page 169
5.1.2.2 Procedure
Step 1 Perform basic RSTP configurations.
Enable STP on S1, S2, S3, and S4, and switch the STP mode to RSTP.
# Name the devices.
The configuration details are not provided.
# Disable the interfaces that are not used in this experiment.
The configuration details are not provided.
# Configure S1.
[S1]stp enable
[S1]stp mode rstp
# Configure S2.
[S2]stp enable
[S2]stp mode rstp
# Configure S3.
[S3]stp enable
[S3]stp mode rstp
# Configure S4.
[S4]stp enable
[S4]stp mode rstp
All ports on S1 are designated ports, and S1 is the root bridge. In practice, the actual test
result may be different from the preceding result because the MAC address of a switch is
uncertain.
# Check the STP status and statistics on S1. The following information is displayed:
<S1>display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :32768.4c1f-cc1d-61a8
Config Times :Hello 2s MaxAge 20s FwDly15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly15s MaxHop 20
CIST Root/ERPC :32768.4c1f-cc1d-61a8 / 0
CIST RegRoot/IRPC :32768.4c1f-cc1d-61a8 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :15
TC count per hello :0
STP Converge Mode :Normal
Time sincelast TC :0 days 0h:11m:14s
Numberof TC :17
Last TC occurred :GigabitEthernet0/0/13
Configure S1 as the primary root bridge and S2 as the secondary root bridge.
# Manually adjust the STP priority and specify S1 as the primary root bridge and S2 as
the secondary root bridge.
When the other two switches retain the default bridge priority (32768), S1 has the lowest
bridge priority, followed by S2.
# Check the STP status and statistics on S1. The following information is displayed:
[S1]display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :4096 .4c1f-cc1d-61a8
Config Times :Hello 2s MaxAge 20s FwDly15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly15s MaxHop 20
CIST Root/ERPC :4096 .4c1f-cc1d-61a8 / 0
CIST RegRoot/IRPC :4096 .4c1f-cc1d-61a8 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
TC or TCN received :75
TC count per hello :0
STP Converge Mode :Normal
Time sincelast TC :0 days 0h:1m:16s
Numberof TC :45
Last TC occurred :GigabitEthernet0/0/10
# Check the STP status and statistics on S1 and S2. The following information is
displayed:
[S1]display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :0 .4c1f-cc1d-61a8
Config Times :Hello 2s MaxAge 20s FwDly15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly15s MaxHop 20
CIST Root/ERPC :0 .4c1f-cc1d-61a8 / 0
CIST RegRoot/IRPC :0 .4c1f-cc1d-61a8 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
CIST Root Type :Primary root
TC or TCN received :85
TC count per hello :0
STP Converge Mode :Normal
Time sincelast TC :0 days 0h:0m:9s
Numberof TC :51
Last TC occurred :GigabitEthernet0/0/10
[S2]display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :4096 .4c1f-cc69-5bf7
Config Times :Hello 2s MaxAge 20s FwDly15s MaxHop 20
HCIP-Datacom-Core Technology Lab Guide Page 172
The bridge priority of S1 is 0 and that of S2 is 4096. S1 is the primary root bridge and S2
is the secondary root bridge.
GE0/0/2 on S4 has a smaller root path cost (RPC) and becomes the root port.
# Check the STP status and statistics on GE0/0/2 of S4.
In this case, the RPC calculation method is dot1t, and the STP cost of the interface is
20000.
# Change the STP cost of GE0/0/2 on S4 to 40001.
The RPC of GE0/0/1 is 40000, smaller than RPC 40001 of GE0/0/2. GE0/0/1 of S4
becomes the root port.
The BPDUs received on GE0/0/10 and GE0/0/11 of S2 have the same RPC, bridge ID, and
interface priority. Therefore, S2 compares interface numbers in the received BPDU
interface IDs.
# Enable LLDP on S1 and S2 and check interface connections.
[S1]lldp enable
[S2]lldp enable
The peer end of S2's GE0/0/10 is S1's GE0/0/10, and the peer end of S2's GE0/0/11 is S1's
GE0/0/11. The BPDU received by GE0/0/10 on S2 has a smaller interface number, which is
why GE0/0/10 becomes the root port.
# Change the STP priority of S1's GE0/0/11 so that the priority of BPDUs sent by
GE0/0/11 becomes higher than that of BPDUs sent by GE0/0/10.
The priority value of the STP interface is 128. The smaller the value, the higher the
priority.
# Check the STP status and statistics on S2 again.
Create VLANs 10, 20, 30, 40, 50, 60, 70 and 80 on all switches. Configure an MSTP
domain named hcip. Create two instances named Instance 1 and Instance 2. Map
VLANs 10, 30, 50, and 70 to Instance 1. Map VLANs 20, 40, 60, and 80 to Instance 2. In
addition, SW1 is configured as the primary root bridge of MSTI1 and the secondary root
bridge of MSTI2, and SW2 is configured as the primary root bridge of MSTI2 and the
secondary root bridge of MSTI1.
# Create VLANs.
[S1]vlan batch 10 20 30 40 50 60 70 80
[S2]vlan batch 10 20 30 40 50 60 70 80
[S3]vlan batch 10 20 30 40 50 60 70 80
[S4]vlan batch 10 20 30 40 50 60 70 80
# Configure all interconnection interfaces as trunk interfaces and allow packets from all
VLANs to pass.
The configuration details are not provided.
# Change the STP mode to MSTP.
# Configure MSTP.
[S1]stp region-configuration
[S1-mst-region] region-name hcip
[S1-mst-region] revision-level 1
[S1-mst-region] instance 1 vlan 10 30 50 70
[S1-mst-region] instance 2 vlan 20 40 60 80
[S1-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-mst-region] quit
[S2]stp region-configuration
[S2-mst-region] region-name hcip
[S2-mst-region] revision-level 1
[S2-mst-region] instance 1 vlan 10 30 50 70
[S2-mst-region] instance 2 vlan 20 40 60 80
[S2-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-mst-region] quit
[S3]stp region-configuration
[S3-mst-region] region-name hcip
[S3-mst-region] revision-level 1
[S3-mst-region] instance 1 vlan 10 30 50 70
[S3-mst-region] instance 2 vlan 20 40 60 80
[S3-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3-mst-region] quit
[S4]stp region-configuration
[S4-mst-region] region-name hcip
[S4-mst-region] revision-level 1
[S4-mst-region] instance 1 vlan 10 30 50 70
[S4-mst-region] instance 2 vlan 20 40 60 80
[S4-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4-mst-region] quit
# Configure SW1 as the root bridge of MSTI1 and the secondary root bridge of MSTI2.
HCIP-Datacom-Core Technology Lab Guide Page 176
# Configure SW2 as the primary root bridge of MSTI2 and the secondary root bridge of
MSTI1.
All ports on S1 are designated ports, and S1 is the root bridge of MSTI1.
# Check the status and statistics of MSTI2 on S2.
All ports on S2 are designated ports, and S2 is the root bridge of MSTI2.
----End
5.1.3 Quiz
Compared with STP, which improvements are made in RTSP?
sysname S1
#
vlan batch 10 20 30 40 50 60 70 80
#
lldp enable
#
stp instance 0 root primary
stp instance 1 root primary
stp instance 2 root secondary
#
stp region-configuration
region-name hcip
revision-level 1
instance 1 vlan 10 30 50 70
HCIP-Datacom-Core Technology Lab Guide Page 177
instance 2 vlan 20 40 60 80
active region-configuration
#
interface GigabitEthernet0/0/10
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/11
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
stp instance 0 port priority 64
#
interface GigabitEthernet0/0/12
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/13
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
return
Configuration on S2
sysname S2
#
vlan batch 10 20 30 40 50 60 70 80
#
lldp enable
#
stp instance 0 root secondary
stp instance 1 root secondary
stp instance 2 root primary
#
stp region-configuration
region-name hcip
revision-level 1
instance 1 vlan 10 30 50 70
instance 2 vlan 20 40 60 80
active region-configuration
#
interface GigabitEthernet0/0/10
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/11
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
stp instance 0 port priority 64
#
interface GigabitEthernet0/0/12
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/13
HCIP-Datacom-Core Technology Lab Guide Page 178
Configuration on S3
#
sysname S3
#
vlan batch 10 20 30 40 50 60 70 80
#
lldp enable
#
stp region-configuration
region-name hcip
revision-level 1
instance 1 vlan 10 30 50 70
instance 2 vlan 20 40 60 80
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
return
Configuration on S4
#
sysname S4
#
vlan batch 10 20 30 40 50 60 70 80
#
lldp enable
#
stp region-configuration
region-name hcip
revision-level 1
instance 1 vlan 10 30 50 70
instance 2 vlan 20 40 60 80
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
HCIP-Datacom-Core Technology Lab Guide Page 179
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
stp instance 0 cost 40001
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
return
HCIP-Datacom-Core Technology Lab Guide Page 180
6 Multicast
In the preceding figure, OSPF runs on four routers. Loopback0 is created on each router.
The IP address of Loopback0 is 10.0.x.x/32, where x is the device number.
The four routers form a multicast network. R1 is the first-hop router and is connected to
multicast source 239.0.0.12. R4 is the last-hop router and is connected to receivers of
multicast group 239.0.0.12. To ensure that the traffic from the multicast source can be
received by multicast group members connected to R4, deploy PIM-DM on each router
and activate IGMPv2 on GE0/0/5 of R4.
HCIP-Datacom-Core Technology Lab Guide Page 181
6.1.1.3 Background
You are a network administrator of a company. Multicast needs to be configured to
forward some services. The network size is small, so you can configure PIM-DM to
implement multicast route learning. To improve network efficiency and security, you can
manually control the election result of the PIM-DM Assert mechanism. To optimize
multicast traffic forwarding on the switch connected to multicast receivers, you can
enable IGMP snooping on the switch.
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0] quit
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[R1-GigabitEthernet0/0/2] quit
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] ip address 10.0.13.1 255.255.255.0
[R1-GigabitEthernet0/0/1] quit
# Configure R2.
HCIP-Datacom-Core Technology Lab Guide Page 182
[R2]interface GigabitEthernet0/0/4
[R2-GigabitEthernet0/0/4] ip address 10.0.234.2 255.255.255.0
[R2-GigabitEthernet0/0/4] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/3] quit
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
# Configure R3.
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] ip address 10.0.13.3 24
[R3-GigabitEthernet0/0/1] quit
[R3]interface GigabitEthernet0/0/4
[R3-GigabitEthernet0/0/4] ip address 10.0.234.3 255.255.255.0
[R3-GigabitEthernet0/0/4] quit
[R3]interface LoopBack 0
[R3-LoopBack0] ip address 10.0.3.3 32
[R3-LoopBack0] quit
# Configure R4.
[R4]interface GigabitEthernet0/0/4
[R4-GigabitEthernet0/0/4] ip address 10.0.234.4 255.255.255.0
[R4-GigabitEthernet0/0/4] quit
[R4]interface GigabitEthernet0/0/5
[R4-GigabitEthernet0/0/5] ip address 192.168.1.1 255.255.255.0
[R4-GigabitEthernet0/0/5] quit
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0] quit
<R1>ping -c 1 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=50 ms
<R1>ping -c 1 10.0.13.3
PING 10.0.13.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=50 ms
<R4>ping -c 1 10.0.234.2
PING 10.0.234.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.234.2: bytes=56 Sequence=1 ttl=255 time=70 ms
<R4>ping -c 1 10.0.234.3
PING 10.0.234.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.234.3: bytes=56 Sequence=1 ttl=255 time=80 ms
Use the IP address of the Loopback0 interface as the router ID of each router and
activate OSPF on the interconnection interfaces and each Loopback0 interface.
# Configure R1.
# Configure R2.
# Configure R3.
# Configure R4.
Total Nets: 9
Intra Area: 9 Inter Area: 0 ASE: 0 NSSA: 0
HCIP-Datacom-Core Technology Lab Guide Page 185
Enable multicast routing on all routers and enable PIM-DM on involved interfaces.
# Enable multicast routing.
[R1]multicast routing-enable
[R2]multicast routing-enable
[R3]multicast routing-enable
[R4]multicast routing-enable
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] pim dm
[R1-GigabitEthernet0/0/1] quit
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] pim dm
[R1-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/4
[R2-GigabitEthernet0/0/4] pim dm
[R2-GigabitEthernet0/0/4] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] pim dm
[R2-GigabitEthernet0/0/3] quit
[R3]interface GigabitEthernet0/0/4
[R3-GigabitEthernet0/0/4] pim dm
[R3-GigabitEthernet0/0/4] quit
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] pim dm
[R3-GigabitEthernet0/0/1] quit
[R4]interface GigabitEthernet0/0/4
[R4-GigabitEthernet0/0/4] pim dm
[R4-GigabitEthernet0/0/4] quit
[R4]interface GigabitEthernet0/0/5
[R4-GigabitEthernet0/0/5] pim dm
[R4-GigabitEthernet0/0/5] quit
PIM neighbor relationships have been established between R1 and R2, between R1 and
R3, between R4 and R2, and between R4 and R3.
# Enable IGMP on GE0/0/5 of R4 and configure GE0/0/5 to join the multicast group in
static mode.
[R4]interface GigabitEthernet0/0/5
[R4-GigabitEthernet0/0/5] igmp enable
[R4-GigabitEthernet0/0/5] igmp static-group 239.0.0.12
The default IGMP version (IGMPv2) is used, and R4 is the IGMP querier.
On R1, use the address of Loopback0 as the source address to send ICMP packets to
239.0.0.12 to simulate traffic of the multicast source. Then, check the PIM routing table
on each router.
# Use R1 to send packets to simulate traffic of the multicast source.
After this command is run, R1 does not send multicast traffic, but it triggers PIM-DM
State-Refresh messages.
# Query the content of the PIM-DM State-Refresh messages.
Frame 45: 70 bytes on wire (560 bits), 70 bytes captured (560 bits) on interface 0
Ethernet II, Src: HuaweiTe_0c:16:0a (54:89:98:0c:16:0a), Dst: IPv4mcast_0d (01:00:5e:00:00:0d)
Internet Protocol Version 4, Src: 10.0.12.1, Dst: 224.0.0.13
Protocol Independent Multicast
0010 .... = Version: 2
.... 1001 = Type: State-Refresh (9)
Reserved byte(s): 00
Checksum: 0x8295 [correct]
[Checksum Status: Good]
PIM Options
Group: 239.0.0.12/32
Source: 10.0.1.1
Originator: 10.0.12.1
0... .... = RP Tree: False
.000 0000 0000 0000 0000 0000 0000 0000 = Metric Preference: 0
Metric: 0
Masklen: 32
TTL: 255
0... .... = Prune indicator: Not set
.0.. .... = Prune now: Not set
..1. .... = Assert override: Set
Interval: 60
The State-Refresh messages carry the multicast source address (10.0.1.1) and multicast
group address (239.0.0.12). After receiving the messages, the downstream device creates
an (S, G) entry and forwards the State-Refresh messages downstream.
# Check statistics about the State-Refresh messages sent by R1.
If the value of Sent is not 0, check the (S, G) entry on the downstream device. If the
value of Sent is 0, you will find no (S, G) entry on the downstream device.
PIM-SM does not have State-Refresh messages. Therefore, this method cannot be used in
PIM-SM scenarios.
# Check the PIM routing tables of the four routers.
(10.0.1.1, 239.0.0.12)
Protocol : pim-dm, Flag: LOC ACT
UpTime : 00:04:19
Upstream interface : LoopBack0
HCIP-Datacom-Core Technology Lab Guide Page 188
On R1, the inbound interface of the (S, G) entry is Loopback0. Because the multicast
source is directly connected to R1, PRF prime neighbor is Null. The downstream
interface is GE0/0/1, and R1 forwards the multicast traffic to R3.
(10.0.1.1, 239.0.0.12)
Protocol : pim-dm, Flag:
UpTime : 00:01:25
Upstream interface : GigabitEthernet0/0/3
Upstream neighbor: 10.0.12.1
RPF prime neighbor: 10.0.12.1
Downstream interface(s) information: None
On R2, the (S, G) entry does not have any downstream interface.
(10.0.1.1, 239.0.0.12)
Protocol : pim-dm, Flag:
UpTime : 00:02:55
Upstream interface : GigabitEthernet0/0/1
Upstream neighbor: 10.0.13.1
RPF prime neighbor: 10.0.13.1
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/4
Protocol: pim-dm, UpTime: 00:02:55, Expires: never
(*, 239.0.0.12)
Protocol : pim-dm, Flag: WC
UpTime : 00:05:41
Upstream interface : NULL
Upstream neighbor: NULL
RPF prime neighbor: NULL
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/5
Protocol: static, UpTime: 00:05:41, Expires: never
(10.0.1.1, 239.0.0.12)
Protocol : pim-dm, Flag:
UpTime : 00:01:52
Upstream interface : GigabitEthernet0/0/4
Upstream neighbor: 10.0.234.2
RPF prime neighbor: 10.0.234.2
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/5
Protocol: pim-dm, UpTime: 00:01:52, Expires: -
Step 5 Change the IGP cost to control the Assert election result.
Change the OSPF cost of GE0/0/1 on R3 so that the unicast route from R3 to the
multicast source address has a higher cost. Consequently, R2 wins the Assert election and
becomes the Assert winner.
# On R2 and R3, check the cost of the route to the multicast source address 10.0.1.1.
[R3]interface GigabitEthernet0/0/1
HCIP-Datacom-Core Technology Lab Guide Page 190
# On R3, check the cost of the route to the multicast source address 10.0.1.1.
[R2]interface GigabitEthernet0/0/4
[R2-GigabitEthernet0/0/4] pim holdtime assert 10
[R3]interface GigabitEthernet0/0/4
[R3-GigabitEthernet0/0/4] pim holdtime assert 10
# Run the debugging pim join-prune receive command on R1 and then observe the
prune process.
<R1>terminal debugging
<R1>terminal monitor
<R1>debugging pim join-prune receive
(10.0.1.1, 239.0.0.12)
Protocol : pim-dm, Flag:
UpTime : 00:00:01
Upstream interface : GigabitEthernet0/0/3
Upstream neighbor: 10.0.12.1
RPF prime neighbor: 10.0.12.1
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/4
Protocol: pim-dm, UpTime: 00:00:01, Expires: never
(10.0.1.1, 239.0.0.12)
Protocol : pim-dm, Flag:
UpTime : 00:00:08
Upstream interface : GigabitEthernet0/01
Upstream neighbor: 10.0.234.2
RPF prime neighbor: 10.0.234.2
Downstream interface(s) information: None
In this case, R3 does not have a downstream interface, and R2 becomes the Assert
winner.
# Check the debugging information on R1.
Jul 2 2020 09:49:03.520.1-08:00 R1 PIM/7/JP:(public net): PIM ver 2 JP receiving 10.0.13.3 -> 224.0.0.13 on
GigabitEthernet0/0/1 (P012998)
Jul 2 2020 09:49:03.520.2-08:00 R1 PIM/7/JP:(public net): Upstream 10.0.13.1, Groups 1, Holdtime 180 (P013002)
Jul 2 2020 09:49:03.520.3-08:00 R1 PIM/7/JP:(public net): Group: 239.0.0.12/32 --- 0 join 1 prune (P013011)
Jul 2 2020 09:49:03.520.4-08:00 R1 PIM/7/JP:(public net): Prune: 10.0.1.1/32 (P013021)
Jul 2 2020 09:49:05.790.1-08:00 R1 PIM/7/JP:(public net): PIM ver 2 JP receiving 10.0.12.2 -> 224.0.0.13 on
GigabitEthernet0/0/2 (P012933)
Jul 2 2020 09:49:05.790.2-08:00 R1 PIM/7/JP:(public net): Upstream 10.0.12.1, Groups 1, Holdtime 0 (P012939)
Jul 2 2020 09:49:05.790.3-08:00 R1 PIM/7/JP:(public net): Group: 239.0.0.12/32 --- 1 join 0 prune (P012949)
Jul 2 2020 09:49:05.790.4-08:00 R1 PIM/7/JP:(public net): Join: 10.0.1.1/32 (P012959)
The debugging information shows that R1 received a Prune message from R3 with the
group address being 239.0.0.12 and the multicast source address being 10.0.1.1.
[S2]igmp-snooping enable
[S2]vlan 1
[S2-vlan1] igmp-snooping enable
[S2-vlan1] quit
[S2]interface GigabitEthernet0/0/4
[S2-GigabitEthernet0/0/4] igmp-snooping static-router-port vlan 1
[S2]interface GigabitEthernet0/0/10
[S2-GigabitEthernet0/0/10] l2-multicast static-group group-address 239.0.0.12 vlan 1
[S2-GigabitEthernet0/0/10] quit
GE0/0/4 is a static router port, and GE0/0/10 is a static member port. The static member
port must be connected to a device and is up.
----End
6.1.3 Quiz
What are the disadvantages of configuring PIM-DM on a large-sized network?
#
sysname R1
#
multicast routing-enable
#
interface GigabitEthernet0/0/1
ip address 10.0.13.1 255.255.255.0
pim dm
#
interface GigabitEthernet0/0/2
ip address 10.0.12.1 255.255.255.0
pim dm
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
ospf 1 router-id 10.0.1.1
area 0.0.0.0
network 10.0.1.1 0.0.0.0
network 10.0.12.1 0.0.0.0
network 10.0.13.1 0.0.0.0
#
return
Configuration on R2
#
sysname R2
#
multicast routing-enable
#
HCIP-Datacom-Core Technology Lab Guide Page 193
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
pim dm
#
interface GigabitEthernet0/0/4
ip address 10.0.234.2 255.255.255.0
pim holdtime assert 10
pim dm
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.0.2.2 0.0.0.0
network 10.0.12.2 0.0.0.0
network 10.0.234.2 0.0.0.0
#
return
Configuration on R3
#
sysname R3
#
multicast routing-enable
#
interface GigabitEthernet0/0/1
ip address 10.0.13.3 255.255.255.0
pim dm
ospf cost 2
#
interface GigabitEthernet0/0/4
ip address 10.0.234.3 255.255.255.0
pim holdtime assert 10
pim dm
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.13.3 0.0.0.0
network 10.0.234.3 0.0.0.0
#
return
Configuration on R4
#
sysname R4
#
multicast routing-enable
#
HCIP-Datacom-Core Technology Lab Guide Page 194
interface GigabitEthernet0/0/4
ip address 10.0.234.4 255.255.255.0
pim dm
#
interface GigabitEthernet0/0/5
ip address 192.168.1.1 255.255.255.0
igmp enable
igmp static-group 239.0.0.12
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
ospf 1 router-id 10.0.4.4
area 0.0.0.0
network 10.0.234.4 0.0.0.0
network 10.0.4.4 0.0.0.0
network 192.168.1.1 0.0.0.0
#
return
Configuration on S2
#
sysname S2
#
igmp-snooping enable
#
vlan 1
igmp-snooping enable
#
interface GigabitEthernet0/0/4
igmp-snooping static-router-port vlan 1
#
interface GigabitEthernet0/0/10
l2-multicast static-group group-address 239.0.0.12 vlan 1
OSPF runs on four routers. Loopback0 is created on each router. The IP address of
Loopback0 is 10.0.x.x/32, where x is the device number. Use R1 to simulate the source of
multicast group 239.0.0.12, and use GE0/0/0 on R4 to simulate a receiver of multicast
group 239.0.0.12.
R3 is planned as the RP of the network and is elected as the RP through the BSR mode.
6.2.1.3 Background
You are a network administrator of a company. PIM-DM has been configured on the
company's network. However, when more and more multicast users are dispersed on the
network, multicast service quality degrades. To improve multicast reliability and
efficiency, you can configure PIM-SM.
In the PIM-SM mode, an RP is required and is used as the root of RPTs.
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[R1-GigabitEthernet0/0/2] quit
[R1]interface LoopBack0
[R1-LoopBack0] ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0] quit
# Configure R2.
[R2]interface LoopBack0
[R2-LoopBack0] ip address 10.0.2.2 255.255.255.255
[R2-LoopBack0] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ip address 10.0.24.2 255.255.255.0
[R2-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.0.23.2 255.255.255.0
[R2-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/3] quit
# Configure R3.
[R3]interface LoopBack0
[R3-LoopBack0] ip address 10.0.3.3 255.255.255.255
[R3-LoopBack0] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.0.34.3 255.255.255.0
[R3-GigabitEthernet0/0/2] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] ip address 10.0.23.3 255.255.255.0
[R3-GigabitEthernet0/0/3] quit
# Configure R4.
[R4]interface LoopBack0
[R4-LoopBack0] ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0]quit
HCIP-Datacom-Core Technology Lab Guide Page 197
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1] ip address 10.0.24.4 255.255.255.0
[R4-GigabitEthernet0/0/1]quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] ip address 10.0.34.4 255.255.255.0
[R4-GigabitEthernet0/0/3]quit
<R2>ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=40 ms
<R2>ping -c 1 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=10 ms
<R2>ping -c 1 10.0.24.4
PING 10.0.24.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.24.4: bytes=56 Sequence=1 ttl=255 time=80 ms
<R3>ping -c 1 10.0.34.4
PING 10.0.34.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.34.4: bytes=56 Sequence=1 ttl=255 time=10 ms
Configure R1, R2, R3, and R4 to use their Loopback0 IP addresses as their router ID, and
activate OSPF on the interconnected interfaces and Loopback0 interfaces of each device.
# Configure R1.
HCIP-Datacom-Core Technology Lab Guide Page 198
# Configure R2.
# Configure R3.
# Configure R4.
The preceding command outputs show that OSPF neighbor relationships have been
established.
HCIP-Datacom-Core Technology Lab Guide Page 199
Total Nets: 9
Intra Area: 9 Inter Area: 0 ASE: 0 NSSA: 0
The preceding command output shows that R4 has learned the routes on the entire
network.
Enable multicast routing on all routers and enable PIM-SM on involved interfaces.
# Enable multicast routing.
[R1]multicast routing-enable
[R2]multicast routing-enable
[R3]multicast routing-enable
[R4]multicast routing-enable
[R1]interface LoopBack 0
[R1-LoopBack0] pim sm
[R1-LoopBack0] quit
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2] pim sm
[R1-GigabitEthernet0/0/2] quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] pim sm
[R2-GigabitEthernet0/0/1] quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] pim sm
[R2-GigabitEthernet0/0/2] quit
HCIP-Datacom-Core Technology Lab Guide Page 200
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3] pim sm
[R2-GigabitEthernet0/0/3] quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] pim sm
[R3-GigabitEthernet0/0/2] quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3] pim sm
[R3-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1] pim sm
[R4-GigabitEthernet0/0/1] quit
[R4]interface GigabitEthernet0/0/3
[R4-GigabitEthernet0/0/3] pim sm
[R4-GigabitEthernet0/0/3] quit
[R4]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0] pim sm
[R4-GigabitEthernet0/0/0] quit
Adjust the C-BSR priority of R2 to enable R2 to become the BSR, and configure R3 as a C-
RP.
# Adjust the C-BSR priority of R2 to enable Loopback0 of R2 to become the BSR.
[R2]interface LoopBack0
[R2-LoopBack0] pim sm
[R2-LoopBack0] quit
HCIP-Datacom-Core Technology Lab Guide Page 201
[R2]pim
[R2-pim] c-bsr priority 100
[R2-pim] c-bsr LoopBack0
[R2-pim] quit
[R3]interface LoopBack 0
[R3-LoopBack0] pim sm
[R3-LoopBack0] quit
[R3]acl 2000
[R3-acl-basic-2000] rule 1 permit source 239.0.0.12 0.0.0.0
[R3-acl-basic-2000] quit
[R3]pim
[R3-pim] c-rp LoopBack 0 group-policy 2000 priority 100
[R3-pim] quit
There is only one C-BSR and one C-RP. Therefore, R2 and R3 function as the BSR and RP,
respectively. The IP address of the RP corresponding to the multicast group 239.0.0.12 is
10.0.3.3.
On R4, use GE0/0/0 to simulate a receiver of multicast group 239.0.0.12 and check the
PIM routing tables of R3 and R4. Change the RPT-to-SPT switchover threshold and trigger
multicast traffic forwarding again. Then, check the PIM routing table again.
# Enable IGMP on GE0/0/0 of R4 and configure GE0/0/0 to join the multicast group in
static mode.
[R4]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0] ip address 192.168.1.1 24
[R4-GigabitEthernet0/0/0] igmp enable
[R4-GigabitEthernet0/0/0] igmp static-group 239.0.0.12
Note that the interface must be configured with an IP address and be up.
# Check the PIM routing table of R4.
(*, 239.0.0.12)
RP : 10.0.3.3
Protocol : pim-sm, Flag: WC EXT
UpTime : 00:01:18
Upstream interface : GigabitEthernet0/0/3
Upstream neighbor: 10.0.34.3
RPF prime neighbor: 10.0.34.3
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/0
Protocol: static, UpTime: 00:01:29, Expires: -
(*, 239.0.0.12)
RP : 10.0.3.3 (local)
Protocol : pim-sm, Flag: WC
UpTime : 00:08:05
Upstream interface : Register
Upstream neighbor: NULL
RPF prime neighbor: NULL
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/2
Protocol: pim-sm, UpTime: 00:08:05, Expires: 00:03:25
HCIP-Datacom-Core Technology Lab Guide Page 203
R3 is the RP and does not need to send the Join message upstream. Currently, no
multicast source has registered with the RP. Therefore, the upstream interface is still null.
# Run the ping multicast command on R1 to simulate the multicast source of the
multicast group 239.0.0.12 and send multicast data.
# After the network becomes stable, check the PIM routing table of R4.
(*, 239.0.0.12)
RP : 10.0.3.3
Protocol : pim-sm, Flag: WC EXT
UpTime : 00:03:38
Upstream interface : GigabitEthernet0/0/3
Upstream neighbor: 10.0.34.3
RPF prime neighbor: 10.0.34.3
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/0
Protocol: static, UpTime: 00:02:27, Expires: -
(10.0.1.1, 239.0.0.12)
RP: 10.0.3.3
Protocol : pim-sm, Flag: SPT ACT
UpTime : 00:00:05
Upstream interface : GigabitEthernet0/0/1
Upstream neighbor: 10.0.24.2
RPF prime neighbor: 10.0.24.2
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/0
Protocol: pim-sm, UpTime: 00:00:03, Expires: -
On R4, the entry with the Flag being SPT ACT is an (S, G) entry, indicating that the (S, G)
entry is used to guide multicast packet forwarding. In addition, the upstream interface is
GE0/0/1 that is connected to R2, rather than GE0/0/3 that is connected to R3. In this case,
the RPT-to-SPT switchover has been performed.
# Change the RPT-to-SPT switchover threshold on R4.
[R4]pim
[R4-pim] spt-switch-threshold infinity
(*, 239.0.0.12)
RP : 10.0.3.3
Protocol : pim-sm, Flag: WC
UpTime : 00:13:27
Upstream interface : GigabitEthernet0/0/3
Upstream neighbor: 10.0.34.3
RPF prime neighbor: 10.0.34.3
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/0
Protocol: static, UpTime: 00:13:27, Expires: -
(10.0.1.1, 239.0.0.12)
RP : 10.0.3.3
Protocol : pim-sm, Flag: ACT
UpTime : 00:00:12
Upstream interface : GigabitEthernet0/0/3
Upstream neighbor: 10.0.34.3
RPF prime neighbor: 10.0.34.3
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/0
Protocol: pim-sm, UpTime: 00:00:12, Expires: -
In this case, the upstream interface of R4 is still GE0/0/3, and the path of the (S, G) entry
to the multicast source is still by way of the RP, indicating that no RPT-to-SPT switchover
is performed.
Change the IGMP version on R4's GE0/0/0 to version 3 and configure GE0/0/0 to join SSM
group 232.0.0.12 in static mode.
# Modify the configurations of GE0/0/0.
[R4]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0] igmp version 3
[R4-GigabitEthernet0/0/0] igmp static-group 232.0.0.12 source 10.0.1.1
By default, the address range of multicast groups in an SSM group policy is 232.0.0.0/8. If
the address of the multicast group that an interface joins in static mode is not in this
range, PIM-SSM entries cannot be generated.
# Check the PIM routing table of R4.
(10.0.1.1, 232.0.0.12)
Protocol: pim-ssm, Flag: SG_RCVR
UpTime: 00:01:58
Upstream interface: GigabitEthernet0/0/1
Upstream neighbor: 10.0.24.2
RPF prime neighbor: 10.0.24.2
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/0
Protocol: static, UpTime: 00:01:58, Expires: -
...
...
(10.0.1.1, 232.0.0.12)
Protocol: pim-ssm, Flag:
UpTime: 00:03:30
Upstream interface: GigabitEthernet0/0/3
Upstream neighbor: 10.0.12.1
RPF prime neighbor: 10.0.12.1
Downstream interface(s) information:
Total number of downstreams: 1
1: GigabitEthernet0/0/1
Protocol: pim-ssm, UpTime: 00:03:30, Expires: 00:03:00
6.2.3 Quiz
What are the advantages of PIM-SM over PIM-DM?
#
sysname R1
#
multicast routing-enable
#
interface GigabitEthernet0/0/2
ip address 10.0.12.1 255.255.255.0
pim sm
#
interface LoopBack0
HCIP-Datacom-Core Technology Lab Guide Page 206
Configuration on R2
#
sysname R2
#
multicast routing-enable
#
interface GigabitEthernet0/0/1
ip address 10.0.24.2 255.255.255.0
pim sm
#
interface GigabitEthernet0/0/2
ip address 10.0.23.2 255.255.255.0
pim sm
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
pim sm
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
pim sm
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.0.2.2 0.0.0.0
network 10.0.12.2 0.0.0.0
network 10.0.23.2 0.0.0.0
network 10.0.24.2 0.0.0.0
#
pim
c-bsr priority 100
c-bsr LoopBack0
#
return
Configuration on R3
#
sysname R3
#
HCIP-Datacom-Core Technology Lab Guide Page 207
multicast routing-enable
#
acl number 2000
rule 1 permit source 239.0.0.12 0
#
interface GigabitEthernet0/0/2
ip address 10.0.34.3 255.255.255.0
pim sm
#
interface GigabitEthernet0/0/3
ip address 10.0.23.3 255.255.255.0
pim sm
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
pim sm
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.23.3 0.0.0.0
network 10.0.34.3 0.0.0.0
#
pim
c-rp LoopBack0 group-policy 2000 priority 100
#
return
Configuration on R4
#
sysname R4
#
multicast routing-enable
#
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
pim sm
igmp enable
igmp version 3
igmp static-group 239.0.0.12
igmp static-group 232.0.0.12 source 10.0.1.1
#
interface GigabitEthernet0/0/1
ip address 10.0.24.4 255.255.255.0
pim sm
#
interface GigabitEthernet0/0/3
ip address 10.0.34.4 255.255.255.0
pim sm
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
HCIP-Datacom-Core Technology Lab Guide Page 208
7 Firewall Technology
The preceding figure shows how the devices are connected and their IP address planning.
Routers R1 and R2 communicate with the firewall FW1 at Layer 3 through switch S1. On
S1, its interfaces (GE0/0/1 and GE0/0/2) connected to R1 and R2 are assigned to VLAN 10
and VLAN 20 respectively, and the interfaces (GE0/0/14 and GE0/0/15) connected to FW1
are assigned to VLAN 10 and VLAN 20 respectively.
R1 belongs to the Demilitarized Zone (DMZ), and R2 to the untrusted zone. Configure
source NAT on FW1 so that R1 can access the untrusted zone through GE0/0/2 of FW1.
Configure NAT Server on FW1, enabling R2 to access the FTP service enabled on R1
through GE0/0/2 of FW1.
In addition, configure security policies on FW1 to restrict the access between R1 and R2
as follows: R1 in the DMZ can access the untrusted zone, but R2 in the untrusted zone
can only access the FTP service on R1 in the DMZ.
HCIP-Datacom-Core Technology Lab Guide Page 210
7.1.1.3 Background
To protect enterprise network security, you (the enterprise network administrator) decide
to deploy a firewall at the border of the enterprise network to prevent external users
from proactively accessing the internal network. In addition, as an egress device, the
firewall needs to be configured with source NAT (for internal users to access the Internet)
and NAT Server (mapping intranet servers to the public network).
The FTP service is provided for external access. FTP is a multi-channel protocol, which
requires NAT ALG in addition to security policies to ensure normal communication after
NAT is performed on the firewall.
[S1]vlan 10
[S1-vlan10] description DMZ
[S1-vlan10] quit
[S1]interface GigabitEthernet0/0/1
[S1-GigabitEthernet0/0/1] port link-type access
[S1-GigabitEthernet0/0/1] port default vlan 10
[S1-GigabitEthernet0/0/1] quit
[S1]interface GigabitEthernet0/0/14
[S1-GigabitEthernet0/0/14] port link-type access
[S1-GigabitEthernet0/0/14] port default vlan 10
HCIP-Datacom-Core Technology Lab Guide Page 211
[S1-GigabitEthernet0/0/14] quit
[S1]vlan 20
[S1-vlan20] description Untrust
[S1-vlan20] quit
[S1]interface GigabitEthernet0/0/2
[S1-GigabitEthernet0/0/2] port link-type access
[S1-GigabitEthernet0/0/2] port default vlan 20
[S1-GigabitEthernet0/0/2] quit
[S1]interface GigabitEthernet0/0/15
[S1-GigabitEthernet0/0/15] port link-type access
[S1-GigabitEthernet0/0/15] port default vlan 20
[S1-GigabitEthernet0/0/15] quit
# Configure R1.
[R1]interface GigabitEthernet0/0/3
[R1-GigabitEthernet0/0/3] ip address 10.0.11.11 24
[R1-GigabitEthernet0/0/3] quit
[R2]interface GigabitEthernet0/0/4
[R2-GigabitEthernet0/0/3] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/3] quit
Login authentication
Username:admin
Password:
The password needs to be changed. Change now? [Y/N]: Y
Please enter old password:
Please enter new password:
Please confirm new password:
By default, login authentication is enabled for the console port of the firewall. The
default user name and password are admin and Admin@123, respectively. After the first
login to the firewall, you need to change the password to ensure subsequent successful
login.
# Configure interface IP addresses and the default route on FW1.
[FW1]interface GigabitEthernet0/0/1
[FW1-GigabitEthernet0/0/1] ip address 10.0.11.1 255.255.255.0
[FW1-GigabitEthernet0/0/1] quit
[FW1]interface GigabitEthernet0/0/2
[FW1-GigabitEthernet0/0/2] ip address 10.0.12.1 255.255.255.0
[FW1-GigabitEthernet0/0/2] quit
[FW1]ip route-static 0.0.0.0 0.0.0.0 10.0.12.2
HCIP-Datacom-Core Technology Lab Guide Page 212
[FW1]interface GigabitEthernet0/0/1
[FW1-GigabitEthernet0/0/1] service-manage ping permit
[FW1-GigabitEthernet0/0/1] quit
[FW1]interface GigabitEthernet0/0/2
[FW1-GigabitEthernet0/0/2] service-manage ping permit
[FW1-GigabitEthernet0/0/2] quit
Step 2 Configure a security policy for access from the local zone to other zones.
Add interfaces to security zones and create a security policy named local_to.
1. Do not restrict source and destination IP addresses.
2. Do not restrict the destination security zone.
3. Do not restrict services.
4. Set the source security zone to local.
5. Set the action to permit.
# Add interfaces to security zones.
[FW1]security-policy
[FW1-policy-security] rule name local_to
[FW1-policy-security-rule-local_to] source-zone local
[FW1-policy-security-rule-local_to] action permit
Since the source IP address, destination IP address, destination security zone, and services
are not restricted, retain the default setting any for these parameters.
HCIP-Datacom-Core Technology Lab Guide Page 213
# Test the connectivity between FW1 and R1 interface IP addresses and between FW1
and R2 interface IP addresses.
<FW1>ping -c 1 10.0.11.11
PING 10.0.11.11: 56 data bytes, press CTRL_C to break
Reply from 10.0.11.11: bytes=56 Sequence=1 ttl=255 time=40 ms
<FW1>ping -c 1 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=27 ms
Configure NAPT for intranet users (R1) to access the Internet and configure NAT Server
to map the FTP service of R1 to the public network.
# Configure a NAT address pool and enable port address translation for reuse of public
addresses.
[FW1]nat address-group 1
[FW1-address-group-1] mode pat
[FW1-address-group-1] section 0 10.0.12.1 10.0.12.1
[FW1-address-group-1] quit
# Configure a source NAT policy to enable source address translation for intranet users on
a specified network segment when they access the Internet.
[FW1]nat-policy
[FW1-policy-nat] rule name 1
[FW1-policy-nat-rule-1] source-zone dmz
[FW1-policy-nat-rule-1] destination-zone untrust
[FW1-policy-nat-rule-1] source-address 10.0.11.0 24
[FW1-policy-nat-rule-1] action source-nat address-group 1
[FW1-policy-nat-rule-1] quit
# Configure NAT Server and create a static mapping to map the FTP service of R1.
[FW1]nat server policy_ftp protocol tcp global 10.0.12.1 ftp inside 10.0.11.11 ftp
[FW1-zone-dmz] quit
[FW1]firewall interzone dmz untrust
[FW1-interzone-dmz-untrust] detect ftp
[FW1-interzone-dmz-untrust] quit
[FW1]security-policy
[FW1-policy-security] rule name DMZtoUntrust
[FW1-policy-security-rule-DMZtoUntrust] source-zone dmz
[FW1-policy-security-rule-DMZtoUntrust] destination-zone untrust
[FW1-policy-security-rule-DMZtoUntrust] source-address 10.0.11.0 24
[FW1-policy-security-rule-DMZtoUntrust] action permit
[FW1]security-policy
[FW1-policy-security-rule] rule name Untrust_DMZ
[FW1-policy-security-rule-Untrust_DMZ] source-zone untrust
[FW1-policy-security-rule-Untrust_DMZ] destination-zone dmz
[FW1-policy-security-rule-Untrust_DMZ] destination-address 10.0.11.11 24
[FW1-policy-security-rule-Untrust_DMZ] service ftp
[FW1-policy-security-rule-Untrust_DMZ] action permit
Note that the destination IP address is the mapped internal address. The security policy
processes a packet after NAT Server changes the destination IP address of the packet.
R1 can access R2 through FW1. In this case, you can view detailed information about the
related session on FW1.
# Check sessions on FW1.
View details about the session with the destination global IP address of 10.0.12.2. In the
command output, you can view the direction of the session regarding the security zone,
which is from DMZ to the untrusted zone; the aging time (TTL) of the session is 20s, the
interface that receives packets is GigabitEthernet0/0/1, and the interface that sends
packets is GigabitEthernet0/0/2. There are a total of 100 packets that match the session,
and the total size of the packets is 8400 bytes. The name of the security policy matching
the session is DMZtoUntrust.
According to the session, we can learn that the source IP address of the packets is
translated from 10.0.11.11 to 10.0.12.1 (IP address of GE0/0/2 on FW1).
Enable the FTP service on R1. Use R2 that serves as the FTP client to access the FTP
service of R1 through the IP address mapped by FW1, and run the dir command to view
the file list. Check how ASPF of FW1 processes multi-channel protocols.
# Enable the FTP service on R1.
[R1]aaa
[R1-aaa] local-user ftp service-type ftp
[R1-aaa] local-user ftp password cipher ftp@123
[R1-aaa] local-user ftp privilege level 15
[R1-aaa] local-user ftp ftp-directory flash:
[R1-aaa] quit
[R1] ftp server enable
# Have R2 access the FTP service enabled on R1 through the address mapped by FW1.
<R2>ftp 10.0.12.1
Trying 10.0.12.1 ...
Press CTRL+K to abort
Connected to 10.0.12.1.
220 FTP service ready.
User(10.0.12.1:(none)):ftp
331 Password required for ftp.
Enter password:
230 User logged in.
R2 can access the FTP service enabled on R1 through NAT Server mapping of FW1.
# Check the session table on FW1.
The command output shows that the FTP control channel has been established.
# Run the dir command on R2.
[ftp]dir
200 Port command okay.
150 Opening ASCII mode data connection for *.
drwxrwxrwx 1noone nogroup 0 Aug 07 2015 src
drwxrwxrwx 1noone nogroup 0 Jun 07 16:46 pmdata
drwxrwxrwx 1noone nogroup 0 Jun 07 16:46 dhcp
-rwxrwxrwx 1noone nogroup 603 Jun 07 18:12 private-data.txt
drwxrwxrwx 1noone nogroup 0 Jun 07 17:01 mplstpoam
-rwxrwxrwx 1noone nogroup 482 Jun 07 17:51 vrpcfg.zip
226 Transfer complete.
The file list of R1 is displayed. In this case, the FTP transmission channel is used.
# Check the session table on FW1 again.
Only the FTP control channel session exists, and no transmission channel session exists.
# Check the server mapping entries generated by NAT ALG.
The server mapping entry of the FTP data channel is generated on FW1.
Note that you need to run the dir command on R2 to trigger traffic on the transmission
channel before checking the server mapping entry.
----End
7.1.3 Quiz
What is the purpose of permitting traffic from the local zone to other zones on the
firewall?
#
sysname R1
HCIP-Datacom-Core Technology Lab Guide Page 217
#
FTP server enable
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user ftp password cipher iA7kS$rR@T=H)H2[EInBK@O#
local-user ftp privilege level 15
local-user ftp ftp-directory flash:
local-user ftp service-type ftp
local-user admin password cipher BJB3#A}[;JZypQCee$t3@bJ#
local-user admin service-type http
#
interface GigabitEthernet0/0/3
ip address 10.0.11.11 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 10.0.11.1
#
return
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/4
ip address 10.0.12.2 255.255.255.0
#
return
Configuration on S1
#
sysname S1
#
vlan batch 10 20
#
vlan 10
description DMZ
vlan 20
description Untrust
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/14
port link-type access
HCIP-Datacom-Core Technology Lab Guide Page 218
Configuration on FW1
#
sysname FW1
#
interface GigabitEthernet0/0/1
undo shutdown
ip address 10.0.11.1 255.255.255.0
service-manage ping permit
#
interface GigabitEthernet0/0/2
undo shutdown
ip address 10.0.12.1 255.255.255.0
service-manage ping permit
#
firewall zone local
set priority 100
#
firewall zone untrust
description Untrust
set priority 5
add interface GigabitEthernet0/0/2
#
firewall zone dmz
description DMZ
set priority 50
add interface GigabitEthernet0/0/1
detect ftp
#
firewall interzone dmz untrust
detect ftp
#
ip route-static 0.0.0.0 0.0.0.0 10.0.12.2
#
nat server policy_ftp protocol tcp global 10.0.12.1 ftp inside 10.0.11.11 ftp
#
nat address-group 1 0
mode pat
route enable
section 0 10.0.12.1 10.0.12.1
#
security-policy
rule name local_to
source-zone local
action permit
rule name DMZtoUntrust
source-zone dmz
HCIP-Datacom-Core Technology Lab Guide Page 219
destination-zone untrust
source-address 10.0.11.0 mask 255.255.255.0
action permit
rule name Untrust_DMZ
source-zone untrust
destination-zone dmz
destination-address 10.0.11.11 mask 255.255.255.255
service ftp
action permit
#
nat-policy
rule name 1
source-zone dmz
destination-zone untrust
source-address 10.0.11.0 mask 255.255.255.0
action source-nat address-group 1
#
Return
HCIP-Datacom-Core Technology Lab Guide Page 220
8 VRRP
Devices are connected as shown in the figure. VLAN 10 and VLAN 20 exist on the
network, each with a VRRP group configured. The IDs of the VLANs are used as the VRIDs
for their respective VRRP groups. S1 is configured as the master of the VRRP group in
VLAN 10, and S2 as the master of the VRRP group in VLAN 20.
In addition, MSTP is deployed on S1, S2, and S3, and instances 1 and 2 are created. VLAN
10 is mapped to MSTI1, and VLAN 20 is mapped to MSTI2. S1 is configured as the
primary root bridge of MSTI1 and the secondary root bridge of MSTI2. S2 is configured as
the secondary root bridge of MSTI1 and the primary root bridge of MSTI2.
The IP address of each VLANIF interface is 10.0.x.y/24, where x indicates the VRID and y
indicates the device ID. The virtual IP address is set to 10.0.x.254/24.
8.1.1.3 Background
To implement gateway redundancy, you as the network administrator need to deploy
VRRP on two aggregation switches. To balance user-to-network traffic of terminal users,
HCIP-Datacom-Core Technology Lab Guide Page 221
you need to deploy a VRRP group in each VLAN. To prevent loops, MSTP is deployed on
the switching network and works with VRRP to implement load balancing.
Create VLANs 10 and 20 on all switches. Configure an MSTP region named hcip, and
create two instances Instance 1 and Instance 2. Map VLAN 10 to Instance 1 and VLAN
20 to Instance 2. Plan S1 as the primary root bridge of MSTI1 and secondary root bridge
of MSTI2; plan S2 as the primary root bridge of MSTI2 and the secondary root bridge of
MSTI1.
# Name the devices.
The configuration details are not provided.
# Disable the interfaces that are not used in this experiment.
The configuration details are not provided.
# Create VLANs.
[S1]vlan batch 10 20
[S2]vlan batch 10 20
[S3]vlan batch 10 20
[S4]vlan batch 10 20
# Configure all interconnection interfaces as trunk interfaces and allow packets from the
corresponding VLANs to pass through.
The configuration details are not provided.
# Change the working mode from STP to MSTP.
# Configure MSTP.
[S1]stp region-configuration
[S1-mst-region] region-name hcip
[S1-mst-region] revision-level 1
[S1-mst-region] instance 1 vlan 10
[S1-mst-region] instance 2 vlan 20
[S1-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-mst-region] quit
[S2]stp region-configuration
[S2-mst-region] region-name hcip
[S2-mst-region] revision-level 1
[S2-mst-region] instance 1 vlan 10
[S2-mst-region] instance 2 vlan 20
[S2-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-mst-region] quit
[S3]stp region-configuration
[S3-mst-region] region-name hcip
[S3-mst-region] revision-level 1
[S3-mst-region] instance 1 vlan 10
[S3-mst-region] instance 2 vlan 20
[S3-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3-mst-region] quit
[S4]stp region-configuration
[S4-mst-region] region-name hcip
[S4-mst-region] revision-level 1
[S4-mst-region] instance 1 vlan 10
[S4-mst-region] instance 2 vlan 20
[S4-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4-mst-region] quit
# Configure S1 as the primary root bridge of MSTI1 and the secondary root bridge of
MSTI2.
# Configure S2 as the primary root bridge of MSTI2 and the secondary root bridge of
MSTI1.
All interfaces on S1 are designated interfaces, and S1 is the primary root bridge of MSTI1.
# Check the status and statistics of MSTI2 on S2.
All interfaces on S2 are designated interfaces, and S2 is the secondary root bridge of
MSTI1.
Create VLANIF 10 and VLANIF 20 on both S1 and S2, and add VLANIF 10 to VRRP group
10 and VLANIF 20 to VRRP group 20. Configure VRRP priorities so that S1 in VLAN 10 and
S2 in VLAN 20 both function as the VRRP master.
# Create VLANIF interfaces.
[S1]interface Vlanif10
[S1-Vlanif10] ip address 10.0.10.1 255.255.255.0
[S1-Vlanif10] quit
[S1]interface Vlanif20
[S1-Vlanif20] ip address 10.0.20.1 255.255.255.0
[S1-Vlanif20] quit
[S2]interface Vlanif10
[S2-Vlanif10] ip address 10.0.10.2 255.255.255.0
[S2-Vlanif10] quit
[S2]interface Vlanif20
[S2-Vlanif20] ip address 10.0.20.2 255.255.255.0
[S2-Vlanif20] quit
HCIP-Datacom-Core Technology Lab Guide Page 224
[S1]interface Vlanif 10
[S1-Vlanif10] vrrp vrid 10 virtual-ip 10.0.10.254
[S1-Vlanif10] vrrp vrid 10 priority 120
[S1-Vlanif10] quit
[S1]interface Vlanif 20
[S1-Vlanif20] vrrp vrid 20 virtual-ip 10.0.20.254
[S1-Vlanif20] quit
Set the VRRP priority to 120 for S1 in VLAN 10, and use the default priority 100 for S1 in
VLAN 20.
# Configure VRRP groups on S2.
[S2]interface Vlanif10
[S2-Vlanif10] vrrp vrid 10 virtual-ip 10.0.10.254
[S2-Vlanif10] quit
[S2]interface Vlanif20
[S2-Vlanif20] vrrp vrid 20 virtual-ip 10.0.20.254
[S2-Vlanif20] vrrp vrid 20 priority 120
[S2-Vlanif20] quit
Set the VRRP priority to 120 for S2 in VLAN 20, and use the default priority 100 for S2 in
VLAN 10.
# Check the VRRP status.
Step 3 Configure association between VRRP and BFD to implement rapid master/backup VRRP
switchovers.
[S1]bfd
HCIP-Datacom-Core Technology Lab Guide Page 225
[S1-bfd] quit
[S1]bfd vlanif10 bind peer-ip 10.0.10.2 interface Vlanif10
[S1-bfd-session-vlanif10] discriminator local 1
[S1-bfd-session-vlanif10] discriminator remote 2
[S1-bfd-session-vlanif10] min-tx-interval 100
[S1-bfd-session-vlanif10] min-rx-interval 100
[S1-bfd-session-vlanif10] commit
[S1-bfd-session-vlanif10] quit
[S1]bfd vlanif20 bind peer-ip 10.0.20.2 interface Vlanif20
[S1-bfd-session-vlanif20] discriminator local 11
[S1-bfd-session-vlanif20] discriminator remote 22
[S1-bfd-session-vlanif20] min-tx-interval 100
[S1-bfd-session-vlanif20] min-rx-interval 100
[S1-bfd-session-vlanif20] commit
[S1-bfd-session-vlanif20] quit
[S2]bfd
[S2-bfd] quit
[S2]bfd vlanif10 bind peer-ip 10.0.10.1 interface Vlanif10
[S2-bfd-session-vlanif10] discriminator local 2
[S2-bfd-session-vlanif10] discriminator remote 1
[S2-bfd-session-vlanif10] min-tx-interval 100
[S2-bfd-session-vlanif10] min-rx-interval 100
[S2-bfd-session-vlanif10] commit
[S2-bfd-session-vlanif10] quit
[S2]bfd vlanif20 bind peer-ip 10.0.20.1 interface Vlanif20
[S2-bfd-session-vlanif20] discriminator local 22
[S2-bfd-session-vlanif20] discriminator remote 11
[S2-bfd-session-vlanif20] min-tx-interval 100
[S2-bfd-session-vlanif20] min-rx-interval 100
[S2-bfd-session-vlanif20] commit
[S2-bfd-session-vlanif20] quit
[S1]interface Vlanif20
[S1-Vlanif20] vrrp vrid 20 track bfd-session 11 increased 30
[S1-Vlanif20] quit
[S2]interface Vlanif10
[S2-Vlanif10] vrrp vrid 10 track bfd-session 2 increased 30
[S2-Vlanif10] quit
Note that bfd-session-id specifies the local discriminator of a BFD session. You only need
to configure the backup device to track the BFD session. In this way, the backup device
increases its local VRRP priority when the BFD session goes down.
# Shut down all interfaces on S1 to simulate a link fault.
[S1]interface GigabitEthernet0/0/10
[S1-GigabitEthernet0/0/10] shutdown
[S1-GigabitEthernet0/0/10] quit
[S1]interface GigabitEthernet0/0/11
[S1-GigabitEthernet0/0/11] shutdown
[S1-GigabitEthernet0/0/11] quit
[S1]interface GigabitEthernet0/0/12
[S1-GigabitEthernet0/0/12] shutdown
[S1-GigabitEthernet0/0/12] quit
[S2]display vrrp
Vlanif10 | Virtual Router 10
State : Master
Virtual IP : 10.0.10.254
Master IP : 10.0.10.2
PriorityRun : 130
PriorityConfig : 100
MasterPriority : 130
Preempt : YES Delay Time : 0s
TimerRun : 1s
TimerConfig : 1s
Auth type : NONE
Virtual MAC : 0000-5e00-010a
Check TTL : YES
Config type : normal-vrrp
Track BFD : 2 Priority increased : 30
BFD-session state: DOWN
Create time : 2020-06-05 11:01:54 UTC-08:00
Last change time : 2020-06-05 11:31:15 UTC-08:00
The priority of VRRP group 10 is 130, and the BFD session is in the Down state. The BFD
down event triggers S2 to increase the priority of VRRP group 10 by 30.
----End
8.1.3 Quiz
In what situation does a device send VRRP packets carrying a priority of 255?
#
sysname S1
#
HCIP-Datacom-Core Technology Lab Guide Page 228
vlan batch 10 20
#
stp instance 1 root primary
stp instance 2 root secondary
#
stp region-configuration
region-name hcip
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
bfd
#
interface Vlanif10
ip address 10.0.10.1 255.255.255.0
vrrp vrid 10 virtual-ip 10.0.10.254
vrrp vrid 10 priority 120
#
interface Vlanif20
ip address 10.0.20.1 255.255.255.0
vrrp vrid 20 virtual-ip 10.0.20.254
vrrp vrid 20 track bfd-session 11 increased 30
#
interface GigabitEthernet0/0/10
shutdown
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/11
shutdown
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/12
shutdown
port link-type trunk
port trunk allow-pass vlan 10 20
#
bfd vlanif10 bind peer-ip 10.0.10.2 interface Vlanif10
discriminator local 1
discriminator remote 2
min-tx-interval 100
min-rx-interval 100
commit
#
bfd vlanif20 bind peer-ip 10.0.20.2 interface Vlanif20
discriminator local 11
discriminator remote 22
min-tx-interval 100
min-rx-interval 100
commit
#
return
HCIP-Datacom-Core Technology Lab Guide Page 229
Configuration on S2
#
sysname S2
#
vlan batch 10 20
#
stp instance 1 root secondary
stp instance 2 root primary
#
stp region-configuration
region-name hcip
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
bfd
#
interface Vlanif10
ip address 10.0.10.2 255.255.255.0
vrrp vrid 10 virtual-ip 10.0.10.254
vrrp vrid 10 track bfd-session 2 increased 30
#
interface Vlanif20
ip address 10.0.20.2 255.255.255.0
vrrp vrid 20 virtual-ip 10.0.20.254
vrrp vrid 20 priority 120
#
interface GigabitEthernet0/0/10
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/11
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/13
port link-type trunk
port trunk allow-pass vlan 10 20
#
bfd vlanif10 bind peer-ip 10.0.10.1 interface Vlanif10
discriminator local 2
discriminator remote 1
min-tx-interval 100
min-rx-interval 100
commit
#
bfd vlanif20 bind peer-ip 10.0.20.1 interface Vlanif20
discriminator local 22
discriminator remote 11
min-tx-interval 100
min-rx-interval 100
commit
#
HCIP-Datacom-Core Technology Lab Guide Page 230
return
Configuration on S3
#
sysname S3
#
vlan batch 10 20
#
stp region-configuration
region-name hcip
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
#
return
HCIP-Datacom-Core Technology Lab Guide Page 231
9 DHCP
VLANIF 10, VLANIF 20, and VLANIF 30 are created on S4 to simulate DHCP clients. S3
and S1 function as a DHCP relay agent and DHCP server, respectively. A global address
pool is created on S1 to allocate IP addresses to the three VLANIF interfaces of S4.
The interfaces between S3 and S4 are configured to work in trunk mode to allow VLANs
10, 20, and 30 to pass through; the interfaces between S1 and S3 are configured to work
in access mode. The PVID is set to 40.
9.1.1.3 Background
You are a network administrator of a company. Because there are a large number of
hosts on the network, static address allocation is difficult to manage. Therefore, a DHCP
server needs to be deployed.
The core switch S1 functions as a DHCP server, S4 as a DHCP client, and S3 as the
gateway of each network segment. DHCPDISCOVER messages are broadcast ones and
cannot traverse routers. Therefore, DHCP relay needs to be deployed on S3 to unicast the
messages to S1.
In addition, DHCP is required to allocate fixed IP addresses to special clients, such as
servers and printers.
HCIP-Datacom-Core Technology Lab Guide Page 232
Create VLANs and VLANIF interfaces on the three switches, and configure interfaces to
allow the corresponding VLANs to pass through. The IP address of the VLANIF interface is
10.0.x.y/24, where x and y indicate the VLAN ID and device number, respectively. IP
addresses do not need to be configured for the VLANIF interfaces on S4.
# Create VLANs.
[S1]vlan 40
[S3]vlan batch 10 20 30 40
[S4]vlan batch 10 20 30
[S4]interface GigabitEthernet0/0/3
[S4-GigabitEthernet0/0/3] port link-type trunk
[S4-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 20 30
[S4-GigabitEthernet0/0/3] quit
[S3]interface GigabitEthernet0/0/1
[S3-GigabitEthernet0/0/1] port link-type access
[S3-GigabitEthernet0/0/1] port default vlan 40
[S3-GigabitEthernet0/0/1] quit
[S3]interface GigabitEthernet0/0/3
[S3-GigabitEthernet0/0/3] port link-type trunk
[S3-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 20 30
[S3-GigabitEthernet0/0/3] quit
[S1]interface GigabitEthernet0/0/12
[S1-GigabitEthernet0/0/12] port link-type access
[S1-GigabitEthernet0/0/12] port default vlan 40
[S1-GigabitEthernet0/0/12] quit
[S4]interface Vlanif 10
HCIP-Datacom-Core Technology Lab Guide Page 233
[S4-Vlanif10] quit
[S4]interface Vlanif 20
[S4-Vlanif20] quit
[S4]interface Vlanif 30
[S4-Vlanif30] quit
[S3]interface Vlanif 10
[S3-Vlanif10] ip address 10.0.10.3 24
[S3-Vlanif10] quit
[S3]interface Vlanif 20
[S3-Vlanif20] ip address 10.0.20.3 24
[S3-Vlanif20] quit
[S3]interface Vlanif 30
[S3-Vlanif30] ip address 10.0.30.3 24
[S3-Vlanif30] quit
[S3]interface Vlanif 40
[S3-Vlanif40] ip address 10.0.40.3 24
[S3-Vlanif40] quit
[S1]interface Vlanif 40
[S1-Vlanif40] ip address 10.0.40.1 24
[S1-Vlanif40] quit
[S1]ping -c 1 10.0.40.3
PING 10.0.40.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.40.3: bytes=56 Sequence=1 ttl=255 time=60 ms
The DHCP server and relay agent can communicate with each other.
Enable the DHCP service, configure a global address pool, and allocate a static IP address
to VLANIF 30 on S4.
# Enable the DHCP service.
[S1]dhcp enable
The actual MAC address is subject to the device in the lab environment.
# On S1, configure static address allocation for VLANIF 30 of S4.
[S1]interface Vlanif 40
[S1-Vlanif40] dhcp select global
The address pool vlan30 already has a used IP address, which is a static one.
# Configure routes to user network segments.
After receiving a DHCP message from the DHCP client, the DHCP relay agent uses the
interface IP address to relay the message to the DHCP server. Therefore, the connectivity
between the interface IP address and DHCP server must be ensured.
# Check the connectivity between the DHCP server and relay interface.
<S1>ping -c 1 10.0.10.3
HCIP-Datacom-Core Technology Lab Guide Page 236
<S1>ping -c 1 10.0.20.3
PING 10.0.20.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.20.3: bytes=56 Sequence=1 ttl=255 time=40 ms
<S1>ping -c 1 10.0.30.3
PING 10.0.30.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.30.3: bytes=56 Sequence=1 ttl=255 time=30 ms
[S3]dhcp enable
[S3]interface Vlanif10
[S3-Vlanif10] dhcp select relay
[S3-Vlanif10] dhcp relay server-ip 10.0.40.1
[S3-Vlanif10] quit
[S3]interface Vlanif20
[S3-Vlanif20] dhcp select relay
[S3-Vlanif20] dhcp relay server-ip 10.0.40.1
[S3-Vlanif20] quit
[S3]interface Vlanif30
[S3-Vlanif30] dhcp select relay
[S3-Vlanif30] dhcp relay server-ip 10.0.40.1
[S3-Vlanif30] quit
Configure VLANIF 10, VLANIF 20, and VLANIF 30 on S4 to obtain IP addresses through
DHCP.
# Enable the DHCP service.
[S4]dhcp enable
[S4]interface Vlanif10
[S4-Vlanif10] ip address dhcp-alloc
[S4-Vlanif10] quit
[S4]interface Vlanif20
[S4-Vlanif20] ip address dhcp-alloc
[S4-Vlanif20] quit
[S4]interface Vlanif30
[S4-Vlanif30] ip address dhcp-alloc
[S4-Vlanif30] quit
The interfaces have obtained IP addresses through DHCP, and the IP address of VLANIF
30 is the static IP address 10.0.30.2.
Run the debugging dhcp relay info and debugging dhcp relay packet commands on
S3. Disable the DHCP client function on VLANIF 30 of S4, and then enable it again. Check
the debugging information.
# Enable debugging on S3.
[S4]interface Vlanif 30
[S4-Vlanif30] undo ip address dhcp-alloc
S3 receives a DHCPRELEASE message from VLANIF 30. The source and destination IP
addresses of the message are 10.0.30.2 and 10.0.40.1, respectively, and the value of the
giaddr field is 0.0.0.0. S3 sets the giaddr field in the message to 10.0.30.3 (IP address of
VLANIF 30) and then sends the message to the DHCP server.
# Enable the DHCP client function on VLANIF 30 of S4 again.
[S4]interface Vlanif 30
[S4-Vlanif30] ip address dhcp-alloc
S3 receives a DHCPDISCOVER message from the client. The source and destination IP
addresses of the message are 0.0.0.0 and 255.255.255.255, respectively. After setting the
giaddr field in the message to 10.0.30.3, S3 unicasts the message to the DHCP server at
10.0.40.1. In this case, the source IP address of the message is 10.0.30.3.
S3 receives a DHCPOFFER message from the DHCP server. The source and destination IP
addresses of the message are 10.0.40.1 and 10.0.30.3, respectively, and the message
carries the DHCP server ID (DHCP Option 54). S3 then unicasts the message to the client.
After receiving a DHCPREQUEST broadcast message from the client, S3 converts the
message into a unicast one and then sends it to the DHCP server.
After receiving a DHCPACK message with the source IP address 10.0.40.1 and destination
IP address 10.0.30.3 from the DHCP server, S3 unicasts the message to the DHCP client.
----End
9.1.3 Quiz
How does a DHCP server select an address pool after receiving a DHCP message from a
DHCP relay agent?
#
sysname S1
HCIP-Datacom-Core Technology Lab Guide Page 240
#
vlan batch 40
#
dhcp enable
#
ip pool vlan10
gateway-list 10.0.10.3
network 10.0.10.0 mask 255.255.255.0
dns-list 10.0.10.3
#
ip pool vlan20
gateway-list 10.0.20.3
network 10.0.20.0 mask 255.255.255.0
dns-list 10.0.20.3
#
ip pool vlan30
gateway-list 10.0.30.3
network 10.0.30.0 mask 255.255.255.0
static-bind ip-address 10.0.30.2 mac-address 4c1f-cc49-4c7c
dns-list 10.0.30.3
#
interface Vlanif40
ip address 10.0.40.1 255.255.255.0
dhcp select global
#
interface GigabitEthernet0/0/12
port link-type access
port default vlan 40
#
ip route-static 10.0.10.0 255.255.255.0 10.0.40.3
ip route-static 10.0.20.0 255.255.255.0 10.0.40.3
ip route-static 10.0.30.0 255.255.255.0 10.0.40.3
#
return
Configuration on S3
#
sysname S3
#
vlan batch 10 20 30 40
#
dhcp enable
#
interface Vlanif10
ip address 10.0.10.3 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.0.40.1
#
interface Vlanif20
ip address 10.0.20.3 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.0.40.1
#
HCIP-Datacom-Core Technology Lab Guide Page 241
interface Vlanif30
ip address 10.0.30.3 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.0.40.1
#
interface Vlanif40
ip address 10.0.40.3 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 40
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
user-interface con 0
user-interface vty 0 4
#
return
Configuration on S4
#
sysname S4
#
vlan batch 10 20 30
#
dhcp enable
#
interface Vlanif10
ip address dhcp-alloc
#
interface Vlanif20
ip address dhcp-alloc
#
interface Vlanif30
ip address dhcp-alloc
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
Return
HCIP-Datacom-Core Technology Lab Guide Page 242
10 WLAN
The preceding figure shows the device connection mode. AP1 is managed by AC1, and
AP2 is managed by AC2. All APs use the direct forwarding mode.
S4 transparently transmits packets from AP2 at Layer 2. S3 serves as the gateway for APs
and STAs.
S3 is enabled with DHCP to allocate IP addresses to AP1, AP2, and STAs associated with
them. APs obtain ACs' addresses from Option 43 in DHCP packets.
10.1.1.3 Background
To meet the increasing STA access requirements, an enterprise needs to deploy a batch of
APs. As AC1 is managing APs of its maximum specifications, the enterprise purchases a
HCIP-Datacom-Core Technology Lab Guide Page 243
new AC (AC2) to manage the newly deployed APs. In addition, inter-AC roaming is
required to minimize the service interruption time when STAs move between the
coverage areas of APs managed by different ACs.
Item Configuration
AC's source interface address VLANIF 100 (10.0.100.254) and VLANIF 200
(10.0.200.254)
Country code: CN
Password: huawei123
X in departX indicates the AC number, that is, depart1 on AC1 and depart2 on
AC2.
HCIP-Datacom-Core Technology Lab Guide Page 244
The poe enable command enables the PoE function on a port. When a port detects a
powered device (PD) connected, the port supplies power to the PD. By default, the PoE
function is enabled on a port. Therefore, this command is unnecessary and is provided for
demonstration purpose only.
The PVID of the S3 port connected to AP1 is set to VLAN 10, and packets in the service
VLAN and management VLAN from AP2 are allowed to pass on the S3 port connected to
S4.
[S4]vlan batch 20 21
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4]interface GigabitEthernet0/0/3
[S4-GigabitEthernet0/0/3] port link-type trunk
[S4-GigabitEthernet0/0/3] port trunk allow-pass vlan 20 to 21
[S4-GigabitEthernet0/0/3] quit
[S4]interface GigabitEthernet0/0/4
[S4-GigabitEthernet0/0/4] port link-type trunk
[S4-GigabitEthernet0/0/4] port trunk pvid vlan 20
[S4-GigabitEthernet0/0/4] port trunk allow-pass vlan 20 to 21
[S4-GigabitEthernet0/0/4] quit
The PVID of the S4 port connected to AP2 is set to VLAN 20, and the uplink port of S4 is
configured to transparently transmit packets in VLANs 20 (management VLAN) and 21
(service VLAN).
The interface is configured to allow packets in VLAN 100 to pass through because VLANIF
100 serves as the CAPWAP source interface of AC1.
The interface is configured to allow packets in VLAN 200 to pass through because VLANIF
200 serves as the CAPWAP source interface of AC2.
# Create VLANIF interfaces on S3, AC1, and AC2.
[S3]interface Vlanif10
[S3-Vlanif10] description ap1_mgnt
[S3-Vlanif10] ip address 10.0.10.1 255.255.255.0
[S3-Vlanif10] quit
[S3]interface Vlanif11
[S3-Vlanif11] description ap1_service
[S3-Vlanif11] ip address 10.0.11.1 255.255.255.0
[S3-Vlanif11] quit
[S3]interface Vlanif20
HCIP-Datacom-Core Technology Lab Guide Page 246
On S3, VLANIF 10 and VLANIF 20 are configured as the management VLAN gateways of
AP1 and AP2, respectively; VLANIF 11 and VLANIF 21 are configured as the service VLAN
gateways of STAs connected to AP1 and AP2, respectively; and VLANIF 100 and VLANIF
200 are used for Layer 3 communication with AC1 and AC2, respectively.
[AC1]interface Vlanif100
[AC1-Vlanif100] description to_S3_CAPWAP
[AC1-Vlanif100] ip address 10.0.100.254 255.255.255.0
[AC1-Vlanif100] quit
[AC2]interface Vlanif200
[AC2-Vlanif200] description to_S3_CAPWAP
[AC2-Vlanif200] ip address 10.0.200.254 255.255.255.0
[AC2-Vlanif200] quit
Static routes to the AP management network segments for communication with APs.
# Configure the DHCP service on S3.
[S3]dhcp enable
The address pools ap1 and ap2 are configured to allocate IP addresses to APs and carry
Option 43 specifying the AC's IP address in DHCP packets. The address pools service_a
and service_b are configured to allocate IP addresses to STAs on AP1 and AP2,
respectively. The gateways for all address pools are set to the addresses of VLANIF
interfaces on S3.
[S3]interface Vlanif10
[S3-Vlanif10] dhcp select global
[S3-Vlanif10] quit
[S3]interface Vlanif11
[S3-Vlanif11] dhcp select global
[S3-Vlanif11] quit
[S3]interface Vlanif20
[S3-Vlanif20] dhcp select global
[S3-Vlanif20] quit
[S3]interface Vlanif21
[S3-Vlanif21] dhcp select global
[S3-Vlanif21] quit
On AC1, specify VLANIF 100 as the CAPWAP source interface, create the AP group
depart1, configure MAC address authentication for APs, name the AP ap1, add it to the
AP group depart1, associate parameter profiles with the VAP profile depart1, and bind
the VAP profile to the AP group depart1.
# Specify the CAPWAP source interface.
[AC1]wlan
[AC1-wlan-view] ap-group name depart1
[AC1-wlan-ap-group-depart1] quit
# Create a regulatory domain profile and configure the AC's country code in the profile.
HCIP-Datacom-Core Technology Lab Guide Page 248
[AC1]wlan
[AC1-wlan-view] regulatory-domain-profile name default
[AC1-wlan-regulate-domain-default] country-code cn
Info: The current country code is same with the input country code.
[AC1-wlan-regulate-domain-default] quit
[AC1]wlan
[AC1-wlan-view]ap-group name depart1
[AC1-wlan-ap-group- depart1]regulatory-domain-profile default
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and
reset the AP. Continue?[Y/N]:y
[AC1-wlan-ap-group- depart1]quit
[AC1]wlan
[AC1-wlan-view] ap auth-mode mac-auth
[AC1-wlan-view] ap-id 0 ap-mac 00e0-fc6e-2890 //Set the AP's MAC address as required in the lab
environment.
[AC1-wlan-ap-0] ap-name ap1
[AC1-wlan-ap-0] ap-group depart1
[AC1]wlan
[AC1-wlan-view] security-profile name depart1
[AC1-wlan-sec-prof-depart1] security wpa2 psk pass-phrase huawei123 aes
[AC1-wlan-sec-prof- depart1] quit
[AC1-wlan-view] ssid-profile name depart1
HCIP-Datacom-Core Technology Lab Guide Page 249
The security profile depart1 is configured, with the authentication mode of WPA2-PSK
and the pre-shared key of huawei123.
The SSID profile depart1 is configured, and the SSID is set to roam.
The VAP profile depart1 is configured, with the direct forwarding mode and the service
VLAN 11, and has the SSID profile depart1 and security profile depart1 bound.
The VAP profile depart1 is bound to the AP group depart1.
# Check the AP online status.
<AC1>display ap all
Info: This operation may take afew seconds. Please wait for amoment.done.
Total AP information:
nor : normal [1]
--------------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
--------------------------------------------------------------------------------------------
0 00e0-fc6e-2890 ap1 depart1 10.0.10.254 AirEngine5760-10 nor 0 50S
--------------------------------------------------------------------------------------------
Total: 1
Wait for a period of time and check the AP online status. If the AP status is nor, the AP
goes online successfully and works properly. The AP has obtained the IP address
10.0.10.254 and has no STA associated.
On AC2, specify VLANIF 200 as the CAPWAP source interface, create the AP group
depart2, configure MAC address authentication for APs, name the AP ap2, add it to the
AP group depart2, associate parameter profiles with the VAP profile depart2, and bind
the VAP profile to the AP group depart2.
# Specify the CAPWAP source interface.
[AC2]wlan
[AC2-wlan-view] ap-group name depart2
[AC2-wlan-ap-group-depart2] quit
# Create a regulatory domain profile and configure the AC's country code in the profile.
HCIP-Datacom-Core Technology Lab Guide Page 250
[AC2]wlan
[AC2-wlan-view] regulatory-domain-profile name default
[AC2-wlan-regulate-domain-default] country-code cn
Info: The current country code is same with the input country code.
[AC2-wlan-regulate-domain-default] quit
[AC2]wlan
[AC2-wlan-view] ap-group name depart2
[AC2-wlan-ap-group- depart2] regulatory-domain-profile default
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and
reset the AP. Continue?[Y/N]:y
[AC2-wlan-ap-group- depart2] quit
# Add an AP.
[AC2]wlan
[AC2-wlan-view] ap auth-mode mac-auth
[AC2-wlan-view] ap-id 0 ap-mac 00e0-fcde-1990 //Set the AP's MAC address as required in the lab
environment.
[AC2-wlan-ap-0] ap-name ap2
[AC2-wlan-ap-0] ap-group depart2
[AC2]wlan
[AC2-wlan-view] security-profile name depart2
[AC2-wlan-sec-prof-depart2] security wpa2 psk pass-phrase huawei123 aes
[AC2-wlan-sec-prof- depart2] quit
[AC2-wlan-view] ssid-profile name depart2
[AC2-wlan-ssid-prof-depart2] ssid roam
[AC2-wlan-ssid-prof-depart2] quit
[AC2-wlan-view] vap-profile name depart2
[AC2-wlan-vap-prof-depart2] forward-mode direct-forward
[AC2-wlan-vap-prof-depart2] service-vlan vlan-id 21
[AC2-wlan-vap-prof-depart2] ssid-profile depart2
[AC2-wlan-vap-prof-depart2] security-profile depart2
[AC2-wlan-vap-prof-depart2] quit
[AC2-wlan-view] ap-group name depart2
[AC2-wlan-ap-group-depart2] vap-profile depart2 wlan 1 radio all
[AC2-wlan-ap-group-depart2] quit
The security profile depart2 is configured, with the authentication mode of WPA2-PSK
and the pre-shared key of huawei123.
The SSID profile depart2 is configured, and the SSID is set to roam.
The VAP profile depart2 is configured, with the direct forwarding mode and the service
VLAN 21, and has the SSID profile depart2 and security profile depart1 bound.
The VAP profile depart2 is bound to the AP group depart2.
# Check the AP online status.
<AC2>display ap all
Info: This operation may take afew seconds. Please wait for amoment.done.
HCIP-Datacom-Core Technology Lab Guide Page 251
Total AP information:
nor : normal [1]
--------------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
--------------------------------------------------------------------------------------------
0 00e0-fcde-1990 ap2 depart2 10.0.20.254 AirEngine5760-10 nor 0 1M:13S
--------------------------------------------------------------------------------------------
Total: 1
Wait for a period of time and check the AP online status. If the AP status is nor, the AP
goes online successfully and works properly. The AP has obtained the IP address
10.0.20.254 and has no STA associated.
Configure static routes between the CAPWAP source interfaces on AC1 and AC2. Create
the mobility group mobility and add AC1 and AC2 to the mobility group, without
specifying a mobility server.
#Configure static routes.
# Configure AC1.
[AC1]wlan
[AC1 -wlan-view] mobility-group name mobility
[AC1-mc-mg-mobility] member ip-address 10.0.100.254
[AC1-mc-mg-mobility] member ip-address 10.0.200.254
The mobility group mobility is created on AC1, and AC1 and AC2 are added to the
mobility group as members.
# Configure AC2.
[AC2]wlan
[AC2 -wlan-view] mobility-group name mobility
[AC2-mc-mg-mobility] member ip-address 10.0.100.254
[AC2-mc-mg-mobility] member ip-address 10.0.200.254
The mobility group mobility is created on AC2, and AC1 and AC2 are added to the
mobility group as members.
# Check the mobility group status.
normal 10.0.100.254 -
normal 10.0.200.254 -
--------------------------------------------------------------------------------
Total: 2
HCIP-Datacom-Core Technology Lab Guide Page 252
Members AC1 and AC2 in the mobility group are both in normal state.
# Check STA information on AC1.
After detecting the WLAN with the SSID roam in the coverage area of AP1, the STA is
associated with the WLAN through the password huawei123. After the display station
ssid roam command is run on AC1 to check STA access information, the command
output shows that the STA (MAC address: 5489-986f-73) is associated with AP1.
Move the STA to the coverage area of AP2 while still associating with AP1 and then
power off AP1 to enable the STA to roam to AP2.
# Check the inter-AC roaming track.
The STA with the MAC address 5489-986f-73ad has roamed from AP1 to AP2, which is an
inter-AC roaming process.
----End
10.1.3 Quiz
What are the differences in forwarding between inter-AC Layer 2 roaming and inter-AC
Layer 3 roaming?
#
sysname S3
HCIP-Datacom-Core Technology Lab Guide Page 253
#
vlan batch 10 to 11 20 to 21 100 200
#
dhcp enable
#
ip pool ap1
gateway-list 10.0.10.1
network 10.0.10.0 mask 255.255.255.0
option 43 sub-option 3 ascii 10.0.100.254
#
ip pool ap2
gateway-list 10.0.20.1
network 10.0.20.0 mask 255.255.255.0
option 43 sub-option 3 ascii 10.0.200.254
#
ip pool service_a
gateway-list 10.0.11.1
network 10.0.11.0 mask 255.255.255.0
dns-list 10.0.11.1
#
ip pool service_b
gateway-list 10.0.21.1
network 10.0.21.0 mask 255.255.255.0
dns-list 10.0.21.1
#
interface Vlanif10
description ap1_mgnt
ip address 10.0.10.1 255.255.255.0
dhcp select global
#
interface Vlanif11
description ap1_service
ip address 10.0.11.1 255.255.255.0
dhcp select global
#
interface Vlanif20
description ap2_mgnt
ip address 10.0.20.1 255.255.255.0
dhcp select global
#
interface Vlanif21
description ap2_service
ip address 10.0.21.1 255.255.255.0
dhcp select global
#
interface Vlanif100
description to_AC1
ip address 10.0.100.1 255.255.255.0
#
interface Vlanif200
description to_AC2
ip address 10.0.200.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
HCIP-Datacom-Core Technology Lab Guide Page 254
Configuration on S4
#
sysname S4
#
vlan batch 20 to 21
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20 to 21
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk pvid vlan 20
port trunk allow-pass vlan 20 to 21
#
return
Configuration on AC1
#
sysname AC1
#
vlan batch 100
#
interface Vlanif100
description to_S3_CAPWAP
ip address 10.0.100.254 255.255.255.0
#
interface GigabitEthernet0/0/12
port link-type trunk
port trunk allow-pass vlan 100
#
ip route-static 10.0.10.0 255.255.255.0 10.0.100.1
ip route-static 10.0.200.0 255.255.255.0 10.0.100.1
HCIP-Datacom-Core Technology Lab Guide Page 255
#
capwap source interface vlanif100
#
wlan
security-profile name depart1
security wpa2 psk pass-phrase huawei123 aes
aes
ssid-profile name depart1
ssid roam
vap-profile name depart1
service-vlan vlan-id 11
ssid-profile depart1
security-profile depart1
regulatory-domain-profile name default
mobility-group name mobility
member ip-address 10.0.100.254
member ip-address 10.0.200.254
ap-group name depart1
radio 0
vap-profile depart1 wlan 1
radio 1
vap-profile depart1 wlan 1
radio 2
vap-profile depart1 wlan 1
ap-id 0 type-id 56 ap-mac 00e0-fc6e-2890 ap-sn 210235448310F30CF56D
ap-name ap1
ap-group depart1
provision-ap
#
return
Configuration on AC2
#
sysname AC2
#
vlan batch 200
#
interface Vlanif200
description to_S3_CAPWAP
ip address 10.0.200.254 255.255.255.0
#
interface GigabitEthernet0/0/13
port link-type trunk
port trunk allow-pass vlan 200
#
ip route-static 10.0.20.0 255.255.255.0 10.0.200.1
ip route-static 10.0.100.0 255.255.255.0 10.0.200.1
#
capwap source interface vlanif200
#
wlan
security-profile name depart2
security wpa-wpa2 psk pass-phrase huawei123 aes
HCIP-Datacom-Core Technology Lab Guide Page 256
As shown in the figure, AC1 and AC2 form an HSB group, and VRRP HSB is configured for
AC backup. AP1 and AP2 are managed by AC1 and AC2 in active/standby mode, and both
use the direct forwarding mode.
S4 transparently transmits packets from AP2 at Layer 2. S3 serves as the gateway for APs
and STAs.
S3 is enabled with DHCP to allocate IP addresses to AP1, AP2, and STAs associated with
them. APs obtain the ACs' virtual IP address from Option 43 in DHCP packets.
10.2.1.3 Background
As the number of STAs on the enterprise intranet keeps increasing, to ensure the stability
of wireless services, you, a network engineer, decide to purchase a new AC (AC2) to form
an HSB group with the existing AC (AC1) and configure the HSB group to work with
VRRP to implement AC HSB and improve the reliability of wireless services.
Item Configuration
Item Configuration
Country code: CN
Password: huawei123
4. Configure HSB on AC1, specify AC1 as the master device in VRRP group 1 and the
active device in HSB mode, and set the CAPWAP source address to the VRRP virtual
IP address.
5. Configure HSB on AC1, specify AC1 as the standby device in HSB mode, and set the
CAPWAP source address to the VRRP virtual IP address.
6. Verify the VRRP HSB configuration. Shut down the downlink interface on AC1, and
check the states of APs and STAs on AC2.
The poe enable command enables the PoE function on a port. When a port detects a PD
connected, the port supplies power to the PD. By default, the PoE function is enabled on
a port. Therefore, this command is unnecessary and is provided for demonstration
purpose only.
The PVID of the S3 port connected to AP1 is set to VLAN 10, packets in the service VLANs
and management VLANs are allowed to pass on the S3 port connected to S4, and the S3
ports connected to ACs are configured to allow packets in VLAN 100 to pass through.
[S4]vlan batch 10 11
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4]interface GigabitEthernet0/0/3
[S4-GigabitEthernet0/0/3] port link-type trunk
[S4-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 to 11
[S4-GigabitEthernet0/0/3] quit
[S4]interface GigabitEthernet0/0/4
[S4-GigabitEthernet0/0/4] port link-type trunk
[S4-GigabitEthernet0/0/4] port trunk pvid vlan 10
[S4-GigabitEthernet0/0/4] port trunk allow-pass vlan 10 to 11
[S4-GigabitEthernet0/0/4] quit
The PVID of the S4 port connected to AP2 is set to VLAN 10, and the uplink port of S4 is
configured to transparently transmit packets in VLANs 10 (management VLAN) and 11
(service VLAN).
[S3]interface Vlanif10
[S3-Vlanif10] description ap_mgnt
[S3-Vlanif10] ip address 10.0.10.1 255.255.255.0
[S3-Vlanif10] quit
[S3]interface Vlanif11
[S3-Vlanif11] description ap_service
[S3-Vlanif11] ip address 10.0.11.1 255.255.255.0
[S3-Vlanif11] quit
[S3]interface Vlanif100
[S3-Vlanif100] description to_AC
[S3-Vlanif100] ip address 10.0.100.3 255.255.255.0
[S3-Vlanif100] quit
On S3, VLANIF 10 is configured as the management VLAN gateway of AP1 and AP2;
VLANIF 11 is configured as the service VLAN gateway of STAs connected to AP1 and AP2;
and VLANIF 100 is used for Layer 3 communication with AC1 and AC2.
HCIP-Datacom-Core Technology Lab Guide Page 261
[AC1]interface Vlanif100
[AC1-Vlanif100] description to_S3_CAPWAP
[AC1-Vlanif100] ip address 10.0.100.1 255.255.255.0
[AC1-Vlanif100] quit
VLANIF 100 of AC1 is configured as the CAPWAP communication interface (instead of the
CAPWAP source interface).
[AC2]interface Vlanif100
[AC2-Vlanif100] description to_S3_CAPWAP
[AC2-Vlanif100] ip address 10.0.100.2 255.255.255.0
[AC2-Vlanif100] quit
VLANIF 100 of AC2 is configured as the CAPWAP communication interface (instead of the
CAPWAP source interface).
# Configure routes to the AP management network segments on AC1 and AC2.
Static routes to the AP management network segments are configured on ACs for
CAPWAP communication with APs.
# Configure the DHCP service on S3.
[S3]dhcp enable
[S3]ip pool ap
[S3-ip-pool-ap] gateway-list 10.0.10.1
[S3-ip-pool-ap] network 10.0.10.0 mask 255.255.255.0
[S3-ip-pool-ap] option 43 sub-option 3 ascii 10.0.100.254
[S3-ip-pool-ap] quit
[S3]ip pool service
[S3-ip-pool-service] gateway-list 10.0.11.1
[S3-ip-pool-service] network 10.0.11.0 mask 255.255.255.0
[S3-ip-pool-service] dns-list 10.0.11.1
[S3-ip-pool-service] quit
[S3]interface Vlanif10
[S3-Vlanif10] dhcp select global
[S3-Vlanif10] quit
[S3]interface Vlanif11
[S3-Vlanif11] dhcp select global
[S3-Vlanif11] quit
HCIP-Datacom-Core Technology Lab Guide Page 262
Create the AP group depart, configure MAC address authentication for APs, name the
APs ap1 and ap2, add them to the AP group depart, and associate parameter profiles
with the VAP profile depart.
The WLAN configurations on AC1 and AC2 are the same. The following uses AC1 as an
example.
# Create an AP group named depart.
[AC1]wlan
[AC1-wlan-view] ap-group name depart
[AC1-wlan-ap-group-depart] quit
# Create a regulatory domain profile and configure the AC's country code in the profile.
[AC1]wlan
[AC1-wlan-view] regulatory-domain-profile name default
[AC1-wlan-regulate-domain-default] country-code cn
Info: The current country code is same with the input country code.
[AC1-wlan-regulate-domain-default] quit
[AC1]wlan
[AC1-wlan-view]ap-group name depart
[AC1-wlan-ap-group- depart]regulatory-domain-profile default
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and
reset the AP. Continue?[Y/N]:y
[AC1-wlan-ap-group- depart]quit
[AC1]wlan
[AC1-wlan-view] ap auth-mode mac-auth
[AC1-wlan-view] ap-id 0 ap-mac 00e0-fc6e-2890 //Set the AP's MAC address as required in the lab
environment.
[AC1-wlan-ap-0] ap-name ap1
[AC1-wlan-ap-0] ap-group depart
[AC1-wlan-ap-0] quit
[AC1-wlan-view] ap-id 1 ap-mac 00e0-fcde-1990 //Set the AP's MAC address as required in the lab
environment.
[AC1-wlan-ap-1] ap-name ap2
[AC1-wlan-ap-1] ap-group depart
[AC1-wlan-ap-1] quit
[AC1]wlan
[AC1-wlan-view] security-profile name depart
[AC1-wlan-sec-prof-depart] security wpa2 psk pass-phrase huawei123 aes
[AC1-wlan-sec-prof- depart] quit
[AC1-wlan-view] ssid-profile name depart
[AC1-wlan-ssid-prof-depart] ssid HSB
[AC1-wlan-ssid-prof-depart] quit
[AC1-wlan-view] vap-profile name depart
[AC1-wlan-vap-prof-depart] forward-mode direct-forward
[AC1-wlan-vap-prof-depart] service-vlan vlan-id 11
[AC1-wlan-vap-prof-depart] ssid-profile depart
[AC1-wlan-vap-prof-depart] security-profile depart
[AC1-wlan-vap-prof-depart] quit
[AC1-wlan-view] ap-group name depart
[AC1-wlan-ap-group-depart] vap-profile depart wlan 1 radio all
[AC1-wlan-ap-group-depart] quit
The security profile depart is configured, with the authentication mode of WPA2-PSK and
the pre-shared key of huawei123.
The SSID profile depart is configured, and the SSID is set to HSB.
The VAP profile depart is configured, with the direct forwarding mode and the service
VLAN 11, and has the SSID profile depart and security profile depart bound.
The VAP profile depart is bound to the AP group depart.
Configure AC1 as the master in VRRP group 1. Configure the hot standby (HSB) function
on AC1 so that service information on AC1 is backed up to AC2 in real time or in batches,
ensuring seamless service switchover.
# Set the recovery delay of the VRRP group to 60 seconds.
# Create a management VRRP group on AC1. Set the VRRP priority of AC1 to 120 and the
preemption delay to 1800 seconds.
The VRRP priority of AC1 is adjusted, and AC1 is specified as the master device in VRRP
group 1.
# Create HSB service 0 on AC1, and configure the IP addresses and port numbers for
establishing an HSB channel. Set the retransmission time and interval of HSB packets.
[AC1] hsb-service 0
[AC1-hsb-service-0] service-ip-port local-ip 10.0.100.1 peer-ip 10.0.100.2 local-data-port 10241 peer-data-port 10241
[AC1-hsb-service-0] service-keep-alive detect retransmit 3 interval 6
[AC1-hsb-service-0] quit
# Create HSB group 0 on AC1, and bind HSB service 0 and the management VRRP group
to the HSB group.
[AC1] hsb-group 0
[AC1-hsb-group-0] bind-service 0
[AC1-hsb-group-0] track vrrp vrid 1 interface vlanif 100
[AC1-hsb-group-0] quit
[AC1]hsb-group 0
[AC1-hsb-group-0] hsb enable
[AC1-hsb-group-0] quit
Note that this IP address must be set to the VRRP virtual IP address.
Configure AC2 as the backup in VRRP group 1. Configure the HSB function on AC2 to
back up service information from AC1, ensuring seamless service switchover.
HCIP-Datacom-Core Technology Lab Guide Page 265
# Create a management VRRP group on AC2 and set the preemption delay to 1800
seconds.
# Create HSB service 0 on AC2, and configure the IP addresses and port numbers for
establishing an HSB channel. Set the retransmission time and interval of HSB packets.
[AC2] hsb-service 0
[AC2-hsb-service-0] service-ip-port local-ip 10.0.100.2 peer-ip 10.0.100.1 local-data-port 10241 peer-data-port 10241
[AC2-hsb-service-0] service-keep-alive detect retransmit 3 interval 6
[AC2-hsb-service-0] quit
# Create HSB group 0 on AC2, and bind HSB service 0 and the management VRRP group
to the HSB group.
[AC2] hsb-group 0
[AC2-hsb-group-0] bind-service 0
[AC2-hsb-group-0] track vrrp vrid 1 interface vlanif 100
[AC2-hsb-group-0] quit
[AC2]hsb-group 0
[AC2-hsb-group-0] hsb enable
[AC2-hsb-group-0] quit
Note that this IP address must be set to the VRRP virtual IP address.
# Check the VRRP status on AC1 and AC2. The State field of AC1 is Master and that of
AC2 is Backup.
HCIP-Datacom-Core Technology Lab Guide Page 266
<AC1>display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.0.100.254
Master IP : 10.0.100.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 1800s
TimerRun : 1s
TimerConfig : 1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : admin-vrrp
Backup-forward : disabled
Create time : 2020-06-12 08:26:33 UTC-05:13
Last change time : 2020-06-12 08:26:36 UTC-05:13
<AC2>display vrrp
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.0.100.254
Master IP : 10.0.100.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0s
TimerRun : 1s
TimerConfig : 1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : admin-vrrp
Backup-forward : disabled
Create time : 2020-06-12 08:41:15 UTC-05:13
Last change time : 2020-06-12 08:41:15 UTC-05:13
<AC1>display hsb-service 0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 10.0.100.1
Peer IP Address : 10.0.100.2
Source Port : 10241
Destination Port : 10241
KeepAlive Times :3
KeepAlive Interval :6
Service State : Connected
Service Batch Modules :
----------------------------------------------------------
HCIP-Datacom-Core Technology Lab Guide Page 267
<AC2>display hsb-service0
Hot Standby Service Information:
----------------------------------------------------------
Local IP Address : 10.0.100.2
Peer IP Address : 10.0.100.1
Source Port : 10241
Destination Port : 10241
KeepAlive Times :3
KeepAlive Interval :6
Service State : Connected
Service Batch Modules :
----------------------------------------------------------
The value of the Service State field is Connected, indicating that the HSB channel has
been established.
# Run the display hsb-group 0 command on AC1 and AC2 to check the running status of
the HSB group.
<AC1>display ap all
HCIP-Datacom-Core Technology Lab Guide Page 268
Info: This operation may take afew seconds. Please wait for amoment.done.
Total AP information:
nor : normal [2]
----------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STAUptime
----------------------------------------------------------------------------------------
0 00e0-fc6e-2890 ap1 depart 10.0.10.254 AirEngine5760-10 nor 1 12M:27S
1 00e0-fcde-1990 ap2 depart 10.0.10.253 AirEngine5760-10 nor 0 12M:29S
----------------------------------------------------------------------------------------
Total: 2
<AC2>dis ap all
Info: This operation may take afew seconds. Please wait for amoment.done.
Total AP information:
stdby: standby [2]
---------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
---------------------------------------------------------------------------------------
0 00e0-fc6e-2890 ap1 depart 10.0.10.254 AirEngine5760-10 stdby 1 -
1 00e0-fcde-1990 ap2 depart 10.0.10.253 AirEngine5760-10 stdby 0 -
---------------------------------------------------------------------------------------
Total: 2
<AC2>display hsb-group 0
Hot Standby Group Information:
----------------------------------------------------------
HSB-group ID :0
Vrrp GroupID :1
Vrrp Interface : Vlanif100
Service Index :0
GroupVrrp Status : Master
GroupStatus : Independent
GroupBackup Process : Independent
Peer GroupDevice Name : AC1
Peer GroupSoftware Version : V200R019C00
GroupBackup Modules : Access-user
AP
----------------------------------------------------------
AC2 is the master in VRRP group 1 that is in the independent running state (indicating
that the connection to AC1 is interrupted).
# Check AP online information on AC2.
<AC2>display ap all
Info: This operation may take afew seconds. Please wait for amoment.done.
Total AP information:
nor : normal [2]
----------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
----------------------------------------------------------------------------------------
0 00e0-fc6e-2890 ap1 depart 10.0.10.254 AirEngine5760-10 nor 1 39M:53S
1 00e0-fcde-1990 ap2 depart 10.0.10.253 AirEngine5760-10 nor 0 39M:55S
----------------------------------------------------------------------------------------
Total: 2
The AP status on AC2 is normal, and the Uptime value is not null (-).
# Check STA information on AC2.
--------------------------------------------------------------------------------------------------
Total: 1 2.4G: 1 5G: 0
10.2.3 Quiz
How many CAPWAP control channels are established between an AP and ACs when VRRP
HSB is deployed?
#
sysname S3
#
vlan batch 10 to 11 100
#
dhcp enable
#
ip pool ap
gateway-list 10.0.10.1
network 10.0.10.0 mask 255.255.255.0
option 43 sub-option 3 ascii 10.0.100.254
#
ip pool service
gateway-list 10.0.11.1
network 10.0.11.0 mask 255.255.255.0
dns-list 10.0.11.1
#
interface Vlanif10
description ap_mgnt
ip address 10.0.10.1 255.255.255.0
dhcp select global
#
interface Vlanif11
description ap_service
ip address 10.0.11.1 255.255.255.0
dhcp select global
#
interface Vlanif100
description to_AC
ip address 10.0.100.3 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100
#
HCIP-Datacom-Core Technology Lab Guide Page 271
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 to 11
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk pvid vlan 10
port trunk allow-pass vlan 10 to 11
#
return
Configuration on S4
#
sysname S4
#
vlan batch 10 to 11
#
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 to 11
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk pvid vlan 10
port trunk allow-pass vlan 10 to 11
#
return
Configuration on AC1
#
sysname AC1
#
vrrp recover-delay 60
#
vlan batch 100
#
interface Vlanif100
description to_S3_CAPWAP
ip address 10.0.100.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.0.100.254
admin-vrrp vrid 1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 1800
#
interface GigabitEthernet0/0/12
port link-type trunk
port trunk allow-pass vlan 100
#
ip route-static 10.0.10.0 255.255.255.0 10.0.100.3
HCIP-Datacom-Core Technology Lab Guide Page 272
#
capwap source ip-address 10.0.100.254
#
hsb-service 0
service-ip-port local-ip 10.0.100.1 peer-ip 10.0.100.2 local-data-port 10241 pe
er-data-port 10241
service-keep-alive detect retransmit 3 interval 6
#
hsb-group 0
track vrrp vrid 1 interface Vlanif100
bind-service 0
hsb enable
#
hsb-service-type access-user hsb-group 0
#
hsb-service-type ap hsb-group 0
#
wlan
traffic-profile name default
security-profile name depart
security wpa2 psk pass-phrase huawei123 aes
ssid-profile name depart
ssid HSB
vap-profile name depart
service-vlan vlan-id 11
ssid-profile depart
security-profile depart
regulatory-domain-profile name default
ap-group name depart
radio 0
vap-profile depart wlan 1
radio 1
vap-profile depart wlan 1
radio 2
vap-profile depart wlan 1
ap-group name default
ap-group name ap-group1
ap-id 0 type-id 56 ap-mac 00e0-fc6e-2890 ap-sn 210235448310F30CF56D
ap-name ap1
ap-group depart
ap-id 1 type-id 56 ap-mac 00e0-fcde-1990 ap-sn 210235448310FA145341
ap-name ap2
ap-group depart
provision-ap
#
Return
Configuration on AC2
#
sysname AC2
#
vrrp recover-delay 60
#
HCIP-Datacom-Core Technology Lab Guide Page 273
provision-ap
#
return
GE0/0/1 GE0/0/2
GE0/0/3 GE0/0/3
S3 S4
GE0/0/4 GE0/0/4
GE0/0/1 GE0/0/1
AP1 AP2
As shown in the figure, AC1 is the active AC, and AC2 is the standby AC. APs establish
CAPWAP links with the active and standby ACs, and periodically exchange CAPWAP
packets with the ACs to monitor the link status. When the AP detects a failure of the link
with the active AC, the AP instructs the standby AC to perform an active/standby
switchover. The standby AC becomes the active AC and controls STA access, thereby
improving WLAN reliability.
S4 transparently transmits packets from AP2 at Layer 2. S3 serves as the gateway for APs
and STAs.
S3 is enabled with DHCP to allocate IP addresses to AP1, AP2, and STAs associated with
them. APs obtain the IP addresses of AC1 and AC2 from Option 43 in DHCP packets. The
direct forwarding mode is configured for all APs.
HCIP-Datacom-Core Technology Lab Guide Page 275
10.3.1.3 Background
As the number of STAs on the enterprise intranet keeps increasing, to ensure the stability
of wireless services, you, a network engineer, decide to purchase a new AC and deploy
dual-link cold backup so that the new AC works as a backup of the existing AC, thereby
improving the reliability of wireless services.
Item Configuration
Country code: CN
SSID name: LB
Password: huawei123
AC2 priority: 1
HCIP-Datacom-Core Technology Lab Guide Page 276
The poe enable command enables the PoE function on a port. When a port detects a PD
connected, the port supplies power to the PD. By default, the PoE function is enabled on
a port. Therefore, this command is unnecessary and is provided for demonstration
purpose only.
[S3]interface GigabitEthernet0/0/3
[S3-GigabitEthernet0/0/3] port link-type trunk
[S3-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 to 11
[S3-GigabitEthernet0/0/3] quit
[S3]interface GigabitEthernet0/0/4
[S3-GigabitEthernet0/0/4] port link-type trunk
[S3-GigabitEthernet0/0/4] port trunk pvid vlan 10
[S3-GigabitEthernet0/0/4] port trunk allow-pass vlan 10 to 11
[S3-GigabitEthernet0/0/4] quit
The PVID of the S3 port connected to AP1 is set to VLAN 10, packets in the service VLANs
and management VLANs are allowed to pass on the S3 port connected to S4, and the S3
ports connected to ACs are configured to allow packets in VLAN 100 to pass through.
[S4]vlan batch 10 11
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4]interface GigabitEthernet0/0/3
[S4-GigabitEthernet0/0/3] port link-type trunk
[S4-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 to 11
[S4-GigabitEthernet0/0/3] quit
[S4]interface GigabitEthernet0/0/4
[S4-GigabitEthernet0/0/4] port link-type trunk
[S4-GigabitEthernet0/0/4] port trunk pvid vlan 10
[S4-GigabitEthernet0/0/4] port trunk allow-pass vlan 10 to 11
[S4-GigabitEthernet0/0/4] quit
The PVID of the S4 port connected to AP2 is set to VLAN 10, and the uplink port of S4 is
configured to transparently transmit packets in VLANs 10 (management VLAN) and 11
(service VLAN).
[S3]interface Vlanif10
[S3-Vlanif10] description ap_mgnt
[S3-Vlanif10] ip address 10.0.10.1 255.255.255.0
[S3-Vlanif10] quit
[S3]interface Vlanif11
[S3-Vlanif11] description ap_service
[S3-Vlanif11] ip address 10.0.11.1 255.255.255.0
HCIP-Datacom-Core Technology Lab Guide Page 278
[S3-Vlanif11] quit
[S3]interface Vlanif100
[S3-Vlanif100] description to_AC
[S3-Vlanif100] ip address 10.0.100.3 255.255.255.0
[S3-Vlanif100] quit
On S3, VLANIF 10 is configured as the management VLAN gateway of AP1 and AP2;
VLANIF 11 is configured as the service VLAN gateway of STAs connected to AP1 and AP2;
and VLANIF 100 is used for Layer 3 communication with AC1 and AC2.
[AC1]interface Vlanif100
[AC1-Vlanif100] description to_S3_CAPWAP
[AC1-Vlanif100] ip address 10.0.100.1 255.255.255.0
[AC1-Vlanif100] quit
[AC1] capwap source interface vlanif100
[AC2]interface Vlanif100
[AC2-Vlanif100] description to_S3_CAPWAP
[AC2-Vlanif100] ip address 10.0.100.2 255.255.255.0
[AC2-Vlanif100] quit
[AC2] capwap source interface vlanif100
Static routes to the AP management network segments are configured on ACs for
CAPWAP communication with APs.
# Configure the DHCP service on S3.
[S3]dhcp enable
[S3]ip pool ap
[S3-ip-pool-ap] gateway-list 10.0.10.1
[S3-ip-pool-ap] network 10.0.10.0 mask 255.255.255.0
[S3-ip-pool-ap] option 43 sub-option 2 ip-address 10.0.100.1 10.0.100.2
[S3-ip-pool-ap] quit
[S3]ip pool service
[S3-ip-pool-service] gateway-list 10.0.11.1
[S3-ip-pool-service] network 10.0.11.0 mask 255.255.255.0
[S3-ip-pool-service] dns-list 10.0.11.1
[S3-ip-pool-service] quit
The address pool service is configured to allocate IP addresses to STAs connected to AP1
and AP2. VLANIF interfaces on S3 are configured as the gateways for all address pools.
[S3]interface Vlanif10
[S3-Vlanif10] dhcp select global
[S3-Vlanif10] quit
[S3]interface Vlanif11
[S3-Vlanif11] dhcp select global
[S3-Vlanif11] quit
Create the AP group depart, configure MAC address authentication for APs, name the
APs ap1 and ap2, add them to the AP group depart, and associate parameter profiles
with the VAP profile depart.
The WLAN configurations on AC1 and AC2 are the same. The following uses AC1 as an
example.
# Create an AP group named depart.
[AC1]wlan
[AC1-wlan-view] ap-group name depart
[AC1-wlan-ap-group-depart] quit
# Create a regulatory domain profile and configure the AC's country code in the profile.
[AC1]wlan
[AC1-wlan-view] regulatory-domain-profile name default
[AC1-wlan-regulate-domain-default] country-code cn
Info: The current country code is same with the input country code.
[AC1-wlan-regulate-domain-default] quit
[AC1]wlan
[AC1-wlan-view]ap-group name depart
[AC1-wlan-ap-group- depart]regulatory-domain-profile default
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and
reset the AP. Continue?[Y/N]:y
[AC1-wlan-ap-group- depart]quit
HCIP-Datacom-Core Technology Lab Guide Page 280
[AC1]wlan
[AC1-wlan-view] ap auth-mode mac-auth
[AC1-wlan-view] ap-id 0 ap-mac 00e0-fc6e-2890 //Set the AP's MAC address as required in the lab
environment.
[AC1-wlan-ap-0] ap-name ap1
[AC1-wlan-ap-0] ap-group depart
[AC1-wlan-ap-0] quit
[AC1-wlan-view] ap-id 1 ap-mac 00e0-fcde-1990 //Set the AP's MAC address as required in the lab
environment.
[AC1-wlan-ap-1] ap-name ap2
[AC1-wlan-ap-1] ap-group depart
[AC1-wlan-ap-1] quit
[AC1]wlan
[AC1-wlan-view] security-profile name depart
[AC1-wlan-sec-prof-depart] security wpa2 psk pass-phrase huawei123 aes
[AC1-wlan-sec-prof- depart] quit
[AC1-wlan-view] ssid-profile name depart
[AC1-wlan-ssid-prof-depart] ssid LB
[AC1-wlan-ssid-prof-depart] quit
[AC1-wlan-view] vap-profile name depart
[AC1-wlan-vap-prof-depart] forward-mode direct-forward
[AC1-wlan-vap-prof-depart] service-vlan vlan-id 11
[AC1-wlan-vap-prof-depart] ssid-profile depart
[AC1-wlan-vap-prof-depart] security-profile depart
[AC1-wlan-vap-prof-depart] quit
[AC1-wlan-view] ap-group name depart
[AC1-wlan-ap-group-depart] vap-profile depart wlan 1 radio all
[AC1-wlan-ap-group-depart] quit
The security profile depart is configured, with the authentication mode of WPA2-PSK and
the pre-shared key of huawei123.
The SSID profile depart is configured, and the SSID is set to LB.
The VAP profile depart is configured, with the direct forwarding mode and the service
VLAN 11, and has the SSID profile depart and security profile depart bound.
The VAP profile depart is bound to the AP group depart.
HCIP-Datacom-Core Technology Lab Guide Page 281
Specify the IP address of the peer AC for APs on the active and standby ACs. Set the
priority of AC1 to 0 and that of AC2 to 1 so that AC1 and AC2 become the active and
standby ACs, respectively.
# Configure AC1.
[AC1]wlan
[AC1-wlan-view]ac protect protect-ac 10.0.100.2 priority 0
Warning: Operation successful. It will take effect after AP reset.
[AC1-wlan-view]undo ac protect restore disable
Info: Protect restore has already enabled.
[AC1-wlan-view]ac protect enable
Warning: This operation maybe cause AP reset, continue?[Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.done.
Info: Capwap echo interval has changed to default value 25, capwap echo times to 3.
[AC2]wlan
[AC2-wlan-view]ac protect protect-ac 10.0.100.1 priority 1
Warning: Operation successful. It will take effect after AP reset.
[AC2-wlan-view]undo ac protect restore disable
Info: Protect restore has already enabled.
[AC2-wlan-view]ac protect enable
Warning: This operation maybe cause AP reset, continue?[Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.done.
Info: Capwap echo interval has changed to default value 25, capwap echo times to 3.
# Run the display ac protect command on AC1 to check the dual-link information and
AC priority.
<AC1>display ac protect
------------------------------------------------------------
Protect state : enable
Protect AC : 10.0.100.2
Priority :0
Protect restore : enable
Coldbackup kickoff station: disable
------------------------------------------------------------
<AC2>display ac protect
------------------------------------------------------------
Protect state : enable
Protect AC : 10.0.100.1
Priority :1
Protect restore : enable
Coldbackup kickoff station: disable
------------------------------------------------------------
<AC1>display ap all
Info: This operation may take afew seconds. Please wait for amoment.done.
Total AP information:
nor : normal [2]
----------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
----------------------------------------------------------------------------------------
0 00e0-fc6e-2890 ap1 depart 10.0.10.254 AirEngine5760-10 nor 0 12M:27S
1 00e0-fcde-1990 ap2 depart 10.0.10.253 AirEngine5760-10 nor 0 12M:29S
----------------------------------------------------------------------------------------
Total: 2
<AC2>dis ap all
Info: This operation may take afew seconds. Please wait for amoment.done.
Total AP information:
stdby: standby [2]
---------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
---------------------------------------------------------------------------------------
0 00e0-fc6e-2890 ap1 depart 10.0.10.254 AirEngine5760-10 stdby 0 -
1 00e0-fcde-1990 ap2 depart 10.0.10.253 AirEngine5760-10 stdby 0 -
---------------------------------------------------------------------------------------
Total: 2
The AP status is normal on AC1 and standby on AC2. The APs have established CAPWAP
tunnels with AC1 and AC2.
# Enable the STA to search for the WLAN with the SSID LB and go online. Check STA
information on AC1 and AC2.
STA MAC AP ID Ap name Rf/WLAN Band Type Rx/Tx RSSI VLAN IP address SSID
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
<AC2>display ap all
Info: This operation may take a few seconds. Please wait for a moment.done.
Total AP information:
nor : normal [2]
---------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime
---------------------------------------------------------------------------------------
0 00e0-fc6e-2890 ap1 depart 10.0.10.253 AirEngine5760-10 nor 0 2S
1 00e0-fcde-1990 ap2 depart 10.0.10.254 AirEngine5760-10 nor 0 2S
---------------------------------------------------------------------------------------
Total: 2
The CAPWAP heartbeat detection time is 25s. If no response is received after three
heartbeat timeouts, the peer end is considered faulty. Therefore, the AP status change
can be displayed on the standby AC at least 75 seconds later.
The AP status on AC2 changes from standby to normal, but no STA goes online. When an
active/standby switchover is implemented between two ACs, STAs using open system
authentication remain connected to APs while STAs using other authentication modes are
disconnected and need to go online again by default.
In this case, reassociate the STA with the SSID LB.
# Check STA information on AC2.
10.3.3 Quiz
How many CAPWAP control channels are established between an AP and ACs when dual-
link cold backup is deployed?
#
sysname S3
#
vlan batch 10 to 11 100
#
dhcp enable
#
ip pool ap
gateway-list 10.0.10.1
network 10.0.10.0 mask 255.255.255.0
option 43 sub-option 3 ascii 10.0.100.254
#
ip pool service
gateway-list 10.0.11.1
network 10.0.11.0 mask 255.255.255.0
dns-list 10.0.11.1
#
interface Vlanif10
description ap_mgnt
ip address 10.0.10.1 255.255.255.0
dhcp select global
#
interface Vlanif11
description ap_service
ip address 10.0.11.1 255.255.255.0
dhcp select global
#
interface Vlanif100
description to_AC
ip address 10.0.100.3 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 to 11
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk pvid vlan 10
HCIP-Datacom-Core Technology Lab Guide Page 285
Configuration on S4
#
sysname S4
#
vlan batch 10 to 11
#
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 to 11
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk pvid vlan 10
port trunk allow-pass vlan 10 to 11
#
return
Configuration on AC1
#
sysname AC1
#
vlan batch 100
#
interface Vlanif100
description to_S3_CAPWAP
ip address 10.0.100.1 255.255.255.0
#
interface GigabitEthernet0/0/12
port link-type trunk
port trunk allow-pass vlan 100
#
ip route-static 10.0.10.0 255.255.255.0 10.0.100.3
#
capwap source interface vlanif100
#
wlan
ac protect enable protect-ac 10.0.100.2
traffic-profile name default
security-profile name depart
security wpa2 psk pass-phrase huawei123 aes
ssid-profile name depart
ssid LB
vap-profile name depart
service-vlan vlan-id 11
ssid-profile depart
security-profile depart
regulatory-domain-profile name default
ap-group name depart
HCIP-Datacom-Core Technology Lab Guide Page 286
radio 0
vap-profile depart wlan 1
radio 1
vap-profile depart wlan 1
radio 2
vap-profile depart wlan 1
ap-group name default
ap-group name ap-group1
ap-id 0 type-id 56 ap-mac 00e0-fc6e-2890 ap-sn 210235448310F30CF56D
ap-name ap1
ap-group depart
ap-id 1 type-id 56 ap-mac 00e0-fcde-1990 ap-sn 210235448310FA145341
ap-name ap2
ap-group depart
provision-ap
#
Return
Configuration on AC2
#
sysname AC2
#
vlan batch 100
#
interface Vlanif100
description to_S3_CAPWAP
ip address 10.0.100.2 255.255.255.0
#
interface GigabitEthernet0/0/13
port link-type trunk
port trunk allow-pass vlan 100
#
ip route-static 10.0.10.0 255.255.255.0 10.0.100.3
#
capwap source interface vlanif100
#
wlan
ac protect enable protect-ac 10.0.100.1 priority 1
traffic-profile name default
security-profile name depart
security wpa2 psk pass-phrase huawei123 aes
ssid-profile name depart
ssid LB
vap-profile name depart
service-vlan vlan-id 11
ssid-profile depart
security-profile depart
regulatory-domain-profile name default
ap-group name depart
radio 0
vap-profile depart wlan 1
radio 1
vap-profile depart wlan 1
radio 2
HCIP-Datacom-Core Technology Lab Guide Page 287
Reference Answers
Answers to the basic OSPF experiment
1. You can configure an interface a silent interface if this interface does not need to
establish an OSPF neighbor relationship, which reduces unnecessary OSPF packets
sending. In addition, the silent interface does not need to send OSPF packets.
2. The cost of a Type 2 external route remains unchanged within the OSPF area and is
equal to the cost (the default value is 1) configured when such a route is imported
into the OSPF area. The cost of a Type 1 external route within the OSPF area is the
sum of the cost of the Type 1 route and the cost of the route from the router to the
ASBR in the OSPF area.
3. When external routes are imported to the OSPF routing table on an ASBR, a Type 4
LSA is generated by an ABR in the area to which the ASBR belongs. The Type 4 LSA is
used to calculate the route destined for the ASBR.
4. A non-backbone area on the border of an AS can be configured as an NSSA if this
area needs to import external routes and has to avoid resource consumption caused
by the external routes.
5. A non-backbone area must be connected to backbone area 0. In addition, due to the
OSPF loop prevention mechanism, if area 0 is not contiguous, routes between non-
backbone areas may be missing, causing communication failures.
1. If the actual IP address of an interface is the same as the virtual IP address of a VRRP
group, the priority of the VRRP group is 255.