HCIP-Routing and Switching-IERS V2.5 Lab Guide PDF
HCIP-Routing and Switching-IERS V2.5 Lab Guide PDF
Huawei e-Learning
https://ilearningx.huawei.com/portal/#/portal/ebg/51
Huawei Certification
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_31
&lang=en
Find Training
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_trai
ningsearch&lang=en
More Information
Huawei learning APP
Huawei Certification
Lab Guide
HUAWEI TECHNOLOGIES 1
HCIP-Routing & Switching-IERS Lab Guide
Huawei owns all copyrights, except for references to other parties. No part of this
document may be reproduced or transmitted in any form or by any means without
prior written consent of Huawei Technologies Co., Ltd.
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 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,
expressed or implied.
Huawei Certification
Lab Guide
Edition 2.5
HUAWEI TECHNOLOGIES 2
HCIP-Routing & Switching-IERS Lab Guide
Relying on its strong technical and professional training and certification system and in
accordance with customers of different ICT technology levels, Huawei certification is committed
to providing customers with authentic, professional certification, and addresses the need for the
development of quality engineers that are capable of supporting Enterprise networks in the face
of an ever changing ICT industry. The Huawei certification portfolio for routing and switching
(R&S) is comprised of three levels to support and validate the growth and value of customer
skills and knowledge in routing and switching technologies.
The Huawei Certified Network Associate (HCIA) certification level validates the skills and
knowledge of IP network engineers to implement and support small to medium-sized enterprise
networks. The HCIA certification provides a rich foundation of skills and knowledge for the
establishment of such enterprise networks, along with the capability to implement services and
features within existing enterprise networks, to effectively support true industry operations.
HCIA certification covers fundamentals skills for TCP/IP, routing, switching and related IP
network technologies, together with Huawei data communications products, and skills for
versatile routing platform (VRP) operation and management.
HUAWEI TECHNOLOGIES 3
HCIP-Routing & Switching-IERS Lab Guide
Overview
Chapter 4 briefly introduces multicast address, IGMP, and PIM-SM, helping readers
learn fundamental multicast knowledge, common multicast protocol principles, and
multicast applications.
Chapter 5 illustrates how to flexibly use a variety of tools to control route selection. It
helps readers flexibly use routing protocols.
Chapter 6 describes the VLAN principles and implementation, including VLAN Layer
2 interconnection and Layer 3 routing, helping readers learn VLAN working
principles and configurations on the VRP.
This document helps readers understand how to implement routing and switching
technologies on Huawei products.
HUAWEI TECHNOLOGIES 4
HCIP-Routing & Switching-IERS Lab Guide
Icons
HUAWEI TECHNOLOGIES 5
HCIP-Routing & Switching-IERS Lab Guide
Contents
HUAWEI TECHNOLOGIES 6
HCIP-Routing & Switching-IERS Lab Guide
Lab Environment
Install eNSP
1. Login website of eNSP:
https://support.huawei.com/enterprise/en/tool/ensp-TL1000000015/23917110
3. Please refer to the software installation guide below to install eNSP in local PC.
Then engineer can practice lab with AR, Router, S57, S37, USG5500, AC, AP .
If the engineer want to practice lab with USG6000V, CE, NE40, NE5000E, NE9000,
CX, please follow Step4
HUAWEI TECHNOLOGIES 7
HCIP-Routing & Switching-IERS Lab Guide
2) Select USG6000V into new project of eNSP, then right click “start”of
USG6000V :
HUAWEI TECHNOLOGIES 8
HCIP-Routing & Switching-IERS Lab Guide
4) Click "Browse" - and import the downloaded mirror files, then engineer can
practice lab with USG6000V.
5) If the engineer want to practice CE, NE40, NE5000E, NE9000, CX, please
repeat step 4-1) --- 4).
HUAWEI TECHNOLOGIES 9
HCIP-IERS Chapter 2 OSPF Features and Configurations
Learning Objectives
The objectives of this lab are to learn and understand how to perform the following
operations:
HUAWEI TECHNOLOGIES 10
HCIP-IERS Chapter 2 OSPF Features and Configurations
Topology
Scenario
Assume that you are a network administrator of a company that has three ARG3
routers. These routers are interconnected over the Ethernet. A broadcast
multi-access network, such as Ethernet, has security threats. Therefore, OSPF area
authentication is required to prevent malicious route attacks. A network connectivity
failure occurs during network deployment. You can run the display and debug
commands for fault location.
Tasks
Configure IP addresses and masks for R1, R2, and R3. Set a 24-bit mask for loopback
interfaces to simulate an independent network segment.
<R1>system-view
HUAWEI TECHNOLOGIES 11
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
<R2>system-view
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
<R3>system-view
[R3-GigabitEthernet0/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R1]ping -c 1 10.0.123.2
HUAWEI TECHNOLOGIES 12
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.123.3
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.123.3
1 packet(s) transmitted
1 packet(s) received
HUAWEI TECHNOLOGIES 13
HCIP-IERS Chapter 2 OSPF Features and Configurations
Configure single-area OSPF and deploy all routers in area 0. Configure OSPF process
1. In addition, configure area authentication and set the password to huawei. In an
OSPF area, Huawei devices support plain text or MD5 authentication. Plain text
authentication is used for this step.
Set the wildcard subnet mask to 0.0.0.0 when you use the network command. To
ensure the stability of Router IDs, they are usually specified manually as.
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R3-ospf-1]area 0
HUAWEI TECHNOLOGIES 14
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
View the routing tables and test the connectivity of the entire network.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
HUAWEI TECHNOLOGIES 15
HCIP-IERS Chapter 2 OSPF Features and Configurations
The command output shows that R1 learns two routes from OSPF: 10.0.2.2/32 and
10.0.3.3/32. The next hops of the two routes are 10.0.123.2 and 10.0.123.3
respectively.
[R1]ping -c 1 10.0.2.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.3.3
1 packet(s) transmitted
1 packet(s) received
Run the display ospf brief command to view basic OSPF information on R1.
HUAWEI TECHNOLOGIES 16
HCIP-IERS Chapter 2 OSPF Features and Configurations
Route Preference: 10
ExChange/Loading Neighbors: 0
ExChange/Loading Neighbors: 0
HUAWEI TECHNOLOGIES 17
HCIP-IERS Chapter 2 OSPF Features and Configurations
Priority: 1
Run the display ospf peer brief command on R1 to check information about OSPF
neighbor relationships between the routers.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Total Peer(s): 2
The preceding command output shows that R1 has two neighbors in Area 0.0.0.0,
their router IDs are 10.0.2.2 and 10.0.3.3 respectively, and their OSPF neighbor
relationships are in Full state.
HUAWEI TECHNOLOGIES 18
HCIP-IERS Chapter 2 OSPF Features and Configurations
Run the display ospf lsdb command on R1 to check OSPF LSDB information.
Area: 0.0.0.0
The preceding command output shows that the LSDB contains four LSAs, the first
three of which are Type 1 LSAs generated by R1, R2, and R3 respectively. You can
check the AdvRouter field to determine which router generates an LSA. The fourth
LSA is a Type 2 LSA, which is generated by a DR of a network segment. Because R1 is
the DR of the network segment 10.0.123.0/24, you can see that the AdvRouter field
of this LSA is 10.0.1.1.
Area: 0.0.0.0
Type : Router
Ls id : 10.0.1.1
Ls age : 430
HUAWEI TECHNOLOGIES 19
HCIP-IERS Chapter 2 OSPF Features and Configurations
Len : 48
Options : E
seq# : 80000009
chksum : 0x8188
Link count: 2
Data : 255.255.255.255
Metric : 0
Priority : Medium
* Link ID : 10.0.123.1
Data : 10.0.123.1
Metric :1
The preceding command output shows detailed information about the Router LSA
generated by R1. This LSA describes two networks. The first network is the network
segment where the loopback interface resides. The Link Type field displays StubNet,
and Link ID and Data fields indicate the IP address and mask of this stub network
segment. The second network is the network segment that connects the three
routers. The Link Type displays TransNet, the Link ID field displays 10.0.123.1, which
is the interface address of the DR, and the Data field displays 10.0.123.1, which is the
local interface address on the network segment.
Area: 0.0.0.0
HUAWEI TECHNOLOGIES 20
HCIP-IERS Chapter 2 OSPF Features and Configurations
Type : Network
Ls id : 10.0.123.1
Ls age : 1662
Len : 36
Options : E
seq# : 80000005
chksum : 0x3d58
Priority : Low
The preceding command output shows detailed information about the Network LSA
generated by R1. This Type 2 LSA describes neighbor information on the network
segment where the DR resides.
Check DR and BDR election on the network segment 10.0.123.0/24 and analyze
whether the results of tests performed by different candidates are the same.
According to the following command output, the interface IP address of the DR on
this network segment is 10.0.123.1, and that of the BDR on this network segment is
10.0.123.2.
HUAWEI TECHNOLOGIES 21
HCIP-IERS Chapter 2 OSPF Features and Configurations
Neighbors
Authentication Sequence: [ 0 ]
Authentication Sequence: [ 0 ]
After the DR fails, the BDR becomes the new DR. You can reset an OSPF process to
observe the DR role change. The following example resets the OSPF process of R1.
HUAWEI TECHNOLOGIES 22
HCIP-IERS Chapter 2 OSPF Features and Configurations
Neighbors
Authentication Sequence: [ 0 ]
Authentication Sequence: [ 0 ]
After the OSPF process of R1 is reset, the BDR 10.0.123.2 becomes the new DR, and
the DR other 10.0.123.3 becomes the new BDR.
Shut down G0/0/0 of R1, R2, and R3 and run the debugging ospf 1 event command
to check the OSPF neighbor relationship establishment process. Undoshutdown
G0/0/0 of R1, R2, and R3 simultaneously, and observe neighbor status change and
DR and BDR election on the broadcast multi-access network.
HUAWEI TECHNOLOGIES 23
HCIP-IERS Chapter 2 OSPF Features and Configurations
<R1>terminal debugging
[R1-GigabitEthernet0/0/0]shut
[R1-GigabitEthernet0/0/0]undo shut
<R2>terminal debugging
[R2-GigabitEthernet0/0/0]shut
[R2-GigabitEthernet0/0/0]undo shut
<R3>terminal debugging
[R3-GigabitEthernet0/0/0]shutdown
[R3-GigabitEthernet0/0/0]undo shutdown
Perform the same operations on R2 and R3 and check debugging information on R3.
The default interface priority of all routers is 1. Therefore, router IDs of the three
routers are compared during DR election. Among the three routers, R3 has the
largest router ID and becomes the DR of the network segment.
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
HUAWEI TECHNOLOGIES 24
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
HUAWEI TECHNOLOGIES 25
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]
HUAWEI TECHNOLOGIES 26
HCIP-IERS Chapter 2 OSPF Features and Configurations
When G0/0/0 is just enabled, the interface state changes from Down to Waiting.
Then routers start exchanging Hello packets. After 40 seconds, the status of G0/0/0
on R3 changes from Waiting to DR.
Check the IP routing table of R1 and focus on the two routes 10.0.2.2/32 and
10.0.3.3/32.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
HUAWEI TECHNOLOGIES 27
HCIP-IERS Chapter 2 OSPF Features and Configurations
During the configuration of IP addresses for loopback interfaces of R2 and R3, the
24-bit mask is used. Analyze why the IP routing table of R1 displays routes with the
32-bit mask.
Run the display ospf interface LoopBack 0 verbose command to check the OSPF
running status of Loopback0.
Interfaces
IO Statistics
Hello 0 0
DB Description 0 0
Link-State Req 0 0
Link-State Update 0 0
Link-State Ack 0 0
ALLSPF GROUP
OSPF knows that the network segment where Loopback0 resides can have only one
IP address. Therefore the subnet mask of the advertised route is 32 bits.
HUAWEI TECHNOLOGIES 28
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R2]interface LoopBack 0
You can see that the subnet mask of the route to Loopback0 address advertised by
R2 is 24 bits.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
HUAWEI TECHNOLOGIES 29
HCIP-IERS Chapter 2 OSPF Features and Configurations
Run the display ospf interface LoopBack 0 verbose command to check the OSPF
running status of Loopback0. The command output shows that the network type of
Loopback0 is broadcast.
Interfaces
Priority: 1
IO Statistics
Hello 0 0
DB Description 0 0
Link-State Req 0 0
Link-State Update 0 0
Link-State Ack 0 0
ALLSPF GROUP
ALLDR GROUP
Check the cost of the route from R1 to Loopback0 of R3. You can see that the cost of
the route to 10.0.3.3/32 is 1.
HUAWEI TECHNOLOGIES 30
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
[R1-GigabitEthernet0/0/0]ospf cost 20
[R1-GigabitEthernet0/0/0]quit
[R3-GigabitEthernet0/0/0]ospf cost 10
HUAWEI TECHNOLOGIES 31
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R3-GigabitEthernet0/0/0]quit
Check the cost of the route from R1 to Loopback0 of R3 again. You can see that the
cost of the route to 10.0.3.3/32 is 20.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
On R3, check the cost of the route to 10.0.1.1/32. You can see that the cost is 10.
[R3]display ip routing-table
HUAWEI TECHNOLOGIES 32
HCIP-IERS Chapter 2 OSPF Features and Configurations
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
[R1]ospf 1
[R1-ospf-1]quit
[R1]display ip routing-table
HUAWEI TECHNOLOGIES 33
HCIP-IERS Chapter 2 OSPF Features and Configurations
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
Check the neighbor list of R1. You can see that OSPF neighbor relationships between
R1 and R2 and between R1 and R3 disapear. After a RIP interface is configured as a
silent interface, this interface does not send RIP updates. In OSPF, routers can
exchange routing information only after they establish an OSPF neighbor
relationship. After an OSPF interface is configured as a silent interface, this interface
does not receive or send Hello packets. As a result, this interface cannot establish
OSPF neighbor relationships with interfaces of other routers.
Interfaces
HUAWEI TECHNOLOGIES 34
HCIP-IERS Chapter 2 OSPF Features and Configurations
Priority: 1
Restore G0/0/0 of R1 to the default state and configure Loopback0 of the three
routes as silent interfaces.
[R1]ospf 1
[R1-ospf-1]silent-interface LoopBack 0
[R1-ospf-1]quit
[R2]ospf 1
[R2-ospf-1]silent-interface LoopBack 0
[R1-ospf-1]quit
[R3]ospf 1
[R3-ospf-1]silent-interface LoopBack 0
[R1-ospf-1]quit
Check the IP routing table of R1. The command output shows that configuring
Loopback0 as a silent interface does not affect its route advertisement.
[R1]display ip routing-table
HUAWEI TECHNOLOGIES 35
HCIP-IERS Chapter 2 OSPF Features and Configurations
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
----End
Analyze why the wildcard mask 0.0.0.0 is used in OSPF configuration? The wildcard
mask 0.0.0.255 can also be used in actual configuration, what are the differences of
the two wildcard masks?
Device Configurations
<R1>display current-configuration
HUAWEI TECHNOLOGIES 36
HCIP-IERS Chapter 2 OSPF Features and Configurations
[V200R007C00SPC600]
sysname R1
interface GigabitEthernet0/0/0
ospf cost 20
interface LoopBack0
silent-interface LoopBack0
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface GigabitEthernet0/0/0
interface LoopBack0
HUAWEI TECHNOLOGIES 37
HCIP-IERS Chapter 2 OSPF Features and Configurations
silent-interface LoopBack0
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface GigabitEthernet0/0/0
ospf cost 10
interface LoopBack0
silent-interface LoopBack0
area 0.0.0.0
HUAWEI TECHNOLOGIES 38
HCIP-IERS Chapter 2 OSPF Features and Configurations
return
HUAWEI TECHNOLOGIES 39
HCIP-IERS Chapter 2 OSPF Features and Configurations
Learning Objectives
Topology
HUAWEI TECHNOLOGIES 40
HCIP-IERS Chapter 2 OSPF Features and Configurations
Scenario
You are a network administrator of a company. There are five AR G3 routers in the
network. R1, R2, and R4 are deployed in the headquarters and connected through an
Ethernet. R3 and R5 are deployed in the branch. R3 is connected to R2 in the
headquarters through a leased line, and R5 is connected to R3 through a leased line.
Because of the large network scale, to control the flooding of LSAs, you design
multiple OSPF areas for interconnection.
To specify router IDs for the routers, configure the routers to use fixed addresses as
their router IDs.
OSPF routes are classified into internal and external routes. You change the priorities
of OSPF routes to avoid risks.
In OSPF, the cost of a specific route is the sum of the costs of all the links through
which a route reaches a destination network. The link cost is obtained through
comparison between the interface bandwidth and reference bandwidth. The
reference bandwidth is 100 Mbps, but actual interface bandwidth may be 1000 Mbps.
Because the cost is an integer, the OSPF cost of both fast Ethernet (FE) interfaces and
gigabit Ethernet (GE) interfaces is 1. To differentiate these links, you can define the
reference bandwidth as 10 Gbps.
HUAWEI TECHNOLOGIES 41
HCIP-IERS Chapter 2 OSPF Features and Configurations
Some network faults occur during device configuration, you can run the display and
debugging commands to rectify these faults.
Tasks
Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
loopback interfaces to simulate an independent network segment.
<R1>system-view
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R1]interface LoopBack 1
[R1-LoopBack1]quit
[R1]interface LoopBack 2
[R1-LoopBack2]quit
<R2>system-view
[R2-GigabitEthernet0/0/0]quit
HUAWEI TECHNOLOGIES 42
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
<R3>system-view
[R3-Serial2/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
<R4>system-view
[R4-GigabitEthernet0/0/0]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
<R5>system-view
HUAWEI TECHNOLOGIES 43
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
[R5]interface LoopBack 1
[R5-LoopBack1]quit
[R5]interface LoopBack 2
[R5-LoopBack2]quit
[R2]ping -c 1 10.0.124.1
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.124.4
1 packet(s) transmitted
HUAWEI TECHNOLOGIES 44
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) received
[R2]ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
To ensure stable router IDs, manually specify router IDs for routers. There are two
methods to manually specify a router ID for a router. The first one is to run the router
id command in the system view.
HUAWEI TECHNOLOGIES 45
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R1]router id 10.0.1.1
The second one is to specify the router-id parameter when starting an OSPF process.
When both methods are used on a router to specify a router ID, only the router ID
configured using the second method takes effect on the router. If multiple OSPF
processes need to be started on a router and these processes must use different
router IDs, you can only use the second method to specify router IDs for these
processes.
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2-ospf-1]area 0
HUAWEI TECHNOLOGIES 46
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R4-ospf-1]area 2
HUAWEI TECHNOLOGIES 47
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R4-ospf-1-area-0.0.0.2]quit
[R4-ospf-1]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
[R5]interface LoopBack 1
[R5-LoopBack1]quit
[R5]interface LoopBack 2
[R5-LoopBack2]quit
After the configurations are complete, check the IP routing table of R1.
[R1]display ip routing-table
HUAWEI TECHNOLOGIES 48
HCIP-IERS Chapter 2 OSPF Features and Configurations
---------------------------------------------------------------------------
Destinations : 24 Routes : 24
HUAWEI TECHNOLOGIES 49
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R1]ping -c 1 10.0.2.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.5.5
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.4.4
HUAWEI TECHNOLOGIES 50
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) transmitted
1 packet(s) received
Run the display ospf brief command on R2 to check basic OSPF information.
Route Preference: 10
ExChange/Loading Neighbors: 0
HUAWEI TECHNOLOGIES 51
HCIP-IERS Chapter 2 OSPF Features and Configurations
ExChange/Loading Neighbors: 0
Priority: 1
ExChange/Loading Neighbors: 0
Priority: 1
HUAWEI TECHNOLOGIES 52
HCIP-IERS Chapter 2 OSPF Features and Configurations
R2 has three interfaces that participate in OSPF route calculation. You have changed
the network type of Loopback0 to broadcast. The encapsulation type of Serial2/0/0
is PPP. Therefore, the default network type is point-to-point (P2P). GigabitEthernet
0/0/0 is connected to Area 2 and its network type is broadcast.
Run the display ospf peer brief command on R2 to check information about OSPF
neighbor relationships between the routers. The command output shows that in
Area 0, R2 has a neighbor 10.0.3.3; in Area 2, R2 has two neighbors 10.0.1.1 and
10.0.4.4 and has established neighbor relationships with the two neighbors (in Full
state).
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Run the display ospf lsdb command on R2 to check OSPF LSDB information. The
command output shows that R2 functioning as an ABR maintains two LSDBs, which
describe routes of Area 0 and Area 2 respectively.
HUAWEI TECHNOLOGIES 53
HCIP-IERS Chapter 2 OSPF Features and Configurations
Area: 0.0.0.0
Area: 0.0.0.2
HUAWEI TECHNOLOGIES 54
HCIP-IERS Chapter 2 OSPF Features and Configurations
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
HUAWEI TECHNOLOGIES 55
HCIP-IERS Chapter 2 OSPF Features and Configurations
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
These specific routes can be summarized and then advertised to other areas. Route
summarization can reduce the routing entries advertised to other areas and reduces
route flappings. Run the abr-summary command on R3 to summarize the network
segment of Loopback1 and Loopback2 of R5 for advertisement.
[R3]ospf 1
[R3-ospf-1]area 1
HUAWEI TECHNOLOGIES 56
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
HUAWEI TECHNOLOGIES 57
HCIP-IERS Chapter 2 OSPF Features and Configurations
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
Destinations : 0 Routes : 0
The preceding command output shows that in the OSPF routing table of R3, routes
10.1.0.0/24 and 10.1.1.0/24 are still displayed as specific routes; in the OSPF routing
table of R2, only the summarized route 10.1.0.0/23 exists.
After the configurations are complete, test the connectivity between other routers
and network segments 10.1.0.0/24 and 10.1.1.0/24.
[R1]ping -c 1 10.1.0.1
HUAWEI TECHNOLOGIES 58
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.1.1.1
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.1.0.1
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.1.0.1
HUAWEI TECHNOLOGIES 59
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) transmitted
1 packet(s) received
In real-world networks, you may use 1000M Ethernet and even 10G Ethernet. The
default OSPF reference bandwidth is 100 Mbps and the interface cost is an integer.
Therefore, OSPF cannot differentiate 100M Ethernet and 1000M Ethernet based on
the bandwidth.
[R2-ospf-1]bandwidth-reference 10000
Check the OSPF routing table of R2 to learn OSPF neighbor relationships and routing
information learning. In the OSPF routing table, the cost has changed.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
HUAWEI TECHNOLOGIES 60
HCIP-IERS Chapter 2 OSPF Features and Configurations
Destinations : 0 Routes : 0
In multiple OSPF areas, the OSPF reference bandwidth must be consistent. Otherwise,
OSPF cannot run normally. Change the OSPF reference bandwidth of all routers to 10
Gbps.
[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
HUAWEI TECHNOLOGIES 61
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R4-ospf-1]quit
[R5]ospf 1
[R5-ospf-1]bandwidth-reference 10000
[R5-ospf-1]quit
Check the neighbor list and OSPF routing table of R2 to determine whether OSPF
neighbor relationships and routing information are normal.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
HUAWEI TECHNOLOGIES 62
HCIP-IERS Chapter 2 OSPF Features and Configurations
Destinations : 0 Routes : 0
The preceding command output shows that routing information is normal. You can
test network connectivity.
Loopback1 and Loopback2 of R1 do not belong to an OSPF area. Import the network
segments where the two loopback interfaces reside into an OSPF area and
summarize the routes on R1.
[R1]ospf 1
[R1-ospf-1]import-route direct
[R1-ospf-1]quit
HUAWEI TECHNOLOGIES 63
HCIP-IERS Chapter 2 OSPF Features and Configurations
Type : External
Ls id : 10.2.0.0
Ls age : 293
Len : 36
Options : E
seq# : 80000001
chksum : 0x2b6
TOS 0 Metric: 2
E type :2
Tag :1
Priority : Low
R1 uses a Type 5 LSA to advertise the network segment 10.2.0.0 to other routers. The
subnet mask is 255.255.254.0.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
HUAWEI TECHNOLOGIES 64
HCIP-IERS Chapter 2 OSPF Features and Configurations
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
[R2]ping -c 1 10.2.0.1
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.2.1.1
HUAWEI TECHNOLOGIES 65
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) transmitted
1 packet(s) received
Delete Loopback2 of R1 and then check the routing entry change on R2. You can see
that Loopback2 does not exist but the summarized route still exists.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
HUAWEI TECHNOLOGIES 66
HCIP-IERS Chapter 2 OSPF Features and Configurations
Destinations : 0 Routes : 0
<R5>tracert 10.2.1.1
1 10.0.35.3 62 ms 28 ms 27 ms
2 10.0.23.2 54 ms 58 ms 57 ms
3 * * *
...
Although Loopback2 has been deleted, the packet to this destination address is still
forwarded by R2 and R3 until it is discarded by R1.
Import this default route into an OSPF area, define its type as Type 1, set its cost to
10, and configure permanent advertisement of this default route.
[R4]ospf 1
[R4-ospf-1]quit
HUAWEI TECHNOLOGIES 67
HCIP-IERS Chapter 2 OSPF Features and Configurations
Check default route learning on R2. You can see that R2 learns a default route using a
Type 5 LSA, and the next hop is the interface address of R4.
----------------------------------------------------------------------------
Destinations : 8 Routes : 8
Destinations : 8 Routes : 8
Destinations : 0 Routes : 0
[R5]ping -c 1 10.0.4.4
HUAWEI TECHNOLOGIES 68
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) transmitted
1 packet(s) received
Check the OSPF routing table of R1 and focus on priorities of different types of
routes.
----------------------------------------------------------------------------
Destinations : 8 Routes : 8
Destinations : 8 Routes : 8
HUAWEI TECHNOLOGIES 69
HCIP-IERS Chapter 2 OSPF Features and Configurations
Destinations : 0 Routes : 0
By default, the priorities of OSPF intra-area and inter-area routes are 10. The
priorities of OSPF external routes are 150.
On R1 and R4, change the priorities of OSPF intra-area and inter-area routes to 20
and those of OSPF external routes to 50.
[R1]ospf 1
[R1-ospf-1]preference 20
[R1-ospf-1]preference ase 50
[R1-ospf-1]quit
[R4]ospf 1
[R4-ospf-1]preference 20
[R4-ospf-1]preference ase 50
[R4-ospf-1]quit
Check the priorities of OSPF internal and external routes in the OSPF routing table of
R1. The following command output shows that their priorities have been changed
successfully.
----------------------------------------------------------------------------
Destinations : 8 Routes : 8
HUAWEI TECHNOLOGIES 70
HCIP-IERS Chapter 2 OSPF Features and Configurations
Destinations : 8 Routes : 8
Destinations : 0 Routes : 0
Route priorities take effect only on a router to help select the optimal route among
multiple routes learned using multiple methods. If route priorities on different
routers within the same area are different, these routers can still work normally.
----End
HUAWEI TECHNOLOGIES 71
HCIP-IERS Chapter 2 OSPF Features and Configurations
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface GigabitEthernet0/0/0
interface LoopBack0
interface LoopBack1
import-route direct
preference 20
preference ase 50
bandwidth-reference 10000
area 0.0.0.2
return
<R2>display current-configuration
HUAWEI TECHNOLOGIES 72
HCIP-IERS Chapter 2 OSPF Features and Configurations
[V200R007C00SPC600]
sysname R2
interface Serial2/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
bandwidth-reference 10000
area 0.0.0.0
area 0.0.0.2
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
HUAWEI TECHNOLOGIES 73
HCIP-IERS Chapter 2 OSPF Features and Configurations
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bandwidth-reference 10000
area 0.0.0.0
area 0.0.0.1
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
HUAWEI TECHNOLOGIES 74
HCIP-IERS Chapter 2 OSPF Features and Configurations
interface GigabitEthernet0/0/0
interface LoopBack0
preference 20
preference ase 50
bandwidth-reference 10000
area 0.0.0.2
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface Serial1/0/0
link-protocol ppp
HUAWEI TECHNOLOGIES 75
HCIP-IERS Chapter 2 OSPF Features and Configurations
interface LoopBack0
interface LoopBack1
interface LoopBack2
bandwidth-reference 10000
area 0.0.0.1
return
HUAWEI TECHNOLOGIES 76
HCIP-IERS Chapter 2 OSPF Features and Configurations
Learning Objectives
Topology
HUAWEI TECHNOLOGIES 77
HCIP-IERS Chapter 2 OSPF Features and Configurations
Scenario
You are a network administrator of a company. There are five AR G3 routers in the
network. R1, R2, R3, and R4 are deployed in the headquarters and connected
through an Ethernet. R5 is deployed in the branch and is connected to R3 in the
headquarters through a leased line. Because of the large network scale, to control
the flooding of LSAs, you design multiple OSPF areas for interconnection.
Loopback0 of R1 belongs to Area 2. Loopback0 of R2, R3, and R4 and the network
segment 10.1.234.0/24 belong to Area 0. The interconnected network segment
between R3 and R5 belongs to Area 1. Loopback0 of R5 belongs to an OSPF external
network.
To specify router IDs for the routers, configure the routers to use fixed addresses as
their router IDs.
You need to affect DR election and BDR election on the interconnected network
between R1, R2, R3, and R4. That is, you need to configure R3 as the DR, R2 as the
BDR, and R4 as the DR other.
Tasks
Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
loopback interfaces to simulate an independent network segment.
<R1>system-view
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
HUAWEI TECHNOLOGIES 78
HCIP-IERS Chapter 2 OSPF Features and Configurations
<R2>system-view
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
<R3>system-view
[R3-GigabitEthernet0/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
<R4>system-view
[R4-GigabitEthernet0/0/0]quit
[R4]interface LoopBack 0
HUAWEI TECHNOLOGIES 79
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R4-LoopBack0]quit
<R5>system-view
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
[R1]ping -c 1 10.1.234.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.1.234.4
1 packet(s) transmitted
HUAWEI TECHNOLOGIES 80
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) received
[R3]ping -c 1 10.1.234.1
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
HUAWEI TECHNOLOGIES 81
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R2-]interface LoopBack 0
[R2-LoopBack0]quit
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]quit
HUAWEI TECHNOLOGIES 82
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R4-ospf-1]quit
[R4-]interface LoopBack 0
[R4-LoopBack0]quit
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit
HUAWEI TECHNOLOGIES 83
HCIP-IERS Chapter 2 OSPF Features and Configurations
After the configurations are complete, check the IP routing table of R1.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 14 Routes : 14
The preceding command output shows that R1 has the routes of the entire network
except the network segment 10.0.5.5/24 that is not advertised into OSPF.
[R1]ping -c 1 10.0.2.2
HUAWEI TECHNOLOGIES 84
HCIP-IERS Chapter 2 OSPF Features and Configurations
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.4.4
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.1.1
1 packet(s) transmitted
1 packet(s) received
HUAWEI TECHNOLOGIES 85
HCIP-IERS Chapter 2 OSPF Features and Configurations
Run the display ospf brief command on R1 to check basic OSPF information
running on the routers. The command output shows that R1 has become an ABR
because its Loopback0 belongs to Area 2. The network segment to which
GigabitEthernet0/0/0 of R1 is connected is a broadcast network, and R1 is the DR of
this network segment.
Route Preference: 10
ExChange/Loading Neighbors: 0
HUAWEI TECHNOLOGIES 86
HCIP-IERS Chapter 2 OSPF Features and Configurations
ExChange/Loading Neighbors: 0
Priority: 1
ExChange/Loading Neighbors: 0
Priority: 1
HUAWEI TECHNOLOGIES 87
HCIP-IERS Chapter 2 OSPF Features and Configurations
Run the display ospf peer brief command on R1 to check information about OSPF
neighbor relationships between the routers. Because R1 is the DR, it has established
OSPF neighbor relationships with all the routers on this network segment. Run the
display ospf peer brief command on R3. The command output shows that R3 and
R4 establish an OSPF neighbor relationship instead of an adjacency.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 88
HCIP-IERS Chapter 2 OSPF Features and Configurations
Run the display ospf lsdb command on R5 to check OSPF LSDB information.
Area: 0.0.0.1
The preceding command output shows that Area 1 has only two routers. Therefore,
in the LSDB of R5, there are only two Type 1 LSAs, and the remaining Type 3 LSAs
describe inter-area routes that are advertised from R3 to R5.
Run the display ospf lsdb command on R2 to check OSPF LSDB information.
Area: 0.0.0.0
HUAWEI TECHNOLOGIES 89
HCIP-IERS Chapter 2 OSPF Features and Configurations
The preceding command output shows that R2 still has one Type 2 LSA in addition to
four Type 1 LSAs. GigabitEthernet0/0/0 of R2 is connected to a broadcast network,
and the DR on this network will generate a Type 2 LSA to describe all neighbors. The
AdvRouter field indicates that R1 generates this LSA. That is, the DR of this network
segment generates this LSA, which meets the requirements.
Run the display ospf lsdb command on R1 to check OSPF LSDB information.
Area: 0.0.0.0
HUAWEI TECHNOLOGIES 90
HCIP-IERS Chapter 2 OSPF Features and Configurations
Area: 0.0.0.2
Loopback0 of R1 belongs to Area 2. Therefore, R1 has LSDBs of two areas: Area 0 and
Area 2.
Run the display ospf lsdb command on R4 to check OSPF LSDB information.
Area: 0.0.0.0
HUAWEI TECHNOLOGIES 91
HCIP-IERS Chapter 2 OSPF Features and Configurations
LSDB information will vary depending on OSPF router roles. Analyze differences in
LSDBs of R5, R2, R1, and R4.
Set the priority of G0/0/0 on R3 to 255 to ensure that R3 becomes the DR of the
network segment 10.1.234.0/24. Set the priority of G0/0/0 on R2 to 254 to ensure
that R2 becomes the BDR of the network segment 10.1.234.0/24. Set the priority of
G0/0/0 on R4 to 0 to ensure that R4 does not participate in DR/ BDR election and
becomes the DR other of the network segment 10.1.234.0/24.
[R3-GigabitEthernet0/0/0]quit
[R2-GigabitEthernet0/0/0]quit
[R4-GigabitEthernet0/0/0]ospf dr-priority 0
[R4-GigabitEthernet0/0/0]quit
After the configurations are complete, the DR and BDR have been elected and
cannot be preempted. Therefore, G0/0/0 of R1, R2, R3, and R4 must be shut down
and G0/0/0 of R3, R2, R1, and R4 must be enabled in sequence.
[R1-GigabitEthernet0/0/0]shutdown
HUAWEI TECHNOLOGIES 92
HCIP-IERS Chapter 2 OSPF Features and Configurations
[R2-GigabitEthernet0/0/0]shutdown
[R3-GigabitEthernet0/0/0]shutdown
[R4-GigabitEthernet0/0/0]shutdown
[R1-GigabitEthernet0/0/0]undo shutdown
[R1-GigabitEthernet0/0/0]quit
[R2-GigabitEthernet0/0/0]undo shutdown
[R2-GigabitEthernet0/0/0]quit
[R3-GigabitEthernet0/0/0]undo shutdown
[R3-GigabitEthernet0/0/0]quit
[R4-GigabitEthernet0/0/0]undo shutdown
[R4-GigabitEthernet0/0/0]quit
Neighbors
HUAWEI TECHNOLOGIES 93
HCIP-IERS Chapter 2 OSPF Features and Configurations
Authentication Sequence: [ 0 ]
Authentication Sequence: [ 0 ]
Authentication Sequence: [ 0 ]
Neighbors
HUAWEI TECHNOLOGIES 94
HCIP-IERS Chapter 2 OSPF Features and Configurations
Authentication Sequence: [ 0 ]
After their interfaces are restarted, R3 becomes the DR and R2 becomes the BDR of
the network segment 10.1.234.0/24.
Neighbors
Authentication Sequence: [ 0 ]
After their neighbor relationship becomes stable, because R1 and R4 are both DR
others, they only establish a neighbor relationship in 2-way state.
HUAWEI TECHNOLOGIES 95
HCIP-IERS Chapter 2 OSPF Features and Configurations
Loopback0 of R5 does not belong to any OSPF area. Import the network segment
where Loopback0 resides into an OSPF area.
[R5]ospf 1
[R5-ospf-1]import-route direct
[R5-ospf-1]quit
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
Destinations : 0 Routes : 0
HUAWEI TECHNOLOGIES 96
HCIP-IERS Chapter 2 OSPF Features and Configurations
----------------------------------------------------------------------------
Destinations : 5 Routes : 5
Destinations : 4 Routes : 4
Destinations : 1 Routes : 1
You can see two external routes on both R1 and R3: 10.0.5.0/24 and 10.0.35.3/32.
10.0.5.0/24 is the loopback interface address of R5. Why there is still a route to
10.0.35.3/32?
Check the IP routing table of R5. PPP encapsulation is used between R3 and R5,
therefore, the Serial3/0/0 address of R3 is displayed in the IP routing table of R5 as a
direct route. After the import-route direct command is run on R5, this direct route is
HUAWEI TECHNOLOGIES 97
HCIP-IERS Chapter 2 OSPF Features and Configurations
also advertised. Other routing entries are not displayed in the following command
output.
[R5]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
[R1]ping -c 1 10.0.5.5
1 packet(s) transmitted
1 packet(s) received
Check OSPF external routes in the LSDB of R1. You can see that the LSDB contains
three external routes: 10.0.5.0/24, 10.0.35.0/24, and 10.0.35.3/32.
HUAWEI TECHNOLOGIES 98
HCIP-IERS Chapter 2 OSPF Features and Configurations
Type : External
Ls id : 10.0.5.0
Ls age : 834
Len : 36
Options : E
seq# : 80000001
chksum : 0xa904
TOS 0 Metric: 1
E type :2
Tag :1
Priority : Low
Type : External
Ls id : 10.0.35.0
Ls age : 1342
Len : 36
Options : E
seq# : 80000001
chksum : 0x5e31
TOS 0 Metric: 1
HUAWEI TECHNOLOGIES 99
HCIP-IERS Chapter 2 OSPF Features and Configurations
E type :2
Tag :1
Priority : Low
Type : External
Ls id : 10.0.35.3
Ls age : 1344
Len : 36
Options : E
seq# : 80000001
chksum : 0x404c
TOS 0 Metric: 1
E type :2
Tag :1
Priority : Medium
After comparison, you will find that the route 10.0.35.0/24 is displayed as an internal
route in the routing table of R1.
Check Type 3 LSAs in the LSDB of R1, and you can see the route 10.0.35.0/24.
Area: 0.0.0.0
Type : Sum-Net
Ls id : 10.0.35.0
Ls age : 236
Len : 28
Options : E
seq# : 80000007
chksum : 0x14e5
Priority : Low
Area: 0.0.0.2
Type : Sum-Net
Ls id : 10.0.35.0
Ls age : 1637
Len : 28
Options : E
seq# : 80000002
chksum : 0x42bf
Priority : Low
When the network bits and mask of the routes advertised by Type 3 and Type 5 LSAs
are the same, OSPF prefers and adds the route advertised by a Type 3 LSA into its
routing table.
On R1, check detailed information about Type 1 LSA 10.0.1.0 in Area 0 and Area 2.
Area: 0.0.0.0
Type : Router
Ls id : 10.0.1.1
Ls age : 591
Len : 36
Options : ABR E
seq# : 8000001e
chksum : 0xbc70
Link count: 1
Data : 10.1.234.1
Metric : 1
Area: 0.0.0.2
Type : Router
Ls id : 10.0.1.1
Ls age : 627
Len : 36
Options : ABR E
seq# : 80000008
chksum : 0x1018
Link count: 1
Date : 255.255.255.0
Metric :0
Priority: Low
For a Type 1 LSA, the Ls id field indicates the router ID of the router that generates
this LSA.
R1 generates two Type 1 LSAs and floods one within Area 0. In Area 0, R1 is
connected to a transit network segment. Therefore, the Link Type field displays
TransNet. For TransNet, the Link ID field indicates the interface IP address of the DR
on this network segment, and the Data field indicates the local interface IP address.
R1 floods the second Type 1 LSA within Area 2 and is connected to Area 2 through
loopback interfaces. For a loopback interface, the Link Type field displays StubNet.
The Link ID field indicates the IP network address of this stub network segment, and
the Data field indicates the network mask of this stub network segment.
On R2, R3, and R4, check detailed information about Type 2 LSA 10.1.234.0 in Area 0.
Area: 0.0.0.0
Type : Network
Ls id : 10.1.234.3
Ls age : 115
Len : 40
Options : E
seq# : 8000000f
chksum : 0x807e
Priority : Low
You can see that this LSA is the same on R2, R3, and R4.
You can also know that this LSA is generated by R3 according to the Adv rtr field.
The Ls id field of a Type 2 LSA indicates the interface IP address of the DR on this
network segment, and the Attached Router field indicates the router IDs of all the
routers on this network segment.
On R1 and R3, check detailed information about Type 3 LSA 10.0.35.0/24 in Area 0.
Area: 0.0.0.0
Type : Sum-Net
Ls id : 10.0.35.0
Ls age : 591
Len : 28
Options : E
seq# : 8000000a
chksum : 0xee8
Priority : Low
The preceding command output shows that this route is advertised by R3 within
Area 0. The Ls id field indicates the network address of the advertised destination
network segment, and the Net mask field indicates the mask of the destination
network segment.
Area: 0.0.0.0
Type : Sum-Net
Ls id : 10.0.35.0
Ls age : 136
Len : 28
Options : E
seq# : 80000004
chksum : 0x1ae2
Priority : Low
Area: 0.0.0.2
Type : Sum-Net
Ls id : 10.0.35.0
Ls age : 382
Len : 28
Options : E
seq# : 80000002
chksum : 0x42bf
Priority : Low
R1 has a total of two Type 3 LSAs 10.0.35.0/24. The Adv rtr field indicates that this
LSA in Area 0 is generated by R3. R1 is an ABR, so it generates another LSA after
receiving this LSA and advertises it within Area 2.
On R1, check detailed information about Type 4 LSA 10.0.5.0 in Area 2. A Type 4 LSA
describes how to reach an ASBR.
Area: 0.0.0.0
Type : Sum-Asbr
Ls id : 10.0.5.5
Ls age : 1119
Len : 28
Options : E
seq# : 80000008
chksum : 0x1df3
Area: 0.0.0.2
Type : Sum-Asbr
Ls id : 10.0.5.5
Ls age : 1118
Len : 28
Options : E
seq# : 80000008
chksum : 0x41d2
The preceding command output shows that R1 receives a Type 4 LSA from R3. The Ls
id field indicates the router ID of an ASBR. This LSA cannot be flooded across areas.
Therefore, R1 generates another Type 4 LSA and floods it within Area 2.
On R2, R4, and R3, this LSA exists in the LSDB for Area 0. These routers do not belong
to the same area as the ASBR (R5), so they need to know the location of this ASBR
through a Type 4 LSA.
Area: 0.0.0.0
Type : Sum-Asbr
Ls id : 10.0.5.5
Ls age : 1676
Len : 28
Options : E
seq# : 80000008
chksum : 0x1df3
The preceding command output shows that this Type 4 LSA does not exist in Area 1.
Routes in the same area do not need to know the ASBR location through this LSA.
Check the transmission of LSU and LSAck packets. Run the debugging ospf packet
update and debugging ospf packet ack commands on R1.
<R1>terminal monitor
<R1>terminal debugging
By default, when the network is running stably, an OSPF router updates its LSDB at
an interval of 30 minutes. To trigger routing information query and update, delete
Loopback0 of R3.
Info: This operation may take a few seconds. Please wait for a moment...succeeded.
[R3]
You can see that R1 receives an LSU packet sent from 10.1.234.3. The destination
address of the packet is 224.0.0.5 (namely all OSPF routers), describing a network
segment (# Links: 1), followed by the Link ID and Link Data of this network segment.
<R1>
<R1>
Then check the LSAck packet sent by R1. The source address is GigabitEthernet0/0/0
address of R1 and the destination address is 224.0.0.6. This packet is sent to the DR
and BDR. The sequence number of this packet is also 80000020.
<R1>
<R1>
[R3]interface loopback 0
[R3-LoopBack0]quit
R1 also receives an LSU packet from R3. However, this packet advertises a new
network segment. Therefore, # Links displays 2, followed by the network ID and
mask of the new network segment.
<R1>
<R1>
<R1>
<R1>
<R1>
<R1>
Next, check LSR packets. Normally, routers do not proactively send LSR packets. To
check LSR packet transmission, restart the OSPF process of R1. You can see that R1
initiates an LSR packet to R2.
<R1>terminal monitor
<R1>terminal debugging
<R1>
<R1>
<R1>
<R1>
----End
Assume that there is a router R6 in Area 2. What are the differences between the
procedure for calculating the routes to the network segment 10.0.5.0/24 on R6 and
that on R2 and R3?
If both R1 and R4 are configured as DR others, what are the potential problems?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface GigabitEthernet0/0/0
interface LoopBack0
area 0.0.0.0
area 0.0.0.2
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface GigabitEthernet0/0/0
interface LoopBack0
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface Serial3/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
area 0.0.0.0
area 0.0.0.1
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface GigabitEthernet0/0/0
ospf dr-priority 0
interface LoopBack0
area 0.0.0.0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
import-route direct
area 0.0.0.1
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company’s network has five AR
G3 routers. R2, R3, and R4 are deployed in the headquarters. R5 is deployed in one
branch. R5 is connected to R3 in the headquarters through a leased line. R1 is
deployed in the other branch and is connected to R2 in the headquarters through a
leased line.
To specify router IDs for the routers, configure the routers to use fixed addresses as
their router IDs.
Tasks
Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
loopback interfaces to simulate an independent network segment.
<R1>system-view
[R1-Serial1/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
<R2>system-view
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
<R3>system-view
[R3-Serial2/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
<R4>system-view
[R4-GigabitEthernet0/0/0]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
<R5>system-view
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
[R2]ping -c 1 10.0.12.1
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.24.4
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]area 3
[R2-ospf-1-area-0.0.0.3]qui
[R2-ospf-1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R4-ospf-1]area 3
[R4-ospf-1-area-0.0.0.3]quit
[R4-ospf-1]quit
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit
After the configurations are complete, check the IP routing table of R1.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
[R1]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.3.3
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.24.4
1 packet(s) transmitted
1 packet(s) received
Import the route to the network segment 10.0.5.0/24 where Loopback0 of R5 resides
into an OSPF area. Use the default configuration to import the route.
[R5]ospf 1
[R5-ospf-1]import-route direct
After the configurations are complete, check the imported route on R1 and test
network connectivity.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
[R1]ping -c 1 10.0.5.5
1 packet(s) transmitted
1 packet(s) received
Configure a default route on R4 with the next hop pointing to Loopback0. Import
this default route into an OSPF area, define it as a Type 1 route, and set its cost to 20,
without using permanent advertisement.
[R4]ospf 1
[R4-ospf-1]quit
After the configurations are complete, check information about learning this default
route on R1, and test network connectivity.
----------------------------------------------------------------------------
Destinations : 8 Routes : 8
Destinations : 8 Routes : 8
Destinations : 0 Routes : 0
[R1]ping -c 1 10.0.4.4
1 packet(s) transmitted
1 packet(s) received
Check routing information on R1. The default route is an external route (O_ASE),
which is learned through the Type 5 LSA advertised by R4.
Area: 0.0.0.2
AS External Database
Type : External
Ls id : 0.0.0.0
Ls age : 504
Len : 36
Options : E
seq# : 80000002
chksum : 0xa981
TOS 0 Metric: 20
E type :1
Tag :1
Priority : Low
[R1]ospf 1
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]stub
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
[R2]ospf 1
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]stub
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit
After the configurations are complete, on R1, compare the current IP routing table
with the previous one and check routing information learning. You can see that the
external route disappears and the default route also becomes an internal route.
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
Destinations : 0 Routes : 0
Check the LSDB of R1. You can see that the LSA describing the external route also
disappears, and the default route is learned through a Type 3 LSA.
Area: 0.0.0.2
Check detailed information about this Type 3 LSA. You can see that the default route
described by this LSA is advertised by R2. This proves that after an area is configured
as a stub area, an ABR prevents Type 4 and Type 5 LSAs from being sent to this area
and uses a Type 3 LSA to flood a default route pointing to itself within this area.
Area: 0.0.0.2
Type : Sum-Net
Ls id : 0.0.0.0
Ls age : 114
Len : 28
Options : None
seq# : 80000001
chksum : 0x1f31
Tos 0 metric: 1
Priority : Low
On R2, configure Area 2 as a totally stub area and specify the no-summary
parameter.
[R2]ospf 1
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]stub no-summary
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit
Check the OSPF routing table of R1. You can see that only one default route is
learned through OSPF.
----------------------------------------------------------------------------
Destinations : 1 Routes : 1
Destinations : 1 Routes : 1
Destinations : 0 Routes : 0
Check the LSDB of R1. You can see that the LSDB contains only one Type 3 LSA
generated by R2 in addition to the Type 1 LSAs generated by R1 and R2.
This proves that in a totally stub area, an ABR blocks Type 3, Type 4, and Type 5 LSAs
and generates a Type 3 LSA to advertise a default route pointing to itself.
Area: 0.0.0.2
Check the OSPF routing table of R3. You can see that the network segment
10.0.5.0/24 advertised by R5 is displayed as an external route.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 6 Routes : 6
Destinations : 1 Routes : 1
Check the OSPF routing table and LSDB of R5. You can see that R5 learns an external
route from R4 and that the remaining routes are all internal routes. R5 uses a Type 5
LSA to advertise the network segment 10.0.5.0/24.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
Area: 0.0.0.1
AS External Database
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]nssa
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R5]ospf 1
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]nssa
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit
After a neighbor relationship is established again, check the OSPF routing table of
R3.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 6 Routes : 6
Destinations : 1 Routes : 1
The preceding command output shows that the external route advertised by R5 is
displayed as O_NSSA in the OSPF routing table.
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
The default route was previously displayed as an external route (O_ASE) and now
becomes an external route (O_NSSA) of an NSSA area.
Area: 0.0.0.1
You can see that the Type 5 LSA disappears and the external route is advertised using
a Type 7 LSA.
Area: 0.0.0.1
Type : NSSA
Ls id : 0.0.0.0
Ls age : 1149
Len : 36
Options : None
seq# : 80000005
chksum : 0x7745
TOS 0 Metric: 1
E type :2
Tag :1
Priority : Low
The previous default route on R5 was advertised by R4, but the current default route
is advertised by R3.
This proves that external Type 4 and Type 5 LSAs are prevented from entering an
NSSA area, and an ABR uses a Type 7 LSA to advertise a default route within this area.
The external route of this area will be advertised by an ASBR as a Type 7 LSA into the
NSSA area.
The fundamental difference between an NSSA area and a stub area is that an NSSA
area allows importing external routes but a stub area does not.
Run the display ospf brief command to check the role of R3. You can see that the
Border Router field displays three values: AREA AS NSSA. AREA indicates that
this router is an ABR; AS indicates that this router is an ASBR; NSSA indicates that
this router has at least one interface located in an NSSA area.
Route Preference: 10
ExChange/Loading Neighbors: 0
ExChange/Loading Neighbors: 0
Priority: 1
ExChange/Loading Neighbors: 0
Type 5 LSAs are not allowed in an NSSA area. Therefore, an ASBR uses a Type 7 LSA
to advertise an external route within an NSSA area. However, this Type 7 LSA can only
be flooded within an NSSA area. After an ABR of this area receives this LSA, it
translates it into a Type 5 LSA and then advertises it to other common areas.
On R3, observe the procedure for translating Type 7 LSAs into Type 5 LSAs. The
following example uses the network segment 10.0.5.0/24. For a Type 7 LSA, the Ls id
field indicates the destination network segment, and the Net mask field indicates
the mask of the destination network segment. If the Options field displays NP, this
LSA can be translated by an ABR into a Type 5 LSA. If the Options field indicates that
this LSA cannot be translated into a Type 5 LSA, the Forwarding Address can be set
to 0.0.0.0. If the Options field indicates that this LSA can be translated into a Type 5
LSA, the Forwarding Address cannot be set to 0.0.0.0.
Here, the next hop of the imported external route is not within an OSPF routing
domain, and the Forwarding Address needs to be set as this ASBR’s interface IP
address of the stub network segment within an OSPF routing domain. The address
used here is the address of Serial1/0/0 on R5.
Area: 0.0.0.0
Area: 0.0.0.1
Type : NSSA
Ls id : 10.0.5.0
Ls age : 836
Len : 36
Options : NP
seq# : 80000001
chksum : 0xb0c2
TOS 0 Metric: 1
E type :2
Tag :1
Priority : Low
Check the Type 5 LSA generated by R3 to describe the network segment 10.0.5.0/24.
Type : External
Ls id : 10.0.5.0
Ls age : 882
Len : 36
Options : E
seq# : 80000001
chksum : 0x413e
TOS 0 Metric: 1
E type :2
Tag :1
Priority : Low
The values of the Ls id, Network Mask, and Forwarding Address fields are copied
from the previous Type 7 LSA. In this manner, the network segment 10.0.5.0/24 is
advertised into other areas.
----End
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.2
stub
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
area 0.0.0.0
area 0.0.0.2
stub no-summary
area 0.0.0.3
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.0
area 0.0.0.1
nssa
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface GigabitEthernet0/0/0
interface NULL0
interface LoopBack0
area 0.0.0.3
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
import-route direct
area 0.0.0.1
nssa
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. This company recently acquired two
small companies, whose routers are R4 and R5 respectively. To combine networks,
you decide to configure OSPF virtual links to implement network interconnection,
instead of planning the networks again. You find that there is non-contiguous Area 0
and that Area 3 is not directly connected to Area 0. Therefore, you establish a virtual
To specify router IDs for the routers, configure the routers to use fixed addresses as
their router IDs.
Tasks
Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
loopback interfaces to simulate an independent network segment.
<R1>system-view
[R1-Serial3/0/0]quit
[R1-Serial1/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
<R2>system-view
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
<R3>system-view
[R3-Serial2/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
<R4>system-view
[R4-Serial1/0/0]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
<R5>system-view
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
[R1]ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.23.2
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]area 3
[R1-ospf-1-area-0.0.0.3]quit
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R4-ospf-1]area 3
[R4-ospf-1-area-0.0.0.3]quit
[R4-ospf-1]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.3]quit
[R5-ospf-1]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
Check the OSPF routing table of R4. Although R4 establishes a neighbor relationship
with R1, it does not learn any OSPF routes.
Neighbors
Authentication Sequence: [ 0 ]
Check the LSDB of R4. You can see that there are only Type 1 LSAs. That is, R1 does
not advertise routes of other areas into Area 3.
Area: 0.0.0.3
Check the OSPF routing table of R1. The route to 10.0.5.0/24 disappears. After
analyzing the LSDB of R3, you will know why this route disappears.
----------------------------------------------------------------------------
Destinations : 5 Routes : 5
Destinations : 5 Routes : 5
Destinations : 0 Routes : 0
Check the LSDB of R1. To prevent inter-area loops, OSPF does not allow directly
advertising routing information between two non-backbone areas. The LSDB shows
that an ABR does not forward the Type 3 LSAs received from non-backbone areas.
On R1, the LSDB for Area 2 has four inter-area routes, which are learned from R2
(10.0.2.2). R1 does not forward these LSAs into Area 3. Therefore, R4 cannot learn
routes outside its local area.
An ABR does not forward the routes learned from a non-backbone area to another
non-backbone area. The routes learned by R1 from R4 will not be advertised as Type
3 LSAs into Area 2. Therefore, R2, R3, and R5 cannot learn routes of Area 3.
Area: 0.0.0.2
Area: 0.0.0.3
Check the OSPF routing table of R2. Three routes to network segments 10.0.4.0/24,
10.0.5.0/24, and 10.0.14.0/24 respectively disappear from the OSPF routing table of
R2.
----------------------------------------------------------------------------
Destinations : 3 Routes : 3
Destinations : 3 Routes : 3
Destinations : 0 Routes : 0
Check the LSDB of R2. You can see that R1 does not advertise routes of Area 3 to R2.
Area: 0.0.0.0
Area: 0.0.0.2
Check the OSPF routing table of R3. The routes to network segments 10.0.4.0/24,
10.0.5.0/24, and 10.0.14.0/24 disappear from the OSPF routing table.
----------------------------------------------------------------------------
Destinations : 3 Routes : 3
Destinations : 3 Routes : 3
Destinations : 0 Routes : 0
Check the LSDB of R3. You can see that in Area 1, R3 receives a Type 3 LSA 10.0.5.0
from R5. According to rules, R3 does not forward the Type 3 LSA received from a
non-backbone area.
R3 does not send this LSA into Area 0 again. This is why R1 and R2 do not have the
route 10.0.5.0/24.
Area: 0.0.0.0
Area: 0.0.0.1
The Type 3 LSA 10.0.5.0/24 received from R5 already exists in the LSDB of R3 but
does not appear in the routing table of R3.
----------------------------------------------------------------------------
Destinations : 5 Routes : 5
Destinations : 5 Routes : 5
Destinations : 0 Routes : 0
Area: 0.0.0.0
Area: 0.0.0.1
Check the Type 1 LSAs generated by R3. The following command output displays
only information about the Type 1 LSAs.
Area: 0.0.0.0
Type : Router
Ls id : 10.0.3.3
Ls age : 732
Len : 60
Options : ABR E
seq# : 80000158
chksum : 0xde39
Link count: 3
Data : 255.255.255.255
Metric : 0
Priority : Medium
Data : 10.0.23.3
Metric : 1562
Data : 255.255.255.0
Metric : 1562
Priority : Low
The preceding command output shows that the type of the link between R3 and R2
is P-2-P. If the link type of an interface is P-2-P, TransNet, or Virtual, a router
considers that this interface will exchange routing information with other routers.
The router connected to a backbone area through each of the three links does not
add the routes learned through Type 3 LSAs from non-backbone areas to its routing
table.
Area: 0.0.0.0
Type : Router
Ls id : 10.0.5.5
Ls age : 583
Len : 36
Options : ABR E
seq# : 80000040
chksum : 0x6d69
Link count: 1
Data : 255.255.255.255
Metric : 0
Priority : Medium
R5 has only one Loopback0 belonging to the backbone area. In the LSA describing
the route to this interface address, the link type is StubNet, indicating that this
interface is not connected to any other router. Then R5 adds the route learned
through a Type 3 LSA sent from a non-backbone area to its routing table.
Configure a virtual link on R3 and R5 and specify the router ID of the peer ABR in the
vlink-peer command.
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]vlink-peer 10.0.5.5
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R5]ospf
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]vlink-peer 10.0.3.3
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit
Virtual Links
GR State: Normal
----------------------------------------------------------------------------
Destinations : 4 Routes : 4
Destinations : 4 Routes : 4
Destinations : 0 Routes : 0
The preceding command output shows that R3 learns the route to 10.0.5.0/24.
Test network connectivity. You can see that R3 can communicate with the network
segment connected to Loopback0 of R5.
[R3]ping -c 1 10.0.5.5
1 packet(s) transmitted
1 packet(s) received
Area: 0.0.0.0
Area: 0.0.0.1
R3 receives two Type 1 LSAs from R5. The first Type 1 LSA is received in Area 0, and
the virtual link belongs to Area 0. Therefore, this LSA is learned through the virtual
link. The second Type 1 LSA is learned in Area 1 and already exists before the virtual
link is established. The route to 10.0.5.0/24 is calculated through the LSA learned in
Area 0.
Check detailed information about the Type 1 LSA 10.0.5.5 in the LSDB of R3.
Area: 0.0.0.0
Type : Router
Ls id : 10.0.5.5
Ls age : 621
Len : 48
Options : ABR E
seq# : 80000005
chksum : 0x1291
Link count: 2
Data : 255.255.255.0
Metric : 0
Priority : Low
Data : 10.0.35.5
Metric : 1562
Area: 0.0.0.1
Type : Router
Ls id : 10.0.5.5
Ls age : 621
Len : 48
seq# : 80000004
chksum : 0x3530
Link count: 2
Data : 10.0.35.5
Metric : 1562
Data : 255.255.255.0
Metric : 1562
Priority : Low
The preceding command output shows that this LSA describes the network
10.0.5.0/24. Therefore, R3 has the corresponding route. The Type 1 LSA learned in
Area 1 describes only the interconnected network segment between R3 and R5.
Area: 0.0.0.0
Area: 0.0.0.1
You can see that the LSDB of R5 is the same as that of R3. After the virtual link is
established, R3 and R5 both have interfaces that belong to Area 0. Therefore, their
LSDBs are synchronized.
[R1]ospf 1
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]vlink-peer 10.0.2.2
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
[R2]ospf
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]vlink-peer 10.0.1.1
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
[R4]ping -c 1 10.0.5.5
1 packet(s) transmitted
1 packet(s) received
Area: 0.0.0.0
Area: 0.0.0.2
Area: 0.0.0.3
Because a virtual link is created, R1 has LSAs of Area 0. Then Area 0 and Area 3 can
exchange routes directly. R1 uses a Type 3 LA to advertise routing information about
Area 0 into Area 3.
Area: 0.0.0.3
The preceding command output shows that R4 learns the Type 3 LSA advertised by
R1.
Control advertisement of the route to 10.0.4.0/24 so that R1 can learn this route but
R2, R3, and R5 cannot.
Configure an ACL.
[R1-acl-basic-2000]rule permit
[R1-acl-basic-2000]permit
Configure Type 3 LSA filtering on R1 when R1 sends routing updates from Area 3 to
other areas.
[R1]ospf 1
[R1-ospf-1]area 3
[R1-ospf-1-area-0.0.0.3]quit
[R1-ospf-1]quit
----------------------------------------------------------------------------
Destinations : 5 Routes : 5
Destinations : 5 Routes : 5
Destinations : 0 Routes : 0
R1 still has this route. This is because R1 and R4 belong to the same area and R4 uses
a Type 1 LSA to advertise this route to R1.
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
Destinations : 0 Routes : 0
----End
Why must Areas 0 in OSPF be contiguous? Can Type 1 and Type 2 LSAs be filtered
according to the current OSPF design?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
rule 10 permit
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.0
area 0.0.0.2
vlink-peer 10.0.2.2
area 0.0.0.3
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.0
area 0.0.0.2
vlink-peer 10.0.1.1
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.0
area 0.0.0.1
vlink-peer 10.0.5.5
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.3
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.0
area 0.0.0.1
vlink-peer 10.0.3.3
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company’s network uses OSPF
as the routing protocol. OSPF has powerful functions but also has complex
configurations. You use various OSPF features including virtual link in network
planning. During network operation, many network communication problems occur.
You use troubleshooting methods to locate and solve these problems, restoring the
network.
Tasks
Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
loopback interfaces to simulate an independent network segment.
<R1>system-view
[R1-Serial1/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
<R2>system-view
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
<R3>system-view
[R3-Serial2/0/0]quit
[R3-GigabitEthernet0/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
<R4>system-view
[R4-GigabitEthernet0/0/0]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
<R5>system-view
[R5-GigabitEthernet0/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
[R3]ping -c 1 10.0.75.4
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.75.5
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.23.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]quit
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]quit
[R4-ospf-1]quit
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
Check the neighbor list of R4. You can see that R4 does not establish neighbor
relationships with other routers.
Run the display ospf error command on R3, R4, and R5 to check OSPF errors.
The preceding command output shows that five types of errors occur on R3, R4, and
R5: Router id confusion (router ID conflict), Netmask mismatch (unmatched subnet
mask), Bad area id (incorrect area ID), Bad packet (error packet), and Bad virtual link
(incorrect virtual link).
Because no virtual link is configured, the incorrect virtual link indicates an incorrect
area ID. If R4 receives an OSPF packet with an area ID 0 on the interface with area ID
1, R4 considers that this packet is sent through a virtual link. No virtual link is
configured on R4, this situation indicates that an error occurs.
A subnet mask error also indicates a type of error packet. You can rectify the subnet
mask error and then check whether error packets still exist.
First, solve the router ID conflict. Check the router ID of each router in sequence to
manually locate the router with the router ID or check system logs to locate the
router. Run the display logbuffer command to check current system logs.
[R5]display logbuffer
Dropped messages: 0
Overwritten messages: 0
Current messages: 66
IpAddr=10.0.75.5, PacketSrcIp=10.0.75.4)
Route Preference: 10
ExChange/Loading Neighbors: 0
ExChange/Loading Neighbors: 0
Priority: 1
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]quit
[R4-ospf-1]undo area 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
Wait for a while and then run the display ospf error command to check whether the
problem of router ID conflict and incorrect area ID is solved.
The preceding command output shows that after the router ID and area ID of R4 are
changed, the problem of router ID conflict and incorrect area ID is solved, and there
is only the problem of unmatched subnet masks. To locate the router with an
incorrect subnet mask, check debugging information on R4.
<R4>terminal debugging
<R4>
The preceding command output shows that the subnet mask in the Hello packet
sent from 10.0.75.3 is 255.255.255.128. According to the topology, the interface
configuration of R3 is incorrect.
[R3-GigabitEthernet0/0/0]display this
[V200R007C00SPC600]
interface GigabitEthernet0/0/0
return
[R3-GigabitEthernet0/0/0]quit
Clear OSPF statistics again to check whether OSPF errors still exist.
Check the neighbor list of R3. You can see that its neighbor relationships with
neighbors are normal.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
[R4-GigabitEthernet0/0/0]quit
After about 30 seconds, you can see that all neighbor information of R4 disappears.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
<R4>system-view
The preceding command output shows Hello timer mismatch, indicating that Hello
intervals of neighbors are inconsistent.
Cancel the Hello interval configuration and then check the neighbor list again.
[R4-GigabitEthernet0/0/0]quit
----------------------------------------------------------------------------
----------------------------------------------------------------------------
The preceding command output shows that neighbor relationships become normal.
[R1-Serial1/0/0]quit
[R2-Serial1/0/0]quit
After the configurations are complete, clear OSPF statistics of R1 and then check
OSPF errors.
<R1>system-view
Configure MD5 authentication on R1 and then check whether OSPF errors still exist.
[R1-Serial1/0/0]return
The preceding command output shows that OSPF errors still exist.
[R1-Serial1/0/0]quit
----------------------------------------------------------------------------
----------------------------------------------------------------------------
The preceding command output shows that R1 and R2 have established a neighbor
relationship.
To ensure connectivity between Area 2 and Area 0, create a virtual link between R2
and R3.
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]vlink-peer 10.0.3.3
[R2-ospf-1-area-0.0.0.1]quit
[R2-ospf-1]quit
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]vlink-peer 10.0.2.2
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
Check whether the virtual link is established normally and whether R1 learns
network-wide routes.
Virtual Links
GR State: Normal
----------------------------------------------------------------------------
Destinations : 5 Routes : 5
Destinations : 5 Routes : 5
Destinations : 0 Routes : 0
Test connectivity from R1 to R5. The following command output shows that R1 can
reach R5.
[R1]ping -c 1 10.0.5.5
1 packet(s) transmitted
1 packet(s) received
Users connected to R1 find that they cannot access addresses outside Area 2. An
administrator logs in to R1 and finds that R1 cannot communicate with R5 using the
loopback interface address.
[R1]ping -c 1 10.0.5.5
1 packet(s) transmitted
0 packet(s) received
Check the virtual link between R2 and R3. You can see that the virtual link status is
not normal and the router ID of R2 changes.
Virtual Links
GR State: Normal
A virtual link is established based on the router ID of the peer device. The router ID of
R2 changes, so the virtual link fails.
Generally, to prevent a router ID from changing during the operation of a router, you
need to specify a router ID for this router when starting an OSPF process.
On R2, set the router ID to 10.0.2.2, add the address of Loopback0, and then restart
the OSPF process.
Info: The configuration succeeded. You need to restart the OSPF process to validate the new router ID.
[R2-ospf-1]interface LoopBack 0
[R2-LoopBack0]quit
Virtual Links
GR State: Normal
For security, the administrator uses area authentication in Area 0, enable MD5
encryption to encrypt packets, and set the key to huawei.
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
[R5]ospf 1
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
The administrator finds that users in Area 2 cannot access networks outside Area 2
and then check the virtual link, finding that the virtual link fails again.
Virtual Links
Clear OSPF statistics and then check OSPF errors. The following command output
shows that authentication errors occur.
The virtual link belongs to Area 0. Area authentication is enabled in Area 0, so area
authentication also needs to be enabled on the virtual link.
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
The preceding command output shows that the virtual link status becomes normal
and R1 can access other areas normally.
Virtual Links
GR State: Normal
[R1]ping -c 1 10.0.5.5
1 packet(s) transmitted
1 packet(s) received
On R4, import the address of Loopback0 as an external route and configure route
summarization using the 16-bit subnet mask.
[R4]ospf 1
[R4-ospf-1]import-route direct
[R4-ospf-1]quit
[R2]ospf 1
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit
All users on the network except users connected to R4 reflect that they cannot
access the loopback interface address 10.1.4.4 of R4.
Check the OSPF routing of R5 that is located in the same area as R4. The following
command output shows that to reach 10.1.4.4, the route 10.1.0.0/16 must be used.
The next hop of this route is 10.0.75.3.
----------------------------------------------------------------------------
Destinations : 5 Routes : 5
Destinations : 5 Routes : 5
Destinations : 0 Routes : 0
Area: 0.0.0.0
AS External Database
The LSDB of R5 has two LSAs describing the route to 10.1.0.0. Check detailed
information about LSAs. The following Type 3 LSA is originated by R2, and the Type 5
LSA is originated by R5. The two LSAs describe the same network segment.
Area: 0.0.0.0
Type : Sum-Net
Ls id : 10.1.0.0
Ls age : 767
Len : 28
Options : E
seq# : 80000001
chksum : 0xa380
Priority : Low
Type : External
Ls id : 10.1.0.0
Ls age : 871
Len : 36
Options : E
seq# : 80000001
chksum : 0xe3cd
TOS 0 Metric: 2
E type :2
Tag :1
Priority : Low
In OSPF, Type 3 LSAs are always preferred over Type 5 LSAs. Therefore, in the OSPF
routing table of R5, the next hop of the route to 10.1.0.0/16 is R3.
To prevent this problem, cancel external route summarization. This route then will
appear in the OSPF routing tables of other routers.
[R4]ospf 1
[R4-ospf-1]quit
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
Destinations : 0 Routes : 0
The preceding command output shows that R5 learns a correct route to 10.1.4.4/24.
Test network connectivity on R1.
[R1]ping -c 1 10.1.4.4
1 packet(s) transmitted
1 packet(s) received
----End
Can area authentication and interface authentication be enabled in the same area?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.2
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
area 0.0.0.0
area 0.0.0.1
vlink-peer 10.0.3.3
area 0.0.0.2
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface Serial2/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
area 0.0.0.0
area 0.0.0.1
vlink-peer 10.0.2.2
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface GigabitEthernet0/0/0
interface LoopBack0
import-route direct
area 0.0.0.0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface GigabitEthernet0/0/0
interface LoopBack0
area 0.0.0.0
Return
Learning Objectives
Topology
Scenario
IS-IS runs as an IGP in a network. R1 and R5 run in Area 49.0002 as Level-2 routers.
R2, R3, and R4 run in Area 49.0001. R4 is a Level-1 router, while R2 and R3 are
Level-1-2 routers. The requirements are as follows: R4 can use the external routes
imported by R5. R4 connected to S5 functions as the DIS. There is a P2P link between
R1 and R5. Uplink and downlink traffic from R4 to R5 is forwarded through Ethernet
interfaces, and route selection is controlled using the cost and route leaking.
Switches do not require additional configurations and are only responsible for
transparent forwarding.
Tasks
[R1]interface loopback 0
[R1-LoopBack0]quit
[R1-GigabitEthernet0/0/0]quit
[R1-GigabitEthernet0/0/1]quit
[R1-Serial1/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R2-GigabitEthernet0/0/0]quit
[R2]interface Serial1/0/0
[R2-Serial1/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R3-GigabitEthernet0/0/0]quit
[R3-GigabitEthernet0/0/1]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
[R4-GigabitEthernet0/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
[R5-GigabitEthernet0/0/0]quit
[R1]ping -c 1 10.0.13.3
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.15.5
1 packet(s) transmitted
1 packet(s) received
[R4]ping -c 1 10.0.234.2
1 packet(s) transmitted
1 packet(s) received
[R4]ping -c 1 10.0.234.3
1 packet(s) transmitted
1 packet(s) received
Configure an IS-IS process 1 for each router according to the topology. The following
example configures IS-IS process 1 for R1.
[R1]isis
[R1-isis-1]network-entity 49.0002.0000.0000.0001.00
By default, after an IS-IS process is enabled on a router, the router works in Level-1-2
mode. According to the planning, R1 needs to work in Level-2 mode. Therefore, you
need to change its IS level.
[R1-isis-1]is-level level-2
[R1-isis-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]isis enable
[R1-LoopBack0]quit
[R1-GigabitEthernet0/0/0]isis enable
[R1-GigabitEthernet0/0/0]quit
[R1-GigabitEthernet0/0/1]isis enable
[R1-GigabitEthernet0/0/1]quit
[R1-Serial1/0/0]isis enable
[R1-Serial1/0/0]quit
---------------------------------
The preceding command output shows that ISIS(1) has been enabled on a total of
four interfaces, whose IPV4.State field displays Up.
Similarly, configure other routers. R2 and R3 work in Level-1-2 mode, so you do not
need to change their IS levels.
[R2]isis 1
[R2-isis-1]network-entity 49.0001.0000.0000.0002.00
[R2-isis-1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]isis enable
[R2-LoopBack0]quit
[R2-GigabitEthernet0/0/0]isis enable
[R2-GigabitEthernet0/0/0]quit
[R2-Serial1/0/0]isis enable
[R2-Serial1/0/0]quit
---------------------------------
[R3]isis 1
[R3-isis-1]network-entity 49.0001.0000.0000.0003.00
[R3-isis-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]isis enable
[R3-LoopBack0]quit
[R3-GigabitEthernet0/0/0]isis enable
[R3-GigabitEthernet0/0/0]quit
[R3-GigabitEthernet0/0/1]isis enable
[R3-GigabitEthernet0/0/1]quit
---------------------------------
[R4]isis 1
[R4-isis-1]network-entity 49.0001.0000.0000.0004.00
[R4-isis-1]is-level level-1
[R4-isis-1]quit
[R4]interface LoopBack 0
[R4-LoopBack0]isis enable
[R4-LoopBack0]quit
[R4-GigabitEthernet0/0/0]isis enable
[R4-GigabitEthernet0/0/0]quit
---------------------------------
[R5]isis 1
[R5-isis-1]network-entity 49.0002.0000.0000.0005.00
[R5-isis-1]is-level level-2
[R5-isis-1]quit
[R5]interface LoopBack 0
[R5-LoopBack0]isis enable
[R5-LoopBack0]quit
[R5-GigabitEthernet0/0/0]isis enable
[R5-GigabitEthernet0/0/0]quit
---------------------------------
After the configurations are complete, check IS-IS neighbor statuses of routers. The
following example displays the IS-IS neighbor status of R1. R1 has three neighbors:
R2, R3, and R5.
----------------------------------------------------------------------------
Total Peer(s): 3
In the preceding command output, the System Id field is similar to the Router Id
field of other routing protocols. You can see that R2, R3, and R5 are in Up state. Their
IS-IS neighbor relationships with R1 are normal.
----------------------------------------------------------------------------
Total Peer(s): 4
----------------------------------------------------------------------------
Total Peer(s): 4
----------------------------------------------------------------------------
Total Peer(s): 2
----------------------------------------------------------------------------
Total Peer(s): 1
routers have the same DIS priority, the router with the highest MAC address
becomes the DIS. To ensure that R4 becomes the DIS, change its DIS priority.
[R4-GigabitEthernet0/0/0]quit
---------------------------------
----------------------------------------------------------------------------
Total Peer(s): 4
----------------------------------------------------------------------------
Total Peer(s): 4
[R1-GigabitEthernet0/0/0]quit
[R5-GigabitEthernet0/0/0]quit
During the change of the circuit-type, neighbor relationships are established again.
Check the configuration. The Circuit Id field format changes and the Circuit
Parameters field displays p2p. The following uses the display of R1 as an example.
----------------------------------------------------------------------------
---------------------------------
IP Address : 10.0.15.1
Cost : L1 10 L2 10
Ipv6 Cost : L1 10 L2 10
Static Bfd : NO
Dynamic Bfd : NO
Fast-Sense Rpr : NO
Before importing external routes into IS-IS, check current route learning. The
following command output shows that traffic from R1 to R4 is load balanced
between GE0/0/1 and S1/0/0.
-----------------------------
--------------------------------
----------------------------------------------------------------------------
S1/0/0 10.0.12.2
GE0/0/1 10.0.13.3
----------------------------------------------------------------------------
Destinations : 5 Routes : 7
Destinations : 5 Routes : 7
Destinations : 0 Routes : 0
R2 is a Level-1-2 router and so generates different routes for Level-1 and Level-2
routers. For Level-1 router, it generates a default route pointing to the null interface.
This situation also exists on R3.
-----------------------------
--------------------------------
----------------------------------------------------------------------------
0.0.0.0/0 10 NULL
--------------------------------
----------------------------------------------------------------------------
10.0.4.4/32 20 NULL
10.0.13.0/24 20 NULL
10.0.3.3/32 10 NULL
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
Destinations : 0 Routes : 0
-----------------------------
--------------------------------
----------------------------------------------------------------------------
0.0.0.0/0 10 NULL
--------------------------------
----------------------------------------------------------------------------
10.0.4.4/32 20 NULL
10.0.12.0/24 20 NULL
10.0.2.2/32 10 NULL
----------------------------------------------------------------------------
Destinations : 6 Routes : 6
Destinations : 6 Routes : 6
Destinations : 0 Routes : 0
R4 is a Level-1 router and can only establish IS-IS neighbor relationships with Level-1
or Level-1-2 routers in the same area. By default, a Level-1 router cannot learn
routing information of Level-2 routers and can only access external networks
through default routes. The following command output shows that R4 has two
default routes pointing to R2 and R3, and the two routes work in load balancing
mode.
-----------------------------
--------------------------------
----------------------------------------------------------------------------
GE0/0/0 10.0.234.2
----------------------------------------------------------------------------
Destinations : 5 Routes : 6
Destinations : 5 Routes : 6
Destinations : 0 Routes : 0
-----------------------------
--------------------------------
----------------------------------------------------------------------------
Destinations : 7 Routes : 7
Destinations : 7 Routes : 7
Destinations : 0 Routes : 0
Create new loopback interfaces on R5 and import direct routes into the Level-2
routing table in IS-IS process 1.
[R5]interface LoopBack 1
[R5-LoopBack1]quit
[R5]interface LoopBack 2
[R5-LoopBack2]quit
[R5]interface LoopBack 3
[R5-LoopBack3]quit
[R5]isis
[R5-isis-1]quit
-----------------------------
--------------------------------
----------------------------------------------------------------------------
----------------------------------
----------------------------------------------------------------------------
D 192.168.1.0/24 0 0
D 192.168.2.0/24 0 0
D 192.168.3.0/24 0 0
Check the IS-IS routing table of R4 again. No changes are found. This is because
Level-2 routes are not leaked into Level-1 routers by default. R4 can access
192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24 through default routes.
----------------------------------------------------------------------------
Destinations : 5 Routes : 6
Destinations : 5 Routes : 6
Destinations : 0 Routes : 0
[R4]ping -c 1 192.168.1.1
1 packet(s) transmitted
1 packet(s) received
[R4]ping -c 1 192.168.2.1
1 packet(s) transmitted
1 packet(s) received
[R4]ping -c 1 192.168.3.1
1 packet(s) transmitted
1 packet(s) received
By default, the IS-IS interface cost is 10, which is not automatically calculated based
on the bandwidth. For R1, traffic destined for R4 is load balanced between R2 and R3.
R1 and R2 are connected using Serial interfaces, which have low bandwidth and are
prone to bandwidth bottlenecks. Therefore, you can change the IS-IS interface cost
to control route selection of R1.
[R1-Serial1/0/0]isis cost 15
[R1-Serial1/0/0]quit
-----------------------------
--------------------------------
----------------------------------------------------------------------------
Observe data forwarding on R4. R4 does not know Level-2 network information and
forwards data to R2 and R3 for load balancing. If you do not want R4 to use the link
between R2 and R1, configure route leaking to import Level-2 routes into Level-1.
According to the longest match principle, R3 forwards packets destined for R5.
[R4]tracert 192.168.1.1
3 * * *
[R4]tracert 192.168.1.1
3 192.168.1.1 8 ms 1 ms 9 ms
The preceding command output shows that tracert packets sent each time are load
balanced between two next-hop addresses and then reach R5. You can enable route
leaking on R3 to make R3 become the preferred next hop.
[R3]isis
[R3-isis-1]quit
-----------------------------
--------------------------------
----------------------------------------------------------------------------
GE0/0/0 10.0.234.2
----------------------------------------------------------------------------
Destinations : 11 Routes : 12
Destinations : 11 Routes : 12
Destinations : 0 Routes : 0
[R4]tracert 192.168.1.1
1 10.0.234.3 2 ms 1 ms 1 ms
2 10.0.13.1 2 ms 2 ms 2 ms
3 192.168.1.1 1 ms 1 ms 2 ms
The preceding tracert operation proves the impact of route leaking on IS-IS route
selection.
----End
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
isis 1
is-level level-2
network-entity 49.0002.0000.0000.0001.00
interface Serial1/0/0
link-protocol ppp
isis enable 1
isis cost 15
interface GigabitEthernet0/0/0
isis enable 1
interface GigabitEthernet0/0/1
isis enable 1
interface LoopBack0
isis enable 1
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
isis 1
network-entity 49.0001.0000.0000.0002.00
interface Serial1/0/0
link-protocol ppp
isis enable 1
interface GigabitEthernet0/0/0
isis enable 1
interface LoopBack0
isis enable 1
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
isis 1
network-entity 49.0001.0000.0000.0003.00
interface GigabitEthernet0/0/0
isis enable 1
interface GigabitEthernet0/0/1
isis enable 1
interface LoopBack0
isis enable 1
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
isis 1
is-level level-1
network-entity 49.0001.0000.0000.0004.00
interface GigabitEthernet0/0/0
isis enable 1
interface LoopBack0
isis enable 1
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
isis 1
is-level level-2
network-entity 49.0002.0000.0000.0005.00
import-route direct
interface GigabitEthernet0/0/0
isis enable 1
interface LoopBack0
isis enable 1
interface LoopBack1
interface LoopBack2
interface LoopBack3
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company’s network uses BGP as
the routing protocol. This network consists of multiple autonomous systems (ASs).
Different branches use different AS numbers. You need to build this network. OSPF is
used in the headquarters as an IGP. Different branches in the company use private
BGP AS numbers. After building the network, you still need to observe BGP routing
information transmission.
Tasks
Configure IP addresses and masks for all the routers. The mask of IP addresses for
Loopback1 of R4 and R5 is 24 bits, which is used to simulate a user network.
<R1>system-view
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
<R2>system-view
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
<R3>system-view
[R3-Serial2/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
<R4>system-view
[R4-Serial1/0/0]quit
[R3]interface LoopBack 0
<R5>system-view
[R5-Serial1/0/0]quit
[R3]interface LoopBack 0
<R1>ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
<R1>ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
<R3>ping -c 1 10.0.23.2
1 packet(s) transmitted
1 packet(s) received
<R3>ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
The preceding command output shows that direct link connectivity is normal.
Use OSPF as an IGP in AS 64512 and advertise the network segment connected to
Loopback0 into OSPF. Run OSPF on the network segment connected to S1/0/0 of R1.
[R1]router id 10.0.1.1
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
Run OSPF on the network segments connected to S1/0/0 and S2/0/0 of R2.
[R2]router id 10.0.2.2
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R3]router id 10.0.3.3
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
When configuring the network command, use the wildcard mask 0.0.0.0.
After the configurations are complete, check whether OSPF neighbor relationships
are established.
Neighbors
Authentication Sequence: [ 0 ]
Neighbors
Authentication Sequence: [ 0 ]
Check the IP routing table of each router. Check whether these routers can learn
routes to the network segments connected to loopback interfaces of the peer device.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 15 Routes : 15
[R2]display ip routing-table
----------------------------------------------------------------------------
Destinations : 15 Routes : 15
[R3]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
The IP routing tables of R1, R2, and R3 show that each router can learn routes to the
network segment connected to Loopback0 of the other two routers.
Configure IBGP full mesh on R1, R2, and R3. Use Loopback0 address as a source
address.
[R1]bgp 64512
[R1-bgp]quit
[R2]bgp 64512
[R2-bgp]quit
[R3]bgp 64512
[R3-bgp]quit
Run the display tcp status command to check the TCP port connection status.
The preceding command output shows that the Local Add field displays 10.0.2.2
(Loopback0 address of R2) and port number is 179 (TCP port number of BGP). The
neighbor state with 10.0.3.3 and 10.0.1.1 is Established, indicating that R2 has
established a TCP connection with R1 and R3.
Run the display bgp peer command to check BGP peer relationships of routers.
The preceding command output shows that BGP peer relationships between R1, R2,
and R3 are in Established state, indicating that BGP peer relationships have been
established.
On R1, run the timer command in the BGP process to change the Keepalive time to
30s and hold time to 90s. Check whether the BGP peer relationship between R1 and
R2 is established and run the display bgp peer verbose command to check the
negotiation interval after the BGP peer relationship is established.
Warning: Changing the parameter in this command resets the peer session. Continue?[Y/N]:y
[R1-bgp]quit
Note that changing the Keepalive time and hold time will restart the BGP session.
Update-group ID: 1
Update messages 0
Open messages 1
KeepAlive messages 15
Notification messages 0
Refresh messages 0
Update messages 0
Open messages 1
KeepAlive messages 15
Notification messages 0
Refresh messages 0
Optional capabilities:
Update-group ID: 1
Update messages 0
Open messages 1
Notification messages 0
Refresh messages 0
Update messages 0
Open messages 1
Notification messages 0
Refresh messages 0
Optional capabilities:
The preceding command output of R2 shows that the default parameter Active Hold
Time is 180s and Keepalive Time is 60s.
After parameters of R1 are changed, the Active Hold Time of packets received by R2
becomes 90s. The negotiated parameters use the smaller value. Therefore, the Active
Hold Time and Keepalive Timer that are negotiated between R2 and R1 are 90s and
30s respectively, but the parameters of R3 still use the default values.
Therefore, the negotiated parameters are the same as the configured parameters.
That is, the Active Hold Time and Keepalive Timer on R2 and R3 are 180s and 60s
respectively.
Configure BGP on R4, set the local AS number to 64513, and establish an EBGP peer
relationship between R4 and R1. During EBGP peer relationship establishment,
specify the address of Loopback0 as the source address and set ebgp-max-hop to 2.
Add a 32-bit static route to the Loopback0 address of the peer device to ensure that
an EBGP peer relationship can be established normally.
[R1]bgp 64512
[R1-bgp]quit
[R4]router id 10.0.4.4
[R4]bgp 64513
[R4-bgp]quit
After an EBGP peer relationship is established, run the display bgp peer command
to check the peer relationship status.
Run the debugging ip packet verbose command on R4 to check the TTL value of
Keepalive packets.
<R4>terminal monitor
<R4>terminal debugging
<R4>debugging ip packet
<R4>
45 c0 00 28 01 ad 00 00 02 06 9d 5f 0a 00 01 01
0a 00 04 04
The preceding command output shows that the TTL value of received packets is 2.
Establish an EBGP peer relationship between R3 and R5. Use physical interface
addresses to establish a connection.
[R3]bgp 64512
[R3-bgp]quit
[R5]router id 10.0.5.5
[R5]bgp 64514
[R5-bgp]quit
[R4]interface LoopBack 1
[R4-LoopBack1]quit
[R4]bgp 64513
[R4-bgp]network 10.1.4.4 24
[R4-bgp]quit
Check the IP routing tables of R1 and R3 to check whether the route to 10.1.4.4/24
exists.
Check the BGP routing table of R3 to analyze next-hop information of this route.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 18 Routes : 18
The command output shows that R1 has learned the EBGP route to 10.1.4.0/24.
[R3]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
The preceding command output shows that R3 does not have any BGP route to
10.1.4.4.
The preceding command output shows that there is a BGP route to 10.1.4.0/24, but
this route is not marked with *, indicating that this route is not preferred. The
NextHop field of this route displays 10.0.4.4, but R3 does not have the route to
10.0.4.4. According to BGP route selection rules, when the next hop of a BGP route is
unreachable, this route is ignored.
Run the next-hop-local command on R1 and check the BGP routing table of R3
again.
[R1]bgp 64512
[R1-bgp]quit
The preceding command output shows that the next hop of the BGP route
10.1.4.0/24 is 10.0.1.1 and this route is marked with * and >, indicating that this route
is correct and the optimal route.
[R3]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
[R5]interface LoopBack 1
[R5-LoopBack1]quit
[R5]bgp 64514
[R5-bgp]network 10.1.5.0 24
[R3]bgp 64512
Check the BGP routing table of R4 to determine whether R4 learns a route to the
network segment connected to Loopback1 of R5. Analyze the display bgp
routing-table command output.
1 packet(s) transmitted
1 packet(s) received
Why does the TTL value of packets sent to EBGP peers default to 1? What is the
default configuration of the peer group_name ebgp-max-hop [ hop-count ]
command?
Device Configurations
[R1]display current-configuration
[V200R007C00SPC600]
sysname R1
router id 10.0.1.1
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
ospf 1
area 0.0.0.0
return
[R2]display current-configuration
[V200R007C00SPC600]
sysname R2
router id 10.0.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
ospf 1
area 0.0.0.0
return
[R3]display current-configuration
[V200R007C00SPC600]
sysname R3
router id 10.0.3.3
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
ospf 1
area 0.0.0.0
return
[R4]display current-configuration
[V200R007C00SPC600]
sysname R4
router id 10.0.4.4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
interface LoopBack1
bgp 64513
ipv4-family unicast
undo synchronization
return
[R5]display current-configuration
[V200R007C00SPC600]
sysname R5
router id 10.0.5.5
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
interface LoopBack1
bgp 64514
ipv4-family unicast
undo synchronization
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company’s network uses BGP as
the routing protocol. This network consists of multiple ASs, and different branches
use different AS numbers. As the company expands, routers have more and more
routing tables. It is urgent to summarize BGP routes to reduce the routing table size.
You test several route summarization methods and select a suitable method to
summarize routes.
Tasks
Configure IP addresses and masks for physical interfaces and loopback interfaces of
all the routers. Each loopback interface address uses the 32-bit mask.
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]quit
[R3-Serial2/0/0]quit
[R3-Serial2/0/0]quit
[R3]interface loopback 1
[R3-LoopBack1]quit
[R4-Serial1/0/0]quit
[R4]interface loopback 0
[R4-LoopBack0]quit
[R5-GigabitEthernet0/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]quit
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.15.5
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
[R1]router id 10.1.1.1
[R1]bgp 64513
[R1-bgp]quit
[R2]router id 10.1.2.2
[R2]bgp 64514
[R2-bgp]quit
[R3]router id 10.1.3.3
[R3]bgp 64515
[R3-bgp]quit
[R4]router id 10.0.4.4
[R4]bgp 64512
[R4-bgp]quit
[R5]router id 10.1.5.5
[R5]bgp 64516
[R5-bgp]quit
The preceding command output shows that all BGP peer relationships are in
Established state.
Run the network command to advertise the network segment of the loopback
interface on each router into BGP.
[R1]bgp 64513
[R1-bgp]quit
[R2]bgp 64514
[R2-bgp]quit
[R3]bgp 64515
[R3-bgp]quit
[R4]bgp 64512
[R4-bgp]quit
[R5]bgp 64516
[R5-bgp]quit
Check the BGP routing table of R4 and observe the AS_Path attribute.
On R1, add the static route 10.1.0.0/16 pointing to interface Null0 and run the
network command to advertise this route.
[R1]bgp 64513
[R1-bgp]quit
Check the BGP routing table of R4 to determine whether the summarized route
exists.
Set an IP prefix list named pref_detail_control to filter the routes to be sent to the
BGP peer R4 and prevent the specific routes from being sent out.
[R1]bgp 64513
[R1-bgp]quit
Check the BGP routing table of R4 again. Observe the AS_Path attribute of the
summarized route.
Delete the IP prefix list configured in step 3 and the summarized route advertised
using the network command.
Run the aggregate command to summarize routes to 10.1.0.0/16 using the default
mode.
[R1]bgp 64513
[R1-bgp]quit
[R1]bgp 64513
[R1-bgp]quit
Check the BGP routing tables of R1 and R4 and observe the Origin attribute of the
summarized route.
The preceding command output shows that the Origin attribute of the summarized
route retains unchanged and is still IGP.
[R1]bgp 64513
[R1-bgp]quit
The preceding command output shows that the BGP routing table of R4 does not
contain specific routes.
Check the IP routing table of R1 to view the next hop of the route to 10.1.0.0/16.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 21 Routes : 21
By default, BGP does not advertise the Community attribute to any peer.
[R5]bgp 64516
[R5-bgp]quit
[R1]bgp 64513
[R1-bgp]quit
Verify that the Community attribute disappears after routes are summarized.
On R5, add the Community attribute 100 to the route 10.1.5.5/32 advertised by R5
and advertise this route to R1.
[R5-acl-basic-2000]quit
[R5-route-policy]quit
[R5]bgp 64516
[R5-bgp]quit
On R1, check whether the route 10.1.5.5/32 carries the Community attribute 100.
On R4, check whether the summarized route carries the Community attribute 100.
The preceding command output shows that R4 does not have any route that carries
the Community attribute.
[R1-acl-basic-2000]quit
[R1-route-policy]quit
[R1]bgp 64513
On R4, check whether the summarized route carries the Community attribute 100:2.
The preceding command output shows that the summarized route learned by R4
carries the Community attribute 100:2.
After routes are summarized, the AS_Path attribute of the summarized route is
discarded by default, which may cause a routing loop. To eliminate this risk, add the
AS_Set attribute to the summarized route.
Configure R1 to add the AS_Set attribute to the summarized route during route
summarization.
[R1]bgp 64513
[R1-bgp]quit
Check the AS_Path attribute of the summarized route in the BGP routing tables of R1
and R4.
The AS_Path attribute of the summarized route to which the AS_Set attribute is
added contains AS path information of specific routes.
On R3, stop advertising the route 10.1.3.3/32 and reset the peer relationship.
[R3]bgp 64515
[R3-bgp]return
After the peer relationship is established again, check the AS_Path attribute of the
summarized route learned by R4.
The preceding command output shows that the AS_Path attribute does not contain
the AS number 64515.
----End
After step 6 is complete, can R5 access the loopback interface address of R3?
What are the differences between the aggregate and summary automatic
commands?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
router id 10.1.1.1
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface NULL0
interface LoopBack0
bgp 64513
ipv4-family unicast
undo synchronization
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
router id 10.1.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
bgp 64514
ipv4-family unicast
undo synchronization
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
router id 10.1.3.3
interface Serial2/0/0
link-protocol ppp
interface LoopBack1
bgp 64515
ipv4-family unicast
undo synchronization
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
router id 10.0.4.4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
router id 10.1.5.5
interface GigabitEthernet0/0/0
interface LoopBack0
bgp 64516
ipv4-family unicast
undo synchronization
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company’s network uses BGP to
connect to two Internet Service Providers (ISPs). The company uses a private AS
number 64512 and connects to ISP1 through two links, and ISP1 uses the AS number
100. ISP2 uses the AS number 200, and the company leases a line to connect to ISP2.
Some Internet users reflect that access to the company website is slow. You change
various BGP attributes to optimize route selection.
Tasks
Configure IP addresses and masks for physical interfaces and loopback interfaces of
all the routers. Each Loopback0 uses the 32-bit mask.
[R1-Serial1/0/0]quit
[R1-GigabitEthernet0/0/2]quit
[R1-GigabitEthernet0/0/1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R3-GigabitEthernet0/0/2]quit
[R3-Serial2/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface loopback 0
[R3-LoopBack0]quit
[R4-GigabitEthernet0/0/1]quit
[R4-GigabitEthernet0/0/0]quit
[R4]interface loopback 0
[R4-LoopBack0]quit
[R5-Serial1/0/0]quit
[R5-GigabitEthernet0/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]quit
<R1>ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.15.3
1 packet(s) transmitted
1 packet(s) received
<R2>ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
<R4>ping -c 1 10.0.45.5
1 packet(s) transmitted
1 packet(s) received
Run OSPF on the network segments connected to G0/0/1 and Loopback0 of R1.
[R1]router id 10.0.1.1
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
Create VLAN 111 on S1 and configure a VLANIF address for interconnection with R1.
Create VLAN 114 on S1 and configure a VLANIF address for interconnection with R4.
Set the link type of interconnected interfaces to access, and run OSPF on the network
segments connected to S1's VLANIF 111, VLANIF 114, and Loopback0.
[S1]router id 10.0.11.11
[S1-Vlanif111]quit
[S1-Vlanif114]quit
[S1]interface loopback 0
[S1-LoopBack0]quit
[S1-GigabitEthernet0/0/1]quit
[S1-GigabitEthernet0/0/4]quit
[S1]ospf 1
[S1-ospf-1]area 0
[S1-ospf-1-area-0.0.0.0]quit
[S1-ospf-1]quit
Run OSPF on the network segments connected to G0/0/1 and Loopback0 of R4.
[R4]router id 10.0.4.4
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
Check whether the devices learn the network segment where Loopback0 of other
devices resides.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 18 Routes : 18
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 9 Routes : 9
<R4>display ip routing-table
----------------------------------------------------------------------------
Destinations : 14 Routes : 14
Configure BGP on R1, R4, and S1, enable them to establish BGP peer relationships
using their Loopback0 interfaces, and configure a peer group named as64512.
By default, BGP load balancing is disabled. Enable BGP load balancing on all the
routers and set the maximum number of equal-cost routes to 4 for load balancing.
[R1]bgp 64512
[R1-bgp]maximum load-balancing 4
[R1-bgp]quit
[S1]bgp 64512
[S1-bgp]maximum load-balancing 4
[S1-bgp]quit
[R4]bgp 64512
[R4-bgp]maximum load-balancing 4
[R4-bgp]quit
Configure EBGP on R1, R2, R3, R4, and R5, and enable these routers to use physical
interfaces to establish EBGP peer relationships according to the topology.
[R1]bgp 64512
[R1-bgp]quit
[R2]router id 10.0.2.2
[R2]bgp 200
[R2-bgp]maximum load-balancing 4
[R2-bgp]quit
[R3]router id 10.0.3.3
[R3]bgp 100
[R3-bgp]maximum load-balancing 4
[R3-bgp]quit
[R4]bgp 64512
[R4-bgp]quit
[R5]router id 10.0.5.5
[R5]bgp 100
[R5-bgp]maximum load-balancing 4
[R5-bgp]quit
Create Loopback1 on S1, assign an address 10.1.11.11/24 to Loopback1, and use the
network command to advertise this address into BGP.
[S1]interface loopback 1
[S1-LoopBack1]quit
[S1]bgp 64512
[S1]quit
Check the BGP routing table of R2. The following command output shows that the
next hop for the route 10.1.11.0/24 is selected based on the AS_Path attribute.
Create a route policy as_path on R1 to add two duplicate AS numbers to the route
10.1.11.0/24.
[R1-acl-basic-2001]quit
[R1-route-policy]quit
Apply this route policy to R1 so that the AS_Path attribute of the route learned by R2
from R1 has three values.
[R1]bgp 64512
[R1-bgp]quit
The preceding command output shows that R2 accesses the network segment
10.1.11.0/24 through AS 100.
The preceding command output shows that the next hop for the route 10.1.11.0/24
is R1. Analyze the cause.
R3 needs to access AS 64512 through R5. The Origin attribute of the route
10.1.11.0/24 is IGP.
Configure a route-policy 22 and change the Origin attribute of the route advertised
from R1 to R3 to incomplete.
[R1-route-policy]quit
[R1]bgp 64512
[R1-bgp]quit
After the configured route-policy takes effect, check the BGP routing table of R3.
* 10.0.15.1 0 64512?
The preceding command output shows that the next hop for the route 10.1.11.0/24
is R5.
[R3]interface loopback 1
[R3-LoopBack1]quit
[R3]bgp 100
[R3-bgp]quit
[R5]interface loopback 1
[R5-LoopBack1]quit
[R5]bgp 100
[R5-bgp]network 10.1.5.5 24
[R5-bgp]quit
Traffic to the network segment 10.1.5.0/24 needs to be sent from R4, and traffic to
the network segment 10.1.3.0/24 needs to be sent from R1.
Create a route-policy Pref4 on R4 to match the route 10.1.5.0/24 and change its
Local_Pref attribute to 110.
On R1, create a route-policy Pref1 to match the route 10.1.3.0/24, change its
Local_Pref attribute to 110, and apply the route-policy to the IBGP peer group.
[R4-acl-basic-2001]quit
[R4-route-policy]quit
[R4-route-policy]quit
[R4]bgp 64512
[R4-bgp]quit
[R1-acl-basic-2002]quit
[R1-route-policy]quit
[R1-route-policy]quit
[R1]bgp 64512
[R1-bgp]quit
The preceding command output shows that routes are selected based on the
Local_Pref attribute, and the route with the highest Local_Pref is preferred.
Delete the route-policy configured in step 4 and change the MED attribute to affect
route selection.
[R1]bgp 64512
[R1-bgp]quit
[R1]undo route-policy 22
Create a route-policy med on R1 to match the route 10.1.11.0/24, change the MED
attribute of this route to 100, and apply this route-policy to R3.
[R1-route-policy]quit
[R1]bgp 64512
[R1-bgp]quit
AS-path 64512, origin igp, localpref 100, pref-val 0, valid, internal, best, select, active, pre 255
10.0.23.2
10.0.15.1
AS-path 64512, origin igp, MED 100, pref-val 0, valid, external, pre 255, not preferred for MED
----End
After step 6 is complete and S1/0/0 of R1 is shut down, what is the MED value of the
route 10.1.11.0/24 learned on R2?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
router id 10.0.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
maximum load-balancing 4
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
router id 10.0.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
bgp 200
ipv4-family unicast
undo synchronization
maximum load-balancing 4
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
router id 10.0.3.3
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface GigabitEthernet0/0/2
interface LoopBack0
interface LoopBack1
bgp 100
ipv4-family unicast
undo synchronization
maximum load-balancing 4
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
router id 10.0.4.4
interface Serial1/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
maximum load-balancing 4
ospf 1
area 0.0.0.0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
router id 10.0.5.5
interface Serial1/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
interface LoopBack1
bgp 100
ipv4-family unicast
undo synchronization
maximum load-balancing 4
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company's network uses BGP for
interconnection. Design AS numbers according to the topology. To ensure network
security, some departments of branches cannot communicate with each other. To
control routing information transmission, you need to use the Community attribute
to filter BGP routes.
Tasks
Configure IP addresses and masks for physical interfaces and Loopback0 of all the
routers. Each Loopback0 uses the 32-bit mask.
<R1>system-view
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1]interface loopback 0
[R1-LoopBack0]quit
<R2>system-view
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2-GigabitEthernet0/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]quit
<R3>system-view
[R3-Serial2/0/0]
[R3]interface loopback 0
[R3-LoopBack0]quit
<R4>system-view
[R4-Serial1/0/0]quit
[R4]interface loopback 0
[R4-LoopBack0]quit
<R5>system-view
[R5-GigabitEthernet0/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]quit
<R1>ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
<R1>ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
<R2>ping -c 1 10.0.25.5
1 packet(s) transmitted
1 packet(s) received
<R2>ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
Establish an IBGP peer relationship between R1 and R2 and establish EBGP peer
relationships between other routers.
[R1]router id 10.0.1.1
[R1]bgp 64513
[R1-bgp]quit
[R2]router id 10.0.2.2
[R2]bgp 64513
[R2-bgp]quit
[R3]router id 10.0.3.3
[R3]bgp 64514
[R3-bgp]quit
[R4]router id 10.0.4.4
[R4]bgp 64512
[R4-bgp]quit
[R5]router id 10.0.5.5
[R5]bgp 64515
[R5-bgp]quit
After the configurations are complete, check whether BGP peer relationships are
established between routers.
The preceding command output shows that all BGP peer relationships are in
Established state.
[R5]interface loopback 1
[R5-LoopBack1]quit
[R5]interface loopback 2
[R5-LoopBack2]quit
[R5]interface loopback 3
[R5-LoopBack3]quit
[R5]bgp 64515
[R5-bgp]quit
[R2]bgp 64513
[R2-bgp]quit
On R5, create a route-policy comm_r5 to add the Community attribute 100 to the
route 10.1.5.0/24.
[R5-acl-basic-2000]quit
[R5-route-policy]quit
[R5]bgp 64515
[R5-bgp]quit
Configure all BGP peers to advertise the Community attribute between each other.
[R1]bgp 64513
[R1-bgp]quit
[R2]bgp 64513
[R2-bgp]quit
[R3]bgp 64514
[R3-bgp]quit
[R4]bgp 64512
[R4-bgp]quit
[R5]bgp 64515
[R5-bgp]quit
You only need to add two new nodes and if-match clauses to the route-policy
comm_r5 created on R5.
[R5]acl 2001
[R5-acl-basic-2001]quit
[R5-route-policy]quit
[R5-acl-basic-2002]quit
[R5-route-policy]quit
Check the BGP routing tables of R2, R1, and R4 to observe transmission of the routes
10.1.5.0/24, 10.2.5.0/24, and 10.3.5.0/24.
The preceding command output shows that R2 does not advertise the route
10.2.5.0/24 carrying the special Community attribute no-export outside its AS but
advertises it to R1 in the same AS. R2 does not advertise the route 10.3.5.0/24
carrying the special Community attribute no-advertise to any BGP peer.
Create Loopback1 and Loopack2 on R3, assign addresses 10.1.3.3/24 and 10.2.3.3/24
to the two loopback interfaces respectively, and run the network command to
advertise these addresses into BGP.
[R3]interface LoopBack 1
[R3-LoopBack1]quit
[R3]interface loopback 2
[R3-LoopBack2]quit
[R3]bgp 64514
[R3-bgp]quit
[R3-acl-basic-2001]quit
[R3-route-policy]quit
[R3-route-policy]quit
[R3]bgp 64514
[R3-bgp]quit
On R1, check whether the learned routes 10.1.5.0/24 and 10.2.3.0/24 carry the
Community attribute 100.
Create a community filter to filter the route with the Community attribute 100.
[R1-route-policy]if-match community-filter 1
[R1-route-policy]quit
[R1-route-policy]quit
On R1, summarize the route matching the route-policy match_comm and use the
route-policy add_comm to add the Community attribute.
[R1]bgp 64513
[R1-bgp]quit
----End
Consider how to retain specific routes of the two routes 10.1.3.0/24 and 10.2.3.0/24
and suppress only specific routes of the route 10.1.5.0/24 on R4.
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
router id 10.0.1.1
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bgp 64513
ipv4-family unicast
undo synchronization
if-match community-filter 1
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
router id 10.0.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
bgp 64513
ipv4-family unicast
undo synchronization
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
router id 10.0.3.3
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
interface LoopBack1
interface LoopBack2
bgp 64514
ipv4-family unicast
undo synchronization
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
router id 10.0.4.4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
Return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
router id 10.0.5.5
interface GigabitEthernet0/0/0
interface LoopBack0
interface LoopBack1
interface LoopBack2
interface LoopBack3
bgp 64515
ipv4-family unicast
undo synchronization
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company's network uses BGP to
connect to ISP1. The company uses a private AS number 64512 and connects to ISP1
through two routers, and ISP1 uses the AS number 100. The company initially used
default routes to connect to the Internet through ISP1. With the development of the
company, this Internet access mode cannot meet requirements. You need to import
some Internet routes into the AS of the company. After a certain period, the
company leases a line to connect to ISP2, whose AS number is 200. Finally, the
company builds a BGP multi-homing network.
Tasks
Configure IP addresses and masks for physical interfaces and loopback interfaces of
all the routers. Each Loopback0 uses the 32-bit mask.
<R1>system-view
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1]interface loopback 0
[R1-LoopBack0]quit
<R2>system-view
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2-GigabitEthernet0/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]quit
<R3>system-view
[R3-Serial2/0/0]quit
[R3-GigabitEthernet0/0/1]quit
[R3]interface loopback 0
[R3-LoopBack0]quit
<R4>system-view
[R4-Serial1/0/0]quit
[R4-GigabitEthernet0/0/1]quit
[R4]interface LoopBack 0
[R4-LoopBack0]quit
<R5>system-view
[R5-GigabitEthernet0/0/0]quit
[R5-GigabitEthernet0/0/1]quit
[R5]interface loopback 0
[R5-LoopBack0]quit
<R1>ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
<R1>ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
<R2>ping -c 1 10.0.25.5
1 packet(s) transmitted
1 packet(s) received
<R2>ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
Run OSPF on the network segments connected to G0/0/1 and Loopback0 of R3.
[R3]router id 10.0.3.3
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
Run OSPF on the network segments connected to G0/0/1 and Loopback0 of R4.
[R4]router id 10.0.4.4
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
Run OSPF on the network segments connected to G0/0/1 and Loopback0 of R5.
[R5]router id 10.0.5.5
[R5]ospf 1
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
Create VLAN 13 on S1 and configure a VLANIF address for interconnection with R3.
Create VLAN 14 on S1 and configure a VLANIF address for interconnection with R4.
Create VLAN 15 on S1 and configure a VLANIF address for interconnection with R5.
Set the link type of interconnected interfaces to access, and run OSPF on the network
segments connected to S1's VLANIF 13, VLANIF 14, VLANIF 15, and Loopback0.
[S1]vlan batch 13 to 15
[S1]interface vlan 13
[S1-Vlanif13]quit
[S1]interface vlan 14
[S1-Vlanif14]quit
[S1]interface vlan 15
[S1-Vlanif15]quit
[S1-GigabitEthernet0/0/3]quit
[S1-GigabitEthernet0/0/4]quit
[S1-GigabitEthernet0/0/5]quit
[S1]interface loopback 0
[S1-LoopBack0]quit
[S1]router id 10.0.1.11
[S1]ospf 1
[S1-ospf-1]area 0
[S1-ospf-1-area-0.0.0.0]quit
[S1-ospf-1]quit
Check whether the devices learn the network segment connected to Loopback0 of
other devices.
<R3>display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
<R4>display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
<R5>display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
Enable R2, R3, and R5 to establish EBGP peer relationships using physical interfaces
according to the topology. Do not run BGP on SI.
[R2]router id 10.0.2.2
[R2]bgp 100
[R2-bgp]quit
[R3]bgp 64512
[R3-bgp]quit
[R5]bgp 64512
[R5-bgp]quit
After the configurations are complete, check whether EBGP peer relationships are
established.
By default, BGP load balancing is disabled. Enable BGP load balancing on all the
routers and set the maximum number of equal-cost routes to 4 for load balancing.
[R1]router id 10.0.1.1
[R1]bgp 200
[R1-bgp]maximum load-balancing 4
[R1-bgp]quit
[R2]bgp 100
[R2-bgp]maximum load-balancing 4
[R2-bgp]quit
[R3]bgp 64512
[R3-bgp]maximum load-balancing 4
[R3-bgp]quit
[R4]bgp 64512
[R4-bgp]maximum load-balancing 4
[R4-bgp]quit
[R5]bgp 64512
[R5-bgp]maximum load-balancing 4
[R5-bgp]quit
[R2]interface LoopBack 1
[R2-LoopBack1]quit
[R2]interface LoopBack 2
[R2-LoopBack2]quit
[R2]bgp 100
[R2-bgp]quit
Check whether R3 and R5 learn the two routes to 10.1.2.2/24 and 10.2.2.2/24.
The link from R1 to ISP1 is the primary link, and the link from R5 to ISP1 is the
backup link. On R3 and R5, run the import-route command to import OSPF routes
into BGP.
[R3]bgp 64512
[R3-bgp]import-route ospf 1
[R3-bgp]quit
[R5]bgp 64512
[R5-bgp]import-route ospf 1
[R5-bgp]quit
On R3 and R5, configure forcible advertisement of default routes into Area 0 and set
the route type as Type 1 external route. Set the costs of default routes advertised by
R3 and R5 to 20 and 40 respectively.
[R3]ospf 1
[R3-ospf-1]quit
[R5]ospf 1
[R5-ospf-1]quit
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 14 Routes : 14
[S1]tracert 10.1.2.2
1 10.0.113.3 10 ms 1 ms 1 ms
2 10.0.23.2 40 ms 20 ms 20 ms
The preceding command output shows that S1 uses the default route learned from
R3. That is, S1 accesses 10.1.2.2 through the primary link.
Shut down S2/0/0 of R3 to simulate a failure of the link from the company to ISP1.
[R3]interface s2/0/0
[R3-Serial2/0/0]shutdown
[R3-Serial2/0/0]quit
After route convergence is complete, check the IP routing table of S1. Check
connectivity to 10.1.2.2.
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 13 Routes : 13
[S1]ping 10.1.2.2
5 packet(s) transmitted
0 packet(s) received
The preceding command output shows that the IP routing table of S1 does not
change and S1 still accesses the target network through R3.
When the uplink fails, S1 selects the default route advertised by R3 after comparing
the costs of the default routes advertised by R3 and R5. Therefore, the network
cannot operate normally.
[R3]interface s2/0/0
[R3-Serial2/0/0]undo shutdown
[R3-Serial2/0/0]quit
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]shutdown
[R3-GigabitEthernet0/0/1]quit
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 10 Routes : 10
[S1]ping 10.1.2.2
5 packet(s) transmitted
5 packet(s) received
S1 selects the default route learned from R5. That is, S1 accesses the target network
through the backup link.
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]undo shutdown
[R3-GigabitEthernet0/0/1]quit
Step 4 Connect to a single ISP using default routes and some filtered
routes.
Establish IBGP peer relationships between R3 and S1, between R4 and S1, and
between R5 and S1, and specify the next-hop-local parameter to ensure that S1 can
learn the route Update message sent from the ISP.
[R3]bgp 64512
[R3-bgp]quit
[R4]bgp 64512
[R4-bgp]quit
[R5]bgp 64512
[R5-bgp]quit
[S1]bgp 64512
[S1-bgp]quit
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 15 Routes : 15
[R3-acl-basic-2001]quit
[R3-route-policy]quit
[R3-route-policy]bgp 64512
[R3-bgp]quit
[R5-acl-basic-2001]quit
[R5-route-policy]quit
[R5-route-policy]quit
[R5]bgp 64512
[R5-bgp]quit
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 15 Routes : 15
The preceding command output shows that the next hop for the route 10.1.2.0/24 is
R5 and the next hop for the route 10.2.2.0/24 is R3.
[R3]interface s2/0/0
[R3-Serial2/0/0]shutdown
[R3-Serial2/0/0]quit
[S1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 14 Routes : 14
The IP routing table of S1 has only one BGP route 10.1.2.0/24 because a route-policy
is configured on R5 to filter the BGP route 10.2.2.0/24.
[S1]ping 10.1.2.2
5 packet(s) transmitted
5 packet(s) received
[R3]interface s2/0/0
[R3-Serial2/0/0]undo shutdown
[R3-Serial2/0/0]quit
The company applies for an Internet line to connect to ISP2. To select routes among
BGP routes, delete the default routes advertised by OSPF.
[R3]ospf
[R3-ospf-1]undo default-route-advertise
[R3-ospf-1]quit
[R5]ospf
[R5-ospf-1]undo default-route-advertise
[R5-ospf-1]quit
On R3 and R5, delete the command used to import OSPF routes into BGP.
[R3]bgp 64512
[R3-bgp]quit
[R5]bgp 64512
[R5-bgp]quit
Establish EBGP peer relationships between R1 and R2 and between R1 and R4 so that
ISP2 can also transmit the routes 10.1.2.0/24 and 10.2.2.0/24.
[R1]bgp 200
[R1-bgp]quit
[R2]bgp 100
[R2-bgp]quit
[R4]bgp 64512
[R4-bgp]quit
On S1, check the routes 10.1.2.0/24 and 10.2.2.0/24 and analyze current route
selection rules.
The company wants to access 10.2.2.0/24 through the new line connected to ISP2.
Configure a route-policy policy_r4 on R4 and change the Local_Pref attribute of the
route 10.2.2.0/24 to 150.
[R4-acl-basic-2001]quit
[R4-route-policy]quit
[R4-route-policy]quit
[R4]bgp 64512
[R4-bgp]quit
The preceding command output shows that S1 accesses 10.2.2.0/24 through the
route obtained from ISP2 connected to R4.
[R4]interface s1/0/0
[R4-Serial1/0/0]shutdown
[R4-Serial1/0/0]quit
The preceding command output shows that S1 obtains the routes 10.1.2.0/24 and
10.2.2.0/24 through ISP1 connected to R3.
[R4]interface s1/0/0
[R4-Serial1/0/0]undo shutdown
[R4-Serial1/0/0]quit
Check the BGP routing table of S1 to determine whether the failure is rectified.
----End
After S2/0/0 of R3 is shut down in step 3, and the primary link from the company to
ISP1 fails, the backup link between R5 and ISP1 still works normally. How to address
the connectivity problem?
This company is dual-homed to two ISPs. Analyze how to load balance incoming
traffic of the same network segment.
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
router id 10.0.1.1
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bgp 200
ipv4-family unicast
undo synchronization
maximum load-balancing 4
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
router id 10.0.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
interface LoopBack1
interface LoopBack2
bgp 100
ipv4-family unicast
undo synchronization
maximum load-balancing 4
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
router id 10.0.3.3
interface Serial2/0/0
link-protocol ppp
interface GigabitEthernet0/0/1
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
maximum load-balancing 4
ospf 1
area 0.0.0.0
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
router id 10.0.4.4
interface Serial1/0/0
link-protocol ppp
interface GigabitEthernet0/0/1
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
maximum load-balancing 4
ospf 1
area 0.0.0.0
Return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
router id 10.0.5.5
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
maximum load-balancing 4
ospf 1
area 0.0.0.0
return
<S1>display current-configuration
sysname S1
router id 10.0.1.11
interface Vlanif13
interface Vlanif14
interface Vlanif15
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/5
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
ospf 1
area 0.0.0.0
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company's network uses BGP as
the routing protocol. This network consists of multiple ASs, and different branches
use different AS numbers. You have finished building the company's network. During
BGP configurations, you encountered many problems and have rectified all network
failures.
Tasks
Configure IP addresses and masks for physical interfaces and loopback interfaces of
all the routers. Each Loopback0 uses the 32-bit mask.
<R1>system-view
[R1-Serial1/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R3-Serial2/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R2]ping -c 1 10.0.12.1
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
The preceding command output shows that direct link connectivity is normal.
Configure OSPF in AS 64512 and configure all devices to belong to Area 0. Configure
each router to use Loopback0 address as its router ID. Run OSPF on the network
segments connected to S1/0/0 and Loopback0 of R1.
[R1]router-id 10.0.1.1
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
Run OSPF on the network segments connected to S1/0/0 and Loopback0 of R2.
[R2]router id 10.0.2.2
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
1 packet(s) transmitted
1 packet(s) received
Configure IBGP between R1 and R2, configure EBGP between R2 and R3, and
configure these routers to establish BGP peer relationships using loopback interface
addresses. To ensure normal transmission of routing information, configure
next-hop-local on R2 and specify R1’s address as the peer address and incorrectly
set the AS number of the peer 10.0.2.2 to 64514 on R3.
[R1]bgp 64512
[R1-bgp]quit
[R2]bgp 64512
[R2-bgp]quit
[R3]router id 10.0.3.3
[R3]bgp 64513
[R3-bgp]quit
After the configurations are complete, you can see that BGP peer relationships
between routers are not established. Check the BGP peer relationships of R2 first.
The preceding command output shows that the State field of 10.0.1.1 displays
Active and the State field of 10.0.2.2 displays idle. If a BGP peer relationship is
established normally, the State field displays Established. If the State field remains
another state for a long period, a failure occurs and needs to be rectified.
Generally, when a peer IP address is unreachable for a local router, the peer status
displays Idle. That is, this router does not initiate a TCP connection with the peer.
When the peer IP address is reachable but an error occurs during the establishment
of a TCP connection, you can see that the peer status remains Active.
First check the BGP peer relationship between R2 and R3 and check connectivity
between loopback interface addresses of R2 and R3.
1 packet(s) transmitted
0 packet(s) received
[R2]display ip routing-table
----------------------------------------------------------------------------
Destinations : 14 Routes : 14
The preceding command output shows that there is no route to 10.0.3.3 of R3.
[R3]display ip routing-table
----------------------------------------------------------------------------
Destinations : 9 Routes : 9
The preceding command output shows that there is no route to 10.0.2.2 of R2.
For different ASs, using static routes can ensure connectivity between loopback
interface addresses of neighboring routers.
On R2 and R3, you need to configure static routes to the network segments
connected to the loopback interfaces of R3 and R2 respectively.
1 packet(s) transmitted
1 packet(s) received
The BGP peer relationship between R2 and R3 changes from Idle to Active state.
Check the BGP peer relationship between R1 and R2. After OSPF is configured,
connectivity between loopback interface addresses of R1 and R2 has been tested.
BGP uses TCP port 179 for communication. Check whether port 179 is enabled on
the routers.
The preceding command output shows that port 179 for corresponding peer
address is in Listening state. BGP works normally on a single router.
Run the debugging command on R1 to check whether R1 receives BGP packets sent
from R2.
<R1>terminal monitor
<R1>terminal debugging
ack = 2254758725,datalen = 0,optlen = 0,flag = ACK RST ,window = 0,ttl = 255,tos = 0,MSS = 0)
The preceding command output shows that the source address of the packet with
the destination port number 179 is 10.0.12.2. After checking the topology, you can
see that 10.0.12.2 is the address of R2's Serial1/0/0.
When establishing BGP peer relationships, you use the loopback interface address of
R2. As a result, the BGP peer relationship between R1 and R2 cannot be established.
Therefore, you need to use connect-interface to specify the source address during
establishment of BGP peer relationships.
Similarly, this problem also exists between R2 and R3. Therefore, you need to use
connect-interface to specify the source address during establishment of BGP peer
relationships.
[R1]bgp 64512
[R1-bgp]quit
[R2]bgp 64512
[R2-bgp]quit
[R3]bgp 64513
[R3-bgp]quit
After the modifications are complete, check BGP peer relationships of R2 again.
The preceding command output shows that the BGP peer relationship between R1
and R2 is in Established state.
Run the debugging command on R3 to check whether R3 receives any BGP packet
and check the content of the packet.
<R3>terminal monitor
<R3>terminal debugging
<R3>debugging ip packet
The preceding command output shows that the TTL of the BGP packet received by
R3 is 1. For EBGP, the default TTL of the packet sent from a router to its peer is 1.
In this scenario, R2 and R3 establish a BGP peer relationship using loopback interface
addresses. There are two hops from the loopback interface address of R2 to that of
R3. Therefore, before this BGP packet reaches the loopback interface address of R2, it
is discarded because of TTL expiry.
To address this problem, change the TTL of the packet sent between two EBGP peers.
[R2]bgp 64512
[R2-bgp]quit
[R3]bgp 64513
[R3-bgp]quit
After the configurations are complete, check the BGP peer relationship of R2 again.
The preceding command output shows that the BGP peer relationship between R2
and R3 remains Active.
<R3>terminal debugging
The preceding command output shows that the error code/suberror code is 2. This
error indicates incorrect AS number. You need to change the peer AS number on R3.
[R3]bgp 64513
[R3-bgp]quit
To prevent malicious users from forging valid routers to establish BGP peer
relationships with BGP routers, configure MD5 authentication between BGP peers.
[R1]bgp 64512
[R1-bgp]quit
[R2]bgp 64512
[R2-bgp]quit
Reset the BGP peer relationship of R1. The following command output shows that
the peer relationship between R1 and R2 remains Connect and Active and cannot
enter the Established state.
[R2]bgp 64512
[R2-bgp]quit
Wait for about 30 seconds, and then check the peer relationship again.
The preceding command output shows that the peer relationship between R1 and
R2 has reached the Established state.
In this scenario, the administrator of AS 64512 does not want the routers in AS 64513
to view its actual AS number.
The fake-as parameter can achieve this purpose. It can specify a fake AS number for
the peer.
Configure this command on R2, specify R3's address as the peer address, and set the
fake AS number to 100.
[R2]bgp 64512
[R2-bgp]quit
[R3]bgp 64513
[R3-bgp]quit
Check the BGP peer of R3. The following command output shows that the AS
number of R2 changes to 100.
On R2, advertise the network segment where its Loopback0 resides and observe the
AS_Path attribute of the BGP route learned from R3.
[R2]bgp 64512
[R2-bgp]network 10.0.2.2 32
[R2-bgp]quit
The preceding command output shows that the AS_Path attribute of the BGP route
10.0.2.2/32 learned from R3 is 100. That is, R3 considers that this route is originated
from AS 100. In this situation, AS 64512 is not displayed.
In this scenario, enable GTSM on the link between R2 and R3 to observe BGP packet
exchange. First, in the system view of R2, configure the default action to be taken on
BGP packets whose TTL value is not within the specified range. Here, you configure
the default action to drop. That is, the BGP packets whose TTL value is not within the
specified range will be discarded.
In the BGP view of R2, specify R3's address as the peer address and enable GTSM.
Before performing this configuration, you need to delete the ebgp-max-hop
configuration. Because R2 and R3 are directly connected, the valid-ttl-hops
parameter is 1.
[R2]bgp 64512
[R2-bgp]quit
[R1]bgp 64512
[R1-bgp]quit
[R3]bgp 64513
[R3-bgp]quit
<R3>terminal monitor
<R3>terminal debugging
<R3>debugging ip packet
The preceding command output shows that the TTL value of packets received by R3
from R2 is 255 instead of the default value 1. To confirm that GTSM discards the BGP
packets whose TTL value is not within the specified range, enable the GTSM log
function on R3. When BGP packets are discarded by GTSM, a log is recorded.
Run the ebgp-max-hop command on R2 to ensure that the TTL value of BGP
packets sent from R2 to R3 is less than 254.
[R2]bgp 64512
[R2-bgp]quit
After waiting for a certain period, you can see that the BGP peer relationship
between R2 and R3 is in Idle state. Check GTSM statistics on R3. The following
command output shows that some BGP packets are discarded by GTSM.
----------------------------------------------------------------
----------------------------------------------------------------
0 BGP 83 27 56
0 OSPF 0 0 0
0 LDP 0 0 0
----------------------------------------------------------------
[R2]bgp 64512
[R2-bgp]quit
----------------------------------------------------------------
----------------------------------------------------------------
0 BGP 89 27 62
0 OSPF 0 0 0
0 LDP 0 0 0
----------------------------------------------------------------
The preceding command output shows that no more BGP packets are discarded.
----End
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
router id 10.0.1.1
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
router id 10.0.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
router id 10.0.3.3
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
bgp 64513
ipv4-family unicast
undo synchronization
return
Learning Objectives
Topology
Scenario
Tasks
S2 is located between R1 and R3, but does not need to be configured. Before the
experiment, clear the configuration on S2 and restart S2.
Configure IP addresses and masks for all the routers. All loopback interfaces must
have 24-bit masks.
<Huawei>system-view
[Huawei]sysname R1
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1-GigabitEthernet0/0/2]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
<Huawei>system-view
[Huawei]sysname R2
[R2-Serial1/0/0]quit
[R2-GigabitEthernet0/0/0]quit
[R2-GigabitEthernet0/0/1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
<Huawei>system-view
[Huawei]sysname R3
[R3-GigabitEthernet0/0/2]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
<Huawei>system-view
[Huawei]sysname R4
[R4-Serial1/0/0]quit
[R4-GigabitEthernet0/0/1]
[R4]interface LoopBack 0
[R4-LoopBack0]quit
<Huawei>system-view
[Huawei]sysname R5
[R5-Serial1/0/0]quit
[R5-GigabitEthernet0/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]quit
After the configurations are complete, test the connectivity between routers.
[R1]ping -c 1 10.0.13.3
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
[R5]ping -c 1 10.0.35.3
1 packet(s) transmitted
1 packet(s) received
[R5]ping -c 1 10.0.25.2
1 packet(s) transmitted
1 packet(s) received
Enable multicast routing on R1, R2, R3, R4, and R5. To enable multicast, run the
multicast routing-enable command in the system view.
By default, the multicast function is disabled on VRP. Before using PIM or IGMP,
enable multicast globally.
[R1]multicast routing-enable
To run PIM DM on an interface, run the pim dm command in the interface view.
[R1-GigabitEthernet0/0/2]pim dm
[R1-GigabitEthernet0/0/2]quit
[R1-Serial1/0/0]pim dm
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]pim dm
[R1-Serial3/0/0]quit
Perform the same configurations on R2, R3, R4, and R5. Enable PIM DM on the
interfaces between routers.
[R2]multicast routing-enable
[R2-Serial1/0/0]pim dm
[R2-Serial1/0/0]quit
[R2-GigabitEthernet0/0/0]pim dm
[R2-GigabitEthernet0/0/0]quit
[R3]multicast routing-enable
[R3-GigabitEthernet0/0/2]pim dm
[R3-GigabitEthernet0/0/2]quit
[R3-Serial3/0/0]pim dm
[R3-Serial3/0/0]quit
[R4]multicast routing-enable
[R4-Serial1/0/0]pim dm
[R4-Serial1/0/0]quit
[R4-GigabitEthernet0/0/1]pim dm
[R4-GigabitEthernet0/0/1]quit
[R5]multicast routing-enable
[R5-Serial1/0/0]pim dm
[R5-Serial1/0/0]quit
[R5-GigabitEthernet0/0/0]pim dm
[R5-GigabitEthernet0/0/0]quit
GE0/0/2 up 1 30 1 10.0.13.3
S1/0/0 up 1 30 1 10.0.12.2
S3/0/0 up 1 30 1 10.0.14.4
R1 has three interfaces running PIM and each interface has a neighbor (NbrCnt). On
a network segment, the router with a larger interface IP address becomes the DR.
PIM version: 2
PIM state: up
By default, the hello interval of PIM DM is 30s, the hello hold time is 3.5 times of the
hello interval (105s).
Check the neighbor list of R1. Three routers established PIM neighbor relationships
with R1. The default DR priority of neighbors is 1.
Check details about neighbor R3. Uptime indicates the neighbor relationship setup
time, Expiry time indicates the remaining time of the PIM neighbor, LAN delay
indicates the delay in transmitting the prune messages, and Override interval
indicates the interval for overriding the prune messages.
Neighbor: 10.0.13.3
Interface: GigabitEthernet0/0/2
Uptime: 01:41:00
DR Priority: 1
Holdtime: 105 s
In this experiment, multicast users are connected to S1. Enable IGMP on G0/0/1 of
R2 and R4. To enable IGMP, run the igmp enable command in the interface view.
[R2-GigabitEthernet0/0/1]igmp enable
[R2-GigabitEthernet0/0/1]quit
[R4-GigabitEthernet0/0/1]igmp enable
[R4-GigabitEthernet0/0/1]quit
Add static multicast groups to G0/0/1 of R2 and R4. Then the interfaces always
forward multicast traffic with destination address 225.1.1.1.
[R2-GigabitEthernet0/0/0]quit
[R4-GigabitEthernet0/0/1]quit
By default, VRP uses IGMPv2. The command output shows that R2 (10.0.24.2) is the
querier of the network segment where G0/0/1 is located. IGMPv2 selects the router
with a smaller IP address as the querier.
Interface information
GigabitEthernet0/0/1(10.0.24.2):
IGMP is enabled
IGMP state: up
IGMP limit: -
Interface information
GigabitEthernet0/0/1(10.0.24.4):
IGMP is enabled
IGMP state: up
IGMP limit: -
Check static IGMP groups on the interfaces. Group 225.1.1.1 is the manually added
multicast group.
Routing table
Total 1 entry
GigabitEthernet0/0/1 (10.0.24.2),
Protocol: STATIC
IGMP routing entries are generated on an interface only when the interface has
IGMP but not PIM enabled, and the interface is an IGMP querier. The routing entries
are not displayed on R4 because R2 is the querier of network segment 10.0.24.0/24.
By default, the query interval of the querier is 60s. To increase the speed of user
addition to multicast groups, run the igmp timer query command to shorten the
interval for sending query packets.
[R2-GigabitEthernet0/0/1]quit
GigabitEthernet0/0/1(10.0.24.2):
IGMP is enabled
IGMP state: up
IGMP limit: -
<R1>terminal monitor
<R2>terminal debugging
<R2>
<R2>
<R2>
<R2>
The default robustness variable of a router is 2. Shut down the interface to test
robustness.
<R2>terminal monitor
<R2>terminal debugging
<R2>
<R2>system-view
[R2-GigabitEthernet0/0/1]shutdown
[R2-GigabitEthernet0/0/1]undo shutdown
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]
When the interface is not shut down, the router's interface sends a General Query
message every 20s. when the interface is shut down and enabled, the interval for
sending the first two query messages is 5s. When a router starts, it sends N General
Query messages (N is the robustness variable). The message sending interval is 1/4
of the configured interval for sending General Query messages.
Run the robust-count command to set the IGMP robustness variable. This
parameter is valid only for IGMPv2 and IGMPv3. Change the robustness variable on
R2's G0/0/1 to 3.
[R2-GigabitEthernet0/0/1]igmp robust-count 3
[R2-GigabitEthernet0/0/1]shutdown
[R2-GigabitEthernet0/0/1]undo shutdown
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]return
After the robustness variable is changed to 3, the interval for sending the first three
General Query messages is 5s, and the interval for sending later messages is 20s.
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
After the configuration, check whether the routers can learn the loopback addresses
of other routers.
----------------------------------------------------------------------------
Destinations : 7 Routes : 8
Destinations : 7 Routes : 8
Destinations : 0 Routes : 0
After several minutes, the multicast routing entries can be seen on all the other
routers. View the multicast routing table on R2.
(*, 225.1.1.1)
UpTime: 00:09:04
(10.0.3.3, 225.1.1.1)
UpTime: 00:00:52
The first entry (*, 225.1.1.1) is generated after static IGMP group is configured on an
interface.
The second entry (10.0.3.3, 225.1.1.1) is generated after multicast traffic is spread on
the router.
After PIM is enabled, routers use the unicast routing table for RPF check. The
command output shows that the RPF neighbor of multicast source 10.0.3.3 is
10.0.25.5.
If you do not want the traffic to be transmitted to the destination through a unicast
route, run the rpf-route-static command to change the RPF path. In this experiment,
change the RPF path from 10.0.25.5 to 10.0.12.1.
To observe the PIM prune and graft messages, delete and add static IGMP groups to
simulate the user deletion and addition operations. Enable debugging on R2.
<R1>terminal monitor
<R2>terminal debugging
<R2>system-view
Dec 31 2011 15:00:05.300.1+00:00 R2 PIM/7/JP:(public net): PIM ver 2 JP sending 10.0.12.2 -> 224.0.0.13 on
Serial1/0/0 (P012689)
Dec 31 2011 15:00:05.300.2+00:00 R2 PIM/7/JP:(public net): Upstream 10.0.12.1, Groups 1, Holdtime 210
(P012693)
Dec 31 2011 15:00:05.300.3+00:00 R2 PIM/7/JP:(public net): Group: 225.1.1.1/32 --- 0 joins 1 prunes (P012701)
Dec 31 2011 15:00:05.350.1+00:00 R2 PIM/7/JP:(public net): PIM ver 2 JP receiving 10.0.12.1 -> 224.0.0.13 on
Serial1/0/0 (P012689)
Dec 31 2011 15:00:05.350.2+00:00 R2 PIM/7/JP:(public net): Upstream 10.0.12.1, Groups 1, Holdtime 207
(P012693)
Dec 31 2011 15:00:05.350.3+00:00 R2 PIM/7/JP:(public net): Group: 225.1.1.1/32 --- 0 joins 1 prunes (P012701)
Dec 31 2011 15:00:19.440.1+00:00 R2 PIM/7/JP:(public net): PIM ver 2 GFT sending 10.0.12.2 -> 10.0.12.1 on
Serial1/0/0 (P012633)
Dec 31 2011 15:00:19.440.2+00:00 R2 PIM/7/JP:(public net): Upstream 10.0.12.1, Groups 1, Holdtime 0 (P012639)
Dec 31 2011 15:00:19.440.3+00:00 R2 PIM/7/JP:(public net): Group: 225.1.1.1/32 --- 1 joins 0 prunes (P012648)
Dec 31 2011 15:00:19.480.1+00:00 R2 PIM/7/JP:(public net): PIM ver 2 GAK receiving 10.0.12.1 -> 10.0.12.2 on
Serial1/0/0 (P012633)
Dec 31 2011 15:00:19.480.2+00:00 R2 PIM/7/JP:(public net): Upstream 10.0.12.2, Groups 1, Holdtime 0 (P012639)
Dec 31 2011 15:00:19.480.3+00:00 R2 PIM/7/JP:(public net): Group: 225.1.1.1/32 --- 1 joins 0 prunes (P012648)
[R2-GigabitEthernet0/0/1]return
The prune message is sent from multicast address 224.0.0.13, while prune messages
are sent to the upstream device through unicast.
If you need to transmit multicast traffic within a specified range, you can run the
multicast boundary command on an interface to specify the range of a multicast
group or multicast address segment.
Prevent the traffic from multicast group 225.1.1.2 from being transmitted to R4.
Perform the following configuration on R1's interface connected to R4:
[R1-Serial3/0/0]quit
Check the multicast routing table on R2 and R4. R2 has the entry (10.0.3.3, 225.1.1.2),
while R4 does not have a routing entry of this multicast group. This indicates that
multicast traffic is not spread to R4.
(*, 225.1.1.1)
UpTime: 00:09:04
(10.0.3.3, 225.1.1.1)
UpTime: 00:02:11
(10.0.3.3, 225.1.1.2)
UpTime: 00:00:08
(*, 225.1.1.1)
UpTime: 00:08:03
1: GigabitEthernet0/0/1
(10.0.3.3, 225.1.1.1)
UpTime: 00:02:43
1: GigabitEthernet0/0/1
By default, PIM DM selects the router connected to the interface with a greater IP
address as the DR.
GE0/0/0 up 1 30 1 10.0.25.5
Check the interface status on R2. R5 is the DR. You can change the interface priority
to affect the DR election result. The priority is a 32-bit value. The default value is 1. In
the following example, change the priority of the R2's interface connected to R5 to
100.
[R2-GigabitEthernet0/0/0]quit
For security purposes, you can disable the user-side interface from sending and
receiving PIM hello packets by running the pim silent command.
[R4-GigabitEthernet0/0/1]pim silent
[R4-GigabitEthernet0/0/1]quit
PIM version: 2
PIM state: up
----End
For which networks you will configure PIM DM? What are the characteristics of these
networks?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface Serial1/0/0
link-protocol ppp
pim dm
interface Serial3/0/0
link-protocol ppp
pim dm
pim dm
interface LoopBack0
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface Serial1/0/0
link-protocol ppp
pim dm
interface GigabitEthernet0/0/0
pim dm
interface GigabitEthernet0/0/1
igmp enable
igmp robust-count 3
interface LoopBack0
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface Serial3/0/0
link-protocol ppp
pim dm
interface GigabitEthernet0/0/2
pim dm
interface LoopBack0
area 0.0.0.0
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface Serial1/0/0
link-protocol ppp
pim dm
interface GigabitEthernet0/0/1
pim silent
igmp enable
interface LoopBack0
area 0.0.0.0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface Serial1/0/0
link-protocol ppp
pim dm
interface GigabitEthernet0/0/0
pim dm
interface LoopBack0
area 0.0.0.0
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The 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, security, and efficiency, you can configure PIM SM.
In the PIM SM mode, you need to define the RP, which is used as the root of the
shared tree in SM mode. In addition, RPs need to perform load balancing.
You may encounter network failures and need to rectify the faults.
Tasks
S2 participates in the experiment, but you do not need to configure S2. Before the
experiment, clear the configuration on S2 and restart S2.
Configure IP addresses and masks for all the routers. All loopback interfaces must
have 24-bit masks.
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2]quit
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1]interface loopback 0
[R1-LoopBack0]quit
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]quit
[R2-Serial1/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2]quit
[R3-Serial3/0/0]quit
[R3]interface loopback 0
[R3-LoopBack0]quit
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1]quit
[R4-Serial1/0/0]quit
[R4]interface loopback 0
[R4-LoopBack0]quit
[R5]interface GigabitEthernet0/0/0
[R5-GigabitEthernet0/0/0]quit
[R5-Serial1/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]quit
[S1]interface Vlanif 1
[S1-Vlanif1]interface loopback 0
[S1-LoopBack0]quit
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.13.3
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
[R5]ping -c 1 10.0.25.2
1 packet(s) transmitted
1 packet(s) received
[R5]ping -c 1 10.0.35.3
1 packet(s) transmitted
1 packet(s) received
[S1]ping -c 1 10.0.24.2
1 packet(s) transmitted
1 packet(s) received
Configure OSPF on R1, R2, R3, R4, R5, and S1. Implement network connectivity.
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
[S1-ospf-1]area 0
[S1-ospf-1-area-0.0.0.0]quit
[S1-ospf-1]quit
After the configuration, wait until the OSPF neighbor relationship is set up. When
route information exchange is complete, test the connectivity between S1 and
Loopback0 of R3.
[S1]ping -c 1 10.0.3.3
1 packet(s) transmitted
1 packet(s) received
Enable multicast routing on R1, R2, R3, R4, R5, and S1.
[R1]multicast routing-enable
[R2]multicast routing-enable
[R3]multicast routing-enable
[R4]multicast routing-enable
[R5]multicast routing-enable
[S1]multicast routing-enable
[R1]interface GigabitEthernet0/0/2
[R1-GigabitEthernet0/0/2]pim sm
[R1-GigabitEthernet0/0/2]quit
[R1-Serial1/0/0]pim sm
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]pim sm
[R1-Serial3/0/0]quit
[R1]interface loopback 0
[R1-LoopBack0]pim sm
[R1-LoopBack0]quit
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0]pim sm
[R2-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]pim sm
[R2-GigabitEthernet0/0/1]quit
[R2-Serial1/0/0]pim sm
[R2-Serial1/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]pim sm
[R2-LoopBack0]quit
[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2]pim sm
[R3-GigabitEthernet0/0/2]quit
[R3-Serial3/0/0]pim sm
[R3-Serial3/0/0]quit
[R3]interface loopback 0
[R3-LoopBack0]pim sm
[R3-LoopBack0]quit
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1]pim sm
[R4-GigabitEthernet0/0/1]quit
[R4-Serial1/0/0]pim sm
[R4-Serial1/0/0]quit
[R4]interface loopback 0
[R4-LoopBack0]pim sm
[R4-LoopBack0]quit
[R5]interface GigabitEthernet0/0/0
[R5-GigabitEthernet0/0/0]pim sm
[R5-GigabitEthernet0/0/0]quit
[R5-Serial1/0/0]pim sm
[R5-Serial1/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]pim sm
[R5-LoopBack0]quit
[S1]interface Vlanif 1
[S1-Vlanif1]pim sm
[S1-Vlanif1]quit
[S1]interface loopback 0
[S1-LoopBack0]pim sm
[S1-LoopBack0]quit
After the configuration, check PIM neighbor learning information on R1, R5, and S1.
The command output shows that the PIM protocol has been running.
[R1]pim
[R1-pim]static-rp 10.0.14.1
[R1-pim]quit
[R2]pim
[R2-pim]static-rp 10.0.14.1
[R2-pim]quit
[R3]pim
[R3-pim]static-rp 10.0.14.1
[R3-pim]quit
[R4]pim
[R4-pim]static-rp 10.0.14.1
[R4-pim]quit
[R5]pim
[R5-pim]static-rp 10.0.14.1
[R5-pim]quit
[S1]pim
[S1-pim]static-rp 10.0.14.1
[S1-pim]quit
[S1]interface LoopBack 0
[S1-LoopBack0]igmp enable
[S1-LoopBack0]quit
Add S1's Loopback 0 to the multicast group 225.0.0.1 to simulate multicast users of
group 225.0.0.1.
[S1]interface LoopBack 0
[S1-LoopBack0]quit
Run the display pim routing-table command on R1, R4, and S1 to check the PIM
routing table.
(*, 225.0.0.1)
UpTime: 00:02:40
1: Serial3/0/0
(*, 225.0.0.1)
RP: 10.0.14.1
UpTime: 00:01:46
1: GigabitEthernet0/0/1
(*, 225.0.0.1)
RP: 10.0.14.1
UpTime: 00:01:19
1: LoopBack0
Create an ACL and apply the ACL to static RP. Specify R1 as the RP serving the
network segment 225.0.0.0/24. Specify R5 as the RP serving the network segment
225.0.1.0/24.
[R1]acl 2000
[R1-acl-basic-2000]quit
[R1]acl 2001
[R1-acl-basic-2001]quit
[R1]pim
[R1-pim]quit
[R2]acl 2000
[R2-acl-basic-2000]quit
[R2]acl 2001
[R2-acl-basic-2001]quit
[R2]pim
[R2-pim]quit
[R3]acl 2000
[R3-acl-basic-2000]quit
[R3]acl 2001
[R3-acl-basic-2001]quit
[R3]pim
[R3-pim]quit
[R4]acl 2000
[R4-acl-basic-2000]quit
[R4]acl 2001
[R4-acl-basic-2001]quit
[R4]pim
[R4-pim]quit
[R5]acl 2000
[R5-acl-basic-2000]quit
[R5]acl 2001
[R5-acl-basic-2001]quit
[R5]pim
[R5-pim]quit
[S1]acl 2000
[S1-acl-basic-2000]quit
[S1]acl 2001
[S1-acl-basic-2001]quit
[S1]pim
Add S1's Loopback 0 to the multicast group 225.0.1.1 to simulate multicast users of
group 225.0.1.1.
[S1]interface LoopBack 0
[S1-LoopBack0]quit
Run the display pim routing-table command on S1, R2, and R5 to check the PIM
routing table.
(*, 225.0.1.1)
UpTime: 00:03:13
1: GigabitEthernet0/0/0
(*, 225.0.1.1)
RP: 10.0.25.5
UpTime: 00:03:41
1: GigabitEthernet0/0/1
(*, 225.0.0.1)
RP: 10.0.14.1
UpTime: 00:17:09
1: LoopBack0
(*, 225.0.1.1)
RP: 10.0.25.5
UpTime: 00:03:58
1: LoopBack0
The command output shows that S1 generates two multicast paths for 225.0.0.1 and
225.0.1.1. The multicast path of 225.0.1.1 reaches R5 through R2.
----End
For which networks you will configure PIM SM? What are the characteristics of these
networks?
Device Configurations
[R1]display current-configuration
[V200R007C00SPC600]
sysname R1
multicast routing-enable
interface Serial1/0/0
link-protocol ppp
pim sm
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
pim sm
interface Serial4/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
pim sm
interface GigabitEthernet0/0/3
description VirtualPort
interface Cellular0/0/0
interface Cellular0/0/1
interface NULL0
interface LoopBack0
pim sm
area 0.0.0.0
pim
return
[R2]display current-configuration
[V200R007C00SPC600]
sysname R2
multicast routing-enable
interface Ethernet4/0/0
interface Ethernet4/0/1
interface Serial1/0/0
link-protocol ppp
pim sm
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
pim sm
interface GigabitEthernet0/0/1
pim sm
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
description VirtualPort
interface Cellular0/0/0
interface Cellular0/0/1
interface NULL0
interface LoopBack0
pim sm
area 0.0.0.0
pim
return
[R3]display current-configuration
[V200R007C00SPC600]
sysname R3
multicast routing-enable
interface Ethernet4/0/0
interface Ethernet4/0/1
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
pim sm
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
pim sm
interface GigabitEthernet0/0/3
description VirtualPort
interface Cellular0/0/0
interface Cellular0/0/1
interface NULL0
interface LoopBack0
pim sm
area 0.0.0.0
pim
return
[R4]display current-configuration
[V200R007C00SPC600]
sysname R4
multicast routing-enable
interface Ethernet2/0/0
interface Ethernet2/0/1
interface Serial1/0/0
link-protocol ppp
pim sm
interface Serial1/0/1
link-protocol ppp
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
pim sm
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
description VirtualPort
interface Cellular0/0/0
interface Cellular0/0/1
interface NULL0
interface LoopBack0
pim sm
area 0.0.0.0
pim
return
[R5]display current-configuration
[V200R007C00SPC600]
sysname R5
multicast routing-enable
interface Ethernet2/0/0
interface Ethernet2/0/1
interface Serial1/0/0
link-protocol ppp
pim sm
interface Serial1/0/1
link-protocol ppp
interface GigabitEthernet0/0/0
pim sm
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
description VirtualPort
interface Cellular0/0/0
interface Cellular0/0/1
interface NULL0
interface LoopBack0
pim sm
area 0.0.0.0
pim
return
[S1]display current-configuration
sysname S1
multicast routing-enable
interface Vlanif1
pim sm
interface LoopBack0
pim sm
igmp enable
ospf 1
area 0.0.0.0
pim
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company's network has OSPF
areas and ISIS areas. To implement network connectivity, configure route import.
When two routing protocols on two devices import routes from each other, some
problems may occur, such as routing loops and sub-optimal routes. To prevent these
problems, you can configure the IP prefix list and route-policy to control routes.
Tasks
Configure IP addresses and masks for physical interfaces and loopback interfaces of
all routers. Each Loopback0 uses the 32-bit mask.
<R1>system-view
[R1-Serial3/0/0]interface LoopBack 0
<R2>system-view
[R2-Serial2/0/0]interface LoopBack 0
<R3>system-view
[R3-Serial3/0/0]interface LoopBack 0
<R4>system-view
[R4-Serial1/0/0]interface LoopBack 0
<R5>system-view
[R5-GigabitEthernet0/0/0]interface LoopBack 0
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.15.5
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
Run OSPF on R1, R2, R4, and R5. All devices belong to area 0.
Run OSPF on the network segments connected to R1's S1/0/0, S3/0/0, G0/0/0, and
Loopback0.
[R1]ospf 1
[R1-ospf-1]area 0
[R2]ospf 1
[R2-ospf-1]area 0
Run OSPF on the network segment connected to R4's S1/0/0 and Loopback0.
[R4]ospf 1
[R4-ospf-1]area 0
[R5]ospf 1
[R5-ospf-1]area 0
Check whether the routers can learn the routes from the network segments
connected to Loopback0 of other routers.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
[R2]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
[R4]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
[R5]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
Run ISIS on the network segments connected to R2's S2/0/0 and Loopback0.
[R2]isis 1
[R2-isis-1]network-entity 49.0001.0000.0000.0002.00
[R2-isis-1]is-level level-2
[R2-isis-1]interface serial2/0/0
[R2-Serial2/0/0]isis enable 1
[R2]interface loopback0
[R2-LoopBack0]isis enable 1
Run ISIS on the network segments connected to R3's S2/0/0, S3/0/0, and Loopback0.
[R3]isis 1
[R3-isis-1]network-entity 49.0001.0000.0000.0003.00
[R3-isis-1]is-level level-2
[R3-isis-1]interface serial2/0/0
[R3-Serial2/0/0]isis enable 1
[R3-Serial2/0/0]interface serial3/0/0
[R3-Serial3/0/0]isis enable 1
[R3-Serial3/0/0]interface loopback0
[R3-LoopBack0]isis enable 1
Run ISIS on the network segments connected to R5's S1/0/0 and Loopback0.
[R5]isis 1
[R5-isis-1]network-entity 49.0001.0000.0000.0005.00
[R5-isis-1]is-level level-2
[R5-isis-1]interface serial1/0/0
[R5-Serial1/0/0]isis enable 1
[R5-Serial1/0/0]interface loopback 0
[R5-LoopBack0]isis enable 1
[R2]display ip routing-table
------------------------------------------------------------------------------
Destinations : 20 Routes : 20
[R3]dis ip routing-table
------------------------------------------------------------------------------
Destinations : 15 Routes : 15
[R5]display ip routing-table
------------------------------------------------------------------------------
Destinations : 19 Routes : 19
[R1]ospf 1
[R1-ospf-1]import-route static
[R4]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
Create the routing policy policy_r1 and invoke the prefix list pref_r1 to control static
route import on R1.
[R1-route-policy]ospf
[R4]display ip routing-table
----------------------------------------------------------------------------
Destinations : 13 Routes : 13
Create Loopback 1 with address 10.1.4.4/24 on R4 and run the import-route direct
command to import routes to OSPF.
[R4]interface LoopBack 1
[R4-LoopBack1]ospf 1
[R4-ospf-1]import-route direct
[R2]isis 1
[R2-isis-1]import-route ospf
[R5]ospf
[R5-ospf-1]import-route isis
[R1]ping 10.1.4.4
5 packet(s) transmitted
0 packet(s) received
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 28 Routes : 28
Check the 10.1.4.0/24 route in the routing tables on R2, R3, and R5.
----------------------------------------------------------------------------
Summary Count : 1
------------------------------------------------------------------------------
Summary Count : 1
------------------------------------------------------------------------------
Summary Count : 1
[R1]tracert 10.1.4.4
1 10.0.15.5 61 ms 2 ms 2 ms
2 10.0.35.3 29 ms 28 ms 29 ms
3 10.0.23.2 31 ms 36 ms 36 ms
4 10.0.12.1 34 ms 36 ms 36 ms
5 10.0.15.5 34 ms 37 ms 37 ms
6 10.0.35.3 55 ms 59 ms 59 ms
7 10.0.23.2 60 ms 66 ms 66 ms
8 10.0.12.1 63 ms 66 ms 66 ms
9 10.0.15.5 65 ms 67 ms 67 ms
A loop is detected.
The reason is: After route import is configured, R5 can learn the 10.1.4.0/24 route in
both the ISIS and OSPF domains.
The ISIS routes have higher priority than OSPF external routes, so R5 uses the routes
learned from the ISIS domain.
R1 can learn this route from both R5 and R4. The two routes are OSPF external routes.
Therefore, the cost values of the two routes are compared. R1 is connected to R5
through GE links, which is better than the serial link between R1 and R4. Therefore,
R1 uses the routes learned from R5, causing the loop.
Apply the route policy policy_r5 to R5 and add tag 100 to the route 10.1.4.0/24.
[R5-route-policy]ospf
Routing Tables
Total Nets: 13
R1 has the 10.1.4.0/24 route with tag 100, indicating that the route is obtained from
R5.
To address the loop problem, filter out the 10.1.4.0/24 route when R5 imports ISIS
routes to OSPF.
Configure the route policy route_delete on R5 to control ISIS route import to OSPF.
[R5-route-policy]ospf 1
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 28 Routes : 28
[R1]ping 10.1.4.4
5 packet(s) transmitted
5 packet(s) received
[R1]tracert 10.1.4.4
1 10.0.14.4 61 ms 29 ms 29 ms
The loop is removed. R4 is the next hop of the 10.1.4.0/24 route on R1.
Check the IP routing table of R5. Observe the next hop of the route 10.1.4.0/24.
[R5]display ip routing-table
------------------------------------------------------------------------------
Destinations : 22 Routes : 22
[R5]tracert 10.1.4.4
1 10.0.35.3 62 ms 24 ms 24 ms
2 10.0.23.2 43 ms 44 ms 44 ms
3 10.0.12.1 33 ms 33 ms 33 ms
4 10.0.14.4 74 ms 55 ms 55 ms
Although route filtering can fix the loop problem, R5 still learns the 10.1.4.0/24 route
from the ISIS domain. The sub-optimal route problem still exists.
To fix both the loop problem and sub-optimal route problem, R5 must learn the
10.1.4.0/24 route from the OSPF domain.
Configure the route-policy route_pref on R5. Change the priority of the 10.1.4.0/24
route to 180, which is smaller than the priority of OSPF external routes.
Use the route-policy route_pref to control the ISIS routes imported into OSPF.
[R5]isis
Check the IP routing tables of R5 and R1. Observe the next hops of the 10.1.4.0/24
routes.
----------------------------------------------------------------------------
Summary Count : 1
----------------------------------------------------------------------------
Summary Count : 1
[R1]ping 10.1.4.4
5 packet(s) transmitted
5 packet(s) received
[R1]tracert 10.1.4.4
1 10.0.14.4 61 ms 25 ms 25 ms
[R5]tracert 10.1.4.4
1 10.0.15.1 61 ms 2 ms 2 ms
2 10.0.14.4 41 ms 28 ms 27 ms
R4 is the next hop of the route 10.1.4.0/24 on R1. R1 is the next hop of the route
10.1.4.0/24 on R5. The sub-optimal route problem is also fixed.
----End
Can you use an ACL to achieve the same effect as that in step 3? What is the
difference between using an ACL and a prefix list?
In the R3's routing table in step 5, why the 10.0.15.0/24 route has two next hops but
the 10.0.12.0/24 route has only one next hop?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
isis 1
is-level level-2
network-entity 49.0001.0000.0000.0002.00
import-route ospf 1
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
isis enable 1
interface LoopBack0
isis enable 1
ospf 1
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
isis 1
is-level level-2
network-entity 49.0001.0000.0000.0003.00
interface Serial2/0/0
link-protocol ppp
isis enable 1
interface Serial3/0/0
link-protocol ppp
isis enable 1
interface LoopBack0
isis enable 1
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
interface LoopBack1
ospf 1
import-route direct
area 0.0.0.0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
isis 1
is-level level-2
network-entity 49.0001.0000.0000.0005.00
interface Serial1/0/0
link-protocol ppp
isis enable 1
interface GigabitEthernet0/0/0
interface LoopBack0
isis enable 1
ospf 1
area 0.0.0.0
return
Learning Objectives
Topology
Scenario
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1-GigabitEthernet0/0/1]quit
<Huawei>system-view
[Huawei]sysname R2
[R2-GigabitEthernet0/0/1]quit
<Huawei>system-view
[Huawei]sysname R3
[R3-GigabitEthernet0/0/2]quit
<Huawei>system-view
[Huawei]sysname S1
<Huawei>system-view
[Huawei]sysname S2
You can bind two or more links into an Eth-Trunk to improve link bandwidth and
reliability. Add G0/0/9 and G0/0/10 and S1 and S2 to an Eth-Trunk group.
Create an Eth-Trunk.
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]
[S1-Eth-Trunk1]mode lacp
[S1-Eth-Trunk1]quit
[S2-Eth-Trunk1]mode lacp
[S2-Eth-Trunk1]quit
[S1-GigabitEthernet0/0/9]eth-trunk 1
[S1-GigabitEthernet0/0/9]quit
[S1-GigabitEthernet0/0/10]eth-trunk 1
[S1-GigabitEthernet0/0/10]quit
[S2-GigabitEthernet0/0/9]eth-trunk 1
[S2-GigabitEthernet0/0/9]quit
[S2-GigabitEthernet0/0/10]eth-trunk 1
[S2-GigabitEthernet0/0/10]quit
[S1]display eth-trunk
Local:
--------------------------------------------------------------------------------
Partner:
--------------------------------------------------------------------------------
The command output shows that the Eth-Trunk working mode is LACP, and the
threshold of active interfaces is 8. G0/0/9 and G0/0/10 are active.
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]max active-linknumber 1
[S1-Eth-Trunk1]quit
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]max active-linknumber 1
[S2-Eth-Trunk1]quit
[S1]display eth-trunk 1
Local:
----------------------------------------------------------------------------
Partner:
----------------------------------------------------------------------------
The status of G0/0/10 changes to Unselect. One link in the Eth-Trunk transmits data,
and the other link is the backup. Network reliability is improved.
[S1-GigabitEthernet0/0/9]shutdown
[S1-GigabitEthernet0/0/9]quit
[S1]display eth-trunk 1
Local:
--------------------------------------------------------------------------------
Partner:
--------------------------------------------------------------------------------
The command output shows that the status of G0/0/9 in the Eth-Trunk changes to
Unselect, and the status of G0/0/10 changes from Unselect to Selected and G0/0/10
resumes data forwarding. Link backup is successful.
Device Configurations
[S1]display current-configuration
sysname SW1
drop-profile default
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
irreversible-cipher %^%#tK;J&jw0HG8<9-"zX!kHwzXRNjuXn96[vN47F$*L~pXcROEP3!>c)NV+:`i;%^%#
interface Vlanif1
interface MEth0/0/1
interface Eth-Trunk1
mode lacp
max active-linknumber 1
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/5
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/8
interface GigabitEthernet0/0/9
shutdown
eth-trunk 1
interface GigabitEthernet0/0/10
eth-trunk 1
interface GigabitEthernet0/0/11
interface GigabitEthernet0/0/12
interface GigabitEthernet0/0/13
interface GigabitEthernet0/0/14
interface GigabitEthernet0/0/15
interface GigabitEthernet0/0/16
interface GigabitEthernet0/0/17
interface GigabitEthernet0/0/18
interface GigabitEthernet0/0/19
interface GigabitEthernet0/0/20
interface GigabitEthernet0/0/21
interface GigabitEthernet0/0/22
interface GigabitEthernet0/0/23
interface GigabitEthernet0/0/24
interface GigabitEthernet0/0/25
interface GigabitEthernet0/0/26
interface GigabitEthernet0/0/27
interface GigabitEthernet0/0/28
interface XGigabitEthernet0/0/1
interface XGigabitEthernet0/0/2
interface XGigabitEthernet0/0/3
interface XGigabitEthernet0/0/4
interface NULL0
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
return
[S2]display current-configuration
sysname SW2
drop-profile default
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
irreversible-cipher %^%#gI/bO8qF$HkpAPUgNd'GiYR4TC!>EK#oG("Wl4_#$G*OKo-'7*R[h3+49<Z2%^%#
interface Vlanif1
interface MEth0/0/1
interface Eth-Trunk1
mode lacp
max active-linknumber 1
interface GigabitEthernet0/0/1
interface GigabitEthernet0/02
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/5
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/8
interface GigabitEthernet0/0/9
eth-trunk 1
interface GigabitEthernet0/0/10
eth-trunk 1
interface GigabitEthernet0/0/11
interface GigabitEthernet0/0/12
interface GigabitEthernet0/0/13
interface GigabitEthernet0/0/14
interface GigabitEthernet0/0/15
interface GigabitEthernet0/0/16
interface GigabitEthernet0/0/17
interface GigabitEthernet0/0/18
interface GigabitEthernet0/0/19
interface GigabitEthernet0/0/20
interface GigabitEthernet0/0/21
interface GigabitEthernet0/0/22
interface GigabitEthernet0/0/23
interface GigabitEthernet0/0/24
interface GigabitEthernet0/0/25
interface GigabitEthernet0/0/26
interface GigabitEthernet0/0/27
interface GigabitEthernet0/0/28
interface XGigabitEthernet0/0/1
interface XGigabitEthernet0/0/2
interface XGigabitEthernet0/0/3
interface XGigabitEthernet0/0/4
interface NULL0
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
Return
Learning Objectives
Topology
Scenario
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]quit
<Huawei>system-view
[Huawei]sysname R2
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]quit
<Huawei>system-view
[Huawei]sysname R3
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]quit
<Huawei>system-view
[Huawei]sysname R4
[R4]interface Ethernet2/0/0
[R4-GigabitEthernet2/0/0]quit
<Huawei>system-view
[Huawei]sysname R5
[R5]interface Ethernet2/0/0
[R1-GigabitEthernet0/0/1]quit
<Huawei>system-view
[Huawei]sysname S1
[S1]
<Huawei>system-view
[Huawei]sysname S2
[S2]
Test the connectivity between R1 and R2, R3, R4, as well as R5.
[R1]ping -c 1 10.0.10.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.10.3
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.10.4
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.10.5
1 packet(s) transmitted
1 packet(s) received
After the devices on the same network segment are added to different VLANs, MUX
VLAN forbids Layer 2 communication between them and allows them to
communicate with the specified VLAN. In addition, MUX VLAN forbids
communication between the devices in the same VLAN.
Configure VLAN 100 as the principle VLAN of MUX VLAN, and VLAN 10 as well as
VLAN 20 as subordinate VLANs.
Set the interface types between PCs and switches. Allow all PCs to communicate with
R4. Prevent R3 and R4 from communicating with other VLANs or accessing each
other.
Configure VLAN 100 as the principle VLAN and configure subordinate VLANs.
[S1]vlan 10
[S1-vlan10]quit
[S1]vlan 20
[S1-vlan20]quit
[S1]vlan 100
[S1-vlan100]mux-vlan
[S1-vlan100]subordinate group 10
[S1-vlan100]subordinate separate 20
[S1-vlan100]quit
[S2]vlan 10
[S2-vlan10]quit
[S2]vlan 20
[S2-vlan20]quit
[S2]vlan 100
[S2-vlan100]mux-vlan
[S2-vlan100]subordinate group 10
[S2-vlan100]subordinate separate 20
[S2-vlan100]quit
Add G0/0/5 between R5 and S2 to VLAN 100 and enable MUX VLAN.
[S2-GigabitEthernet0/0/5]quit
Add G0/0/1 between R1 and S1 and G0/0/2 between R2 and S1 to VLAN 10, and
enable MUX VLAN.
[S1-GigabitEthernet0/0/1]quit
[S1-GigabitEthernet0/0/2]quit
Add G0/0/3 between R3 and S1 and G0/0/4 between R4 and S2 to VLAN 20, and
enable MUX VLAN.
[S1-GigabitEthernet0/0/3]quit
[S2-GigabitEthernet0/0/4]quit
[S1]display mux-vlan
----------------------------------------------------------------------------
100 - principal
[S2]display mux-vlan
----------------------------------------------------------------------------
100 10 group
----------------------------------------------------------------------------
[R1]ping -c 1 10.0.10.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.10.3
1 packet(s) transmitted
0 packet(s) received
[R1]ping -c 1 10.0.10.4
1 packet(s) transmitted
0 packet(s) received
[R1]ping -c 1 10.0.10.5
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.10.2
1 packet(s) transmitted
0 packet(s) received
[R3]ping -c 1 10.0.10.4
1 packet(s) transmitted
0 packet(s) received
[R3]ping -c 1 10.0.10.5
1 packet(s) transmitted
1 packet(s) received
The ping command output shows that R1 and R2 in VLAN 10 of MUX VLAN can
communicate with R5, and also access each other. R3 and R4 in VLAN 20 can only
communicate with R5.
----End
Can the users belonging to different MUX VLANs communicate with each other?
Device Configurations
[S1]display current-configuration
sysname S1
drop-profile default
vlan 100
mux-vlan
subordinate separate 20
subordinate group 10
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
irreversible-cipher %^%#tK;J&jw0HG8<9-"zX!kHwzXRNjuXn96[vN47F$*L~pXcROEP3!>c)NV+:`i;%^%#
interface Vlanif1
interface MEth0/0/1
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/5
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/8
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/10
interface GigabitEthernet0/0/11
interface GigabitEthernet0/0/12
interface GigabitEthernet0/0/13
interface GigabitEthernet0/0/14
interface GigabitEthernet0/0/15
interface GigabitEthernet0/0/16
interface GigabitEthernet0/0/17
interface GigabitEthernet0/0/18
interface GigabitEthernet0/0/19
interface GigabitEthernet0/0/20
interface GigabitEthernet0/0/21
interface GigabitEthernet0/0/22
interface GigabitEthernet0/0/23
interface GigabitEthernet0/0/24
interface GigabitEthernet0/0/25
interface GigabitEthernet0/0/26
interface GigabitEthernet0/0/27
interface GigabitEthernet0/0/28
interface XGigabitEthernet0/0/1
interface XGigabitEthernet0/0/2
interface XGigabitEthernet0/0/3
interface XGigabitEthernet0/0/4
interface NULL0
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
return
[S2]display current-configuration
sysname S2
drop-profile default
vlan 100
mux-vlan
subordinate separate 20
subordinate group 10
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
irreversible-cipher %^%#gI/bO8qF$HkpAPUgNd'GiYR4TC!>EK#oG("Wl4_#$G*OKo-'7*R[h3+49<Z2%^%#
interface Vlanif1
interface MEth0/0/1
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/5
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/8
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/10
interface GigabitEthernet0/0/11
interface GigabitEthernet0/0/12
interface GigabitEthernet0/0/13
interface GigabitEthernet0/0/14
interface GigabitEthernet0/0/15
interface GigabitEthernet0/0/16
interface GigabitEthernet0/0/17
interface GigabitEthernet0/0/18
interface GigabitEthernet0/0/19
interface GigabitEthernet0/0/20
interface GigabitEthernet0/0/21
interface GigabitEthernet0/0/22
interface GigabitEthernet0/0/23
interface GigabitEthernet0/0/24
interface GigabitEthernet0/0/25
interface GigabitEthernet0/0/26
interface GigabitEthernet0/0/27
interface GigabitEthernet0/0/28
interface XGigabitEthernet0/0/1
interface XGigabitEthernet0/0/2
interface XGigabitEthernet0/0/3
interface XGigabitEthernet0/0/4
interface NULL0
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
Learning Objectives
Topology
Scenario
Then, due to the network structure change, more traffic is transmitted between
VLANs. Therefore, the company required multi-level switching. To facilitate network
management, VLAN aggregation is needed.
Tasks
<huawei>system-view
[huawei]sysname R1
[R1-GigabitEthernet0/0/1]quit
<huawei>system-view
[huawei]sysname R2
[R2-GigabitEthernet0/0/2]quit
<Huawei>system-view
[Huawei]sysname S1
<Huawei>system-view
[Huawei]sysname S2
<huawei>system-view
[huawei]sysname R4
[R4-GigabitEthernet0/0/1]quit
[R4]interface Ethernet2/0/0
[R4-Ethernet2/0/0]quit
[R1]ping -c 1 10.0.2.1
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.3.1
1 packet(s) transmitted
1 packet(s) received
The R1's gateway address is the address of R4's G0/0/1, and the R2's gateway
address is the address of R4's G0/0/2.
[S1]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
Add R1 to VLAN 2, R2 to VLAN 3, R4's G0/0/1 to VLAN 2, and R4's G0/0/2 to VLAN 3.
[S1-GigabitEthernet0/0/1]quit
[S1-GigabitEthernet0/0/4]quit
[S2-GigabitEthernet0/0/2]
[S2-GigabitEthernet0/0/4]quit
Configure the gateway addresses on R1 and R2. The gateway addresses are the R4
interface addresses belonging to their respective VLANs.
[S1]display vlan 2
----------------------------------------------------------------------------
#: ProtocolTransparent-vlan; *: Management-vlan;
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
[S2]display vlan 3
----------------------------------------------------------------------------
#: ProtocolTransparent-vlan; *: Management-vlan;
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
[R1]ping -c 1 10.0.3.2
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.2.2
1 packet(s) transmitted
1 packet(s) received
This is router-on-a-stick.
[S2-GigabitEthernet0/0/4]shutdown
[S2-GigabitEthernet0/0/4]quit
[S2-GigabitEthernet0/0/9]quit
[S1-GigabitEthernet0/0/9]quit
Change the access type of S1's G0/0/4 to Trunk, allowing VLAN 2 and VLAN 3.
[S1-GigabitEthernet0/0/4]quit
[R4-GigabitEthernet0/0/1.2]quit
[R4-GigabitEthernet0/0/1.3]quit
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/1 10.0.2.1/24 up up
GigabitEthernet0/0/1.2 10.0.20.1/24 up up
GigabitEthernet0/0/1.3 10.0.30.1/24 up up
Serial1/0/0 unassigned up up
[R1-GigabitEthernet0/0/1]quit
[R2-GigabitEthernet0/0/2]quit
[R1]ping -c 1 10.0.30.2
1 packet(s) transmitted
1 packet(s) received
The ping command output shows that the computers in VLAN 2 and VLAN 3
successfully communicate with each other.
However, in the router-on-a-stick method, all data is transmitted through the same
interface. When the number of VLANs increases, the load on a single link increases.
This link potentially causes a single-point failure.
In Layer 3 switching, each VLAN has a VLANIF interface, which functions as a router
to allow inter-VLAN communication.
[S1-GigabitEthernet0/0/4]shutdown
[S1-GigabitEthernet0/0/4]quit
Change the access types of S1's G0/0/9 and S2's G0/0/9 to Trunk, allowing VLAN 2
and VLAN 3.
[S1-GigabitEthernet0/0/9]quit
[S2-GigabitEthernet0/0/9]quit
[S1]interface Vlanif 2
[S1-Vlanif2]quit
[S1]inter Vlanif 3
[S1-Vlanif3]quit
[R1]ping -c 1 10.0.30.2
1 packet(s) transmitted
1 packet(s) received
The ping command output shows that the computers on VLAN 2 and VLAN 3
implement Layer 3 communication through two VLANIF interfaces of S1.
On a network where most traffic is inter-VLAN traffic, the network can fully support
the services.
Info: This operation may take a few seconds. Please wait for a moment...done.
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-GigabitEthernet0/0/9]quit
[S2-GigabitEthernet0/0/9]quit
Add S1's G0/0/1 and S2's G0/0/2 to VLAN 10 and VLAN 20 respectively.
[S1-GigabitEthernet0/0/1]quit
[S2-GigabitEthernet0/0/1]quit
Configure VLAN 100 as a super VLAN, and add VLAN 10 and VLAN 20 to VLAN 100
as sub VLANs.
[S1]vlan 100
[S1-vlan100]aggregate-vlan
[S1-vlan100]access-vlan 10 20
[S1-Vlan100]quit
Configure a VLANIF interface for VLAN 100 and enable ARP proxy.
[S1-Vlanif100]quit
Change the IP addresses of R1 and R2 to make them on the same network segment
as VLANIF 100. Configure the VLANIF 100 address as the gateway address.
[R1-GigabitEthernet0/0/1]quit
[R2-GigabitEthernet0/0/2]quit
[R1]ping -c 1 10.0.100.1
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.100.3
1 packet(s) transmitted
1 packet(s) received
[R2]pin -c 1 10.0.100.1
1 packet(s) transmitted
1 packet(s) received
The ping command output shows that R1 and R2 can communicate with S1's VLANIF
100. With VLAN aggregation, different VLANs can use the same gateway to
communicate with each other. This conserves IP addresses and improves
management efficiency. However, the computers on the same network segment
communicate with each other through the same VLANIF interface. This interface
bears large loads.
----End
Device Configurations
[S1]display current-configuration
sysname S1
drop-profile default
vlan 100
aggregate-vlan
access-vlan 10 20
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
irreversible-cipher %^%#tK;J&jw0HG8<9-"zX!kHwzXRNjuXn96[vN47F$*L~pXcROEP3!>c)NV+:`i;%^%#
interface Vlanif1
interface Vlanif2
interface Vlanif3
interface Vlanif100
interface MEth0/0/1
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
shutdown
interface GigabitEthernet0/0/5
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/8
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/10
interface NULL0
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
return
[S2]display current-configuration
sysname S2
drop-profile default
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
irreversible-cipher %^%#gI/bO8qF$HkpAPUgNd'GiYR4TC!>EK#oG("Wl4_#$G*OKo-'7*R[h3+49<Z2%^%#
interface Vlanif1
interface MEth0/0/1
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
shutdown
interface GigabitEthernet0/0/5
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/8
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/10
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
return
[R4]display current-configuration
[V200R007C00SPC600]
sysname R4
enrollment self-signed
pki-realm default
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
irreversible-cipher %^%#`S|f)zA5xQeP^7UA/d/LH:}m3<KxR6fH,g5a%d)'zc,T/&qu:XPCg7))ihy5%^%#
priority 64
interface Ethernet2/0/0
interface Ethernet2/0/1
interface Serial1/0/0
link-protocol ppp
interface Serial1/0/1
link-protocol ppp
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/1.2
interface GigabitEthernet0/0/1.3
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
description VirtualPort
interface Cellular0/0/0
interface Cellular0/0/1
interface NULL0
user-interface con 0
authentication-mode aaa
idle-timeout 0 0
user-interface vty 0
authentication-mode aaa
user-interface vty 1 4
wlan ac
voice
diagnose
ops
autostart
return
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company uses a backup network,
and configure STP to prevent loops. STP convergence on interfaces requires a long
time. To speed up convergence, the company needs to use RSTP. All VLANs share an
STP tree. To load balance traffic between VLANs, the company needs to use MSTP.
Tasks
[S1]stp enable
[S2]stp enable
[S3]stp enable
[S4]stp enable
Configure STP.
[S1]display stp
BPDU-Protection :Disabled
…output omit…
[S2]display stp
BPDU-Protection :Disabled
…output omit…
The switch MAC addresses are not fixed, so the actual lab test result may be
different.
Configure S1 as the primary root bridge and S2 as the backup root bridge.
[S1]display stp
BPDU-Protection :Disabled
…output omit…
[S2]display stp
BPDU-Protection :Disabled
…output omit…
A small bridge priority value indicates a high priority. Change the bridge priority of
S1 to 8192 and bridge priority of S2 to 4096.
[S1]display stp
BPDU-Protection :Disabled
…output omit…
[S2]display stp
BPDU-Protection :Disabled
…output omit…
The priority of S1 is 8192, the priority of S2 is 4096, and S2 is the root bridge.
The default port priority is 128. A large value indicates a low priority.
On S2, set the priority of G0/0/9 to 32 and the priority of G0/0/10 to 16.
[S2-GigabitEthernet0/0/9]quit
[S2-GigabitEthernet0/0/10]quit
----[CIST][Port1(GigabitEthernet0/0/1)][DISCARDING]----
----[CIST][Port24(GigabitEthernet0/0/6)][DISCARDING]----
[S4]interface GigabitEthernet0/0/6
[S4-GigabitEthernet0/0/6]quit
----[CIST][Port1(GigabitEthernet0/0/1)][FORWARDING]----
----[CIST][Port6(GigabitEthernet0/0/6)][DISCARDING]----
TC or TCN send :7
BPDU Sent :8
Configure VLANIF 1 addresses on S1 and S2. Test the connectivity between S1 and
S2.
[S1]interface Vlanif 1
[S1-Vlanif1]quit
[S2]interface Vlanif 1
[S2-Vlanif1]quit
[S1]ping 10.0.1.2
5 packet(s) transmitted
5 packet(s) received
Note: After S1 performs ping, shut down S2's GigabitEthernet 0/0/10 immediately.
[S1]ping -c 20 10.0.1.2
DOWN state.
20 packet(s) transmitted
5 packet(s) received
[S2-GigabitEthernet0/0/10]shutdown
[S2-GigabitEthernet0/0/10]quit
S1's GigabitEthernet0/0/9 becomes the root port, and the port enters the
Forwarding state. There are 15 timeout packets, and network convergence time is
30s.
[S2-GigabitEthernet0/0/10]undo shutdown
[S2-GigabitEthernet0/0/10]quit
Note: After S1 performs ping, shut down S2's GigabitEthernet 0/0/10 immediately.
[S1]ping -c 20 10.0.1.2
DOWN state.
20 packet(s) transmitted
19 packet(s) received
[S2-GigabitEthernet0/0/10]shutdown
[S2-GigabitEthernet0/0/10]quit
S1's GigabitEthernet0/0/9 becomes the root port and enters the Forwarding state.
There is one timeout packet, and network convergence time is 2s.
[S2-GigabitEthernet0/0/10]undo shutdown
[S2-GigabitEthernet0/0/10]quit
Note: After S1 performs ping, shut down S2's GigabitEthernet 0/0/10 immediately.
[S1]ping -c 20 10.0.1.2
DOWN state.
20 packet(s) transmitted
5 packet(s) received
[S2-GigabitEthernet0/0/10]shutdown
S1's GigabitEthernet0/0/9 becomes the root port and enters the Forwarding state.
There are 15 timeout packets, and network convergence time is 30s.
[S2-GigabitEthernet0/0/10]undo shutdown
[S2-GigabitEthernet0/0/10]quit
[S1]vlan batch 2 to 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-GigabitEthernet0/0/9]quit
[S1-GigabitEthernet0/0/10]quit
[S1-GigabitEthernet0/0/13]quit
[S1-GigabitEthernet0/0/14]quit
[S2]vlan batch 1 to 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-GigabitEthernet0/0/9]quit
[S2-GigabitEthernet0/0/10]quit
[S2-GigabitEthernet0/0/6]quit
[S2-GigabitEthernet0/0/7]quit
[S3]vlan batch 1 to 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3]interface GigabitEthernet0/0/1
[S3-GigabitEthernet0/0/1]quit
[S3]interface GigabitEthernet0/0/13
[S3-GigabitEthernet0/0/13]quit
[S3]interface GigabitEthernet0/0/7
[S3-GigabitEthernet0/0/7]quit
[S4]vlan batch 1 to 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4]interface GigabitEthernet0/0/1
[S4-GigabitEthernet0/0/1]quit
[S4]interface GigabitEthernet0/0/14
[S4-GigabitEthernet0/0/14]quit
[S4]interface GigabitEthernet0/0/6
[S4-GigabitEthernet0/0/6]quit
Configure MSTP.
[S1]stp region-configuration
[S1-mst-region]region-name RG1
[S1-mst-region]instance 1 vlan 1 TO 10
[S1-mst-region]instance 2 vlan 11 to 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 RG1
[S2-mst-region]instance 1 vlan 1 TO 10
[S2-mst-region]instance 2 vlan 11 to 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
Info: This operation may take a few seconds. Please wait for a moment.....done.
[S3]stp region-configuration
[S3-mst-region]region-name RG1
[S3-mst-region]instance 1 vlan 1 to 10
[S3-mst-region]instance 2 vlan 11 to 20
[S3-mst-region]quit
Info: This operation may take a few seconds. Please wait for a moment.....done.
[S4]stp region-configuration
[S4-mst-region]region-name RG1
[S4-mst-region]instance 1 vlan 1 to 10
[S4-mst-region]instance 2 vlan 11 to 20
[S4-mst-region]quit
Oper configuration
Format selector :0
Revision level :0
0 21 to 4094
1 1 to 10
2 11 to 20
Set the S1 priority in instance 1 to 4096 and the S1 priority in instance 2 to 8192.
Set the S2 priority in instance 2 to 4096 and the S2 priority in instance 1 to 8192.
TC received :20
Cost to Master :0
TC received :16
S1 in instance 1 is the root bridge. The users in VLAN 1-10 on S3 communicate with
the users in VLAN 1-10 on S1, S2, and S4 through Ethernet0/0/13.
S2 in instance 2 is the root bridge. The users in VLAN 11-20 on S3 communicate with
the users in VLAN 11-20 on S1, S2, and S4 through Ethernet0/0/23.
----End
How can MSTP load balance data from different VLANs in multiple regions?
Device Configurations
[S1]display current-configuration
sysname S1
vlan batch 2 to 20
stp region-configuration
region-name RG1
instance 1 vlan 1 to 10
instance 2 vlan 11 to 20
active region-configuration
interface Vlanif1
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/10
interface GigabitEthernet0/0/13
Return
[S2]display current-configuration
sysname S2
vlan batch 2 to 20
stp region-configuration
region-name RG1
instance 1 vlan 1 to 10
instance 2 vlan 11 to 20
active region-configuration
interface Vlanif1
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/10
Return
[S3]display current-configuration
sysname S3
vlan batch 2 to 20
stp region-configuration
region-name RG1
instance 1 vlan 1 to 10
instance 2 vlan 11 to 20
active region-configuration
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/13
interface GigabitEthernet0/0/7
Return
[S4]display current-configuration
sysname S4
vlan batch 2 to 20
stp region-configuration
region-name RG1
instance 1 vlan 1 to 10
instance 2 vlan 11 to 20
active region-configuration
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/14
interface Ethernet0/0/23
interface GigabitEthernet0/0/6
Return
Learning Objectives
Topology
Scenario
Tasks
<S1>system-view
[S1-GigabitEthernet0/0/9]shutdown
[S1-GigabitEthernet0/0/9]quit
<S3>system-view
[S3-GigabitEthernet0/0/6]shutdown
[S3-GigabitEthernet0/0/6]quit
<S4>system-view
[S4-GigabitEthernet0/0/14]shutdown
[S4-GigabitEthernet0/0/14]quit
[S1]vlan batch 3 to 8
[S2]vlan batch 3 to 8
[S3]vlan batch 3 to 8
[S4]vlan batch 3 to 8
[S1]display vlan
* : management-vlan
---------------------
----------------------------------------------------------------------------
[S2]display vlan
* : management-vlan
---------------------
----------------------------------------------------------------------------
[S3]display vlan
* : management-vlan
---------------------
----------------------------------------------------------------------------
[S4]display vlan
* : management-vlan
---------------------
----------------------------------------------------------------------------
Set the access types of the links among all switches to Trunk to receive BPDUs. Allow
all VLANs. You do not need to configure the direct link between S2 and S3.
[S1-GigabitEthernet0/0/13]bpdu enable
[S1-GigabitEthernet0/0/13]quit
[S1-GigabitEthernet0/0/10]bpdu enable
[S1-GigabitEthernet0/0/10]quit
[S2-GigabitEthernet0/0/6]bpdu enable
[S2-GigabitEthernet0/0/6]quit
[S2-GigabitEthernet0/0/10]bpdu enable
[S2-GigabitEthernet0/0/10]quit
[S3]interface GigabitEthernet0/0/1
[S3-GigabitEthernet0/0/1]bpdu enable
[S3-GigabitEthernet0/0/1]quit
[S3]interface GigabitEthernet0/0/13
[S3-GigabitEthernet0/0/13]bpdu enable
[S3-GigabitEthernet0/0/13]quit
[S4]interface GigabitEthernet0/0/1
[S4-GigabitEthernet0/0/1]bpdu enable
[S4-GigabitEthernet0/0/1]quit
[S4]interface GigabitEthernet0/0/6
[S4-GigabitEthernet0/0/6]bpdu enable
[S4-GigabitEthernet0/0/6]quit
[S1]stp enable
[S2]stp enable
[S3]stp enable
[S4]stp enable
Allocate all switches to the same region RG1 and set the revision level to 1. Map
instance 1 to VLANs 3, 4, and 5. Create instance 2 and map it to VLANs 6, 7, and 8.
Activate region configuration.
[S1]stp region-configuration
[S1-mst-region]region-name RG1
[S1-mst-region]revision-level 1
[S1-mst-region]instance 1 vlan 3 4 5
[S1-mst-region]instance 2 vlan 6 7 8
[S1-mst-region]active region-configuration
[S1-mst-region]quit
[S2]stp region-configuration
[S2-mst-region]region-name RG1
[S2-mst-region]revision-level 1
[S2-mst-region]instance 1 vlan 3 4 5
[S2-mst-region]instance 2 vlan 6 7 8
[S2-mst-region]active region-configuration
[S2-mst-region]quit
[S3]stp region-configuration
[S3-mst-region]region-name RG1
[S3-mst-region]revision-level 1
[S3-mst-region]instance 1 vlan 3 4 5
[S3-mst-region]instance 2 vlan 6 7 8
[S3-mst-region]active region-configuration
[S3-mst-region]quit
[S4]stp region-configuration
[S4-mst-region]region-name RG1
[S4-mst-region]revision-level 1
[S4-mst-region]instance 1 vlan 3 4 5
[S4-mst-region]instance 2 vlan 6 7 8
[S4-mst-region]active region-configuration
[S4-mst-region]quit
S1 is the root switch. S4's E0/0/24 is the backup port for all MST processes.
In instance 2, the S2's priority is 0, the S1's priority is 4096, and the S4's priority is
8192; therefore, S2 becomes the root switch in instance 2.
After the configurations are complete, check the MSTP basic information.
S2 becomes the root switch in instance 2, and S3's E0/0/1 becomes the alternate
port in instance 2. However, the status of switches in instance 1 is not changed. Each
MST instance independently calculates the spanning tree.
Delete the MST regions and priority settings of all switches in step 2.
Add S1 and S3 to the same MST region. The region name is RG1 and revision version
is 1.
[S1]stp region-configuration
[S1-mst-region]region-name RG1
[S1-mst-region]revision-level 1
[S1-mst-region]instance 1 vlan 3 4 5
[S1-mst-region]instance 2 vlan 6 7 8
[S1-mst-region]active region-configuration
[S1-mst-region]quit
[S3]stp region-configuration
[S3-mst-region]region-name RG1
[S3-mst-region]revision-level 1
[S3-mst-region]instance 1 vlan 3 4 5
[S3-mst-region]instance 2 vlan 6 7 8
[S3-mst-region]active region-configuration
[S3-mst-region]quit
Add S2 and S4 to another MST region. The region name is RG2 and revision version
is 2.
Create instance 2 and map it to VLANs 6, 7, and 8. Activate all region configurations.
[S2]stp region-configuration
[S2-mst-region]region-name RG2
[S2-mst-region]revision-level 2
[S2-mst-region]instance 1 vlan 3 4 5
[S2-mst-region]instance 2 vlan 6 7 8
[S2-mst-region]active region-configuration
[S2-mst-region]quit
[S4]stp region-configuration
[S4-mst-region]region-name RG2
[S4-mst-region]revision-level 2
[S4-mst-region]instance 1 vlan 3 4 5
[S4-mst-region]instance 2 vlan 6 7 8
[S4-mst-region]active region-configuration
[S4-mst-region]quit
After the configurations are complete, check the MSTP basic information.
Set the S3 priority in instance 0 to 0 so that S3 becomes the CIST root. Set the S3
priority in instance 1 to 0 so that S3 becomes the root of instance 1. Set the S4
priority in instance 1 to 0 so that S4 becomes the root of instance 1.
After the configurations are complete, check the MSTP basic information.
Delete MSTP configuration on S2 and S4, and S2 and S4 to another MST region. The
region name is RG2 and revision version is 2. Create instance 1 and map instance 1 to
VLANs 6, 7, and 8. Create instance 2 and map it to VLANs 3, 4, and 5. Activate region
configuration.
[S2]stp region-configuration
[S2-mst-region]region-name RG2
[S2-mst-region]revision-level 2
[S2-mst-region]instance 1 vlan 6 7 8
[S2-mst-region]instance 2 vlan 3 4 5
[S2-mst-region]active region-configuration
[S2-mst-region]quit
[S4]stp region-configuration
[S4-mst-region]region-name RG2
[S4-mst-region]revision-level 2
[S4-mst-region]instance 1 vlan 6 7 8
[S4-mst-region]instance 2 vlan 3 4 5
[S4-mst-region]active region-configuration
[S4-mst-region]quit
After the configurations are complete, check the MSTP basic information.
Add S1, S2, and S3 to the same MST region. Configure STP on S4.
Delete and reconfigure MSTP on S2. The region name is RG1. Create instance 1 and
map it to VLANs 3, 4, and 5. Create instance 2 and map it to VLANs 6, 7, and 8.
Activate all region configurations.
[S2]stp region-configuration
[S2-mst-region]region-name RG1
[S2-mst-region]revision-level 1
[S2-mst-region]instance 1 vlan 3 4 5
[S2-mst-region]instance 2 vlan 6 7 8
[S2-mst-region]active region-configuration
[S2-mst-region]quit
Set the access type of the direct link between S2 and S3 to Trunk to receive BPDUs.
All VLANs are allowed.
[S2-GigabitEthernet0/0/7]undo shutdown
[S2-GigabitEthernet0/0/7]bpdu enable
[S2-GigabitEthernet0/0/7]quit
[S3- GigabitEthernet0/0/7]quit
After the configurations are complete, check the STP basic information.
Instance 0 on S4 running STP and instance 0 on S1, S2, and S3 running MSTP
calculate CIST together. In this situation, S1 is the root of CIST.
Set the S4's priority to 4096 so that S4 becomes the root of CIST.
S4 becomes the root of CIST, and all ports on S4 are designated ports.
[S4]interface GigabitEthernet0/0/1
[S4-GigabitEthernet0/0/1]stp root-protection
[S4-GigabitEthernet0/0/1]quit
[S4]interface GigabitEthernet0/0/6
[S4-GigabitEthernet0/0/6]stp root-protection
[S4-GigabitEthernet0/0/6]quit
The S4's ports enter the Discarding state, and do not forward packets. This indicates
that the S4's port status does not change and S4 is still the root switch.
The port recovers to the normal state if the port does not receive packets of higher
priorities for a fixed period (Max Age, default value 20s).
[S2-GigabitEthernet0/0/9]undo shutdown
[S2-GigabitEthernet0/0/9]quit
Configure S1's G0/0/9 as an edge port. Enable edge port protection globally.
[S1-GigabitEthernet0/0/9]undo shutdown
[S1-GigabitEthernet0/0/9]quit
[S1]stp bpdu-protection
Enable S1's G0/0/9 so that the edge port can receive BPDUs. Simulate an attack on
the switch.
[S1-GigabitEthernet0/0/9]undo shutdown
[S1-GigabitEthernet0/0/9]quit
Observe S1.
state.
DOWN state.
After edge port protection is configured, the edge port is shut down once it receives
a BPDU.
[S3]interface GigabitEthernet0/0/7
[S3-GigabitEthernet0/0/7]stp loop-protection
[S3-GigabitEthernet0/0/7]quit
[S1]stp tc-protection
----End
If the switches have the same MSTP region name, can the revision versions be
different?
In step 4, if the priority of instance 1 on S3 is changed to 0, how will the port status
on four switches be changed?
Device Configurations
<S1>display current-configuration
sysname S1
vlan batch 3 to 8
stp bpdu-protection
stp tc-protection
stp region-configuration
region-name RG1
revision-level 1
instance 1 vlan 3 to 5
instance 2 vlan 6 to 8
active region-configuration
interface GigabitEthernet0/0/9
shutdown
interface GigabitEthernet0/0/10
interface GigabitEthernet0/0/13
return
<S2>display current-configuration
sysname S2
vlan batch 3 to 8
stp region-configuration
region-name RG1
revision-level 1
instance 1 vlan 3 to 5
instance 2 vlan 6 to 8
active region-configuration
interface GigabitEthernet0/0/9
interface GigabitEthernet0/0/6
interface GigabitEthernet0/0/7
interface GigabitEthernet0/0/10
return
<S3>display current-configuration
sysname S3
vlan batch 3 to 8
stp region-configuration
region-name RG1
revision-level 1
instance 1 vlan 3 to 5
instance 2 vlan 6 to 8
active region-configuration
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/7
stp loop-protection
interface GigabitEthernet0/0/13
return
<S4>display current-configuration
sysname S4
vlan batch 3 to 8 30
interface Vlanif30
interface GigabitEthernet0/0/1
stp root-protection
interface GigabitEthernet0/0/6
stp root-protection
interface GigabitEthernet0/0/7
bpdu disable
Return
Huawei e-Learning
https://ilearningx.huawei.com/portal/#/portal/ebg/51
Huawei Certification
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_31
&lang=en
Find Training
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_trai
ningsearch&lang=en
More Information
Huawei learning APP