Вы находитесь на странице: 1из 506

The privilege of HCNA/HCNP/HCIE:

With any Huawei Career Certification, you have the privilege on http://learning.huawei.com/en to enjoy:
n
 1、e-Learning Courses: Logon http://learning.huawei.com/en and enter Huawei Training/e-Learning
/e

o m
If you have the HCNA/HCNP certificate:You can access Huawei Career Certification and Basic Technology e-Learning
courses.
e i .c
If you have the HCIE certificate: You can access all the e-Learning courses which marked for HCIE Certification Users.

aw

Methods to get the HCIE e-Learning privilege : Please associate HCIE certificate information with your Huawei account, and

hu

email the account to Learning@huawei.com to apply for HCIE e-Learning privilege.


g .
 2、 Training Material Download
i n

arn
Content: Huawei product training material and Huawei career certification training material.

//le
Method:Logon http://learning.huawei.com/en and enter Huawei Training/Classroom Training ,then you can download
training material in the specific training introduction page.
p :
 3、 Priority to participate in Huawei Online Open Class (LVC)
t t

s :h
The Huawei career certification training and product training covering all ICT technical domains like R&S, UC&C, Security,

4、Learning Tools: rc e
Storage and so on, which are conducted by Huawei professional instructors.

u

s o
eNSP :Simulate single Router&Switch device and large network.

R e
WLAN Planner :Network planning tools for WLAN AP products.

n g
In addition, Huawei has built up Huawei Technical Forum which allows candidates to discuss technical issues with Huawei experts ,

ni
share exam experiences with others or be acquainted with Huawei Products.

a r
 Statement:
L e
r e
This material is for personal use only, and can not be used by any individual or organization for any commercial purposes.
o
M
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential 1
HCNP-IERS

Huawei Certification

e n
/
o m
HCNP-IERS i.c
w e
u a
.hg
i n
Implementing EnterpriseaRouting rn and
e
Switching Network /: /l
t tp
Lab: hGuide
e s
r c
o u
e s
R
i n g
a rn
L e
e
or
M

Huawei Technologies Co.,Ltd

HUAWEI TECHNOLOGIES
HCNP-IERS

Copyright © Huawei Technologies Co., Ltd. 2017. All rights reserved.

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.

Trademarks and Permissions

e n
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd. /
o
All other trademarks and trade names mentioned in this document are the property of theirm
respective holders.
e i.c
Notice
aw
u
.h
The information in this document is subject to change without notice. Every effort has been
g
i n
made in the preparation of this document to ensure accuracy of the contents, but all statements,
n
r
information, and recommendations in this document do not constitute a warranty of any kind,
expressed or implied.

//lea
p :
t t
s :h
r c e
s ou
Re
i n g
n
e ar Huawei Certification
e L
or Implementing Enterprise Routing and Switching Network
M Lab Guide

Edition 2.0

HUAWEI TECHNOLOGIES
HCNP-IERS

Huawei Certification System

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
e n
(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.
o m
e i.c
The Huawei Certified Network Associate (HCNA) certification level validates the skills and

aw
knowledge of IP network engineers to implement and support small to medium-sized enterprise
u
g .h
networks. The HCNA certification provides a rich foundation of skills and knowledge for the
establishment of such enterprise networks, along with the capability to implement services and

ni n
features within existing enterprise networks, to effectively support true industry operations.
r
//lea
HCNA certification covers fundamentals skills for TCP/IP, routing, switching and related IP

p :
network technologies, together with Huawei data communications products, and skills for

t t
versatile routing platform (VRP) operation and management.

s :h
r c e
The Huawei Certified Network Professional (HCNP-R&S) certification is aimed at enterprise
network engineers involved in design and maintenance, as well as professionals who wish to

ou
develop an in depth knowledge of routing, switching, network efficiency and optimization
s
e
technologies. HCNP-R&S consists of three units including Implementing Enterprise Routing and
R
i n g
Switching Network (IERS), Improving Enterprise Network Performance (IENP), and Implementing
Enterprise Network Engineering Project (IEEP), which includes advanced IPv4 routing and
n
ar
switching technology principles, network security, high availability and QoS, as well as

e
L
application of the covered technologies in Huawei products.

e
or The Huawei Certified Internet Expert (HCIE-R&S) certification is designed to imbue

M
engineers with a variety of IP network technologies and proficiency in maintenance, for the
diagnosis and troubleshooting of Huawei products, to equip engineers with in-depth
competency in the planning, design and optimization of large-scale IP networks.

HUAWEI TECHNOLOGIES
HCNP-IERS

e n
/
o m
ei.c
aw
u
g.h
ni n
r
//lea
p :
t t
s:h
r c e
sou
Re
i n g
n
e ar
e L
or
M

HUAWEI TECHNOLOGIES
HCNP-IERS

About This Document

Overview

This document is HCNP-Implementing Enterprise Routing and Switching


(HCNP-IERS) certification training material. It is intended for those who are
preparing for the HCNP-IERS exam and those who want to master common routing
protocol principles and Huawei Versatile Routing Platform (VRP) implementation. / e n
o m
.
Chapters 1, 2, and 3 describe working principles, configurations, and implementation
i c
of OSPF and IS-IS (two IGPs) as well as BGP (an EGP). These chapters help
w e readers
master IPv4 routing protocol knowledge. a
. huhelping readers
Chapter 4 briefly introduces multicast address, IGMP, and PIM-DM,
i n g
learn fundamental multicast knowledge, common multicast
r n protocol principles, and
multicast applications.
l e a
:
Chapter 5 illustrates how to flexibly use a variety /of/ tools to control route selection. It
helps readers flexibly use routing protocols.tp
h t
Chapter 6 describes the VLAN principles s : and implementation, including VLAN Layer
r c
2 interconnection and Layer 3 routing,
e helping readers learn VLAN working

o u the VRP.
es
principles and configurations on

Chapter 7 describes the Rworking principles and implementation of STP protocols,


i
including STP, RSTP,n gand MSTP.
a
This document rnhelps readers understand how to implement routing and switching
L e on Huawei products.
technologies
r e
o
M
Background Knowledge Required

To fully understand this document, readers should:

 Have participated in HCNA training.


 Have passed HCNA exams.
 Familiarize with the TCP/IP protocol stack and IP addressing.

HUAWEI TECHNOLOGIES
HCNP-IERS

Icons

Router Layer 3 switch Layer 2 switch Firewall Network cloud

e n
/
o m
Ethernet cable Serial cable
e i.c
aw
u
g .h
ni n
r
// lea
p :
t t
s :h
r c e
s ou
Re
i n g
n
e ar
e L
or
M

HUAWEI TECHNOLOGIES
HCNP-IERS

Lab Environment

Networking

Lab devices include five routers, four switches, and one firewall. Each lab
environment allows two candidates to perform lab practices simultaneously.

e n
/
Devices
o m
In order to ensure that the configuration given in this lab is supported on all.c
e i devices,

w
it is recommended that the following device models and VRP versions be used:
a
Device Name Device Model
. hu
Software Version

R1 AR 2220E
i n gV2R7

r n
R2 AR 2220E
l e a V2R7

R3 AR 2220E
: // V2R7

t tp
R4
h
AR 2220E
:
V2R7

R5
e s
AR 2220E V2R7

r c
S1
o u S5720-36C-EI-AC V2R8

S2 es S5720-36C-EI-AC V2R8
R
S3
i n g S3700-28TP-EI-AC V1R6C5

a rn
S4 S3700-28TP-EI-AC V1R6C5

L e FW USG6330 V100R001C30

r e
o
M

HUAWEI TECHNOLOGIES
HCNP-IERS

Contents

Chapter 1 OSPF Features and Configurations 10


Lab 1-1 Single-Area OSPF 10

Lab 1-2 Multiple OSPF Areas 32

Lab 1-3 OSPF Neighbor Relationship and LSA


e n
59
/
Lab 1-4 OSPF Stub Area and NSSA Area

o m 91

i.c
Lab 1-5 OSPF Virtual Link and Inter-Area Route Filtering 116

Lab 1-6 OSPF Troubleshooting


w e 141

Lab 1-7 Advanced OSPF Features


u a 168

Chapter 2 IS-IS Features and Configurations


g.h 193
Lab 2-1 IS-IS Configurations
ni n 193
r
Chapter 3 BGP Features and Configurations

//lea 220
Lab 3-1 IBGP and EBGP
p : 220

Lab 3-2 BGP Route Summarization


t t 242

:h
es
Lab 3-3 BGP Attributes and Route Selection 1 261

r c
Lab 3-4 BGP Attributes and Route Selection 2 (Optional) 281

Lab 3-5 BGP Multi-homing


s ou 299

R e
Lab 3-6 BGP Troubleshooting 328

Chapter 4 Multicast
i n gProtocols 349

a rn
Lab 4-1 Multicast, IGMP, and PIM DM Protocols 349

L e
Lab 4-2 PIM SM and Static RP 373

r e 5 Route Control
Chapter 396
o
M Lab 5-1 Route Import and Control 396

Chapter 6 VLAN Features and Configurations 420


Lab 6-1 VLAN Configurations 420

Lab 6-2 MUX VLAN 429

Lab 6-3 Inter-VLAN Communication 442

Chapter 7 STP Configurations 460

HUAWEI TECHNOLOGIES
HCNP-IERS

Lab 7-1 STP, RSTP, and MSTP 460

Lab 7-2 Compatibility Between MST Multi-Region and STP (Optional) 482

e n
/
o m
ei.c
aw
u
g .h
ni n
r
//lea
p :
t t
s :h
r c e
s ou
Re
i n g
n
e ar
e L
or
M

HUAWEI TECHNOLOGIES
HCNP-IERS Chapter 1 OSPF Features and Configurations

Chapter 1 OSPF Features and Configurations

Lab 1-1 Single-Area OSPF

Learning Objectives

The objectives of this lab are to learn and understand how to perform the following
e n
operations: /
o m
i.c
 How to configure single-area OSPF
 How to configure OSPF authentication
w e
How to establish neighbor relationships on multi-access a

hu networks

g .
How to use OSPF to advertise the subnet mask of the network to which
the loopback interface connects
ni n
ar

l e
How to change cost values for OSPF interfaces

: // interface
How to configure an interface as a silent
tpdisplay command

How to view OSPF status usingtthe


: h

e
How to view OSPF neighbor s relationships and troubleshoot faults using
the debug commandrc

o u
e s
R
i n g
a rn
e Le
o r
M

HC Series HUAWEI TECHNOLOGIES 10


HCNP-IERS Chapter 1 OSPF Features and Configurations

Topology

e n
/
o m
e i.c
aw
u
Figure 1-1 Single-area OSPF

g .h
ni n
r
lea
Scenario

: //
t tp
Assume that you are a network administrator of a company that has three ARG3
routers. These routers are interconnected over the Ethernet. A broadcast
: h
multi-access network, such as Ethernet,
e smalicious route attacks. A network connectivity
has security threats. Therefore, OSPF area

r c
authentication is required to prevent
failure occurs during network u
s o deployment. You can run the display and debug

e
commands for fault location.
R
Tasks i n g
rn
e a
Step 1 Perform basic configurations and configure IP addresses.

e L
r
Configure IP addresses and masks for R1, R2, and R3. Set a 24-bit mask for loopback
o to simulate an independent network segment.
M
interfaces
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.0.123.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 24

HC Series HUAWEI TECHNOLOGIES 11


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1-LoopBack0]quit

<R2>system-view
Enter system view, return user view with Ctrl+Z.
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.0.123.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24
e n
[R2-LoopBack0]quit
/
o m
i.c
<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface GigabitEthernet 0/0/0
w e
[R3-GigabitEthernet0/0/0]ip address 10.0.123.3 24
u a
[R3-GigabitEthernet0/0/0]quit

g .h
n
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 24
ni
r
lea
[R3-LoopBack0]quit

: //
Verify the connectivity between routers.
t t p
:h
[R1]ping -c 1 10.0.123.2
PING 10.0.123.2: 56
e s
data bytes, press CTRL_C to break

r c
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=2 ms

s ou
--- 10.0.123.2 ping statistics ---
1 packet(s) transmitted
Re
g
1 packet(s) received

i n
0.00% packet loss

n
ar
round-trip min/avg/max = 2/2/2 ms

L e
[R1]ping -c 1 10.0.123.3

e
or
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=2 ms

M--- 10.0.123.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

[R2]ping -c 1 10.0.123.3

HC Series HUAWEI TECHNOLOGIES 12


HCNP-IERS Chapter 1 OSPF Features and Configurations

PING 10.0.123.3: 56 data bytes, press CTRL_C to break


Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.0.123.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

e n
/
Step 2 Configure single-area OSPF.
o m
i . cprocess
e
Configure single-area OSPF and deploy all routers in area 0. Configure OSPF

w In an
1. In addition, configure area authentication and set the password to huawei.
a
u Plain text
OSPF area, Huawei devices support plain text or MD5 authentication.
. h
authentication is used for this step. g
n command. To
inetwork
Set the wildcard subnet mask to 0.0.0.0 when you use the r n
a
ensure the stability of Router IDs, they are usuallyespecified manually as.
/: /l
tp
[R1]ospf 1 router-id 10.0.1.1
[R1-ospf-1]area 0
ht
:
[R1-ospf-1-area-0.0.0.0]network 10.0.123.1 0.0.0.0

s
r c e
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
[R1-ospf-1-area-0.0.0.0]quit
o u
[R1-ospf-1]quit
e s
R
i n g
[R2]ospf 1 router-id 10.0.2.2

rn
[R2-ospf-1]area 0

a
[R2-ospf-1-area-0.0.0.0]network 10.0.123.2 0.0.0.0

e
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0

L
e
[R2-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei

o r
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
M[R3]ospf 1 router-id 10.0.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.123.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit

HC Series HUAWEI TECHNOLOGIES 13


HCNP-IERS Chapter 1 OSPF Features and Configurations

View the routing tables and test the connectivity of the entire network.

View the routing table of R1.

[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
e n
Routing Tables: Public /
Destinations : 12 Routes : 12
o m
Destination/Mask Proto Pre Cost Flags NextHop Interface
e i.c
aw
10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0
u
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0

g .h
10.0.1.255/32 Direct 0 0 D 127.0.0.1
i n
LoopBack0

n
r
10.0.2.2/32 OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0

lea
10.0.3.3/32 OSPF 10 1 D 10.0.123.3 GigabitEthernet0/0/0

//
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1
p : GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D
t t
127.0.0.1 GigabitEthernet0/0/0

:h
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

es
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0
r c D 127.0.0.1 InLoopBack0

ou
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

es
R that R1 learns two routes from OSPF: 10.0.2.2/32 and
The command output shows

i n
10.0.3.3/32. The nextghops of the two routes are 10.0.123.2 and 10.0.123.3
respectively. rn
e a
e L
Verify the connectivity from R1 to loopback interface addresses of R2 and R3.

o r
[R1]ping -c 1 10.0.2.2

M PING 10.0.2.2: 56 data bytes, press CTRL_C to break


Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms

--- 10.0.2.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms

HC Series HUAWEI TECHNOLOGIES 14


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1]ping -c 1 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.0.3.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms
e n
/
Run the display ospf brief command to view basic OSPF information on R1. o
m
i . c
[R1]display ospf brief

w e
a
hu
OSPF Process 1 with Router ID 10.0.1.1
OSPF Protocol Information
g .
ni n
r
RouterID: 10.0.1.1 Border Router:
Multi-VPN-Instance is not enabled

l e a
//
Global DS-TE Mode: Non-Standard IETF Mode

:
tp
Graceful-restart capability: disabled

t
Helper support capability : not configured

h
:
Applications Supported: MPLS Traffic-Engineering

e s
Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms

r c
Default ASE parameters: Metric: 1 Tag: 1 Type: 2
Route Preference: 10

o u
s
ASE Route Preference: 150

e
R
SPF Computation Count: 9

g
RFC 1583 Compatible

i n
Retransmission limitation is disabled

a rn
Area Count: 1 Nssa Area Count: 0

e
ExChange/Loading Neighbors: 0

L
Process total up interface count: 2

e
o r
Process valid up interface count: 1

M Area: 0.0.0.0
Authtype: Simple
(MPLS TE not enabled)
Area flag: Normal
SPF scheduled Count: 9
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 2

Interface: 10.0.1.1 (LoopBack0)

HC Series HUAWEI TECHNOLOGIES 15


HCNP-IERS Chapter 1 OSPF Features and Configurations

Cost: 0 State: P-2-P Type: P2P MTU: 1500


Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Interface: 10.0.123.1 (GigabitEthernet0/0/0)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.0.123.1
Backup Designated Router: 10.0.123.2
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

e n
The preceding command output Authtype: Simple shows that plaintext
/
authentication is enabled in Area 0. OSPF runs on two interfaces:
o m
GigabitEthernet0/0/0 and Loopback0. The network type of GigabitEthernet0/0/0
i . c is
broadcast, cost is 1, and priority is 1. DR is R1, and BDR is 10.0.123.2. Theenetwork
aw
type of another OSPF-enabled Loopback 0 is P2P.
hu
Run the display ospf peer brief command on R1 to check information g . about OSPF

ni n
neighbor relationships between the routers.
ar
[R1]display ospf peer brief
/ l e
: /
OSPF Process 1 with Router ID 10.0.1.1

t tp
h
Peer Statistic Information

:
s
----------------------------------------------------------------------------
Area Id Interface

r c e Neighbor id State

u
0.0.0.0 GigabitEthernet0/0/0 10.0.2.2 Full
0.0.0.0
s o
GigabitEthernet0/0/0 10.0.3.3 Full

Total Peer(s): 2
R e
----------------------------------------------------------------------------

i n g
The precedingrn command output shows that R1 has two neighbors in Area 0.0.0.0,
a
e IDs are 10.0.2.2 and 10.0.3.3 respectively, and their OSPF neighbor
L
their router
e are in Full state.
r
relationships
o the display ospf lsdb command on R1 to check OSPF LSDB information.
M
Run
[R1]display ospf lsdb

OSPF Process 1 with Router ID 10.0.1.1


Link State Database

Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric

HC Series HUAWEI TECHNOLOGIES 16


HCNP-IERS Chapter 1 OSPF Features and Configurations

Router 10.0.3.3 10.0.3.3 1569 48 80000005 0


Router 10.0.2.2 10.0.2.2 1568 48 80000006 0
Router 10.0.1.1 10.0.1.1 1567 48 80000008 0
Network 10.0.123.1 10.0.1.1 1567 36 80000004 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
e n
/
LSA is a Type 2 LSA, which is generated by a DR of a network segment. Because R1 is
o m
the DR of the network segment 10.0.123.0/24, you can see that the AdvRouter
i . c field
of this LSA is 10.0.1.1.
w e
a
hu
[R1]display ospf lsdb router self-originate

g .
n
OSPF Process 1 with Router ID 10.0.1.1
Area: 0.0.0.0
ni
Link State Database
ar
l e
Type : Router
: //
Ls id : 10.0.1.1
t tp
Adv rtr : 10.0.1.1

: h
Ls age : 430

e s
Len : 48

r c
u
Options : E
seq# : 80000009
s o
chksum : 0x8188
Link count: 2 Re
i n
* Link ID: 10.0.1.1g
rn
Data : 255.255.255.255

a
Link Type: StubNet

e
L
Metric : 0

e
r
Priority : Medium

o* Link ID : 10.0.123.1

M Data : 10.0.123.1
Link Type: TransNet
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,

HC Series HUAWEI TECHNOLOGIES 17


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
[R1]display ospf lsdb network self-originate

e n
OSPF Process 1 with Router ID 10.0.1.1 /
Area: 0.0.0.0
o m
i.c
Link State Database

w e
a
Type : Network
Ls id : 10.0.123.1
u
Adv rtr : 10.0.1.1

g .h
Ls age
Len
: 1662
: 36
ni n
r
lea
Options : E

//
seq# : 80000005
chksum : 0x3d58

p :
Net mask : 255.255.255.0
t t
:h
Priority : Low
Attached Router 10.0.1.1

e s
Attached Router 10.0.2.2
r c
ou
Attached Router 10.0.3.3

e s
The preceding command R output shows detailed information about the Network LSA
generated by R1. n
i g Type 2 LSA describes neighbor information on the network
This
segment where
a rnthe DR resides.
Step 3 L
e
Observe the OSPF neighbor relationship establishment
r e on the routers.
o
process
MCheck 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.

HC Series HUAWEI TECHNOLOGIES 18


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1]display ospf peer

OSPF Process 1 with Router ID 10.0.1.1


Neighbors

Area 0.0.0.0 interface 10.0.123.1(GigabitEthernet0/0/0)'s neighbors


Router ID: 10.0.2.2 Address: 10.0.123.2

e n
State: Full Mode:Nbr is Master Priority: 1
/
DR: 10.0.123.1 BDR: 10.0.123.2 MTU: 0

o m
i.c
Dead timer due in 40 sec
Retrans timer interval: 5
Neighbor is up for 01:03:35
w e
Authentication Sequence: [ 0 ]
u a
Router ID: 10.0.3.3 Address: 10.0.123.3
g .h
State: Full Mode:Nbr is Master Priority: 1
ni n
r
lea
DR: 10.0.123.1 BDR: 10.0.123.2 MTU: 0
Dead timer due in 33 sec
Retrans timer interval: 5
: //
Neighbor is up for 01:02:27

t t p
:h
Authentication Sequence: [ 0 ]

e s
The results of tests performed bycdifferent candidates may be different. This is
r
because DR election of OSPF isunot preempted. That is, when there is a DR or BDR on
s o joins the network cannot preempt to be the DR or
a network, the router that
R e newly

g
BDR. On this network, the router whose OSPF process starts first or that connects to
this network firstin
r n becomes the DR, and other routers are the BDR and DR others.

a
e fails, the BDR becomes the new DR. You can reset an OSPF process to
After the DR
L
e the DR role change. The following example resets the OSPF process of R1.
r
observe
o
M
<R1>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
[R1]display ospf peer

OSPF Process 1 with Router ID 10.0.1.1


Neighbors

Area 0.0.0.0 interface 10.0.123.1(GigabitEthernet0/0/0)'s neighbors


Router ID: 10.0.2.2 Address: 10.0.123.2

HC Series HUAWEI TECHNOLOGIES 19


HCNP-IERS Chapter 1 OSPF Features and Configurations

State: Full Mode:Nbr is Master Priority: 1


DR: 10.0.123.2 BDR: 10.0.123.3 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 0
Neighbor is up for 00:00:19
Authentication Sequence: [ 0 ]

Router ID: 10.0.3.3 Address: 10.0.123.3


State: Full Mode:Nbr is Master Priority: 1
e n
DR: 10.0.123.2 BDR: 10.0.123.3 MTU: 0
/
Dead timer due in 39 sec
o m
i.c
Retrans timer interval: 5
Neighbor is up for 00:00:19
Authentication Sequence: [ 0 ]
w e
u a
. h
i n g
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.
r n
l e
Shut down G0/0/0 of R1, R2, and R3 and run the debugginga ospf 1 event command
: // process. Undoshutdown
to check the OSPF neighbor relationship establishment

t
G0/0/0 of R1, R2, and R3 simultaneously, and tpobserve neighbor status change and
h
DR and BDR election on the broadcast:multi-access network.
e s
<R1>debugging ospf 1 event
r c
<R1>terminal debugging
o u
e s
[R1]interface GigabitEthernet 0/0/0

R
[R1-GigabitEthernet0/0/0]shut

i n g
[R1-GigabitEthernet0/0/0]undo shut

rn
<R2>debugging ospf 1 event

a
L e
<R2>terminal debugging
[R2]interface GigabitEthernet 0/0/0

r e
[R2-GigabitEthernet0/0/0]shut

o
[R2-GigabitEthernet0/0/0]undo shut

M<R3>debugging ospf 1 event


<R3>terminal debugging
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]shutdown
[R3-GigabitEthernet0/0/0]undo shutdown

HC Series HUAWEI TECHNOLOGIES 20


HCNP-IERS Chapter 1 OSPF Features and Configurations

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]
Oct 12 2016 11:54:59.220.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802c Line: 1326 Level: 0x20

e n
OSPF 1: Intf 10.0.123.3 Rcv InterfaceUp State Down -> Waiting.
/
[R3-GigabitEthernet0/0/0]

o m
i.c
Oct 12 2016 11:54:59.230.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802c Line: 1440 Level: 0x20
OSPF 1 Send Hello Interface Up on 10.0.123.3
w e
[R3-GigabitEthernet0/0/0]
u a
.h
Oct 12 2016 11:55:08.550.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1200 Level: 0x20

i n g
n
OSPF 1: Nbr 10.0.123.1 Rcv HelloReceived State Down -> Init.

r
lea
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:09.530.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1200 Level: 0x20
: //
t p
OSPF 1: Nbr 10.0.123.2 Rcv HelloReceived State Down -> Init.

t
:h
[R3-GigabitEthernet0/0/0]

s
Oct 12 2016 11:55:18.540.2+00:00 R3 RM/6/RMDEBUG:

r c e
FileID: 0xd017802d Line: 1796 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv 2WayReceived State Init -> 2Way.
[R3-GigabitEthernet0/0/0]

s ou
Re
Oct 12 2016 11:55:19.570.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1796 Level: 0x20

n g
OSPF 1: Nbr 10.0.123.2 Rcv 2WayReceived State Init -> 2Way.

i
n
[R3-GigabitEthernet0/0/0]

ar
Oct 12 2016 11:55:39.370.1+00:00 R3 RM/6/RMDEBUG:

L e
FileID: 0xd017802d Line: 1796 Level: 0x20

e
OSPF 1: Nbr 10.0.123.1 Rcv AdjOk? State 2Way -> ExStart.

or
[R3-GigabitEthernet0/0/0]

M
Oct 12 2016 11:55:39.370.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1796 Level: 0x20
OSPF 1: Nbr 10.0.123.2 Rcv AdjOk? State 2Way -> ExStart.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.370.3+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802c Line: 2127 Level: 0x20
OSPF 1 Send Hello Interface State Changed on 10.0.123.3
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.370.4+00:00 R3 RM/6/RMDEBUG:

HC Series HUAWEI TECHNOLOGIES 21


HCNP-IERS Chapter 1 OSPF Features and Configurations

FileID: 0xd017802c Line: 2138 Level: 0x20


OSPF 1: Intf 10.0.123.3 Rcv WaitTimer State Waiting -> DR.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.390.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1909 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv NegotiationDone State ExStart -> Exchange.
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.390.2+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 1909 Level: 0x20
e n
OSPF 1: Nbr 10.0.123.2 Rcv NegotiationDone State ExStart -> Exchange.
/
[R3-GigabitEthernet0/0/0]
o m
i.c
Oct 12 2016 11:55:39.400.1+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 2021 Level: 0x20
OSPF 1: Nbr 10.0.123.1 Rcv ExchangeDone State Exchange -> Loading.
w e
[R3-GigabitEthernet0/0/0]
u a
Oct 12 2016 11:55:39.400.2+00:00 R3 RM/6/RMDEBUG:

g .h
n
FileID: 0xd017802d Line: 2423 Level: 0x20

ni
OSPF 1: Nbr 10.0.123.1 Rcv LoadingDone State Loading -> Full.

r
lea
[R3-GigabitEthernet0/0/0]
Oct 12 2016 11:55:39.400.3+00:00 R3 RM/6/RMDEBUG:
FileID: 0xd017802d Line: 2021 Level: 0x20
: //
t p
OSPF 1: Nbr 10.0.123.2 Rcv ExchangeDone State Exchange -> Loading.

t
:h
[R3-GigabitEthernet0/0/0]

s
Oct 12 2016 11:55:39.400.4+00:00 R3 RM/6/RMDEBUG:

c e
FileID: 0xd017802d Line: 2423 Level: 0x20

r
ou
OSPF 1: Nbr 10.0.123.2 Rcv LoadingDone State Loading -> Full.
<R1>undo debugging all
<R2>undo debugging all
es
<R3>undo debugging all
R
i n g
njust enabled, the interface state changes from Down to Waiting.
When G0/0/0ris
a
e start exchanging Hello packets. After 40 seconds, the status of G0/0/0
L
Then routers
on R3echanges from Waiting to DR.
o r
MStep 4 Set the network type for loopback interfaces.
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
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

HC Series HUAWEI TECHNOLOGIES 22


HCNP-IERS Chapter 1 OSPF Features and Configurations

Routing Tables: Public


Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/32 OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0
e n
10.0.3.3/32 OSPF 10 1 D 10.0.123.3 GigabitEthernet0/0/0
/
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
o m
i.c
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32
127.0.0.0/8
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
GigabitEthernet0/0/0
InLoopBack0
w e
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
u a
127.255.255.255/32 Direct 0 0 D 127.0.0.1

g
InLoopBack0
.h
n
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

ni
r
ainterfaces of R2 and R3, the
l
During the configuration of IP addresses for loopback
e
/ of R1 displays routes with the
24-bit mask is used. Analyze why the IP routing /table
:
32-bit mask.
t tp
: h 0 verbose command to check the OSPF
s
Run the display ospf interface LoopBack
e
running status of Loopback0.
r c
o u
s
[R1]display ospf interface LoopBack 0 verbose

e
R
g
OSPF Process 1 with Router ID 10.0.1.1

i n
Interfaces

a rn
e
Interface: 10.0.1.1 (LoopBack0)

e L
Cost: 0 State: P-2-P Type: P2P MTU: 1500

r
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

o
IO Statistics

M Type
Hello
Input
0
Output
0
DB Description 0 0
Link-State Req 0 0
Link-State Update 0 0
Link-State Ack 0 0
ALLSPF GROUP
OpaqueId: 0 PrevState: Down

HC Series HUAWEI TECHNOLOGIES 23


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.

Change the network type of Loopback0 on R2 to broadcast. When OSPF advertises


network information of this interface, it will use a 24-bit mask.
[R2]interface LoopBack 0

e n
[R2-LoopBack0]ospf network-type broadcast
/
o m
i
You can see that the subnet mask of the route to Loopback0 address advertised . c by
R2 is 24 bits. w e
a
[R1]display ip routing-table
. hu
Route Flags: R - relay, D - download to fib

i n g
----------------------------------------------------------------------------
Routing Tables: Public
r n
Destinations : 12 Routes : 12
l e a
: //
tp
Destination/Mask Proto Pre Cost Flags NextHop Interface

ht
10.0.1.0/24 Direct 0 0

s : D 10.0.1.1 LoopBack0
10.0.1.1/32
10.0.1.255/32
Direct 0
Direct 0
r
0

c
0 e D
D
127.0.0.1
127.0.0.1
LoopBack0
LoopBack0
10.0.2.2/24 OSPF
o
10
u 1 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32 OSPF
es10 1 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24
R
Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32
10.0.123.255/32
i n g
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
GigabitEthernet0/0/0
GigabitEthernet0/0/0

a rn
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

L e
127.0.0.1/32 Direct 0
127.255.255.255/32 Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0

r e
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

o
MRun 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.
[R2]display ospf interface LoopBack 0 verbose

OSPF Process 1 with Router ID 10.0.2.2

HC Series HUAWEI TECHNOLOGIES 24


HCNP-IERS Chapter 1 OSPF Features and Configurations

Interfaces

Interface: 10.0.2.2 (LoopBack0)


Cost: 0 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.0.2.2
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
IO Statistics
e n
Type Input Output
/
Hello 0 0
o m
i.c
DB Description 0 0
Link-State Req
Link-State Update
0
0
0
0
w e
Link-State Ack 0 0
u a
ALLSPF GROUP

g .h
n
ALLDR GROUP
OpaqueId: 0 PrevState: Waiting
ni
r
//lea
Step 5 Change the OSPF interface cost.
p :
t t
:h
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.
e s
[R1]display ip routing-table
r c
ou
Route Flags: R - relay, D - download to fib

s
Routing Tables: Public
Re
----------------------------------------------------------------------------

ing
Destinations : 12 Routes : 12

a
Destination/Mask
rn Proto Pre Cost Flags NextHop Interface

e
eL
10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0

or
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0

M
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/24 OSPF 10 1 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.3/32 OSPF 10 1 D 10.0.123.3 GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 25


HCNP-IERS Chapter 1 OSPF Features and Configurations

255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Change the cost of G0/0/0 on R1 to 20 and that on R3 to 10.


[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ospf cost 20
[R1-GigabitEthernet0/0/0]quit

e n
/
[R3]interface GigabitEthernet 0/0/0

m
[R3-GigabitEthernet0/0/0]ospf cost 10
[R3-GigabitEthernet0/0/0]quit
o
e i.c
Check the cost of the route from R1 to Loopback0 of R3 again. You can see that the
aw
u
.h
cost of the route to 10.0.3.3/32 is 20.
[R1]display ip routing-table

i n g
Route Flags: R - relay, D - download to fib

r n
lea
----------------------------------------------------------------------------

//
Routing Tables: Public
Destinations : 12 Routes : 12

p :
t t
:h
Destination/Mask Proto Pre Cost Flags NextHop Interface

e s
10.0.1.0/24 Direct 0 0

r c D 10.0.1.1 LoopBack0

ou
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0

s
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.2/24
10.0.3.3/32
OSPF
OSPF Re
10
10
1
20
D
D
10.0.123.2
10.0.123.3
GigabitEthernet0/0/0
GigabitEthernet0/0/0
10.0.123.0/24
i n g
Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0

n
ar
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0

L e
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

e
or
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

M
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public

HC Series HUAWEI TECHNOLOGIES 26


HCNP-IERS Chapter 1 OSPF Features and Configurations

Destinations : 12 Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 OSPF 10 10 D 10.0.123.1 GigabitEthernet0/0/0


10.0.2.0/24 OSPF 10 10 D 10.0.123.2 GigabitEthernet0/0/0
10.0.3.0/24 Direct 0 0 D 10.0.3.3 LoopBack0
10.0.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.3.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
e n
10.0.123.0/24 Direct 0 0 D 10.0.123.3 GigabitEthernet0/0/0
/
10.0.123.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
o m
i.c
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
127.0.0.0/8
127.0.0.1/32
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
w e
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
u a
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

g .h
Step 6 Configure OSPF interfaces as silent interfaces.
ni n
r
Configure G0/0/0 of R1 as a silent interface.
//lea
[R1]ospf 1
p :
t
[R1-ospf-1]silent-interface GigabitEthernet 0/0/0
t
:h
[R1-ospf-1]quit

e s
r con R1 to check OSPF neighbor relationship
ou learning on R1. The command output shows that
Run the display ip routing-table
establishment and routingsentry
the route learned fromR
e
OSPF disappears in the IP routing table.

i n g
[R1]display ip routing-table

rn
Route Flags: R - relay, D - download to fib

a
L e
----------------------------------------------------------------------------
Routing Tables: Public

r e Destinations : 12 Routes : 12

o
MDestination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.123.0/24 Direct 0 0 D 10.0.123.1 GigabitEthernet0/0/0
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0

HC Series HUAWEI TECHNOLOGIES 27


HCNP-IERS Chapter 1 OSPF Features and Configurations

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0


127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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

e n
silent interface, this interface does not send RIP updates. In OSPF, routers can
/
exchange routing information only after they establish an OSPF neighbor
o m
. c
relationship. After an OSPF interface is configured as a silent interface, this interface
i
does not receive or send Hello packets. As a result, this interface cannot e establish
OSPF neighbor relationships with interfaces of other routers. aw
. hu
g
[R1]display ospf interface GigabitEthernet 0/0/0

ni n
OSPF Process 1 with Router ID 10.0.1.1

ar
e
Interfaces

// l
:
tp
Interface: 10.0.123.1 (GigabitEthernet0/0/0)
Cost: 20 State: DR
t
Type: Broadcast

h
MTU: 1500

:
Priority: 1
Designated Router: 10.0.123.1
e s
r
Backup Designated Router: 0.0.0.0
c
u
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

o
Silent interface, No hellos

e s
R
i
Restore G0/0/0 of R1
n g to the default state and configure Loopback0 of the three
routes as silentninterfaces.
a r
L e
[R1]ospf 1

r e
[R1-ospf-1]undo silent-interface GigabitEthernet0/0/0

o
[R1-ospf-1]silent-interface LoopBack 0

M[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

HC Series HUAWEI TECHNOLOGIES 28


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public

e n
Destinations : 12 Routes : 12
/
o m
i.c
Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0


w e
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
u a
.h
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.0/24
10.0.3.3/32
OSPF
OSPF
10
10
20
20
D
D
10.0.123.2
10.0.123.3
i n g
GigabitEthernet0/0/0
GigabitEthernet0/0/0
10.0.123.0/24 Direct 0 0 D 10.0.123.1
r n
GigabitEthernet0/0/0

lea
10.0.123.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0

://
10.0.123.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0

tp
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

t
:h
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e s
r c
ou
----End

e s
Additional Exercises:RAnalysis and Verification

i n g
rncan also be used in actual configuration, what are the differences of
Analyze why the wildcard mask 0.0.0.0 is used in OSPF configuration? The wildcard
a
e
mask 0.0.0.255
the two L
r e wildcard masks?

o which types of interfaces should be configured as silent interfaces in


Analyze
Mreal-world networks.
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
#
sysname R1

HC Series HUAWEI TECHNOLOGIES 29


HCNP-IERS Chapter 1 OSPF Features and Configurations

#
interface GigabitEthernet0/0/0
ip address 10.0.123.1 255.255.255.0
ospf cost 20
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
#
ospf 1 router-id 10.0.1.1
e n
silent-interface LoopBack0
/
area 0.0.0.0
o m
i.c
authentication-mode simple plain huawei
network 10.0.1.1 0.0.0.0
network 10.0.123.1 0.0.0.0
w e
#
u a
return

g .h
<R2>display current-configuration
ni n
r
lea
[V200R007C00SPC600]
#
sysname R2
: //
#

t t p
:h
interface GigabitEthernet0/0/0

s
ip address 10.0.123.2 255.255.255.0
#

r c e
ou
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
es
#
R
n g
ospf 1 router-id 10.0.2.2

i
n
silent-interface LoopBack0
area 0.0.0.0

e ar
L
authentication-mode simple plain huawei

e
network 10.0.2.2 0.0.0.0

or network 10.0.123.2 0.0.0.0

M
#
return

<R3>display current-configuration
[V200R007C00SPC600]
#
sysname R3
#
interface GigabitEthernet0/0/0

HC Series HUAWEI TECHNOLOGIES 30


HCNP-IERS Chapter 1 OSPF Features and Configurations

ip address 10.0.123.3 255.255.255.0


ospf cost 10
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
#
ospf 1 router-id 10.0.3.3
silent-interface LoopBack0
area 0.0.0.0
e n
authentication-mode simple plain huawei
/
network 10.0.3.3 0.0.0.0
o m
i.c
network 10.0.123.3 0.0.0.0
#
return
w e
u a
g .h
ni n
r
//lea
p :
t t
s :h
r c e
sou
Re
i n g
n
e ar
e L
or
M

HC Series HUAWEI TECHNOLOGIES 31


HCNP-IERS Chapter 1 OSPF Features and Configurations

Lab 1-2 Multiple OSPF Areas

Learning Objectives

The objectives of this lab are to learn and understand:

e n
 How to configure a router ID for an OSPF router
/
 How to configure multiple OSPF areas
o m
 How to configure route summarization between OSPF areas
e i.c
 How to set the reference bandwidth
aw
u
 How to configure OSPF to import external routes
g .h

i n
How to summarize routes when OSPF imports external routes
n
How to import default routes into OSPF
ar
e

l
How to change the priorities of OSPF//routes

p :
t t
Topology
: h
e s
r c
o u
es
R
i n g
a rn
L e
r e
o
M
Figure 1-2 Multiple OSPF areas

HC Series HUAWEI TECHNOLOGIES 32


HCNP-IERS Chapter 1 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
e n
multiple OSPF areas for interconnection. /
Loopback0 and interconnected interfaces of R2 and R3 belong to Area 0. The o
m
i . c
interconnected network segment between R3 and R5 and Loopback0/1/2 e of R5
w and R4 and
belong to Area 1. The interconnected network segment between R1,aR2,
Loopback0 of R1 and R4 belong to Area 2.
. hu
To specify router IDs for the routers, configure the routersin
g
to use fixed addresses as
r n
their router IDs.
l e a
:
To improve routing forwarding efficiency for routers,// you configure automatic
summarization on the borders between areas.
t tp
h
R1 is connected to an external network: of the company. You configure R1 to import
e s
routes outside the areas into these
r c areas.
o u You need to configure a default route on R4 and
esthat all the routers in these areas know how to access the
R4 is connected to the Internet.
import it into the areasRso
Internet.
i n g
a
OSPF routes arernclassified into internal and external routes. You change the priorities
of OSPFL e to avoid risks.
routes

Ino re the cost of a specific route is the sum of the costs of all the links through
OSPF,
Mwhich 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.

HC Series HUAWEI TECHNOLOGIES 33


HCNP-IERS Chapter 1 OSPF Features and Configurations

Some network faults occur during device configuration, you can run the display and
debugging commands to rectify these faults.

Tasks

Step 1 Set basic parameters and configure IP addresses.

Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
e n
/
loopback interfaces to simulate an independent network segment.
o m
i.c
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet 0/0/0
w e
[R1-GigabitEthernet0/0/0]ip address 10.0.124.1 24
u a
[R1-GigabitEthernet0/0/0]quit

g .h
n
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 24
ni
r
lea
[R1-LoopBack0]quit

//
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 10.2.0.1 24

p :
[R1-LoopBack1]quit
t t
:h
[R1]interface LoopBack 2
[R1-LoopBack2]ip address 10.2.1.1 24

e s
c
[R1-LoopBack2]quit

r
<R2>system-view
s ou
Re
Enter system view, return user view with Ctrl+Z.
[R2]interface GigabitEthernet 0/0/0

n g
[R2-GigabitEthernet0/0/0]ip address 10.0.124.2 24
i
n
[R2-GigabitEthernet0/0/0]quit

ar
[R2]interface Serial 2/0/0

e
e L
[R2-Serial2/0/0]ip address 10.0.23.2 24
[R2-Serial2/0/0]quit

or
[R2]interface LoopBack 0

M
[R2-LoopBack0]ip address 10.0.2.2 24
[R2-LoopBack0]quit

<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface Serial 2/0/0
[R3-Serial2/0/0]ip address 10.0.23.3 24
[R3-Serial2/0/0]quit
[R3]interface Serial 3/0/0

HC Series HUAWEI TECHNOLOGIES 34


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3-Serial3/0/0]ip address 10.0.35.3 24


[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 24

<R4>system-view
Enter system view, return user view with Ctrl+Z.
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 10.0.124.4 24
e n
[R4-GigabitEthernet0/0/0]quit
/
[R4]interface LoopBack 0
o m
i.c
[R4-LoopBack0]ip address 10.0.4.4 24
[R4-LoopBack0]quit

w e
<R5>system-view
u a
Enter system view, return user view with Ctrl+Z.

g .h
n
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]ip address 10.0.35.5 24
ni
r
lea
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 10.0.5.5 24
: //
[R5-LoopBack0]quit

t t p
:h
[R5]interface LoopBack 1

s
[R5-LoopBack1]ip address 10.1.0.1 24
[R5-LoopBack1]quit

r c e
ou
[R5]interface LoopBack 2
[R5-LoopBack2]ip address 10.1.1.1 24
[R5-LoopBack2]quit
es
R
i n g
After the configurations are complete, test direct link connectivity.
n
e ar
[R2]ping -c 1 10.0.124.1

e L
PING 10.0.124.1: 56 data bytes, press CTRL_C to break

or
Reply from 10.0.124.1: bytes=56 Sequence=1 ttl=255 time=5 ms

M--- 10.0.124.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 5/5/5 ms

[R2]ping -c 1 10.0.124.4
PING 10.0.124.4: 56 data bytes, press CTRL_C to break

HC Series HUAWEI TECHNOLOGIES 35


HCNP-IERS Chapter 1 OSPF Features and Configurations

Reply from 10.0.124.4: bytes=56 Sequence=1 ttl=255 time=14 ms

--- 10.0.124.4 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 14/14/14 ms

[R2]ping -c 1 10.0.23.3
e n
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
/
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=41 ms
o m
--- 10.0.23.3 ping statistics ---
e i.c
1 packet(s) transmitted

aw
1 packet(s) received
u
0.00% packet loss

g .h
n
round-trip min/avg/max = 41/41/41 ms

ni
r
lea
[R3]ping -c 1 10.0.35.5
PING 10.0.35.5: 56 data bytes, press CTRL_C to break

: //
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=38 ms

t t p
:h
--- 10.0.35.5 ping statistics ---

s
1 packet(s) transmitted
1 packet(s) received

r c e
ou
0.00% packet loss
round-trip min/avg/max = 38/38/38 ms

e s
R
Step 2 Configuregmultiple OSPF areas.
i n
a rn router IDs, manually specify router IDs for routers. There are two
To ensure stable

L e manually specify a router ID for a router. The first one is to run the router
methods to

r e in the system view.


id command
o
M[R1]router id 10.0.1.1

The second one is to specify the router-id parameter when starting an OSPF process.
[R1]ospf 1 router-id 10.0.1.1

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

HC Series HUAWEI TECHNOLOGIES 36


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.

On R1, configure Loopback0 and GigabitEthernet0/0/0 to belong to Area 2. To


enable OSPF to advertise real masks of loopback interfaces, change the OSPF
network type of loopback interfaces in all the areas to broadcast.
e n
[R1]ospf 1 router-id 10.0.1.1
/
[R1-ospf-1]area 2
o m
i.c
[R1-ospf-1-area-0.0.0.2]network 10.0.124.1 0.0.0.0
[R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0

w e
a
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit
u
[R1]interface LoopBack 0

g .h
n
[R1-LoopBack0]ospf network-type broadcast
[R1-LoopBack0]quit
ni
r
//lea
:
On R2, configure Loopback0 and Serial2/0/0 to belong to Area 0 and
p
GigabitEthernet0/0/0 to belong to Area 2.
t t
[R2]ospf 1 router-id 10.0.2.2
s:h
[R2-ospf-1]area 0

r c e
[R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0

ou
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0

s
[R2-ospf-1]area 2
Re
[R2-ospf-1-area-0.0.0.0]quit

n g
[R2-ospf-1-area-0.0.0.2]network 10.0.124.2 0.0.0.0

i
n
[R2-ospf-1-area-0.0.0.2]quit

ar
[R2-ospf-1]quit

L e
[R2]interface LoopBack 0

e
[R2-LoopBack0]ospf network-type broadcast

or
[R2-LoopBack0]quit

M
On R3, configure Loopback0 and Serial2/0/0 to belong to Area 0 and Serial3/0/0 to
belong to Area 1.
[R3]ospf 1 router-id 10.0.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 37


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ospf network-type broadcast
[R3-LoopBack0]quit

e n
/
On R4, configure Loopback0 and GigabitEthernet0/0/0 to belong to Area 2.
o m
[R4]ospf 1 router-id 10.0.4.4
i . c
[R4-ospf-1]area 2

w e
[R4-ospf-1-area-0.0.0.2]network 10.0.4.4 0.0.0.0
a
hu
[R4-ospf-1-area-0.0.0.2]network 10.0.124.4 0.0.0.0
[R4-ospf-1-area-0.0.0.2]quit
g .
[R4-ospf-1]quit

ni n
r
[R4]interface LoopBack 0
[R4-LoopBack0]ospf network-type broadcast

l e a
//
[R4-LoopBack0]quit

:
t tp to belong to Area 1.
h
On R5, configure loopback interfaces and Serial1/0/0
:
[R5]ospf 1 router-id 10.0.5.5
e s
[R5-ospf-1]area 1
r c
o u
[R5-ospf-1-area-0.0.0.1]network 10.0.5.5 0.0.0.0

es
[R5-ospf-1-area-0.0.0.1]network 10.1.0.1 0.0.0.0

R
[R5-ospf-1-area-0.0.0.1]network 10.1.1.1 0.0.0.0

i n g
[R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0

rn
[R5-ospf-1-area-0.0.0.1]quit

a
[R5-ospf-1]quit

e
[R5]interface LoopBack 0
L
e
[R5-LoopBack0]ospf network-type broadcast

o r
[R5-LoopBack0]quit

M
[R5]interface LoopBack 1
[R5-LoopBack1]ospf network-type broadcast
[R5-LoopBack1]quit
[R5]interface LoopBack 2
[R5-LoopBack2]ospf network-type broadcast
[R5-LoopBack2]quit

After the configurations are complete, check the IP routing table of R1.
[R1]display ip routing-table

HC Series HUAWEI TECHNOLOGIES 38


HCNP-IERS Chapter 1 OSPF Features and Configurations

Route Flags: R - relay, D - download to fib


---------------------------------------------------------------------------
Routing Tables: Public
Destinations : 24 Routes : 24

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
e n
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
/
10.0.2.0/24 OSPF 10 1 D 10.0.124.2 GigabitEthernet0/0/0
o m
i.c
10.0.3.0/24 OSPF 10 1563 D 10.0.124.2 GigabitEthernet0/0/0
10.0.4.0/24
10.0.5.0/24
OSPF
OSPF
10
10
1
3125
D
D
10.0.124.4
10.0.124.2
GigabitEthernet0/0/0

w
GigabitEthernet0/0/0e
10.0.23.0/24 OSPF 10 1563 D 10.0.124.2
u a
GigabitEthernet0/0/0
10.0.35.0/24 OSPF 10 3125 D 10.0.124.2
.h
GigabitEthernet0/0/0

g
n
10.0.124.0/24 Direct 0 0 D 10.0.124.1 GigabitEthernet0/0/0
10.0.124.1/32 Direct 0 0 D 127.0.0.1
ni
GigabitEthernet0/0/0

r
lea
10.0.124.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.1.0.0/24 OSPF 10 3125 D 10.0.124.2 GigabitEthernet0/0/0
10.1.1.0/24 OSPF 10 3125 D
:
10.0.124.2
// GigabitEthernet0/0/0
10.2.0.0/24 Direct 0 0 D
t p
10.2.0.1

t
LoopBack1

:h
10.2.0.1/32 Direct 0 0 D 127.0.0.1 LoopBack1

es
10.2.0.255/32 Direct 0 0 D 127.0.0.1 LoopBack1

c
10.2.1.0/24 Direct 0 0 D 10.2.1.1 LoopBack2

r
ou
10.2.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack2
10.2.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack2
127.0.0.0/8 Direct 0
es 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32
R
Direct 0 0 D 127.0.0.1 InLoopBack0

i n g
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

n
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e ar
L
R1 has all routing entries of the network.
e
or
On R1, test the connectivity to loopback interfaces of other routers.
M
[R1]ping -c 1 10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms

--- 10.0.2.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss

HC Series HUAWEI TECHNOLOGIES 39


HCNP-IERS Chapter 1 OSPF Features and Configurations

round-trip min/avg/max = 3/3/3 ms

[R1]ping -c 1 10.0.5.5
PING 10.0.5.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=88 ms

--- 10.0.5.5 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
e n
0.00% packet loss
/
round-trip min/avg/max = 88/88/88 ms
o m
[R1]ping -c 1 10.0.4.4
e i.c
PING 10.0.4.4: 56 data bytes, press CTRL_C to break

aw
Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=255 time=3 ms
u
g .h
n
--- 10.0.4.4 ping statistics ---
1 packet(s) transmitted
ni
r
lea
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
: //
t t p
Run the display ospf brief command onhR2 to check basic OSPF information.
s :
[R2]display ospf brief
r c e
o u
s
OSPF Process 1 with Router ID 10.0.2.2

Re
OSPF Protocol Information

i n
RouterID: 10.0.2.2g Border Router: AREA

rn
Multi-VPN-Instance is not enabled

a
e
Global DS-TE Mode: Non-Standard IETF Mode

L
Graceful-restart capability: disabled

e
o r
Helper support capability : not configured
Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms

M Default ASE parameters: Metric: 1 Tag: 1 Type: 2


Route Preference: 10
ASE Route Preference: 150
SPF Computation Count: 19
RFC 1583 Compatible
Retransmission limitation is disabled
Area Count: 2 Nssa Area Count: 0
ExChange/Loading Neighbors: 0

HC Series HUAWEI TECHNOLOGIES 40


HCNP-IERS Chapter 1 OSPF Features and Configurations

Area: 0.0.0.0 (MPLS TE not enabled)


Authtype: None Area flag: Normal
SPF scheduled Count: 18
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 2

Interface: 10.0.2.2 (LoopBack0)


e n
Cost: 0 State: DR Type: Broadcast MTU: 1500
/
Priority: 1
o m
i.c
Designated Router: 10.0.2.2
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
w e
u a
Interface: 10.0.23.2 (Serial2/0/0) --> 10.0.23.3

g .h
n
Cost: 1562 State: P-2-P Type: P2P MTU: 1500

ni
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

r
Area: 0.0.0.2 (MPLS TE not enabled)

//lea
Authtype: None Area flag: Normal

p :
SPF scheduled Count: 16

t t
:h
ExChange/Loading Neighbors: 0

s
Router ID conflict state: Normal
Area interface up count: 1

r c e
ou
Interface: 10.0.124.2 (GigabitEthernet0/0/0)
s
Cost: 1
Priority: 1
State: BDR

ReType: Broadcast MTU: 1500

n g
Designated Router: 10.0.124.1

i
n
Backup Designated Router: 10.0.124.2

ar
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

e
e L
r
In the preceding command output, "Border Router: AREA" indicates that R2 is an
o
MABR. If R2 is an intra-area router, the Border Router field is empty. If it is an ASBR,
this field displays AS.

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.

HC Series HUAWEI TECHNOLOGIES 41


HCNP-IERS Chapter 1 OSPF Features and Configurations

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).
[R2]display ospf peer brief

e n
OSPF Process 1 with Router ID 10.0.2.2 /
Peer Statistic Information
o m
i.c
----------------------------------------------------------------------------
Area Id Interface Neighbor id State

w e
a
0.0.0.0 Serial2/0/0 10.0.3.3 Full
0.0.0.2 GigabitEthernet0/0/0 10.0.1.1 Full
u
0.0.0.2 GigabitEthernet0/0/0 10.0.4.4

g
Full
.h
i n
----------------------------------------------------------------------------

n
r
aOSPF LSDB information. The
Run the display ospf lsdb command on R2 to check
/ l e
command output shows that R2 functioning as:/ an ABR maintains two LSDBs, which

t tp
describe routes of Area 0 and Area 2 respectively.
: h
[R2]display ospf lsdb

e s
r c
u
OSPF Process 1 with Router ID 10.0.2.2

o
s
Link State Database

e
R
g
Area: 0.0.0.0
Type
i n
LinkState ID AdvRouter Age Len Sequence Metric
Router

a rn
10.0.3.3 10.0.3.3 788 60 80000008 0

e
Router 10.0.2.2 10.0.2.2 869 60 80000008 0

e L
Sum-Net 10.0.35.0 10.0.3.3 846 28 80000002 1562

o r
Sum-Net
Sum-Net
10.0.124.0
10.0.1.0
10.0.2.2
10.0.2.2
1259 28
143 28
80000002
80000001 1
1

MSum-Net 10.1.1.0
Sum-Net 10.0.5.0
10.0.3.3
10.0.3.3
1565 28
1594 28
80000001
80000001
1562
1562
Sum-Net 10.1.0.0 10.0.3.3 1584 28 80000001 1562
Sum-Net 10.0.4.0 10.0.2.2 538 28 80000002 1

Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.4.4 10.0.4.4 504 48 80000008 1

HC Series HUAWEI TECHNOLOGIES 42


HCNP-IERS Chapter 1 OSPF Features and Configurations

Router 10.0.2.2 10.0.2.2 558 36 80000006 1


Router 10.0.1.1 10.0.1.1 568 60 80000011 1
Network 10.0.124.1 10.0.1.1 559 36 80000005 0
Sum-Net 10.0.35.0 10.0.2.2 846 28 80000002 3124
Sum-Net 10.0.3.0 10.0.2.2 830 28 80000002 1562
Sum-Net 10.0.2.0 10.0.2.2 1249 28 80000002 0
Sum-Net 10.1.1.0 10.0.2.2 1565 28 80000001 3124
Sum-Net 10.0.5.0 10.0.2.2 1595 28 80000001 3124
Sum-Net 10.1.0.0 10.0.2.2 1584 28 80000001 3124
e n
Sum-Net 10.0.23.0 10.0.2.2 1261 28 80000002 1562
/
o m
Step 3 Configure inter-area route summarization.
e i.c
aw
Check the OSPF routing tables of R2 and R3.
u
[R2]display ip routing-table protocol ospf
g .h
Route Flags: R - relay, D - download to fib

ni n
r
----------------------------------------------------------------------------

lea
Public routing table : OSPF

//
Destinations : 7 Routes : 7

p :
OSPF routing table status : <Active>
t t
:h
Destinations : 7 Routes : 7

e s
Destination/Mask Proto Pre Cost
r c Flags NextHop Interface

10.0.1.0/24 OSPF
s
10 ou
1 D 10.0.124.1 GigabitEthernet0/0/0
10.0.3.0/24 OSPF
Re
10 1562 D 10.0.23.3 Serial2/0/0

ing
10.0.4.0/24 OSPF 10 1 D 10.0.124.4 GigabitEthernet0/0/0
10.0.5.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0

n
ar
10.0.35.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0

e
10.1.0.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0

e L
10.1.1.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0

or
OSPF routing table status : <Inactive>

M Destinations : 0 Routes : 0

[R3]display ip routing-table protocol ospf


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 7 Routes : 7

HC Series HUAWEI TECHNOLOGIES 43


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF routing table status : <Active>


Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0


10.0.2.0/24 OSPF 10 1562 D 10.0.23.2 Serial2/0/0
10.0.4.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0
10.0.5.0/24 OSPF 10 1562 D 10.0.35.5 Serial3/0/0
e n
10.0.124.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0
/
10.1.0.0/24 OSPF 10 1562 D 10.0.35.5 Serial3/0/0
o m
i.c
10.1.1.0/24 OSPF 10 1562 D 10.0.35.5 Serial3/0/0

OSPF routing table status : <Inactive>


w e
Destinations : 0 Routes : 0
u a
g .h
i n
Routing information of 10.1.0.0/24 and 10.1.1.0/24 is displayed as specific routes.
n
ar
l e
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

t
route flappings. Run the abr-summary command tp on R3 to summarize the network
segment of Loopback1 and Loopback2 of
: hR5 for advertisement.
e s
[R3]ospf 1
r c
[R3-ospf-1]area 1

o u
s
[R3-ospf-1-area-0.0.0.1]abr-summary 10.1.0.0 255.255.254.0

e
R
[R3-ospf-1-area-0.0.0.1]quit

g
[R3-ospf-1]quit

i n
a rn
After the configurations are complete, check summarized route information on R3
and R2. Le

r e
o
[R3]display ip routing-table protocol ospf

MRoute Flags: R - relay, D - download to fib


----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 7 Routes : 7

OSPF routing table status : <Active>


Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

HC Series HUAWEI TECHNOLOGIES 44


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.0.1.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0


10.0.2.0/24 OSPF 10 1562 D 10.0.23.2 Serial2/0/0
10.0.4.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0
10.0.5.0/24 OSPF 10 1562 D 10.0.35.5 Serial3/0/0
10.0.124.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0
10.1.0.0/24 OSPF 10 1562 D 10.0.35.5 Serial3/0/0
10.1.1.0/24 OSPF 10 1562 D 10.0.35.5 Serial3/0/0

e n
OSPF routing table status : <Inactive>
/
Destinations : 0 Routes : 0
o m
[R2]display ip routing-table protocol ospf
e i.c
Route Flags: R - relay, D - download to fib

aw
----------------------------------------------------------------------------
u
Public routing table : OSPF

g .h
n
Destinations : 6 Routes : 6

ni
r
lea
OSPF routing table status : <Active>
Destinations : 6 Routes : 6

: //
Destination/Mask Proto Pre Cost
t p
Flags NextHop

t
Interface

:h
es
10.0.1.0/24 OSPF 10 1 D 10.0.124.1 GigabitEthernet0/0/0

c
10.0.3.0/24 OSPF 10 1562 D 10.0.23.3 Serial2/0/0

r
ou
10.0.4.0/24 OSPF 10 1 D 10.0.124.4 GigabitEthernet0/0/0
10.0.5.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0
10.0.35.0/24 OSPF
es
10 3124 D 10.0.23.3 Serial2/0/0
10.1.0.0/23 OSPF
R10 3124 D 10.0.23.3 Serial2/0/0

i n g
n
OSPF routing table status : <Inactive>

e ar
Destinations : 0 Routes : 0

e L
r
The preceding command output shows that in the OSPF routing table of R3, routes
o
M10.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
PING 10.1.0.1: 56 data bytes, press CTRL_C to break

HC Series HUAWEI TECHNOLOGIES 45


HCNP-IERS Chapter 1 OSPF Features and Configurations

Reply from 10.1.0.1: bytes=56 Sequence=1 ttl=253 time=66 ms

--- 10.1.0.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 66/66/66 ms

[R1]ping -c 1 10.1.1.1
e n
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
/
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=253 time=66 ms
o m
--- 10.1.1.1 ping statistics ---
e i.c
1 packet(s) transmitted

aw
1 packet(s) received
u
0.00% packet loss

g .h
n
round-trip min/avg/max = 66/66/66 ms

ni
r
lea
[R2]ping -c 1 10.1.0.1
PING 10.1.0.1: 56 data bytes, press CTRL_C to break

: //
Reply from 10.1.0.1: bytes=56 Sequence=1 ttl=254 time=69 ms

t t p
:h
--- 10.1.0.1 ping statistics ---

s
1 packet(s) transmitted
1 packet(s) received

r c e
ou
0.00% packet loss
round-trip min/avg/max = 69/69/69 ms

es
[R3]ping -c 1 10.1.0.1
R
n g
PING 10.1.0.1: 56 data bytes, press CTRL_C to break

i
n
Reply from 10.1.0.1: bytes=56 Sequence=1 ttl=255 time=29 ms

e ar
L
--- 10.1.0.1 ping statistics ---

e
1 packet(s) transmitted

or1 packet(s) received

M 0.00% packet loss


round-trip min/avg/max = 29/29/29 ms

Step 4 Change the OSPF reference bandwidth.

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.

HC Series HUAWEI TECHNOLOGIES 46


HCNP-IERS Chapter 1 OSPF Features and Configurations

Therefore, OSPF cannot differentiate 100M Ethernet and 1000M Ethernet based on
the bandwidth.

Run the bandwidth-reference command on R2 to change the OSPF reference


bandwidth to 10 Gbps.
[R2-ospf-1]bandwidth-reference 10000

e n
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. o m
i . c
[R2]display ip routing-table protocol ospf

w e
a
Route Flags: R - relay, D - download to fib

hu
----------------------------------------------------------------------------
Public routing table : OSPF

g .
n
Destinations : 7 Routes : 7

ni
OSPF routing table status : <Active>
ar
l e
//
Destinations : 7 Routes : 7

:
Destination/Mask Proto Pre Cost
t tp
Flags NextHop Interface

: h
10.0.3.0/24 OSPF 10
s
65535

e
D 10.0.23.3 Serial2/0/0
10.0.4.0/24 OSPF 10

r c
10 D 10.0.124.4 GigabitEthernet0/0/0
10.0.5.0/24 OSPF 10

o u 67097 D 10.0.23.3 Serial2/0/0

s
10.0.35.0/24 OSPF 10 67097 D 10.0.23.3 Serial2/0/0
10.1.0.0/23 OSPF

R e 10 67097 D 10.0.23.3 Serial2/0/0

i n g
OSPF routing table status : <Inactive>

rn
Destinations : 0 Routes : 0

a
eOSPF areas, the OSPF reference bandwidth must be consistent. Otherwise,
L
ecannot run normally. Change the OSPF reference bandwidth of all routers to 10
In multiple

o
OSPFr
MGbps.
[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

HC Series HUAWEI TECHNOLOGIES 47


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3]ospf 1
[R3-ospf-1]bandwidth-reference 10000
[R3-ospf-1]quit

[R4]ospf 1
[R4-ospf-1]bandwidth-reference 10000
[R4-ospf-1]quit

e n
[R5]ospf 1
/
[R5-ospf-1]bandwidth-reference 10000
o m
i.c
[R5-ospf-1]quit

e
w OSPF
a
Check the neighbor list and OSPF routing table of R2 to determine whether
neighbor relationships and routing information are normal.
. hu
[R2]display ospf peer brief
i n g
r n
OSPF Process 1 with Router ID 10.0.2.2
l e a
Peer Statistic Information
: //
tp
----------------------------------------------------------------------------
Area Id Interface
ht Neighbor id State
0.0.0.0 Serial2/0/0

s : 10.0.3.3 Full
0.0.0.2
0.0.0.2
r c e
GigabitEthernet0/0/0
GigabitEthernet0/0/0
10.0.1.1
10.0.4.4
Full
Full

o u
----------------------------------------------------------------------------

es
R
[R2]display ip routing-table protocol ospf

i n g
Route Flags: R - relay, D - download to fib

rn
----------------------------------------------------------------------------

a
Public routing table : OSPF

L e
Destinations : 6 Routes : 6

r e
OSPF routing table status : <Active>
o Destinations : 6 Routes : 6
MDestination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 OSPF 10 100 D 10.0.124.1 GigabitEthernet0/0/0


10.0.3.0/24 OSPF 10 65535 D 10.0.23.3 Serial2/0/0
10.0.4.0/24 OSPF 10 100 D 10.0.124.4 GigabitEthernet0/0/0
10.0.5.0/24 OSPF 10 131070 D 10.0.23.3 Serial2/0/0
10.0.35.0/24 OSPF 10 131070 D 10.0.23.3 Serial2/0/0

HC Series HUAWEI TECHNOLOGIES 48


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.1.0.0/23 OSPF 10 131070 D 10.0.23.3 Serial2/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

The preceding command output shows that routing information is normal. You can
test network connectivity.

Step 5 Summarize direct routes and import summarized routes into/ e n


OSPF areas. o m
i . c
Loopback1 and Loopback2 of R1 do not belong to an OSPF area. Import the
w e network
segments where the two loopback interfaces reside into an OSPF area
u a and
summarize the routes on R1. . h
i n g
n
[R1]ospf 1
[R1-ospf-1]import-route direct
ar
[R1-ospf-1]asbr-summary 10.2.0.0 255.255.254.0
l e
[R1-ospf-1]quit
: //
t tp
:
Check external routing information on R1.h
e s
r c
[R1]display ospf lsdb ase 10.2.0.0

o u
s
OSPF Process 1 with Router ID 10.0.1.1

e
R
Link State Database

Type
i n g
: External
Ls id

a rn
: 10.2.0.0

e
Adv rtr : 10.0.1.1
Ls age

e L : 293

o r
Len
Options
: 36
: E

M seq#
chksum
: 80000001
: 0x2b6
Net mask : 255.255.254.0
TOS 0 Metric: 2
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Low

HC Series HUAWEI TECHNOLOGIES 49


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.

Check summarized routes on other routers and test network connectivity.


[R2]display ip routing-table protocol ospf

n
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
/ e
Public routing table : OSPF

o m
i.c
Destinations : 7 Routes : 7

OSPF routing table status : <Active>


w e
Destinations : 7 Routes : 7

u a
Destination/Mask Proto Pre Cost Flags NextHop
g .h
Interface

ni n
10.0.1.0/24 O_ASE 150 100 D 10.0.124.1
r
GigabitEthernet0/0/0

lea
10.0.3.0/24 OSPF 10 65535 D 10.0.23.3 Serial2/0/0

://
10.0.4.0/24 OSPF 10 100 D 10.0.124.4 GigabitEthernet0/0/0

tp
10.0.5.0/24 OSPF 10 131070 D 10.0.23.3 Serial2/0/0
10.0.35.0/24 OSPF 10 131070 D
t
10.0.23.3 Serial2/0/0
10.1.0.0/23 OSPF 10 131070

s
D
:h
10.0.23.3 Serial2/0/0
10.2.0.0/23 O_ASE 150 2

r c e D 10.0.124.1 GigabitEthernet0/0/0

ou
OSPF routing table status : <Inactive>
Destinations : 0
es Routes : 0

R
i n g
[R2]ping -c 1 10.2.0.1
PING 10.2.0.1: 56 data bytes, press CTRL_C to break

n
ar
Reply from 10.2.0.1: bytes=56 Sequence=1 ttl=255 time=2 ms

L e
--- 10.2.0.1 ping statistics ---

e
or
1 packet(s) transmitted
1 packet(s) received

M 0.00% packet loss


round-trip min/avg/max = 2/2/2 ms

[R2]ping -c 1 10.2.1.1
PING 10.2.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.2.1.1: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.2.1.1 ping statistics ---

HC Series HUAWEI TECHNOLOGIES 50


HCNP-IERS Chapter 1 OSPF Features and Configurations

1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

You can see a summarized route with a 23-bit mask on R2.

Delete Loopback2 of R1 and then check the routing entry change on R2. You can see
e n
that Loopback2 does not exist but the summarized route still exists. /
o m
i.c
[R1]undo interface LoopBack 2

[R2]display ip routing-table protocol ospf


w e
Route Flags: R - relay, D - download to fib

u a
.h
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 7 Routes : 7
i n g
r n
lea
OSPF routing table status : <Active>
Destinations : 7 Routes : 7

: //
Destination/Mask Proto Pre Cost
t t
Flags NextHopp Interface

s :h
10.0.1.0/24
10.0.3.0/24
ospf
OSPF
150 100
10
r c
65535 e D
D
10.0.124.1
10.0.23.3
GigabitEthernet0/0/0
Serial2/0/0

ou
10.0.4.0/24 OSPF 10 100 D 10.0.124.4 GigabitEthernet0/0/0
10.0.5.0/24 OSPF
es
10 131070 D 10.0.23.3 Serial2/0/0
10.0.35.0/24 OSPF
R10 131070 D 10.0.23.3 Serial2/0/0

ing
10.1.0.0/23 OSPF 10 131070 D 10.0.23.3 Serial2/0/0
10.2.0.0/23 O_ASE 150 2 D 10.0.124.1 GigabitEthernet0/0/0

a rn
e
OSPF routing table status : <Inactive>

eL
Destinations : 0 Routes : 0

o r
MOn R5, send a tracert packet to the address 10.2.1.1.
<R5>tracert 10.2.1.1
traceroute to 10.2.1.1(10.2.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.0.35.3 62 ms 28 ms 27 ms
2 10.0.23.2 54 ms 58 ms 57 ms
3 * * *
...

HC Series HUAWEI TECHNOLOGIES 51


HCNP-IERS Chapter 1 OSPF Features and Configurations

Although Loopback2 has been deleted, the packet to this destination address is still
forwarded by R2 and R3 until it is discarded by R1.

Step 6 Configure OSPF to import default routes.

Loopback0 of R4 is connected to the Internet. Configure a default route on R4 with


the next hop pointing to Loopback0.

e n
/
[R4]ip route-static 0.0.0.0 0.0.0.0 LoopBack 0

o m
Import this default route into an OSPF area, define its type as Type 1, set its c
e i . cost to
10, and configure permanent advertisement of this default route.
a w
hu
[R4]ospf 1
[R4-ospf-1]default-route-advertise always type 1

g .
[R4-ospf-1]quit

ni n
Check default route learning on R2. You can see thateR2
r
a learns a default route using a
l
// of R4.
:
Type 5 LSA, and the next hop is the interface address

t tp
[R2]display ip routing-table protocol ospf

: h
s
Route Flags: R - relay, D - download to fib

c e
----------------------------------------------------------------------------

r
u
Public routing table : OSPF
Destinations : 8
s o Routes : 8

R e
OSPF routing table status : <Active>

n g
Destinations : 8

i
Routes : 8

a rn
Destination/Mask Proto Pre Cost Flags NextHop Interface

L e
r e 0.0.0.0/0 O_ASE 150 101 D 10.0.124.4 GigabitEthernet0/0/0

o 10.0.1.0/24 ospf 10 100 D 10.0.124.1 GigabitEthernet0/0/0

M 10.0.3.0/24
10.0.4.0/24
OSPF
OSPF
10
10
65535
100
D
D
10.0.23.3
10.0.124.4
Serial2/0/0
GigabitEthernet0/0/0
10.0.5.0/24 OSPF 10 131070 D 10.0.23.3 Serial2/0/0
10.0.35.0/24 OSPF 10 131070 D 10.0.23.3 Serial2/0/0
10.1.0.0/23 OSPF 10 131070 D 10.0.23.3 Serial2/0/0
10.2.0.0/23 O_ASE 150 2 D 10.0.124.1 GigabitEthernet0/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

HC Series HUAWEI TECHNOLOGIES 52


HCNP-IERS Chapter 1 OSPF Features and Configurations

Test the connectivity between R5 and the address 10.0.4.4.


[R5]ping -c 1 10.0.4.4
PING 10.0.4.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=253 time=78 ms

--- 10.0.4.4 ping statistics ---

e n
/
1 packet(s) transmitted

m
1 packet(s) received
0.00% packet loss
o
round-trip min/avg/max = 78/78/78 ms

e i.c
aw
hu
Step 7 Change the priorities of internal and external routes.
.
Check the OSPF routing table of R1 and focus on priorities ofgdifferent types of
nin
routes.
ar
[R1]display ip routing-table protocol ospf
/ l e
Route Flags: R - relay, D - download to fib
: /
t tp
----------------------------------------------------------------------------
Public routing table : OSPF

: h
Destinations : 8

e s
Routes : 8

r c
u
OSPF routing table status : <Active>

o
s
Destinations : 8 Routes : 8

Re
g
Destination/Mask Proto Pre Cost Flags NextHop Interface

i n
rn
0.0.0.0/0 O_ASE 150 101 D 10.0.124.4 GigabitEthernet0/0/0

e a
10.0.2.0/24 OSPF 10 100 D 10.0.124.2 GigabitEthernet0/0/0

e L
10.0.3.0/24 OSPF 10 65635 D 10.0.124.2 GigabitEthernet0/0/0

r
10.0.4.0/24 OSPF 10 100 D 10.0.124.4 GigabitEthernet0/0/0

o 10.0.5.0/24 OSPF 10 131170 D 10.0.124.2 GigabitEthernet0/0/0

M 10.0.23.0/24 OSPF
10.0.35.0/24 OSPF
10
10
65635
131170
D
D
10.0.124.2
10.0.124.2
GigabitEthernet0/0/0
GigabitEthernet0/0/0
10.1.0.0/23 OSPF 10 131170 D 10.0.124.2 GigabitEthernet0/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

HC Series HUAWEI TECHNOLOGIES 53


HCNP-IERS Chapter 1 OSPF Features and Configurations

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

e n
/
[R1-ospf-1]preference ase 50

m
[R1-ospf-1]quit

o
[R4]ospf 1
[R4-ospf-1]preference 20
e i.c
[R4-ospf-1]preference ase 50
aw
u
.h
[R4-ospf-1]quit

i n g
rn
Check the priorities of OSPF internal and external routes in the OSPF routing table of
R1. The following command output shows that their a
/ l e priorities have been changed
successfully.
: /
t
[R1]display ip routing-table protocol ospf
tp
: h
Route Flags: R - relay, D - download to fib

e s
----------------------------------------------------------------------------
Public routing table : OSPF
r c
Destinations : 8

o u Routes : 8

es
R
OSPF routing table status : <Active>

i n g
Destinations : 8 Routes : 8

a rn
Destination/Mask Proto Pre Cost Flags NextHop Interface

L e
0.0.0.0/0 O_ASE 50 101 D 10.0.124.4 GigabitEthernet0/0/0

r e10.0.2.0/24 OSPF 20 100 D 10.0.124.2 GigabitEthernet0/0/0

o 10.0.3.0/24 OSPF 20 65545 D 10.0.124.2 GigabitEthernet0/0/0

M 10.0.4.0/24
10.0.5.0/24
OSPF
OSPF
20
20
100
131170
D
D
10.0.124.4
10.0.124.2
GigabitEthernet0/0/0
GigabitEthernet0/0/0
10.0.23.0/24 OSPF 20 65635 D 10.0.124.2 GigabitEthernet0/0/0
10.0.35.0/24 OSPF 20 131170 D 10.0.124.2 GigabitEthernet0/0/0
10.1.0.0/23 OSPF 20 131170 D 10.0.124.2 GigabitEthernet0/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

HC Series HUAWEI TECHNOLOGIES 54


HCNP-IERS Chapter 1 OSPF Features and Configurations

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

e n
Additional Exercises: Analysis and Verification /
o m
Analyze what is the function of configuring permanent advertisement of default
i . c
e
routes in step 6 and what are the advantages and disadvantages ot this function.
wto avoid
a
hu
Route summarization has advantages and disadvantages. Analyze how
these disadvantages.
g .
ni n
Device Configurations
ar
l e
//
<R1>display current-configuration

:
tp
[V200R007C00SPC600]
#
sysname R1
ht
#
s :
interface GigabitEthernet0/0/0
r c e
u
ip address 10.0.124.1 255.255.255.0

o
#

e s
R
interface LoopBack0

g
ip address 10.0.1.1 255.255.255.0

i n
ospf network-type broadcast

rn
#

e a
interface LoopBack1

L
ip address 10.2.0.1 255.255.255.0

e
#

o r
ospf 1 router-id 10.0.1.1

M asbr-summary 10.2.0.0 255.255.254.0


import-route direct
preference 20
preference ase 50
bandwidth-reference 10000
area 0.0.0.2
network 10.0.1.1 0.0.0.0
network 10.0.124.1 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 55


HCNP-IERS Chapter 1 OSPF Features and Configurations

#
return

<R2>display current-configuration
[V200R007C00SPC600]
#
sysname R2
#
interface Serial2/0/0
e n
link-protocol ppp
/
ip address 10.0.23.2 255.255.255.0
o m
i.c
#
interface GigabitEthernet0/0/0
ip address 10.0.124.2 255.255.255.0
w e
#
u a
interface LoopBack0

g .h
n
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
ni
r
lea
#
ospf 1 router-id 10.0.2.2
bandwidth-reference 10000
: //
area 0.0.0.0

t t p
:h
network 10.0.2.2 0.0.0.0

s
network 10.0.23.2 0.0.0.0
area 0.0.0.2

r c e
ou
network 10.0.124.2 0.0.0.0
#
return
es
R
n g
<R3>display current-configuration

i
n
[V200R007C00SPC600]
#

e ar
L
sysname R3
#
e
or
interface Serial2/0/0

M
link-protocol ppp
ip address 10.0.23.3 255.255.255.0
#
interface Serial3/0/0
link-protocol ppp
ip address 10.0.35.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0

HC Series HUAWEI TECHNOLOGIES 56


HCNP-IERS Chapter 1 OSPF Features and Configurations

ospf network-type broadcast


#
ospf 1 router-id 10.0.3.3
bandwidth-reference 10000
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.23.3 0.0.0.0
area 0.0.0.1
abr-summary 10.1.0.0 255.255.254.0
e n
network 10.0.35.3 0.0.0.0
/
#
o m
i.c
return

<R4>display current-configuration
w e
[V200R007C00SPC600]
u a
#

g .h
n
sysname R4
#
ni
r
lea
interface GigabitEthernet0/0/0
ip address 10.0.124.4 255.255.255.0
#
: //
interface LoopBack0

t t p
:h
ip address 10.0.4.4 255.255.255.0

s
ospf network-type broadcast
#

r c e
ou
ospf 1 router-id 10.0.4.4
default-route-advertise always type 1
preference 20
es
preference ase 50
R
n g
bandwidth-reference 10000

i
area 0.0.0.2
n
ar
network 10.0.4.4 0.0.0.0

e
L
network 10.0.124.4 0.0.0.0
#
e
or
ip route-static 0.0.0.0 0.0.0.0 LoopBack0

M
#
return

<R5>display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
interface Serial1/0/0

HC Series HUAWEI TECHNOLOGIES 57


HCNP-IERS Chapter 1 OSPF Features and Configurations

link-protocol ppp
ip address 10.0.35.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.0
ospf network-type broadcast
#
interface LoopBack1
ip address 10.1.0.1 255.255.255.0
e n
ospf network-type broadcast
/
#
o m
i.c
interface LoopBack2
ip address 10.1.1.1 255.255.255.0
ospf network-type broadcast
w e
#
u a
ospf 1 router-id 10.0.5.5

g .h
n
bandwidth-reference 10000
area 0.0.0.1
ni
r
lea
network 10.0.5.5 0.0.0.0
network 10.1.0.1 0.0.0.0
network 10.1.1.1 0.0.0.0
: //
network 10.0.35.5 0.0.0.0

t t p
:h
#

s
return

r c e
s ou
Re
i n g
n
e ar
e L
or
M

HC Series HUAWEI TECHNOLOGIES 58


HCNP-IERS Chapter 1 OSPF Features and Configurations

Lab 1-3 OSPF Neighbor Relationship and LSA

Learning Objectives

The objectives of this lab are to learn and understand:

e n
 Procedure for establishing OSPF neighbor relationships on an Ethernet
/
 How to affect DR election
o m
 What are the content and functions of five types of LSAs
e i.c

aw (LSU),
Transmission of OSPF Link State Request (LSR), Link State Update
and Link State Acknowledgement (LSAck) packets
. hu
i n g
Topology
r n
l e a
: //
t tp
: h
e s
r c
o u
e s
R
i n g
a rn
L e
r e
o
M Figure 1-3 OSPF neighbor relationship and LSA

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

HC Series HUAWEI TECHNOLOGIES 59


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
e n
network.
/
o mas
To specify router IDs for the routers, configure the routers to use fixed addresses
i . c
their router IDs.
e
wnetwork
You need to affect DR election and BDR election on the interconnected a
u DR, R2 as the
between R1, R2, R3, and R4. That is, you need to configure R3 as . hthe
BDR, and R4 as the DR other.
i n g
r n
Tasks l e a
: //
Step 1 Set basic parameters and configure
t tp IP addresses.
h
Configure IP addresses and masks for :all the routers. Set a 24-bit mask for all
e s
r
loopback interfaces to simulate an c independent network segment.

o u
s
<R1>system-view

R e
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet 0/0/0

i n g
[R1-GigabitEthernet0/0/0]ip address 10.1.234.1 24

rn
[R1-GigabitEthernet0/0/0]quit

a
[R1]interface LoopBack 0

e
L
[R1-LoopBack0]ip address 10.0.1.1 24

e
r
[R1-LoopBack0]quit

o
M<R2>system-view
Enter system view, return user view with Ctrl+Z.
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.1.234.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24
[R2-LoopBack0]quit

HC Series HUAWEI TECHNOLOGIES 60


HCNP-IERS Chapter 1 OSPF Features and Configurations

<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.1.234.3 24
[R3-GigabitEthernet0/0/0]quit
[R3]interface Serial 3/0/0
[R3-Serial3/0/0]ip address 10.0.35.3 24
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
e n
[R3-LoopBack0]ip address 10.0.3.3 24
/
[R3-LoopBack0]quit
o m
<R4>system-view
e i.c
Enter system view, return user view with Ctrl+Z.

aw
[R4]interface GigabitEthernet 0/0/0
u
[R4-GigabitEthernet0/0/0]ip address 10.1.234.4 24

g .h
n
[R4-GigabitEthernet0/0/0]quit
[R4]interface LoopBack 0
ni
r
lea
[R4-LoopBack0]ip address 10.0.4.4 24
[R4-LoopBack0]quit

: //
<R5>system-view

t t p
:h
Enter system view, return user view with Ctrl+Z.

s
[R5]interface Serial 1/0/0

c e
[R5-Serial1/0/0]ip address 10.0.35.5 24

r
ou
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0

es
[R5-LoopBack0]ip address 10.0.5.5 24
[R5-LoopBack0]quit
R
i n g
a rn
After the configurations are complete, test direct link connectivity.

L e
[R1]ping -c 1 10.1.234.2

r e
PING 10.1.234.2: 56 data bytes, press CTRL_C to break

o Reply from 10.1.234.2: bytes=56 Sequence=1 ttl=255 time=13 ms

M --- 10.1.234.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 13/13/13 ms

[R1]ping -c 1 10.1.234.4

HC Series HUAWEI TECHNOLOGIES 61


HCNP-IERS Chapter 1 OSPF Features and Configurations

PING 10.1.234.4: 56 data bytes, press CTRL_C to break


Reply from 10.1.234.4: bytes=56 Sequence=1 ttl=255 time=6 ms

--- 10.1.234.4 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 6/6/6 ms

e n
[R3]ping -c 1 10.1.234.1
/
PING 10.1.234.1: 56 data bytes, press CTRL_C to break
o m
i.c
Reply from 10.1.234.1: bytes=56 Sequence=1 ttl=255 time=13 ms

--- 10.1.234.1 ping statistics ---


w e
1 packet(s) transmitted
u a
1 packet(s) received

g .h
n
0.00% packet loss
round-trip min/avg/max = 13/13/13 ms
ni
r
[R3]ping -c 1 10.0.35.5

//lea
:
PING 10.0.35.5: 56 data bytes, press CTRL_C to break

p
t
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=32 ms

t
--- 10.0.35.5 ping statistics ---
s :h
1 packet(s) transmitted

r c e
ou
1 packet(s) received
0.00% packet loss

es
round-trip min/avg/max = 32/32/32 ms

R
i n g
Step 2 Configure multiple OSPF areas.
rn
e a
On R1, configure GigabitEthernet0/0/0 to belong to Area 0 and Looback0 to belong

e L
or network type of loopback interfaces in all the areas to broadcast.
to Area 2. To enable OSPF to advertise real masks of loopback interfaces, change the
OSPF
M[R1]ospf 1 router-id 10.0.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.1.234.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit

HC Series HUAWEI TECHNOLOGIES 62


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1]interface LoopBack 0
[R1-LoopBack0]ospf network-type broadcast
[R1-LoopBack0]quit

Configure all the interfaces of R2 and R4 to belong to Area 0.


[R2]ospf 1 router-id 10.0.2.2
[R2-ospf-1]area 0

e n
/
[R2-ospf-1-area-0.0.0.0]network 10.1.234.2 0.0.0.0

m
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]quit
o
[R2-ospf-1]quit
[R2-]interface LoopBack 0
e i.c
[R2-LoopBack0]ospf network-type broadcast
aw
u
.h
[R2-LoopBack0]quit

[R4]ospf 1 router-id 10.0.4.4


i n g
[R4-ospf-1]area 0
r n
lea
[R4-ospf-1-area-0.0.0.0]network 10.1.234.4 0.0.0.0

//
[R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]quit
p :
[R4-ospf-1]quit
t t
:h
[R4-]interface LoopBack 0

e s
[R4-LoopBack0]ospf network-type broadcast
[R4-LoopBack0]quit
r c
s ou
e
On R3, configure Loopback0 and GigabitEthernet0/0/0 to belong to Area 0 and
RArea 2.
i n g
Serial3/0/0 to belong to

rn
[R3]ospf 1 router-id 10.0.3.3

a
[R3-ospf-1]area 0

e
L
[R3-ospf-1-area-0.0.0.0]network 10.1.234.3 0.0.0.0

e
r
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0

o
[R3-ospf-1-area-0.0.0.0]quit

M[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ospf network-type broadcast
[R3-LoopBack0]quit

HC Series HUAWEI TECHNOLOGIES 63


HCNP-IERS Chapter 1 OSPF Features and Configurations

On R5, configure Serial1/0/0 to belong to Area 1 and configure Looback0 not to


belong to any area.
[R5]osp 1 router-id 10.0.5.5
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit

e n
After the configurations are complete, check the IP routing table of R1. /
o m
i.c
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
w e
Routing Tables: Public

u a
.h
Destinations : 14 Routes : 14

Destination/Mask Proto Pre Cost Flags NextHop


i n g
Interface

r n
lea
10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0

://
10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0

tp
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.0/24 OSPF 10 1 D
t
10.1.234.2 GigabitEthernet0/0/0
10.0.3.0/24 OSPF 10 1

s
D
:h
10.1.234.3 GigabitEthernet0/0/0
10.0.4.0/24
10.0.35.0/24
OSPF
OSPF
10
10
1

r c
1563 e D
D
10.1.234.4
10.1.234.3
GigabitEthernet0/0/0
GigabitEthernet0/0/0

ou
10.1.234.0/24 Direct 0 0 D 10.1.234.1 GigabitEthernet0/0/0
10.1.234.1/32 Direct 0
es 0 D 127.0.0.1 GigabitEthernet0/0/0
10.1.234.255/32
R
Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0

ing
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

n
ar
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Le
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

r e
o
The preceding command output shows that R1 has the routes of the entire network
Mexcept the network segment 10.0.5.5/24 that is not advertised into OSPF.
Test network connectivity.
[R1]ping -c 1 10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=2 ms

--- 10.0.2.2 ping statistics ---

HC Series HUAWEI TECHNOLOGIES 64


HCNP-IERS Chapter 1 OSPF Features and Configurations

1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

[R1]ping -c 1 10.0.4.4
PING 10.0.4.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=255 time=3 ms

e n
--- 10.0.4.4 ping statistics ---
/
1 packet(s) transmitted
o m
i.c
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms
w e
u a
[R3]ping -c 1 10.0.1.1

g .h
n
PING 10.0.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=3 ms
ni
r
--- 10.0.1.1 ping statistics ---

//lea
1 packet(s) transmitted

p :
1 packet(s) received

t t
:h
0.00% packet loss

s
round-trip min/avg/max = 3/3/3 ms

r c e
o u on R1 to check basic OSPF information
Run the display ospf brief command
running on the routers. Thees command output shows that R1 has become an ABR
because its Loopback0R
i
GigabitEthernet0/0/0n g belongs to Area 2. The network segment to which
of R1 is connected is a broadcast network, and R1 is the DR of
rn
a
this network segment.
e
e L
[R1]display ospf brief

o r
M
OSPF Process 1 with Router ID 10.0.1.1
OSPF Protocol Information

RouterID: 10.0.1.1 Border Router: AREA


Multi-VPN-Instance is not enabled
Global DS-TE Mode: Non-Standard IETF Mode
Graceful-restart capability: disabled
Helper support capability : not configured
Applications Supported: MPLS Traffic-Engineering

HC Series HUAWEI TECHNOLOGIES 65


HCNP-IERS Chapter 1 OSPF Features and Configurations

Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms


Default ASE parameters: Metric: 1 Tag: 1 Type: 2
Route Preference: 10
ASE Route Preference: 150
SPF Computation Count: 22
RFC 1583 Compatible
Retransmission limitation is disabled
Area Count: 2 Nssa Area Count: 0
ExChange/Loading Neighbors: 0
e n
Process total up interface count: 2
/
Process valid up interface count: 1
o m
Area: 0.0.0.0 (MPLS TE not enabled)
e i.c
Authtype: None Area flag: Normal

aw
SPF scheduled Count: 22
u
ExChange/Loading Neighbors: 0

g .h
n
Router ID conflict state: Normal
Area interface up count: 1
ni
r
Interface: 10.1.234.1 (GigabitEthernet0/0/0)

//lea
Cost: 1 State: DR Type: Broadcast
:
MTU: 1500

p
Priority: 1

t t
:h
Designated Router: 10.1.234.1

s
Backup Designated Router: 10.1.234.2

c e
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

r
Area: 0.0.0.2
ou
(MPLS TE not enabled)
s
Authtype: None
e
Area flag: Normal
SPF scheduled Count: 20
R
n g
ExChange/Loading Neighbors: 0

i
n
Router ID conflict state: Normal

ar
Area interface up count: 1

e
e L
Interface: 10.0.1.1 (LoopBack0)

or
Cost: 0 State: DR Type: Broadcast MTU: 1500

M
Priority: 1
Designated Router: 10.0.1.1
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

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

HC Series HUAWEI TECHNOLOGIES 66


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
[R1]display ospf peer brief

OSPF Process 1 with Router ID 10.0.1.1

n
Peer Statistic Information
----------------------------------------------------------------------------
/ e
Area Id Interface Neighbor id State

o m
i.c
0.0.0.0 GigabitEthernet0/0/0 10.0.2.2 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.3.3 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.4.4 Full
w e
----------------------------------------------------------------------------

u a
[R3]display ospf peer brief
g .h
ni n
OSPF Process 1 with Router ID 10.0.3.3
r
lea
Peer Statistic Information

//
----------------------------------------------------------------------------

:
Area Id
0.0.0.0
Interface
GigabitEthernet0/0/0
t t p
Neighbor id
10.0.1.1
State
Full

:h
0.0.0.0 GigabitEthernet0/0/0 10.0.2.2 Full
0.0.0.0 GigabitEthernet0/0/0
e s 10.0.4.4 2-Way
0.0.0.1 Serial3/0/0
r c 10.0.5.5 Full

ou
----------------------------------------------------------------------------

e s
R command on R5 to check OSPF LSDB information.
i n g
Run the display ospf lsdb

rn
[R5]display ospf lsdb

e a
L
OSPF Process 1 with Router ID 10.0.5.5

r e Link State Database

o
M
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 1182 48 80000002 1562
Router 10.0.3.3 10.0.3.3 1183 48 80000002 1562
Sum-Net 10.0.3.0 10.0.3.3 1429 28 80000001 0
Sum-Net 10.0.2.0 10.0.3.3 1429 28 80000001 1
Sum-Net 10.0.1.0 10.0.3.3 1429 28 80000001 1
Sum-Net 10.1.234.0 10.0.3.3 1429 28 80000001 1
Sum-Net 10.0.4.0 10.0.3.3 1430 28 80000001 1

HC Series HUAWEI TECHNOLOGIES 67


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
[R2]display ospf lsdb

e n
/
OSPF Process 1 with Router ID 10.0.2.2
o m
i.c
Link State Database

Area: 0.0.0.0
w e
Type LinkState ID AdvRouter Age Len Sequence
u a
Metric
Router
Router
10.0.3.3
10.0.4.4
10.0.3.3
10.0.4.4
4 48
150 48
80000009
80000009
g .h1
1
Router 10.0.2.2 10.0.2.2 149 48
ni n
8000000C 1

r
lea
Router 10.0.1.1 10.0.1.1 149 36 8000000B 1
Network 10.1.234.1 10.0.1.1 149 40 80000007 0
Sum-Net 10.0.35.0 10.0.3.3 1790
:
28
// 80000001 1562
Sum-Net 10.0.1.0 10.0.1.1

t t
817
p 28 80000002 0

s :h
r e
The preceding command output shows that R2 still has one Type 2 LSA in addition to
c of R2 is connected to a broadcast network,
u
four Type 1 LSAs. GigabitEthernet0/0/0
and the DR on this network o
e s will generate a Type 2 LSA to describe all neighbors. The

R
AdvRouter field indicates that R1 generates this LSA. That is, the DR of this network
segment generates g
i n this LSA, which meets the requirements.

a rnospf lsdb command on R1 to check OSPF LSDB information.


Run the display

L e
[R1]display ospf lsdb

r e
o OSPF Process 1 with Router ID 10.0.1.1

M Link State Database

Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.3.3 10.0.3.3 447 48 80000009 1
Router 10.0.4.4 10.0.4.4 592 48 80000009 1
Router 10.0.2.2 10.0.2.2 592 48 8000000C 1
Router 10.0.1.1 10.0.1.1 591 36 8000000B 1

HC Series HUAWEI TECHNOLOGIES 68


HCNP-IERS Chapter 1 OSPF Features and Configurations

Network 10.1.234.1 10.0.1.1 591 40 80000007 0


Sum-Net 10.0.35.0 10.0.3.3 434 28 80000002 1562
Sum-Net 10.0.1.0 10.0.1.1 1259 28 80000002 0

Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.1.1 10.0.1.1 1223 36 80000004 0
Sum-Net 10.0.35.0 10.0.1.1 433 28 80000002 1563
Sum-Net 10.0.3.0 10.0.1.1 541 28 80000002 1
e n
Sum-Net 10.0.2.0 10.0.1.1 909 28 80000002 1
/
Sum-Net 10.1.234.0 10.0.1.1 1269 28 80000002 1
o m
i.c
Sum-Net 10.0.4.0 10.0.1.1 711 28 80000002 1;

e
w Area 0 and
a
Loopback0 of R1 belongs to Area 2. Therefore, R1 has LSDBs of two areas:
Area 2.
. hu
Run the display ospf lsdb command on R4 to check OSPFin
g
r n LSDB information.
[R4]display ospf lsdb

l e a
: //
tp
OSPF Process 1 with Router ID 10.0.4.4
Link State Database

ht
s :
Type LinkState ID
r c e
Area: 0.0.0.0
AdvRouter Age Len Sequence Metric
Router 10.0.3.3
o u
10.0.3.3 745 48 80000009 1
Router 10.0.4.4
e s 10.0.4.4 888 48 80000009 1
Router 10.0.2.2
R 10.0.2.2 889 48 8000000C 1
Router
Network
10.0.1.1

i n g
10.1.234.1
10.0.1.1
10.0.1.1
889
889
36
40
8000000B
80000007
1
0
Sum-Net

a rn
10.0.35.0 10.0.3.3 732 28 80000002 1562
Sum-Net

L e 10.0.1.0 10.0.1.1 1556 28 80000002 0

r einformation will vary depending on OSPF router roles. Analyze differences in


o
LSDB
MLSDBs of R5, R2, R1, and R4.
Step 3 Change OSPF interface priorities of routers to affect DR
election.

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

HC Series HUAWEI TECHNOLOGIES 69


HCNP-IERS Chapter 1 OSPF Features and Configurations

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]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ospf dr-priority 255
[R3-GigabitEthernet0/0/0]quit

e n
/
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ospf dr-priority 254

o m
i.c
[R2-GigabitEthernet0/0/0]quit

[R4]interface GigabitEthernet 0/0/0


w e
[R4-GigabitEthernet0/0/0]ospf dr-priority 0

u a
.h
[R4-GigabitEthernet0/0/0]quit

i n g
n
After the configurations are complete, the DR and BDR have been elected and
r
cannot be preempted. Therefore, G0/0/0 of R1, R2, R3,
l e a and R4 must be shut down
and G0/0/0 of R3, R2, R1, and R4 must be enabled
: // in sequence.
[R1]interface GigabitEthernet 0/0/0
t tp
[R1-GigabitEthernet0/0/0]shutdown
: h
e s
r c
[R2]interface GigabitEthernet 0/0/0

o u
[R2-GigabitEthernet0/0/0]shutdown

e s
R
[R3]interface GigabitEthernet 0/0/0

i n g
[R3-GigabitEthernet0/0/0]shutdown

rn
[R4]interface GigabitEthernet 0/0/0

a
e
[R4-GigabitEthernet0/0/0]shutdown

L
r e
[R1-GigabitEthernet0/0/0]undo shutdown

o
[R1-GigabitEthernet0/0/0]quit

M[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

HC Series HUAWEI TECHNOLOGIES 70


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R4-GigabitEthernet0/0/0]quit

Check DR/BDR election on the network segment 10.1.234.0/24.


[R3]display ospf peer

OSPF Process 1 with Router ID 10.0.3.3


Neighbors

e n
/
m
Area 0.0.0.0 interface 10.1.234.3(GigabitEthernet0/0/0)'s neighbors
Router ID: 10.0.1.1 Address: 10.1.234.1
o
State: Full Mode:Nbr is Slave Priority: 1
DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0
e i.c
Dead timer due in 29 sec
aw
u
.h
Retrans timer interval: 3

g
Neighbor is up for 00:02:17
Authentication Sequence: [ 0 ]

ni n
r
lea
Router ID: 10.0.2.2 Address: 10.1.234.2

//
State: Full Mode:Nbr is Slave Priority: 254
DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0
p :
Dead timer due in 35 sec
t t
:h
Retrans timer interval: 6
Neighbor is up for 00:01:14
e s
Authentication Sequence: [ 0 ]
r c
Router ID: 10.0.4.4
s ou
Address: 10.1.234.4
State: Full
Re
Mode:Nbr is Master Priority: 0

g
DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0

i n
Dead timer due in 32 sec

n
ar
Retrans timer interval: 3

e
Neighbor is up for 00:01:26

L
Authentication Sequence: [ 0 ]

e
or Neighbors

M
Area 0.0.0.1 interface 10.0.35.3(Serial3/0/0)'s neighbors
Router ID: 10.0.5.5 Address: 10.0.35.5
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 27 sec
Retrans timer interval: 4
Neighbor is up for 00:53:37

HC Series HUAWEI TECHNOLOGIES 71


HCNP-IERS Chapter 1 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.

Check the neighbor relationship between R4 and R1.

n
[R4]display ospf peer 10.0.1.1

/ e
OSPF Process 1 with Router ID 10.0.4.4

o m
i.c
Neighbors

Area 0.0.0.0 interface 10.1.234.4(GigabitEthernet0/0/0)'s neighbors


w e
Router ID: 10.0.1.1 Address: 10.1.234.1

u a
.h
State: 2-Way Mode:Nbr is Slave Priority: 1
DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0
Dead timer due in 30 sec
i n g
Retrans timer interval: 0
r n
lea
Neighbor is up for 00:00:00
Authentication Sequence: [ 0 ]

: //
t t p
:h
After their neighbor relationship becomes stable, because R1 and R4 are both DR
s
r c e
others, they only establish a neighbor relationship in 2-way state.

Step 4 Summarize direct u routes and import summarized routes into


s o
OSPF areas.
Re
i n
Loopback0 of R5 doesg not belong to any OSPF area. Import the network segment
rn resides into an OSPF area.
where Loopback0
a
L e
[R5]ospf 1

r e
[R5-ospf-1]import-route direct

o
[R5-ospf-1]quit

M
Check the imported external route on R1 and R3.
[R1]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 6 Routes : 6

HC Series HUAWEI TECHNOLOGIES 72


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF routing table status : <Active>


Destinations : 6 Routes : 6

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.2.0/24 OSPF 10 1 D 10.1.234.2 GigabitEthernet0/0/0


10.0.3.0/24 OSPF 10 1 D 10.1.234.3 GigabitEthernet0/0/0
10.0.4.0/24 OSPF 10 1 D 10.1.234.4 GigabitEthernet0/0/0
e n
10.0.5.0/24 O_ASE 150 1 D 10.1.234.3 GigabitEthernet0/0/0
/
10.0.35.0/24 OSPF 10 1563 D 10.1.234.3 GigabitEthernet0/0/0
o m
i.c
10.0.35.3/32 O_ASE 150 1 D 10.1.234.3 GigabitEthernet0/0/0

OSPF routing table status : <Inactive>


w e
Destinations : 0 Routes : 0
u a
g .h
n
[R3]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
ni
r
lea
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5
: //
OSPF routing table status : <Active>

t t p
:h
Destinations : 4 Routes : 4

e s
c
Destination/Mask Proto Pre Cost Flags NextHop Interface

r
10.0.1.0/24 OSPF 10
s ou
1 D 10.1.234.1 GigabitEthernet0/0/0
10.0.2.0/24 OSPF
10.0.4.0/24 OSPF
Re
10
10
1
1
D
D
10.1.234.2
10.1.234.4
GigabitEthernet0/0/0
GigabitEthernet0/0/0

i n g
10.0.5.0/24 O_ASE 150 1 D 10.0.35.5 Serial3/0/0

n
ar
OSPF routing table status : <Inactive>

Le
Destinations : 1 Routes : 1

r e
o
Destination/Mask Proto Pre Cost Flags NextHop Interface

M 10.0.35.3/32 O_ASE 150 1 10.0.35.5 Serial3/0/0

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?

HC Series HUAWEI TECHNOLOGIES 73


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
also advertised. Other routing entries are not displayed in the following command
output.
[R5]display ip routing-table
Route Flags: R - relay, D - download to fib
e n
---------------------------------------------------------------------------- /
Routing Tables: Public
o m
i.c
Destinations : 16 Routes : 16

w e
a
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.35.0/24 Direct 0 0 D 10.0.35.5
u
Serial1/0/0
10.0.35.3/32 Direct 0 0 D 10.0.35.3
.h
Serial1/0/0

g
10.0.35.5/32
10.0.35.255/32
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
ni n
InLoopBack0

r
InLoopBack0

Test network connectivity.


//lea
[R1]ping -c 1 10.0.5.5
p :
t t
PING 10.0.5.5: 56 data bytes, press CTRL_C to break

:h
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=254 time=41 ms

s
--- 10.0.5.5 ping statistics ---
r c e
ou
1 packet(s) transmitted
1 packet(s) received
es
0.00% packet loss
R
i n g
round-trip min/avg/max = 41/41/41 ms

rn
Check OSPFaexternal routes in the LSDB of R1. You can see that the LSDB contains
L e routes: 10.0.5.0/24, 10.0.35.0/24, and 10.0.35.3/32.
three external
r e
o routing table of R1 has only two external routes.
The
M [R1]display ospf lsdb ase
OSPF Process 1 with Router ID 10.0.1.1
Link State Database

Type : External
Ls id : 10.0.5.0
Adv rtr : 10.0.5.5
Ls age : 834

HC Series HUAWEI TECHNOLOGIES 74


HCNP-IERS Chapter 1 OSPF Features and Configurations

Len : 36
Options : E
seq# : 80000001
chksum : 0xa904
Net mask : 255.255.255.0
TOS 0 Metric: 1
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
e n
Priority : Low
/
o m
i.c
Type : External
Ls id
Adv rtr
: 10.0.35.0
: 10.0.5.5
w e
Ls age : 1342
u a
Len : 36

g .h
n
Options : E
seq# : 80000001
ni
r
lea
chksum : 0x5e31
Net mask : 255.255.255.0
TOS 0 Metric: 1
: //
E type : 2

t t p
:h
Forwarding Address : 0.0.0.0

s
Tag : 1
Priority : Low

r c e
Type : External
sou
Ls id
Adv rtr
: 10.0.35.3
: 10.0.5.5
Re
Ls age : 1344

i n g
Len : 36
n
Options :
arE

Le
seq# : 80000001

re
chksum : 0x404c

o
Net mask : 255.255.255.255

MTOS 0 Metric: 1
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Medium

HC Series HUAWEI TECHNOLOGIES 75


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
[R1]display ospf lsdb summary 10.0.35.0

OSPF Process 1 with Router ID 10.0.1.1


Area: 0.0.0.0
e n
Link State Database
/
o m
i.c
Type : Sum-Net
Ls id
Adv rtr
: 10.0.35.0
: 10.0.3.3
w e
Ls age : 236
u a
Len : 28

g .h
n
Options : E
seq# : 80000007
ni
r
lea
chksum : 0x14e5

//
Net mask : 255.255.255.0
Tos 0 metric: 1562

p :
Priority : Low
t t
:h
Area: 0.0.0.2
Link State Database

e s
r c
ou
Type : Sum-Net

s
Ls id : 10.0.35.0
Adv rtr
Ls age
: 10.0.1.1
: 1637
Re
Len : 28
i n g
Options : E
n
seq#
ar
: 80000002
chksum

e Le: 0x42bf
Net mask : 255.255.255.0

o r
Tos 0 metric: 1563

M 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.

HC Series HUAWEI TECHNOLOGIES 76


HCNP-IERS Chapter 1 OSPF Features and Configurations

Step 5 Check various types of LSAs.

On R1, check detailed information about Type 1 LSA 10.0.1.0 in Area 0 and Area 2.
[R1]display ospf lsdb router 10.0.1.1

OSPF Process 1 with Router ID 10.0.1.1


Area: 0.0.0.0
Link State Database

e n
/
Type : Router
o m
i.c
Ls id : 10.0.1.1
Adv rtr
Ls age
: 10.0.1.1
: 591
w e
Len : 36
u a
Options
seq#
: ABR E
: 8000001e
g .h
chksum : 0xbc70
ni n
r
lea
Link count: 1
* Link ID: 10.1.234.3
Data : 10.1.234.1
: //
Link Type: TransNet

t t p
:h
Metric : 1

s
Area: 0.0.0.2
Link State Database

r c e
Type : Router

s ou
Ls id
Adv rtr
: 10.0.1.1
: 10.0.1.1
Re
Ls age : 627

i n g
Len : 36
n
Options
ar
: ABR E

Le
seq# : 80000008

re
chksum : 0x1018

o
Link count: 1

M
* Link ID: 10.0.1.0
Date : 255.255.255.0
Link Type: StubNet
Metric : 0
Priority: Low

HC Series HUAWEI TECHNOLOGIES 77


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
e n
R1 floods the second Type 1 LSA within Area 2 and is connected to Area 2 through/
o m
loopback interfaces. For a loopback interface, the Link Type field displays StubNet.
i . c and
The Link ID field indicates the IP network address of this stub network segment,
w e
the Data field indicates the network mask of this stub network segment.
u a
On R2, R3, and R4, check detailed information about Type 2 LSA . h10.1.234.0 in Area 0.

i n g
n
[R2]display ospf lsdb network 10.1.234.3

ar
OSPF Process 1 with Router ID 10.0.2.2
l e
Area: 0.0.0.0
: //
tp
Link State Database

ht
Type : Network
s :
Ls id
Adv rtr
: 10.1.234.3
: 10.0.3.3
r c e
Ls age : 115
o u
Len : 40
e s
Options : E
R
seq#
n g
: 8000000f

i
rn
chksum : 0x807e

a
Net mask : 255.255.255.0

L e
Priority : Low

e
Attached Router 10.0.3.3

o rAttached Router 10.0.1.1

M
Attached Router 10.0.2.2
Attached Router 10.0.4.4

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

HC Series HUAWEI TECHNOLOGIES 78


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
[R3]display ospf lsdb summary 10.0.35.0

OSPF Process 1 with Router ID 10.0.3.3


Area: 0.0.0.0
e n
Link State Database
/
o m
i.c
Type : Sum-Net
Ls id
Adv rtr
: 10.0.35.0
: 10.0.3.3
w e
Ls age : 591
u a
Len : 28

g .h
n
Options : E
seq# : 8000000a
ni
r
lea
chksum : 0xee8

//
Net mask : 255.255.255.0
Tos 0 metric: 1562

p :
Priority : Low
t t
s :h
r e
The preceding command output shows that this route is advertised by R3 within
c network address of the advertised destination
oumask field indicates the mask of the destination
Area 0. The Ls id field indicates the
network segment, and the sNet
network segment. Re
i n g
[R1]display ospf lsdb summary 10.0.35.0

a rn
L e
OSPF Process 1 with Router ID 10.0.1.1
Area: 0.0.0.0

r e Link State Database

o
M Type
Ls id
: Sum-Net
: 10.0.35.0
Adv rtr : 10.0.3.3
Ls age : 136
Len : 28
Options : E
seq# : 80000004
chksum : 0x1ae2

HC Series HUAWEI TECHNOLOGIES 79


HCNP-IERS Chapter 1 OSPF Features and Configurations

Net mask : 255.255.255.0


Tos 0 metric: 1562
Priority : Low
Area: 0.0.0.2
Link State Database

Type : Sum-Net
Ls id : 10.0.35.0
Adv rtr : 10.0.1.1
e n
Ls age : 382
/
Len : 28
o m
i.c
Options : E
seq#
chksum
: 80000002
: 0x42bf
w e
Net mask : 255.255.255.0
u a
Tos 0 metric: 1563

g .h
n
Priority : Low

ni
r
a rtr field indicates that this
e
R1 has a total of two Type 3 LSAs 10.0.35.0/24. The Adv
l
:
LSA in Area 0 is generated by R3. R1 is an ABR, so// it generates another LSA after
t tp 2.
receiving this LSA and advertises it within Area

: hType 4 LSA 10.0.5.0 in Area 2. A Type 4 LSA


s
On R1, check detailed information about
e
describes how to reach an ASBR. c
ur
s o
[R1]display ospf lsdb asbr 10.0.5.5

Re
g
OSPF Process 1 with Router ID 10.0.1.1

i n Area: 0.0.0.0

rn
Link State Database

e a
Type

e L : Sum-Asbr

r
Ls id : 10.0.5.5

o
Adv rtr : 10.0.3.3

M Ls age
Len
: 1119
: 28
Options : E
seq# : 80000008
chksum : 0x1df3
Tos 0 metric: 1562
Area: 0.0.0.2
Link State Database

HC Series HUAWEI TECHNOLOGIES 80


HCNP-IERS Chapter 1 OSPF Features and Configurations

Type : Sum-Asbr
Ls id : 10.0.5.5
Adv rtr : 10.0.1.1
Ls age : 1118
Len : 28
Options : E
seq# : 80000008
chksum : 0x41d2
e n
Tos 0 metric: 1563
/
o m
The preceding command output shows that R1 receives a Type 4 LSA from iR3. . c The Ls
id field indicates the router ID of an ASBR. This LSA cannot be floodedw
e
across areas.
Therefore, R1 generates another Type 4 LSA and floods it within Area u a 2.
. h
On R2, R4, and R3, this LSA exists in the LSDB for Area 0. These
i n grouters do not belong
to the same area as the ASBR (R5), so they need to know
r nthe location of this ASBR
through a Type 4 LSA.
l e a
: //
tp
[R2]display ospf lsdb asbr

ht
:
OSPF Process 1 with Router ID 10.0.2.2

s
r c
Link State Database e
Area: 0.0.0.0

o u
Type : Sum-Asbr
e s
Ls id : 10.0.5.5
R
Adv rtr
Ls age
i
: 1676
n g
: 10.0.3.3

Len
rn
: 28

a
Options
seq#
L e : E
: 80000008

r e
chksum : 0x1df3

oTos 0 metric: 1562

M
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.

Step 6 Check LSR, LSU, and LSAck packets.

HC Series HUAWEI TECHNOLOGIES 81


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
Info: Current terminal monitor is on
<R1>terminal debugging
Info: Current terminal debugging is on
<R1>debugging ospf packet update
<R1>debugging ospf packet ack
e n
/
o mat
By default, when the network is running stably, an OSPF router updates its LSDB
i . c
an interval of 30 minutes. To trigger routing information query and update,
w e delete
Loopback0 of R3. a
[R3]undo interface LoopBack 0
. hu
i n g
Info: This operation may take a few seconds. Please wait for a moment...succeeded.
[R3]
r n
l e a
Oct 25 2016 15:32:27+00:00 R3 %%01IFNET/4/LINK_STATE(l)[58]:The line protocol IP on the

//
interface LoopBack0 has entered the DOWN state

:
tp
You can see that R1 receives an LSU packett sent from 10.1.234.3. The destination
: hall OSPF routers), describing a network
s
address of the packet is 224.0.0.5 (namely
e
segment (# Links: 1), followed by c
u r the Link ID and Link Data of this network segment.
<R1>
s o
R e
Oct 25 2016 15:24:57.790.1+00:00 R1 RM/6/RMDEBUG:

g
FileID: 0xd0178024 Line: 2271 Level: 0x20

i n
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R1>

a rn
e
Oct 25 2016 15:24:57.790.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3

L
Oct 25 2016 15:24:57.790.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5

e
o r
Oct 25 2016 15:24:57.790.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 4 (Link-State Update)
Oct 25 2016 15:24:57.790.5+00:00 R1 RM/6/RMDEBUG: Length: 64, Router: 10.0.3.3

MOct 25 2016 15:24:57.790.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: d8ce


Oct 25 2016 15:24:57.790.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 15:24:57.790.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 15:24:57.790.9+00:00 R1 RM/6/RMDEBUG: # LSAS: 1
Oct 25 2016 15:24:57.790.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 15:24:57.790.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
Oct 25 2016 15:24:57.790.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 15:24:57.790.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 1

HC Series HUAWEI TECHNOLOGIES 82


HCNP-IERS Chapter 1 OSPF Features and Configurations

Oct 25 2016 15:24:57.790.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON


Oct 25 2016 15:24:57.790.15+00:00 R1 RM/6/RMDEBUG: Length: 36, Seq# 80000020
Oct 25 2016 15:24:57.790.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 9090
Oct 25 2016 15:24:57.790.17+00:00 R1 RM/6/RMDEBUG: NtBit: 0 VBit: 0 EBit: 0 BBit: 1
Oct 25 2016 15:24:57.790.18+00:00 R1 RM/6/RMDEBUG: # Links: 1
Oct 25 2016 15:24:57.790.19+00:00 R1 RM/6/RMDEBUG: LinkID: 10.1.234.3
Oct 25 2016 15:24:57.790.20+00:00 R1 RM/6/RMDEBUG: LinkData: 10.1.234.3
Oct 25 2016 15:24:57.790.21+00:00 R1 RM/6/RMDEBUG: LinkType: 2
Oct 25 2016 15:24:57.790.22+00:00 R1 RM/6/RMDEBUG: TOS# 0 Metric 1
e n
/
o m
i . cthe DR
Then check the LSAck packet sent by R1. The source address is GigabitEthernet0/0/0

e
address of R1 and the destination address is 224.0.0.6. This packet is sent to
w
and BDR. The sequence number of this packet is also 80000020.
a
<R1>
. hu
Oct 25 2016 15:24:58.200.1+00:00 R1 RM/6/RMDEBUG:

i n g
FileID: 0xd0178025 Line: 4708 Level: 0x20

r n
OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0

l e a
//
<R1>

:
Oct 25 2016 15:24:58.200.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.1

t tp
Oct 25 2016 15:24:58.200.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.6

h
Oct 25 2016 15:24:58.200.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack)

:
s
Oct 25 2016 15:24:58.200.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.1.1

e
c
Oct 25 2016 15:24:58.200.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: c5ef

u r
Oct 25 2016 15:24:58.200.7+00:00 R1 RM/6/RMDEBUG: AuType: 00

s o
Oct 25 2016 15:24:58.200.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *

Re
Oct 25 2016 15:24:58.200.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1
Oct 25 2016 15:24:58.200.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1

n g
Oct 25 2016 15:24:58.200.11+00:00 R1 RM/6/RMDEBUG:
i
LS ID: 10.0.3.3

rn
Oct 25 2016 15:24:58.200.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3

e a
Oct 25 2016 15:24:58.200.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 2

e L
Oct 25 2016 15:24:58.200.14+00:00 R1 RM/6/RMDEBUG:
Oct 25 2016 15:24:58.200.15+00:00 R1 RM/6/RMDEBUG:
Options: ExRouting:ON
Length: 36, Seq# 80000020

o r
Oct 25 2016 15:24:58.200.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 9090

M
Restore Loopback0 of R3.
[R3]interface loopback 0
[R3-LoopBack0]ip address 10.0.3.3 24
[R3-LoopBack0]quit

HC Series HUAWEI TECHNOLOGIES 83


HCNP-IERS Chapter 1 OSPF Features and Configurations

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>
Oct 25 2016 15:51:26.250.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178024 Line: 2271 Level: 0x20

n
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R1>
/ e
Oct 25 2016 15:51:26.250.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3

o m
i.c
Oct 25 2016 15:51:26.250.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5
Oct 25 2016 15:51:26.250.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 4 (Link-State Update)
Oct 25 2016 15:51:26.250.5+00:00 R1 RM/6/RMDEBUG: Length: 76, Router: 10.0.3.3
w e
Oct 25 2016 15:51:26.250.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 2c6f

u a
.h
Oct 25 2016 15:51:26.250.7+00:00 R1 RM/6/RMDEBUG: AuType: 00

Oct 25 2016 15:51:26.250.9+00:00 R1 RM/6/RMDEBUG: # LSAS: 1


i n g
Oct 25 2016 15:51:26.250.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *

r
Oct 25 2016 15:51:26.250.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
n
lea
Oct 25 2016 15:51:26.250.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3

://
Oct 25 2016 15:51:26.250.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3

tp
Oct 25 2016 15:51:26.250.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 1

t
Oct 25 2016 15:51:26.250.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON

:h
Oct 25 2016 15:51:26.250.15+00:00 R1 RM/6/RMDEBUG: Length: 48, Seq# 8000002a

e s
Oct 25 2016 15:51:26.250.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 2cca

r c
Oct 25 2016 15:51:26.250.17+00:00 R1 RM/6/RMDEBUG: NtBit: 0 VBit: 0 EBit: 0 BBit: 1

ou
Oct 25 2016 15:51:26.250.18+00:00 R1 RM/6/RMDEBUG: # Links: 2

es
Oct 25 2016 15:51:26.250.19+00:00 R1 RM/6/RMDEBUG: LinkID: 10.1.234.3

R
Oct 25 2016 15:51:26.250.20+00:00 R1 RM/6/RMDEBUG: LinkData: 10.1.234.3

ing
Oct 25 2016 15:51:26.250.21+00:00 R1 RM/6/RMDEBUG: LinkType: 2
Oct 25 2016 15:51:26.250.22+00:00 R1 RM/6/RMDEBUG: TOS# 0 Metric 1

n
ar
Oct 25 2016 15:51:26.250.23+00:00 R1 RM/6/RMDEBUG: LinkID: 10.0.3.3

L e
Oct 25 2016 15:51:26.250.24+00:00 R1 RM/6/RMDEBUG:
Oct 25 2016 15:51:26.250.25+00:00 R1 RM/6/RMDEBUG:
LinkData: 255.255.255.255
LinkType: 3

e
or
Oct 25 2016 15:51:26.250.26+00:00 R1 RM/6/RMDEBUG: TOS# 0 Metric 0

MR1 first receives the LSAck packet of the BDR.


<R1>
Oct 25 2016 15:51:27.90.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178024 Line: 2271 Level: 0x20
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R1>
Oct 25 2016 15:51:27.90.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.2

HC Series HUAWEI TECHNOLOGIES 84


HCNP-IERS Chapter 1 OSPF Features and Configurations

Oct 25 2016 15:51:27.90.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5


Oct 25 2016 15:51:27.90.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack)
Oct 25 2016 15:51:27.90.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.2.2
Oct 25 2016 15:51:27.90.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 289f
Oct 25 2016 15:51:27.90.7+00:00 R1 RM/6/RMDEBUG: AuType: 00
Oct 25 2016 15:51:27.90.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 25 2016 15:51:27.90.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1
Oct 25 2016 15:51:27.90.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1
Oct 25 2016 15:51:27.90.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3
e n
Oct 25 2016 15:51:27.90.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
/
Oct 25 2016 15:51:27.90.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 2
o m
i.c
Oct 25 2016 15:51:27.90.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON
Oct 25 2016 15:51:27.90.15+00:00 R1 RM/6/RMDEBUG:
Oct 25 2016 15:51:27.90.16+00:00 R1 RM/6/RMDEBUG: CheckSum: 2cca
w e
Length: 48, Seq# 8000002a

u a
Then check the LSAck packet sent by R1.
g .h
ni n
r
<R1>

lea
Oct 25 2016 15:51:26.430.1+00:00 R1 RM/6/RMDEBUG:

//
FileID: 0xd0178025 Line: 4708 Level: 0x20

p :
OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0
<R1>
t t
:h
Oct 25 2016 15:51:26.430.2+00:00 R1 RM/6RMDEBUG: Source Address: 10.1.234.1

e s
Oct 25 2016 15:51:26.430.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.6

r c
Oct 25 2016 15:51:26.430.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack)

ou
Oct 25 2016 15:51:26.430.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.1.1

s
Oct 25 2016 15:51:26.430.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 29a1

e
R
Oct 25 2016 15:51:26.430.7+00:00 R1 RM/6/RMDEBUG: AuType: 00

g
Oct 25 2016 15:51:26.430.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *

i n
Oct 25 2016 15:51:26.430.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1

n
ar
Oct 25 2016 15:51:26.430.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1

e
Oct 25 2016 15:51:26.430.11+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3

e L
Oct 25 2016 15:51:26.430.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3

or
Oct 25 2016 15:51:26.430.13+00:00 R1 RM/6/RMDEBUG: LSA Age: 1
Oct 25 2016 15:51:26.430.14+00:00 R1 RM/6/RMDEBUG: Options: ExRouting:ON

M
Oct 25 2016 15:51:26.430.15+00:00 R1 RM/6/RMDEBUG:
Oct 25 2016 15:51:26.430.16+00:00 R1 RM/6/RMDEBUG:
Length: 48, Seq# 8000002a
CheckSum: 2cca

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.

HC Series HUAWEI TECHNOLOGIES 85


HCNP-IERS Chapter 1 OSPF Features and Configurations

<R1>terminal monitor
Info: Current terminal monitor is on
<R1>terminal debugging
Info: Current terminal debugging is on
<R1>debugging ospf packet update
<R1>debugging ospf packet ack
<R1>debugging ospf packet request

<R1>reset ospf process


e n
Warning: The OSPF process will be reset. Continue? [Y/N]:y
/
<R1>
o m
i.c
Oct 25 2016 16:17:59.750.1+00:00 R1 RM/6/RMDEBUG:
FileID: 0xd0178025 Line: 2993 Level: 0x20
OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0
w e
<R1>
u a
.h
Oct 25 2016 16:17:59.750.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.1

g
n
Oct 25 2016 16:17:59.750.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 10.1.234.2

ni
Oct 25 2016 16:17:59.750.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 3 (Link-State Req)

r
lea
Oct 25 2016 16:17:59.750.5+00:00 R1 RM/6/RMDEBUG: Length: 156, Router: 10.0.1.1
Oct 25 2016 16:17:59.750.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 8b05

: //
Oct 25 2016 16:17:59.750.7+00:00 R1 RM/6/RMDEBUG: AuType: 00

t p
Oct 25 2016 16:17:59.750.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *

t
:h
Oct 25 2016 16:17:59.750.9+00:00 R1 RM/6/RMDEBUG: # Requesting LSAs: 11

s
Oct 25 2016 16:17:59.750.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1

c e
Oct 25 2016 16:17:59.750.11+00:00 R1 RM/6/RMDEBUG:

r
LS ID: 10.0.2.2

ou
Oct 25 2016 16:17:59.750.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.2.2
Oct 25 2016 16:17:59.750.13+00:00 R1 RM/6/RMDEBUG: LSA Type 1

es
Oct 25 2016 16:17:59.750.14+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.1.1

R
Oct 25 2016 16:17:59.750.15+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1

n g
Oct 25 2016 16:17:59.750.16+00:00 R1 RM/6/RMDEBUG: LSA Type 1

i
n
Oct 25 2016 16:17:59.750.17+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.4.4

e ar
Oct 25 2016 16:17:59.750.18+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.4.4

L
Oct 25 2016 16:17:59.750.19+00:00 R1 RM/6/RMDEBUG: LSA Type 1

e
Oct 25 2016 16:17:59.750.20+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.3.3

or
Oct 25 2016 16:17:59.750.21+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3

M
Oct 25 2016 16:17:59.750.22+00:00 R1 RM/6/RMDEBUG: LSA Type 2
Oct 25 2016 16:17:59.750.23+00:00 R1 RM/6/RMDEBUG: LS ID: 10.1.234.3
Oct 25 2016 16:17:59.750.24+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 16:17:59.750.25+00:00 R1 RM/6/RMDEBUG: LSA Type 3
Oct 25 2016 16:17:59.750.26+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.1.0
Oct 25 2016 16:17:59.750.27+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1
Oct 25 2016 16:17:59.750.28+00:00 R1 RM/6/RMDEBUG: LSA Type 3
Oct 25 2016 16:17:59.750.29+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.35.0
Oct 25 2016 16:17:59.750.30+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3

HC Series HUAWEI TECHNOLOGIES 86


HCNP-IERS Chapter 1 OSPF Features and Configurations

Oct 25 2016 16:17:59.750.31+00:00 R1 RM/6/RMDEBUG: LSA Type 4


Oct 25 2016 16:17:59.750.32+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.5.5
Oct 25 2016 16:17:59.750.33+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.3.3
Oct 25 2016 16:17:59.750.34+00:00 R1 RM/6/RMDEBUG: LSA Type 5
Oct 25 2016 16:17:59.750.35+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.5.0
Oct 25 2016 16:17:59.750.36+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.5.5
Oct 25 2016 16:17:59.750.37+00:00 R1 RM/6/RMDEBUG: LSA Type 5
Oct 25 2016 16:17:59.750.38+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.35.0
Oct 25 2016 16:17:59.750.39+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.5.5
e n
Oct 25 2016 16:17:59.750.40+00:00 R1 RM/6/RMDEBUG: LSA Type 5
/
Oct 25 2016 16:17:59.750.41+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.35.3
o m
i.c
Oct 25 2016 16:17:59.750.42+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.5.5

w e
R1 then receives the LSR packet of R3.
u a
<R1>
g .h
Oct 25 2016 16:30:10.80.1+00:00 R1 RM/6/RMDEBUG:

ni n
r
FileID: 0xd0178024 Line: 2271 Level: 0x20

lea
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0

//
<R1>

p :
Oct 25 2016 16:30:10.80.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3

t t
Oct 25 2016 16:30:10.80.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 10.1.234.1

:h
Oct 25 2016 16:30:10.80.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 3 (Link-State Req)

e s
Oct 25 2016 16:30:10.80.5+00:00 R1 RM/6/RMDEBUG: Length: 48, Router: 10.0.3.3

r c
Oct 25 2016 16:30:10.80.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: c4c2

ou
Oct 25 2016 16:30:10.80.7+00:00 R1 RM/6/RMDEBUG: AuType: 00

s
Oct 25 2016 16:30:10.80.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *

e
R
Oct 25 2016 16:30:10.80.9+00:00 R1 RM/6/RMDEBUG: # Requesting LSAs: 2

g
Oct 25 2016 16:30:10.80.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1

i n
Oct 25 2016 16:30:10.80.11+00:00 R1 RM/6/RMDEBUG:

n
LS ID: 10.0.1.1

ar
Oct 25 2016 16:30:10.80.12+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1

e
Oct 25 2016 16:30:10.80.13+00:00 R1 RM/6/RMDEBUG: LSA Type 3

e L
Oct 25 2016 16:30:10.80.14+00:00 R1 RM/6/RMDEBUG: LS ID: 10.0.1.0

or----End
Oct 25 2016 16:30:10.80.15+00:00 R1 RM/6/RMDEBUG: Adv Rtr: 10.0.1.1

M
Additional Exercises: Analysis and Verification

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?

HC Series HUAWEI TECHNOLOGIES 87


HCNP-IERS Chapter 1 OSPF Features and Configurations

When will Type 4 LSAs appear?

If both R1 and R4 are configured as DR others, what are the potential problems?

Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
#

e n
sysname R1
/
#
o m
i.c
interface GigabitEthernet0/0/0
ip address 10.1.234.1 255.255.255.0
#
w e
interface LoopBack0
u a
ip address 10.0.1.1 255.255.255.0
ospf network-type broadcast
g .h
#
ni n
r
lea
ospf 1 router-id 10.0.1.1
area 0.0.0.0
network 10.1.234.1 0.0.0.0
: //
area 0.0.0.2

t t p
:h
network 10.0.1.1 0.0.0.0

s
#
return

r c e
<R2>display current-configuration

s ou
[V200R007C00SPC600]
#
Re
sysname R2

i n g
n
#

ar
interface GigabitEthernet0/0/0

e
L
ip address 10.1.234.2 255.255.255.0

e
ospf dr-priority 254

or
#

M
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.1.234.2 0.0.0.0
network 10.0.2.2 0.0.0.0
#

HC Series HUAWEI TECHNOLOGIES 88


HCNP-IERS Chapter 1 OSPF Features and Configurations

return

<R3>display current-configuration
[V200R007C00SPC600]
#
sysname R3
#
interface Serial3/0/0
link-protocol ppp
e n
ip address 10.0.35.3 255.255.255.0
/
#
o m
i.c
interface GigabitEthernet0/0/0
ip address 10.1.234.3 255.255.255.0
ospf dr-priority 255
w e
#
u a
interface LoopBack0

g .h
n
ip address 10.0.3.3 255.255.255.0
ospf network-type broadcast
ni
r
lea
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
: //
network 10.1.234.3 0.0.0.0

t t p
:h
network 10.0.3.3 0.0.0.0

s
area 0.0.0.1
network 10.0.35.3 0.0.0.0

r c e
ou
#
return

es
R
<R4>display current-configuration
[V200R007C00SPC600]

i n g
#
n
sysname R4

e ar
L
#

e
interface GigabitEthernet0/0/0

or
ip address 10.1.234.4 255.255.255.0

M
ospf dr-priority 0
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.4.4
area 0.0.0.0
network 10.1.234.4 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 89


HCNP-IERS Chapter 1 OSPF Features and Configurations

network 10.0.4.4 0.0.0.0


#
return

<R5>display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
e n
interface Serial1/0/0
/
link-protocol ppp
o m
i.c
ip address 10.0.35.5 255.255.255.0
#
interface LoopBack0
w e
ip address 10.0.5.5 255.255.255.0
u a
#

g .h
n
ospf 1 router-id 10.0.5.5
import-route direct
ni
r
lea
area 0.0.0.1
network 10.0.35.5 0.0.0.0
#
: //
return

t t p
s:h
r c e
s ou
Re
i n g
n
e ar
e L
or
M

HC Series HUAWEI TECHNOLOGIES 90


HCNP-IERS Chapter 1 OSPF Features and Configurations

Lab 1-4 OSPF Stub Area and NSSA Area

Learning Objectives

The objectives of this lab are to learn and understand:

e n
 How to configure a stub area
/
 How to configure an NSSA area
o m
 How to check Type 7 LSAs
e i.c
 Translation between Type 5 and Type 7 LSAs
aw
u
Topology g .h
ni n
r
//lea
p :
t t
s :h
r c e
s ou
Re
i n g
n
e ar
e L
or
M

Figure 1-4 OSPF stub area and NSSA area

HC Series HUAWEI TECHNOLOGIES 91


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
e n
/
Network segments 10.0.23.0/24, 10.0.2.0/24, and 10.0.3.0/24 belong to Area 0.
o m
The network segment 10.0.35.0/24 belongs to Area 1, which is an NSSA area.
i . c
Loopback0 of R5 does not belong to any OSPF area.
w e
The network segment 10.0.24.0/24 belongs to Area 3. Loopback0 u
a
to the Internet, requiring a default route to be configured. g
. h of R4 is connected

n i n
Network segments 10.0.12.0/24 and 10.0.1.0/24 belong
ar to Area 2, which is a stub
area.
/ l e
: / routers to use fixed addresses as
t
To specify router IDs for the routers, configure
t p the
their router IDs.
: h
e s
Tasks r c
o u
e
Step 1 Set basic parameters s and configure IP addresses.
Rand masks for all the routers. Set a 24-bit mask for all
n
Configure IP addresses
i g
rn to simulate an independent network segment.
loopback interfaces

e a
L
<R1>system-view

e
Enter system view, return user view with Ctrl+Z.

or
[R1]interface Serial 1/0/0

M
[R1-Serial1/0/0]ip address 10.0.12.1 24
[R1-Serial1/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 24
[R1-LoopBack0]quit

<R2>system-view
Enter system view, return user view with Ctrl+Z.
[R2]interface Serial 1/0/0

HC Series HUAWEI TECHNOLOGIES 92


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R2-Serial1/0/0]ip address 10.0.12.2 24


[R2-Serial1/0/0]quit
[R2]interface Serial 2/0/0
[R2-Serial2/0/0]ip address 10.0.23.2 24
[R2-Serial2/0/0]quit
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.0.24.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface LoopBack 0
e n
[R2-LoopBack0]ip address 10.0.2.2 24
/
[R2-LoopBack0]quit
o m
<R3>system-view
e i.c
Enter system view, return user view with Ctrl+Z.

aw
[R3]interface Serial 2/0/0
u
[R3-Serial2/0/0]ip address 10.0.23.3 24

g .h
n
[R3-Serial2/0/0]quit
[R3]interface Serial 3/0/0
ni
r
lea
[R3-Serial3/0/0]ip address 10.0.35.3 24
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
: //
[R3-LoopBack0]ip address 10.0.3.3 24

t t p
:h
[R3-LoopBack0]quit

e s
c
<R4>system-view

r
ou
Enter system view, return user view with Ctrl+Z.
[R4]interface GigabitEthernet 0/0/0

es
[R4-GigabitEthernet0/0/0]ip address 10.0.24.4 24

R
[R4-GigabitEthernet0/0/0]quit

n g
[R4]interface LoopBack 0

i
n
[R4-LoopBack0]ip address 10.0.4.4 24

ar
[R4-LoopBack0]quit

e
e L
<R5>system-view

or
Enter system view, return user view with Ctrl+Z.

M
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]ip address 10.0.35.5 24
[R5-Serial1/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 10.0.5.5 24
[R5-LoopBack0]quit

Test direct link connectivity.

HC Series HUAWEI TECHNOLOGIES 93


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R2]ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=30 ms

--- 10.0.12.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/30/30 ms
e n
/
[R2]ping -c 1 10.0.24.4
o m
i.c
PING 10.0.24.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.24.4: bytes=56 Sequence=1 ttl=255 time=6 ms

w e
--- 10.0.24.4 ping statistics ---
u a
1 packet(s) transmitted

g .h
n
1 packet(s) received
0.00% packet loss
ni
r
lea
round-trip min/avg/max = 6/6/6 ms

[R2]ping -c 1 10.0.23.3
: //
PING 10.0.23.3: 56
t p
data bytes, press CTRL_C to break

t
:h
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=31 ms

e s
c
--- 10.0.23.3 ping statistics ---

r
ou
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
es
R
round-trip min/avg/max = 31/31/31 ms

i n g
n
[R3]ping -c 1 10.0.35.5

ar
PING 10.0.35.5: 56 data bytes, press CTRL_C to break

e
L
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=38 ms

e
or
--- 10.0.35.5 ping statistics ---

M 1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 38/38/38 ms

Step 2 Configure multiple OSPF areas.

HC Series HUAWEI TECHNOLOGIES 94


HCNP-IERS Chapter 1 OSPF Features and Configurations

On R1, configure Serial1/0/0 and Loopback0 to belong to Area 2. To enable OSPF to


advertise real masks of loopback interfaces, change the OSPF network type of
loopback interfaces in all the areas to broadcast. Configure all routers to use IP
address of Loopback0 as their router IDs.
[R1]ospf 1 router-id 10.0.1.1
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]network 10.0.12.1 0.0.0.0

e n
[R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0
/
[R1-ospf-1-area-0.0.0.2]quit

o m
i.c
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ospf network-type broadcast
w e
[R1-LoopBack0]quit
u a
g .h
i n
On R2, configure Serial2/0/0 and Loopback0 to belong to Area 0, Serial1/0/0 to
nArea 3.
belong to Area 2, and GigabitEthernet0/0/0 to belong rto
l e a
[R2]ospf 1 router-id 10.0.2.2
: //
tp
[R2-ospf-1]area 0

t
[R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0

h
:
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0

s
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]area 2
r c e
o u
[R2-ospf-1-area-0.0.0.2]network 10.0.12.2 0.0.0.0

e s
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]area 3
R
i n g
[R2-ospf-1-area-0.0.0.3]network 10.0.24.2 0.0.0.0
[R2-ospf-1-area-0.0.0.3]qui

rn
[R2-ospf-1]quit

a
L e
[R2]interface LoopBack 0
[R2-LoopBack0]ospf network-type broadcast

r e
[R2-LoopBack0]quit

oR3, configure Serial2/0/0 and Loopback0 to belong to Area 0 and Serial3/0/0 to


M
On
belong to Area 1.
[R3]ospf 1 router-id 10.0.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]quit

HC Series HUAWEI TECHNOLOGIES 95


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ospf network-type broadcast
[R3-LoopBack0]quit

e n
On R4, configure GigabitEthernet0/0/0 to belong to Area 3 and configure Loopback0
/
not to belong to any area.
o m
[R4]ospf 1 router-id 10.0.4.4
e i.c
w
[R4-ospf-1]area 3
[R4-ospf-1-area-0.0.0.3]network 10.0.24.4 0.0.0.0
u a
.h
[R4-ospf-1-area-0.0.0.3]quit
[R4-ospf-1]quit

i n g
rn Looback0 not to
On R5, configure Serial1/0/0 to belong to Area 1 andaconfigure
/ l e
belong to any area.
: /
[R5]ospf 1 router-id 10.0.5.5
t tp
[R5-ospf-1]area 1
: h
e s
[R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0
[R5-ospf-1-area-0.0.0.1]quit
r c
[R5-ospf-1]quit

o u
es
Rare complete, check the IP routing table of R1.
After the configurations

i n g
rn
[R1]display ip routing-table

a
Route Flags: R - relay, D - download to fib

L e
----------------------------------------------------------------------------

e
Routing Tables: Public

o r Destinations : 16 Routes : 16

MDestination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0


10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.2.0/24 OSPF 10 1562 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial1/0/0

HC Series HUAWEI TECHNOLOGIES 96


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.0.12.1/32 Direct 0 0 D 127.0.0.1 Serial1/0/0


10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0
10.0.24.0/24 OSPF 10 1563 D 10.0.12.2 Serial1/0/0
10.0.35.0/24 OSPF 10 4686 D 10.0.12.2 Serial1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
e n
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
/
o m
Test network connectivity.
e i.c
[R1]ping -c 1 10.0.35.5
aw
u
.h
PING 10.0.35.5: 56 data bytes, press CTRL_C to break

g
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=253 time=114 ms

ni n
r
--- 10.0.35.5 ping statistics ---

lea
1 packet(s) transmitted

//
1 packet(s) received
0.00% packet loss
p :
round-trip min/avg/max = 114/114/114 ms
t t
s :h
e
[R1]ping -c 1 10.0.3.3

r c
PING 10.0.3.3: 56 data bytes, press CTRL_C to break

ou
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=74 ms

es
R
--- 10.0.3.3 ping statistics ---

g
1 packet(s) transmitted

i n
1 packet(s) received

n
ar
0.00% packet loss

e
round-trip min/avg/max = 74/74/74 ms

e L
or
[R1]ping -c 1 10.0.24.4
PING 10.0.24.4: 56 data bytes, press CTRL_C to break

M Reply from 10.0.24.4: bytes=56 Sequence=1 ttl=254 time=34 ms

--- 10.0.24.4 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/34/34 ms

HC Series HUAWEI TECHNOLOGIES 97


HCNP-IERS Chapter 1 OSPF Features and Configurations

Step 3 Import external routes into OSPF.

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

e n
After the configurations are complete, check the imported route on R1 and test /
network connectivity.
o m
[R1]display ip routing-table protocol ospf
e i.c
Route Flags: R - relay, D - download to fib

aw
----------------------------------------------------------------------------
u
Public routing table : OSPF

g .h
n
Destinations : 7 Routes : 7

ni
r
lea
OSPF routing table status : <Active>

//
Destinations : 7 Routes : 7

p :
Destination/Mask Proto Pre Cost
t
Flags NextHop
t
Interface

:h
es
10.0.2.0/24 OSPF 10 1562 D 10.0.12.2 Serial1/0/0

c
10.0.3.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0

r
ou
10.0.5.0/24 O_ASE 150 1 D 10.0.12.2 Serial1/0/0

s
10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0
10.0.24.0/24 OSPF
10.0.35.0/24 OSPF
Re10
10
1563
4686
D
D
10.0.12.2
10.0.12.2
Serial1/0/0
Serial1/0/0

i n g
10.0.35.3/32 O_ASE 150 1 D 10.0.12.2 Serial1/0/0

n
ar
OSPF routing table status : <Inactive>

e Le
Destinations : 0 Routes : 0

o r
[R1]ping -c 1 10.0.5.5

M PING 10.0.5.5: 56 data bytes, press CTRL_C to break


Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=111 ms

--- 10.0.5.5 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 111/111/111 ms

HC Series HUAWEI TECHNOLOGIES 98


HCNP-IERS Chapter 1 OSPF Features and Configurations

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]ip route-static 0.0.0.0 0.0.0.0 LoopBack 0
[R4]ospf 1
[R4-ospf-1]default-route-advertise type 1 cost 20

n
[R4-ospf-1]quit

/ e
o
After the configurations are complete, check information about learning this defaultm
route on R1, and test network connectivity. i . c
w e
a
[R1]display ip routing-table protocol ospf

hu
Route Flags: R - relay, D - download to fib

.
----------------------------------------------------------------------------
g
Public routing table : OSPF

ni n
r
Destinations : 8 Routes : 8

l e a
//
OSPF routing table status : <Active>
Destinations : 8 Routes : 8
:
t tp
Destination/Mask Proto Pre Cost

: h Flags NextHop Interface

e s
0.0.0.0/0 O_ASE
r c
150 1583 D 10.0.12.2 Serial1/0/0
10.0.2.0/24 OSPF

o u
10 1562 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 OSPF

e s 10 3124 D 10.0.12.2 Serial1/0/0

R
10.0.5.0/24 O_ASE 150 1 D 10.0.12.2 Serial1/0/0

g
10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0

i n
10.0.24.0/24 OSPF 10 1563 D 10.0.12.2 Serial1/0/0

rn
10.0.35.0/24 OSPF 10 4686 D 10.0.12.2 Serial1/0/0

e a
10.0.35.3/32 O_ASE 150 1 D 10.0.12.2 Serial1/0/0

e L
r
OSPF routing table status : <Inactive>

o Destinations : 0 Routes : 0

M[R1]ping -c 1 10.0.4.4
PING 10.0.4.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=254 time=39 ms

--- 10.0.4.4 ping statistics ---


1 packet(s) transmitted
1 packet(s) received

HC Series HUAWEI TECHNOLOGIES 99


HCNP-IERS Chapter 1 OSPF Features and Configurations

0.00% packet loss


round-trip min/avg/max = 39/39/39 ms

Step 4 Configure Area 2 as a stub area.

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.

e n
[R1]display ospf lsdb
/
o m
i.c
OSPF Process 1 with Router ID 10.0.1.1

e
Link State Database

aw
u
Area: 0.0.0.2

.h
Type LinkState ID AdvRouter Age Len Sequence Metric
Router
Router
10.0.2.2
10.0.1.1
10.0.2.2
10.0.1.1
12 48
11 60
80000003
80000003
i n g
1562
0

r n
lea
Sum-Net 10.0.35.0 10.0.2.2 33 28 80000001 3124
Sum-Net 10.0.24.0 10.0.2.2 33 28 80000001 1
Sum-Net 10.0.3.0 10.0.2.2 33 28
: //
80000001 1562
Sum-Net 10.0.2.0 10.0.2.2
t
33 28

t p 80000001 0

:h
Sum-Net 10.0.23.0 10.0.2.2 34 28 80000001 1562

s
Sum-Asbr 10.0.4.4 10.0.2.2 34 28 80000001 1
Sum-Asbr 10.0.5.5 10.0.2.2

r c e 34 28 80000001 3124

s ou
Type LinkState ID
Re
AS External Database
AdvRouter Age Len Sequence Metric

ing
External 0.0.0.0 10.0.4.4 1049 36 80000002 20

rn
External 10.0.5.0 10.0.5.5 1350 36 80000001 1

a
External 10.0.35.0 10.0.5.5 1350 36 80000001 1
External
L e
10.0.35.3 10.0.5.5 1350 36 80000001 1

r e
o
[R1]display ospf lsdb ase 0.0.0.0

M OSPF Process 1 with Router ID 10.0.1.1


Link State Database

Type : External
Ls id : 0.0.0.0
Adv rtr : 10.0.4.4
Ls age : 504
Len : 36

HC Series HUAWEI TECHNOLOGIES 100


HCNP-IERS Chapter 1 OSPF Features and Configurations

Options : E
seq# : 80000002
chksum : 0xa981
Net mask : 0.0.0.0
TOS 0 Metric: 20
E type : 1
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Low
e n
/
o m
i.c
On R1 and R2, configure Area 2 as a stub area.
[R1]ospf 1

w e
[R1-ospf-1]area 2

u a
.h
[R1-ospf-1-area-0.0.0.2]stub

g
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit

ni n
r
lea
[R2]ospf 1

//
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]stub
p :
[R2-ospf-1-area-0.0.0.2]quit
t t
:h
[R2-ospf-1]quit

e s
r c on R1, compare the current IP routing table
u routing information learning. You can see that the
After the configurations are complete,
o
s
with the previous one and check
e
R the default route also becomes an internal route.
external route disappears and

i n g
[R1]display ip routing-table protocol ospf

rn
Route Flags: R - relay, D - download to fib

a
e
----------------------------------------------------------------------------

L
Public routing table : OSPF

e
o r Destinations : 6 Routes : 6

MOSPF routing table status : <Active>


Destinations : 6 Routes : 6

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 OSPF 10 1563 D 10.0.12.2 Serial1/0/0


10.0.2.0/24 OSPF 10 1562 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0

HC Series HUAWEI TECHNOLOGIES 101


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0


10.0.24.0/24 OSPF 10 1563 D 10.0.12.2 Serial1/0/0
10.0.35.0/24 OSPF 10 4686 D 10.0.12.2 Serial1/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

Check the LSDB of R1. You can see that the LSA describing the external route also
e n
disappears, and the default route is learned through a Type 3 LSA. /
o m
i.c
[R1]display ospf lsdb

OSPF Process 1 with Router ID 10.0.1.1


w e
Link State Database
u a
Area: 0.0.0.2
g .h
Type LinkState ID AdvRouter Age Len
i
Sequence

n n Metric
Router 10.0.2.2 10.0.2.2 182 48
r
80000003 1562

lea
Router 10.0.1.1 10.0.1.1 182 60 80000004 0

://
Sum-Net 0.0.0.0 10.0.2.2 183 28 80000001 1

tp
Sum-Net 10.0.35.0 10.0.2.2 183 28 80000001 3124

t
:h
Sum-Net 10.0.24.0 10.0.2.2 183 28 80000001 1
Sum-Net 10.0.3.0 10.0.2.2 183 28 80000001 1562
Sum-Net 10.0.2.0 10.0.2.2
e s 184 28 80000001 0
Sum-Net 10.0.23.0 10.0.2.2
r c 184 28 80000001 1562

s ou
e
Radvertised by R2. This proves that after an area is configured
Check detailed information about this Type 3 LSA. You can see that the default route
described by this LSA
i n g is

rn3 LSA to flood a default route pointing to itself within this area.
as a stub area, an ABR prevents Type 4 and Type 5 LSAs from being sent to this area
a
e
and uses a Type
L
r e
[R1]display ospf lsdb summary 0.0.0.0

o
M OSPF Process 1 with Router ID 10.0.1.1
Area: 0.0.0.2
Link State Database

Type : Sum-Net
Ls id : 0.0.0.0
Adv rtr : 10.0.2.2
Ls age : 114
Len : 28

HC Series HUAWEI TECHNOLOGIES 102


HCNP-IERS Chapter 1 OSPF Features and Configurations

Options : None
seq# : 80000001
chksum : 0x1f31
Net mask : 0.0.0.0
Tos 0 metric: 1
Priority : Low

On R2, configure Area 2 as a totally stub area and specify the no-summary
e n
parameter. /
o m
i.c
[R2]ospf 1

e
[R2-ospf-1]area 2

w
[R2-ospf-1-area-0.0.0.2]stub no-summary
[R2-ospf-1-area-0.0.0.2]quit
u a
.h
[R2-ospf-1]quit

i n g
Check the OSPF routing table of R1. You can see thataonlyrn one default route is
/ l e
learned through OSPF.
: /
t
[R1]display ip routing-table protocol ospf
tp
h
Route Flags: R - relay, D - download to fib
:
s
----------------------------------------------------------------------------
e
Public routing table : OSPF
r c
Destinations : 1

o u Routes : 1

es
R
OSPF routing table status : <Active>

g
Destinations : 1 Routes : 1

i n
a rn
Destination/Mask Proto Pre Cost Flags NextHop Interface

L e
0.0.0.0/0 OSPF 10 1563 D 10.0.12.2 Serial1/0/0

r e
o
OSPF routing table status : <Inactive>

M 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.

HC Series HUAWEI TECHNOLOGIES 103


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1]display ospf lsdb

OSPF Process 1 with Router ID 10.0.1.1


Link State Database

Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.2.2 10.0.2.2 167 48 80000004 1562
Router 10.0.1.1 10.0.1.1 166 60 80000006 0
e n
Sum-Net 0.0.0.0 10.0.2.2 549 28 80000001 1
/
o m
Step 5 Configure Area 1 as an NSSA area.
e i.c
aw
u
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. .h
[R3]display ip routing-table protocol ospf
i n g
r n
a
Route Flags: R - relay, D - download to fib

l e
----------------------------------------------------------------------------
Public routing table : OSPF
: //
tp
Destinations : 7 Routes : 7

ht
OSPF routing table status : <Active>
s :
Destinations : 6

r c e Routes : 6

Destination/Mask
o u
Proto Pre Cost Flags NextHop Interface

e s
0.0.0.0/0
R O_ASE 150 1583 D 10.0.23.2 Serial2/0/0
10.0.1.0/24

i n g OSPF 10 3124 D 10.0.23.2 Serial2/0/0

rn
10.0.2.0/24 OSPF 10 1562 D 10.0.23.2 Serial2/0/0

a
10.0.5.0/24 O_ASE 150 1 D 10.0.35.5 Serial3/0/0

L e
10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0

e
10.0.24.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0

o r
M
OSPF routing table status : <Inactive>
Destinations : 1 Routes : 1

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.35.3/32 O_ASE 150 1 10.0.35.5 Serial3/0/0

HC Series HUAWEI TECHNOLOGIES 104


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
[R5]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

n
Public routing table : OSPF
Destinations : 7 Routes : 7
/ e
o m
i.c
OSPF routing table status : <Active>
Destinations : 7 Routes : 7

w e
Destination/Mask Proto Pre Cost Flags NextHop Interface

u a
0.0.0.0/0 O_ASE 150 3145 D 10.0.35.3
g .h
Serial1/0/0
10.0.1.0/24 OSPF 10 4686 D 10.0.35.3

ni n
Serial1/0/0
10.0.2.0/24 OSPF 10 3124 D 10.0.35.3
r Serial1/0/0

lea
10.0.3.0/24 OSPF 10 1562 D 10.0.35.3 Serial1/0/0

://
10.0.12.0/24 OSPF 10 4686 D 10.0.35.3 Serial1/0/0

tp
10.0.23.0/24 OSPF 10 3124 D 10.0.35.3 Serial1/0/0
10.0.24.0/24 OSPF 10 3125 D
t 10.0.35.3 Serial1/0/0

s :h
e
OSPF routing table status : <Inactive>
Destinations : 0
r c
Routes : 0

[R5]display ospf lsdb


s ou
Re
i n g
OSPF Process 1 with Router ID 10.0.5.5
Link State Database

n
e ar Area: 0.0.0.1
Type

e L LinkState ID AdvRouter Age Len Sequence Metric

or
Router 10.0.5.5 10.0.5.5 882 48 80000004 1562
Router 10.0.3.3 10.0.3.3 1309 48 80000003 1562

M
Sum-Net
Sum-Net
10.0.24.0
10.0.12.0
10.0.3.3
10.0.3.3
65 28
819 28
80000003
80000001
1563
3124
Sum-Net 10.0.3.0 10.0.3.3 65 28 80000003 0
Sum-Net 10.0.2.0 10.0.3.3 65 28 80000003 1562
Sum-Net 10.0.1.0 10.0.3.3 812 28 80000001 3124
Sum-Net 10.0.23.0 10.0.3.3 65 28 80000003 1562
Sum-Asbr 10.0.4.4 10.0.3.3 602 28 80000002 1563

HC Series HUAWEI TECHNOLOGIES 105


HCNP-IERS Chapter 1 OSPF Features and Configurations

AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 10.0.5.0 10.0.5.5 882 36 80000002 1
External 10.0.35.0 10.0.5.5 883 36 80000002 1
External 10.0.35.3 10.0.5.5 883 36 80000002 1
External 0.0.0.0 10.0.4.4 586 36 80000003 20

e n
On R3 and R5, configure Area 1 as an NSSA area.
/
[R3]ospf 1
o m
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]nssa
e i.c
[R3-ospf-1-area-0.0.0.1]quit
aw
u
.h
[R3-ospf-1]quit

[R5]ospf 1
i n g
[R5-ospf-1]area 1
r n
lea
[R5-ospf-1-area-0.0.0.1]nssa

//
[R5-ospf-1-area-0.0.0.1]quit
[R5-ospf-1]quit
p :
t t
: h again, check the OSPF routing table of
s
After a neighbor relationship is established
e
R3.
r c
o u
s
[R3]display ip routing-table protocol ospf

R e
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

i n g
Public routing table : OSPF

rn
Destinations : 7 Routes : 7

e a
L
OSPF routing table status : <Active>

e
r
Destinations : 6 Routes : 6

o
MDestination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 O_ASE 150 1583 D 10.0.23.2 Serial2/0/0


10.0.1.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0
10.0.2.0/24 OSPF 10 1562 D 10.0.23.2 Serial2/0/0
10.0.5.0/24 O_NSSA 150 1 D 10.0.35.5 Serial3/0/0
10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0
10.0.24.0/24 OSPF 10 1563 D 10.0.23.2 Serial2/0/0

HC Series HUAWEI TECHNOLOGIES 106


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF routing table status : <Inactive>


Destinations : 1 Routes : 1

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.35.3/32 O_NSSA 150 1 10.0.35.5 Serial3/0/0

The preceding command output shows that the external route advertised by R5 is
e n
displayed as O_NSSA in the OSPF routing table. /
o m
i.c
Check the OSPF routing table of R5 again.
[R5]display ip routing-table protocol ospf
w e
Route Flags: R - relay, D - download to fib

u a
.h
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 7 Routes : 7
i n g
r n
lea
OSPF routing table status : <Active>
Destinations : 7 Routes : 7

: //
Destination/Mask Proto Pre Cost
t t p
Flags NextHop Interface

s :h
0.0.0.0/0
10.0.1.0/24
O_NSSA 150 1
OSPF 10
r c
4686 e D
D
10.0.35.3
10.0.35.3
Serial1/0/0
Serial1/0/0

ou
10.0.2.0/24 OSPF 10 3124 D 10.0.35.3 Serial1/0/0
10.0.3.0/24 OSPF
es
10 1562 D 10.0.35.3 Serial1/0/0
10.0.12.0/24 OSPF
R 10 4686 D 10.0.35.3 Serial1/0/0

ing
10.0.23.0/24 OSPF 10 3124 D 10.0.35.3 Serial1/0/0
10.0.24.0/24 OSPF 10 3125 D 10.0.35.3 Serial1/0/0

a rn
e
OSPF routing table status : <Inactive>

eL
Destinations : 0 Routes : 0

o r
MThe default route was previously displayed as an external route (O_ASE) and now
becomes an external route (O_NSSA) of an NSSA area.

Check the LSDB of R5.


[R5]display ospf lsdb

OSPF Process 1 with Router ID 10.0.5.5


Link State Database

HC Series HUAWEI TECHNOLOGIES 107


HCNP-IERS Chapter 1 OSPF Features and Configurations

Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 811 48 80000007 1562
Router 10.0.3.3 10.0.3.3 811 48 80000007 1562
Sum-Net 10.0.24.0 10.0.3.3 929 28 80000005 1563
Sum-Net 10.0.12.0 10.0.3.3 929 28 80000005 3124
Sum-Net 10.0.3.0 10.0.3.3 929 28 80000005 0
Sum-Net 10.0.2.0 10.0.3.3 929 28 80000005 1562
e n
Sum-Net 10.0.1.0 10.0.3.3 930 28 80000005 3124
/
Sum-Net 10.0.23.0 10.0.3.3 930 28 80000005 1562
o m
i.c
NSSA 10.0.5.0 10.0.5.5 819 36 80000005 1
NSSA
NSSA
10.0.35.0
10.0.35.3
10.0.5.5
10.0.5.5
819
819
36
36
80000006
80000005
1
1
w e
NSSA 0.0.0.0 10.0.3.3 930 36 80000005
u
1 a
g .h
i n
You can see that the Type 5 LSA disappears and the external route is advertised using
n
r
lea
a Type 7 LSA.

Check detailed information about the default route.


: //
[R5]display ospf lsdb nssa 0.0.0.0
t t p
s :h
r c
Area: 0.0.0.1 e
OSPF Process 1 with Router ID 10.0.5.5

ou
Link State Database

es
Type : NSSA
R
Ls id
Adv rtr
: 0.0.0.0

i n
: 10.0.3.3g
n
ar
Ls age : 1149

Le
Len : 36
Options : None

r e
seq# : 80000005

ochksum : 0x7745

M Net mask : 0.0.0.0


TOS 0 Metric: 1
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
Priority : Low

HC Series HUAWEI TECHNOLOGIES 108


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
e n
The fundamental difference between an NSSA area and a stub area is that an NSSA/
o m
area allows importing external routes but a stub area does not.
i . c
Step 6 Observe changes brought by an NSSA area to OSPF.e
a w
Run the display ospf brief command to check the role of R3. Youu
. h can see that the
Border Router field displays three values: AREA AS NSSA.
n g AREA indicates that
i NSSA indicates that
n
r area.
this router is an ABR; AS indicates that this router is an ASBR;
this router has at least one interface located in an NSSA
l e a
: / /
tp
[R3]display ospf brief

ht
OSPF Process 1 with Router ID 10.0.3.3

s :
OSPF Protocol Information

r c e
RouterID: 10.0.3.3
u
Border Router:

o
AREA AS NSSA

s
Multi-VPN-Instance is not enabled

e
R
Global DS-TE Mode: Non-Standard IETF Mode

g
Graceful-restart capability: disabled

i n
Helper support capability : not configured

rn
Applications Supported: MPLS Traffic-Engineering

a
e
Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms

L
Default ASE parameters: Metric: 1 Tag: 1 Type: 2

e
o r
Route Preference: 10
ASE Route Preference: 150

M SPF Computation Count: 14


RFC 1583 Compatible
Retransmission limitation is disabled
Area Count: 2 Nssa Area Count: 1
ExChange/Loading Neighbors: 0
Process total up interface count: 3
Process valid up interface count: 2

HC Series HUAWEI TECHNOLOGIES 109


HCNP-IERS Chapter 1 OSPF Features and Configurations

Area: 0.0.0.0 (MPLS TE not enabled)


Authtype: None Area flag: Normal
SPF scheduled Count: 14
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 2

Interface: 10.0.3.3 (LoopBack0)


Cost: 0 State: DR Type: Broadcast MTU: 1500
e n
Priority: 1
/
Designated Router: 10.0.3.3
o m
i.c
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

w e
Interface: 10.0.23.3 (Serial2/0/0) --> 10.0.23.2
u a
Cost: 1562 State: P-2-P Type: P2P MTU: 1500

g .h
n
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

ni
r
lea
Area: 0.0.0.1 (MPLS TE not enabled)
Authtype: None Area flag: NSSA
SPF scheduled Count: 3
: //
ExChange/Loading Neighbors: 0

t t p
:h
NSSA Translator State: Elected

s
Router ID conflict state: Normal
Area interface up count: 1

r c e
ou
NSSA LSA count: 0

es
Interface: 10.0.35.3 (Serial3/0/0) --> 10.0.35.5
Cost: 1562
R
State: P-2-P Type: P2P MTU: 1500

n g
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

i
r n
e a
Type 5 LSAs are not allowed in an NSSA area. Therefore, an ASBR uses a Type 7 LSA
L
re
to advertise an external route within an NSSA area. However, this Type 7 LSA can only
beoflooded within an NSSA area. After an ABR of this area receives this LSA, it
Mtranslates 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

HC Series HUAWEI TECHNOLOGIES 110


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
e n
address of the stub network segment within an OSPF routing domain. The address
/
used here is the address of Serial1/0/0 on R5.
o m
[R3]display ospf lsdb nssa 10.0.5.0
e i.c
aw
u
OSPF Process 1 with Router ID 10.0.3.3

.h
Area: 0.0.0.0
Link State Database

i n g
Area: 0.0.0.1
r n
lea
Link State Database

: //
Type : NSSA

t t p
:h
Ls id : 10.0.5.0

s
Adv rtr : 10.0.5.5
Ls age
Len
: 836
: 36
r c e
Options : NP

s ou
e
seq# : 80000001
chksum : 0xb0c2
R
Net mask : 255.255.255.0

i n g
n
TOS 0 Metric: 1

ar
E type : 2

L e
Forwarding Address : 10.0.35.5

e
Tag : 1

or
Priority : Low

M
Check the Type 5 LSA generated by R3 to describe the network segment 10.0.5.0/24.
[R3]display ospf lsdb ase 10.0.5.0

OSPF Process 1 with Router ID 10.0.3.3


Link State Database

Type : External

HC Series HUAWEI TECHNOLOGIES 111


HCNP-IERS Chapter 1 OSPF Features and Configurations

Ls id : 10.0.5.0
Adv rtr : 10.0.3.3
Ls age : 882
Len : 36
Options : E
seq# : 80000001
chksum : 0x413e
Net mask : 255.255.255.0
TOS 0 Metric: 1
e n
E type : 2
/
Forwarding Address : 10.0.35.5
o m
i.c
Tag : 1
Priority : Low

w e
a
u are copied
The values of the Ls id, Network Mask, and Forwarding Address fields
. h
n
from the previous Type 7 LSA. In this manner, the network segment
i g 10.0.5.0/24 is
advertised into other areas.
r n
l e a
----End
: / /
t tp
h
Additional Exercises: Analysis and Verification
:
e s to?
Which scenarios are NSSA areas applicable
r c
o
Analyze why R3 is defined as anu ASBR.
es
Device Configurations R
i n g
<R1>display current-configuration

rn
[V200R007C00SPC600]

a
#

L e
sysname R1
#
r e
o
interface Serial1/0/0

M link-protocol ppp
ip address 10.0.12.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.1.1

HC Series HUAWEI TECHNOLOGIES 112


HCNP-IERS Chapter 1 OSPF Features and Configurations

area 0.0.0.2
network 10.0.12.1 0.0.0.0
network 10.0.1.1 0.0.0.0
stub
#
return

<R2>display current-configuration
[V200R007C00SPC600]
e n
#
/
sysname R2
o m
i.c
#
interface Serial1/0/0
link-protocol ppp
w e
ip address 10.0.12.2 255.255.255.0
u a
#

g .h
n
interface Serial2/0/0
link-protocol ppp
ni
r
lea
ip address 10.0.23.2 255.255.255.0
#
interface GigabitEthernet0/0/0
: //
ip address 10.0.24.2 255.255.255.0

t t p
:h
#

s
interface LoopBack0
ip address 10.0.2.2 255.255.255.0

r c e
ou
ospf network-type broadcast
#
ospf 1 router-id 10.0.2.2
es
area 0.0.0.0
R
n g
network 10.0.23.2 0.0.0.0

i
n
network 10.0.2.2 0.0.0.0
area 0.0.0.2

e ar
L
network 10.0.12.2 0.0.0.0

e
stub no-summary

or
area 0.0.0.3

M
#
network 10.0.24.2 0.0.0.0

return

<R3>display current-configuration
[V200R007C00SPC600]
#
sysname R3
#

HC Series HUAWEI TECHNOLOGIES 113


HCNP-IERS Chapter 1 OSPF Features and Configurations

interface Serial2/0/0
link-protocol ppp
ip address 10.0.23.3 255.255.255.0
#
interface Serial3/0/0
link-protocol ppp
ip address 10.0.35.3 255.255.255.0
#
interface LoopBack0
e n
ip address 10.0.3.3 255.255.255.0
/
ospf network-type broadcast
o m
i.c
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
w e
network 10.0.23.3 0.0.0.0
u a
network 10.0.3.3 0.0.0.0

g .h
n
area 0.0.0.1
network 10.0.35.3 0.0.0.0
ni
r
lea
nssa
#
return
: //
t t p
:h
<R4>display current-configuration

s
[V200R007C00SPC600]
#

r c e
ou
sysname R4
#

e
interface GigabitEthernet0/0/0s
R
ip address 10.0.24.4 255.255.255.0
#

i n g
interface NULL0
n
#

e ar
L
interface LoopBack0

e
ip address 10.0.4.4 255.255.255.0

or
ospf network-type broadcast

M
#
ospf 1 router-id 10.0.4.4
default-route-advertise cost 20 type 1
area 0.0.0.3
network 10.0.24.4 0.0.0.0
#
ip route-static 0.0.0.0 0.0.0.0 LoopBack0
#
return

HC Series HUAWEI TECHNOLOGIES 114


HCNP-IERS Chapter 1 OSPF Features and Configurations

<R5>display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.35.5 255.255.255.0
e n
#
/
interface LoopBack0
o m
i.c
ip address 10.0.5.5 255.255.255.0
#
ospf 1 router-id 10.0.5.5
w e
import-route direct
u a
area 0.0.0.1

g .h
n
network 10.0.35.5 0.0.0.0
nssa
ni
r
lea
#
return

: //
t t p
s:h
r c e
s ou
Re
i n g
n
e ar
e L
or
M

HC Series HUAWEI TECHNOLOGIES 115


HCNP-IERS Chapter 1 OSPF Features and Configurations

Lab 1-5 OSPF Virtual Link and Inter-Area Route Filtering

Learning Objectives

The objectives of this lab are to learn and understand:

e n
 How to configure OSPF virtual links to connect to non-contiguous Area 0

How to configure OSPF virtual links to connect a non-backbone aream


/

. co to
Area 0
e i
How to filter and control routes between areas
aw
. hu
Topology
i n g
r n
l e a
: //
t tp
: h
e s
r c
o u
e s
R
i n g
a rn
L e Figure 1-5 OSPF virtual link and inter-area route filtering
r e
o
M
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

HC Series HUAWEI TECHNOLOGIES 116


HCNP-IERS Chapter 1 OSPF Features and Configurations

link between R1 and R2 to enable Area 3 to be directly connected to Area 0.


Additionally, you establish a virtual link between R3 and R5 to connect
non-contiguous Area 0.

To specify router IDs for the routers, configure the routers to use fixed addresses as
their router IDs.

e n
Tasks
/
o m
i.c
Step 1 Set basic parameters and configure IP addresses.

w e
Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
loopback interfaces to simulate an independent network segment. a

. hu
<R1>system-view
Enter system view, return user view with Ctrl+Z.
i n g
[R1]interface Serial 3/0/0
r n
[R1-Serial3/0/0]ip address 10.0.14.1 24
l e a
[R1-Serial3/0/0]quit
: //
tp
[R1]interface Serial 1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 24

ht
[R1-Serial1/0/0]quit

s :
[R1]interface LoopBack 0

r c e
[R1-LoopBack0]ip address 10.0.1.1 24
[R1-LoopBack0]quit
o u
es
<R2>system-view
R
i n g
Enter system view, return user view with Ctrl+Z.
[R2]interface Serial 1/0/0

rn
[R2-Serial1/0/0]ip address 10.0.12.2 24

a
L e
[R2-Serial1/0/0]quit
[R2]interface Serial 2/0/0

r e
[R2-Serial2/0/0]ip address 10.0.23.2 24

o
[R2-Serial2/0/0]quit

M[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24
[R2-LoopBack0]quit

<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface Serial 2/0/0
[R3-Serial2/0/0]ip address 10.0.23.3 24

HC Series HUAWEI TECHNOLOGIES 117


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3-Serial2/0/0]quit
[R3]interface Serial 3/0/0
[R3-Serial3/0/0]ip address 10.0.35.3 24
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 24
[R3-LoopBack0]quit

<R4>system-view
e n
Enter system view, return user view with Ctrl+Z.
/
[R4]interface Serial 1/0/0
o m
i.c
[R4-Serial1/0/0]ip address 10.0.14.4 24
[R4-Serial1/0/0]quit
[R4]interface LoopBack 0
w e
[R4-LoopBack0]ip address 10.0.4.4 24
u a
[R4-LoopBack0]quit

g .h
<R5>system-view
ni n
r
lea
Enter system view, return user view with Ctrl+Z.
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]ip address 10.0.35.5 24
: //
[R5-Serial1/0/0]quit

t t p
:h
[R5]interface LoopBack 0

s
[R5-LoopBack0]ip address 10.0.5.5 24
[R5-LoopBack0]quit

r c e
sou
e
After the configurations are complete, test direct link connectivity.
R
g
[R1]ping -c 1 10.0.14.4

i n
PING 10.0.14.4: 56 data bytes, press CTRL_C to break

n
ar
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=39 ms

L e
--- 10.0.14.4 ping statistics ---

e
or
1 packet(s) transmitted
1 packet(s) received

M 0.00% packet loss


round-trip min/avg/max = 39/39/39 ms
[R1]ping -c 1 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=29 ms

--- 10.0.12.2 ping statistics ---


1 packet(s) transmitted

HC Series HUAWEI TECHNOLOGIES 118


HCNP-IERS Chapter 1 OSPF Features and Configurations

1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 29/29/29 ms

[R3]ping -c 1 10.0.23.2
PING 10.0.23.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.2: bytes=56 Sequence=1 ttl=255 time=45 ms

--- 10.0.23.2 ping statistics ---


e n
1 packet(s) transmitted
/
1 packet(s) received
o m
i.c
0.00% packet loss
round-trip min/avg/max = 45/45/45 ms

w e
[R3]ping -c 1 10.0.35.5
u a
PING 10.0.35.5: 56 data bytes, press CTRL_C to break

g .h
n
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=32 ms

ni
r
lea
--- 10.0.35.5 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
: //
0.00% packet loss

t t p
:h
round-trip min/avg/max = 32/32/32 ms

e s
Step 2 Configure multiple rOSPF c areas.
o u
e s and Loopback0 to belong to Area 2 and Serial3/0/0 to
On R1, configure Serial1/0/0
R OSPF to advertise real masks of loopback interfaces,
belong to Area 3. To enable
change the OSPF n
i g
network type of loopback interfaces in all the areas to broadcast.
Configure all rn to use IP address of Loopback0 as their router IDs.
e a routers

L
[R1]ospf 1 router-id 10.0.1.1

e
o r
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]network 10.0.12.1 0.0.0.0

M[R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0


[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]area 3
[R1-ospf-1-area-0.0.0.3]network 10.0.14.1 0.0.0.0
[R1-ospf-1-area-0.0.0.3]quit
[R1-ospf-1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ospf network-type broadcast

HC Series HUAWEI TECHNOLOGIES 119


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1-LoopBack0]quit

On R2, configure Serial2/0/0 and Loopback0 to belong to Area 0 and Serial1/0/0 to


belong to Area 2.

[R2]ospf 1 router-id 10.0.2.2


[R2-ospf-1]area 2

e n
[R2-ospf-1-area-0.0.0.2]network 10.0.12.2 0.0.0.0
/
[R2-ospf-1-area-0.0.0.2]quit

o m
i.c
[R2-ospf-1]area 0

e
[R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0

w
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]quit
u a
.h
[R2-ospf-1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ospf network-type broadcast
i n g
[R2-LoopBack0]quit
r n
//lea
p :
On R3, configure Serial2/0/0 and Loopback0 to belong to Area 0 and Serial3/0/0 to
t t
:h
belong to Area 1.
[R3]ospf 1 router-id 10.0.3.3
e s
[R3-ospf-1]area 0
r c
ou
[R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0

s
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0

e
R
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]area 1

i n g
[R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0

n
ar
[R3-ospf-1-area-0.0.0.1]quit

e
[R3-ospf-1]quit

L
[R3]interface LoopBack 0

e
or
[R3-LoopBack0]ospf network-type broadcast
[R3-LoopBack0]quit

M
On R4, configure Serial1/0/0 and Loopback0 to belong to Area 3.
[R4]ospf 1 router-id 10.0.4.4
[R4-ospf-1]area 3
[R4-ospf-1-area-0.0.0.3]network 10.0.14.4 0.0.0.0
[R4-ospf-1-area-0.0.0.3]network 10.0.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.3]quit

HC Series HUAWEI TECHNOLOGIES 120


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R4-ospf-1]quit
[R4]interface LoopBack 0
[R4-LoopBack0]ospf network-type broadcast
[R4-LoopBack0]quit

On R5, configure Serial1/0/0 to belong to Area 1 and Looback0 to belong to Area 0.


[R5]ospf 1 router-id 10.0.5.5

e n
/
[R5-ospf-1]area 0

m
[R5-ospf-1-area-0.0.0.0]network 10.0.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]quit
o
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0
e i.c
[R5-ospf-1-area-0.0.0.3]quit
aw
u
.h
[R5-ospf-1]quit

g
[R5]interface LoopBack 0
[R5-LoopBack0]ospf network-type broadcast

ni n
r
[R5-LoopBack0]quit

//lea
Step 3 Check the OSPF routing table of each router.
p :
t t
:h
Check the OSPF routing table of R4. Although R4 establishes a neighbor relationship

e s
with R1, it does not learn any OSPF routes.

r c
ou
[R4]display ip routing-table protocol ospf

s
[R4]display ospf peer

Re
g
OSPF Process 1 with Router ID 10.0.4.4

n i n
Neighbors

ar
Area 0.0.0.3 interface 10.0.14.4(Serial1/0/0)'s neighbors

e
e L
Router ID: 10.0.1.1 Address: 10.0.14.1

or
State: Full Mode:Nbr is Slave Priority: 1
DR: None BDR: None MTU: 0

M Dead timer due in 39 sec


Retrans timer interval: 4
Neighbor is up for 00:21:33
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.

HC Series HUAWEI TECHNOLOGIES 121


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R4]display ospf lsdb

OSPF Process 1 with Router ID 10.0.4.4


Link State Database

Area: 0.0.0.3
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.4.4 10.0.4.4 571 60 80000005 0
Router 10.0.1.1 10.0.1.1 616 48 80000003 1562
e n
/
Check the OSPF routing table of R1. The route to 10.0.5.0/24 disappears. Aftero
m
i . c
analyzing the LSDB of R3, you will know why this route disappears.
w e
[R1]display ip routing-table protocol ospf
a
Route Flags: R - relay, D - download to fib
. hu
Public routing table : OSPF
i n g
----------------------------------------------------------------------------

Destinations : 5 Routes : 5
r n
l e a
OSPF routing table status : <Active>
: //
tp
Destinations : 5 Routes : 5

ht
Destination/Mask Proto Pre

s :
Cost Flags NextHop Interface

10.0.2.0/24 OSPF
r c
10e 1562 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 OSPF
o u 10 3124 D 10.0.12.2 Serial1/0/0
10.0.4.0/24
e s
OSPF 10 1562 D 10.0.14.4 Serial3/0/0

R
10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0

i n g
10.0.35.0/24 OSPF 10 4686 D 10.0.12.2 Serial1/0/0

a rn
OSPF routing table status : <Inactive>

L e
Destinations : 0 Routes : 0

Checkethe LSDB of R1. To prevent inter-area loops, OSPF does not allow directly
or routing information between two non-backbone areas. The LSDB shows
advertising
Mthat 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.

HC Series HUAWEI TECHNOLOGIES 122


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
[R1]display ospf lsdb

OSPF Process 1 with Router ID 10.0.1.1

n
Link State Database

/ e
Area: 0.0.0.2

o m
i.c
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.2.2 10.0.2.2 1251 48 80000023 1562
Router 10.0.1.1 10.0.1.1 1266 60 80000024 0
w e
Sum-Net 10.0.35.0 10.0.2.2 1178 28 8000001B 3124

u a
.h
Sum-Net 10.0.3.0 10.0.2.2 1178 28 8000001B 1562
Sum-Net
Sum-Net
10.0.2.0
10.0.23.0
10.0.2.2
10.0.2.2
1228 28
1189 28
80000021

i
8000001B
n g 0
1562

r n
lea
Area: 0.0.0.3

://
Type LinkState ID AdvRouter Age Len Sequence Metric

tp
Router 10.0.4.4 10.0.4.4 855 60 80000024 0
Router 10.0.1.1 10.0.1.1
t
898 48 80000022 1562

s :h
c e
Check the OSPF routing table of R2. Three routes to network segments 10.0.4.0/24,
r
o u
10.0.5.0/24, and 10.0.14.0/24 respectively disappear from the OSPF routing table of
R2.
e s
R
i n g
[R2]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib

rn
----------------------------------------------------------------------------

a
L e
Public routing table : OSPF
Destinations : 3 Routes : 3

r e
o
OSPF routing table status : <Active>

M Destinations : 3 Routes : 3

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 OSPF 10 1562 D 10.0.12.1 Serial1/0/0


10.0.3.0/24 OSPF 10 1562 D 10.0.23.3 Serial2/0/0
10.0.35.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0

HC Series HUAWEI TECHNOLOGIES 123


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

Check the LSDB of R2. You can see that R1 does not advertise routes of Area 3 to R2.

Therefore, R2 does not have routes to network segments 10.0.4.0/24 and


10.0.14.0/24.

e n
In Area 0, R3 does not advertise the route 10.0.5.0 to R2.
/
o m
i.c
[R2]display ospf lsdb

OSPF Process 1 with Router ID 10.0.2.2

w e
Link State Database

u a
Area: 0.0.0.0
g .h
Type LinkState ID AdvRouter Age Len
i
Sequence

n n Metric
Router 10.0.3.3 10.0.3.3 973 60
r
80000027 0

lea
Router 10.0.2.2 10.0.2.2 972 60 80000028 0

://
Sum-Net 10.0.35.0 10.0.3.3 984 28 8000001D 1562

tp
Sum-Net 10.0.12.0 10.0.2.2 1035 28 80000022 1562
Sum-Net 10.0.1.0 10.0.2.2
t
1035 28 80000022 1562

s :h
e
Area: 0.0.0.2
Type LinkState ID
r c
AdvRouter Age Len Sequence Metric

ou
Router 10.0.2.2 10.0.2.2 1046 48 80000024 1562
Router 10.0.1.1

es
10.0.1.1 1063 60 80000025 0
Sum-Net 10.0.35.0
R
10.0.2.2 973 28 8000001C 3124

ing
Sum-Net 10.0.3.0 10.0.2.2 973 28 8000001C 1562
Sum-Net 10.0.2.0 10.0.2.2 1023 28 80000022 0

n
ar
Sum-Net 10.0.23.0 10.0.2.2 984 28 8000001C 1562

L e
Checkethe OSPF routing table of R3. The routes to network segments 10.0.4.0/24,
or and 10.0.14.0/24 disappear from the OSPF routing table.
10.0.5.0/24,
M[R3]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 3 Routes : 3

OSPF routing table status : <Active>


Destinations : 3 Routes : 3

HC Series HUAWEI TECHNOLOGIES 124


HCNP-IERS Chapter 1 OSPF Features and Configurations

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0


10.0.2.0/24 OSPF 10 1562 D 10.0.23.2 Serial2/0/0
10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0
e n
/
o m
. c
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 ifrom a
w e
non-backbone area.
u a
R3 does not send this LSA into Area 0 again. This is why R1 and.h R2 do not have the
route 10.0.5.0/24.
i n g
r n
[R3]display ospf lsdb

l e a
:
OSPF Process 1 with Router ID 10.0.3.3 //
Link State Database
t tp
: h
s
Area: 0.0.0.0

e
Type LinkState ID
r c
AdvRouter Age Len Sequence Metric
Router 10.0.3.3

o u 10.0.3.3 111 60 80000028 0


Router 10.0.2.2

e s 10.0.2.2 112 60 80000029 0

R
Sum-Net 10.0.35.0 10.0.3.3 122 28 8000001E 1562

g
Sum-Net 10.0.12.0 10.0.2.2 175 28 80000023 1562
Sum-Net
i n
10.0.1.0 10.0.2.2 175 28 80000023 1562

a rn
e
Area: 0.0.0.1
Type

e L LinkState ID AdvRouter Age Len Sequence Metric

r
Router 10.0.5.5 10.0.5.5 117 48 8000001E 1562

o
Router 10.0.3.3 10.0.3.3 117 48 80000020 1562

M Sum-Net
Sum-Net
10.0.12.0
10.0.3.0
10.0.3.3
10.0.3.3
107 28
128 28
8000001D
8000001D
3124
0
Sum-Net 10.0.2.0 10.0.3.3 107 28 8000001D 1562
Sum-Net 10.0.1.0 10.0.3.3 108 28 8000001D 3124
Sum-Net 10.0.5.0 10.0.5.5 128 28 8000001D 0
Sum-Net 10.0.23.0 10.0.3.3 124 28 8000001D 1562

HC Series HUAWEI TECHNOLOGIES 125


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.

Check the OSPF routing table of R5.


[R5]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
e n
Destinations : 5 Routes : 5
/
o m
i.c
OSPF routing table status : <Active>
Destinations : 5 Routes : 5

w e
Destination/Mask Proto Pre Cost Flags NextHop
u
Interfacea
g .h
n
10.0.1.0/24 OSPF 10 4686 D 10.0.35.3 Serial1/0/0
10.0.2.0/24 OSPF 10 3124 D 10.0.35.3
niSerial1/0/0

r
lea
10.0.3.0/24 OSPF 10 1562 D 10.0.35.3 Serial1/0/0

//
10.0.12.0/24 OSPF 10 4686 D 10.0.35.3 Serial1/0/0
10.0.23.0/24 OSPF 10 3124 D
:
10.0.35.3

p
Serial1/0/0

t t
:h
OSPF routing table status : <Inactive>
Destinations : 0
s
Routes : 0

e
r c
ou
[R5]display ospf lsdb

es
OSPF Process 1 with Router ID 10.0.5.5

R
Link State Database

i n g
n Area: 0.0.0.0
Type
ar
LinkState ID AdvRouter Age Len Sequence Metric
Router
Le 10.0.5.5 10.0.5.5 820 36 80000002 0

re
Sum-Net 10.0.35.0 10.0.5.5 861 28 80000001 1562

o
M
Type LinkState ID
Area: 0.0.0.1
AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 1096 48 80000003 1562
Router 10.0.3.3 10.0.3.3 1097 48 80000002 1562
Sum-Net 10.0.12.0 10.0.3.3 1129 28 80000001 3124
Sum-Net 10.0.3.0 10.0.3.3 1129 28 80000001 0
Sum-Net 10.0.2.0 10.0.3.3 1129 28 80000001 1562
Sum-Net 10.0.1.0 10.0.3.3 1129 28 80000001 3124
Sum-Net 10.0.5.0 10.0.5.5 861 28 80000001 0

HC Series HUAWEI TECHNOLOGIES 126


HCNP-IERS Chapter 1 OSPF Features and Configurations

Sum-Net 10.0.23.0 10.0.3.3 1129 28 80000001 1562

R5 does not have routes to network segments 10.0.4.0/24 and 10.0.14.0/24.

R5 has the route to Loopback0 of R3.

R3 has a physical interface connected to Area 0 and can exchange routing


information with other routers in Area 0. In this situation, R3 does not add the routes
e n
learned through Type 3 LSAs from non-backbone areas to its routing table. Although /
R5 has an interface belonging to Area 0, this interface is a loopback interface, o m
whose
i . c
link type is StubNet during OSPF route calculation.
e
w displays
Check the Type 1 LSAs generated by R3. The following command output a
only information about the Type 1 LSAs.
. hu
[R3]display ospf lsdb router 10.0.3.3
i n g
r n
OSPF Process 1 with Router ID 10.0.3.3
l e a
Area: 0.0.0.0
: //
tp
Link State Database

ht
Type : Router

s :
Ls id
Adv rtr
: 10.0.3.3
: 10.0.3.3
r c e
Ls age : 732
o u
Len : 60
e s
Options : ABR
R
E
seq#
g
: 80000158

i n
rn
chksum : 0xde39

a
Link count: 3

e
* Link ID: 10.0.3.3

L
e
Data : 255.255.255.255

o r
Link Type: StubNet
Metric : 0
M Priority : Medium
* Link ID: 10.0.2.2
Data : 10.0.23.3
Link Type: P-2-P
Metric : 1562
* Link ID: 10.0.23.0
Data : 255.255.255.0
Link Type: StubNet

HC Series HUAWEI TECHNOLOGIES 127


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
e n
add the routes learned through Type 3 LSAs from non-backbone areas to its routing /
table. o m
i . c
[R5]display ospf lsdb router 10.0.5.5

w e
a
hu
OSPF Process 1 with Router ID 10.0.5.5
Area: 0.0.0.0

g .
n
Link State Database

ni
Type : Router
ar
l e
//
Ls id : 10.0.5.5
Adv rtr : 10.0.5.5
:
Ls age : 583
t tp
Len : 36

: h
Options : ABR E

e s
seq# : 80000040

r c
u
chksum : 0x6d69
Link count: 1
s o
* Link ID: 10.0.5.5
Data R e
: 255.255.255.255

i n g
Link Type: StubNet

rn
Metric : 0

a
Priority : Medium

e
L
e only one Loopback0 belonging to the backbone area. In the LSA describing
o r
R5 has

M
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.

Step 4 Connect two non-contiguous Areas 0 together.

HC Series HUAWEI TECHNOLOGIES 128


HCNP-IERS Chapter 1 OSPF Features and Configurations

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

e n
[R5]ospf /
[R5-ospf-1]area 1
o m
i.c
[R5-ospf-1-area-0.0.0.1]vlink-peer 10.0.3.3
[R5-ospf-1-area-0.0.0.1]quit

w e
a
[R5-ospf-1]quit

u
Check whether the neighbor state of the virtual link is Full. g .h
ni n
[R3]display ospf vlink
r
OSPF Process 1 with Router ID 10.0.3.3
//lea
Virtual Links
p :
t t
:h
Virtual-link Neighbor-id -> 10.0.5.5, Neighbor-State: Full

s
r
Interface: 10.0.35.3 (Serial3/0/0)
c e
ou
Cost: 1562 State: P-2-P Type: Virtual
Transit Area: 0.0.0.1
es
R
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
GR State: Normal

i n g
a rn information changes.
Observe routing
L e
e
[R3]display ip routing-table protocol ospf

r
o
Route Flags: R - relay, D - download to fib

M----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 4 Routes : 4

OSPF routing table status : <Active>


Destinations : 4 Routes : 4

Destination/Mask Proto Pre Cost Flags NextHop Interface

HC Series HUAWEI TECHNOLOGIES 129


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.0.1.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0


10.0.2.0/24 OSPF 10 1562 D 10.0.23.2 Serial2/0/0
10.0.5.0/24 OSPF 10 1562 D 10.0.35.5 Serial3/0/0
10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

e n
The preceding command output shows that R3 learns the route to 10.0.5.0/24.
/
o m
Test network connectivity. You can see that R3 can communicate with the network
i . c
segment connected to Loopback0 of R5.
w e
[R3]ping -c 1 10.0.5.5
a
PING 10.0.5.5: 56 data bytes, press CTRL_C to break

. hu
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=255 time=34 ms

i n g
--- 10.0.5.5 ping statistics ---
r n
1 packet(s) transmitted

l e a
1 packet(s) received

: //
tp
0.00% packet loss
round-trip min/avg/max = 34/34/34 ms

ht
s :
Check the LSDB of R3.
r c e
<R3>display ospf lsdb
o u
e s
R
OSPF Process 1 with Router ID 10.0.3.3

i n g
Link State Database

a rn Area: 0.0.0.0
Type
L e LinkState ID AdvRouter Age Len Sequence Metric

r e
Router 10.0.5.5 10.0.5.5 1098 48 80000005 0

o
Router 10.0.3.3 10.0.3.3 1096 72 80000008 0

M Router
Sum-Net
10.0.2.2
10.0.35.0
10.0.2.2
10.0.3.3
920 60
830 28
80000006
80000002
0
1562
Sum-Net 10.0.35.0 10.0.5.5 565 28 80000002 1562
Sum-Net 10.0.12.0 10.0.2.2 1124 28 80000002 1562
Sum-Net 10.0.1.0 10.0.2.2 1110 28 80000002 1562

Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 1098 48 80000004 1562

HC Series HUAWEI TECHNOLOGIES 130


HCNP-IERS Chapter 1 OSPF Features and Configurations

Router 10.0.3.3 10.0.3.3 1096 48 80000003 1562


Sum-Net 10.0.12.0 10.0.3.3 830 28 80000002 3124
Sum-Net 10.0.3.0 10.0.3.3 831 28 80000002 0
Sum-Net 10.0.2.0 10.0.3.3 831 28 80000002 1562
Sum-Net 10.0.1.0 10.0.3.3 831 28 80000002 3124
Sum-Net 10.0.5.0 10.0.5.5 566 28 80000002 0
Sum-Net 10.0.23.0 10.0.3.3 831 28 80000002 1562

e n
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
o m
link. The second Type 1 LSA is learned in Area 1 and already exists before the
i . cvirtual
link is established. The route to 10.0.5.0/24 is calculated through the LSAelearned in
aw
Area 0.
hu
Check detailed information about the Type 1 LSA 10.0.5.5 in g
.
the LSDB of R3.

ni n
[R3]display ospf lsdb router 10.0.5.5

ar
/ l e
OSPF Process 1 with Router ID 10.0.3.3
: /
tp
Area: 0.0.0.0
Link State Database

ht
s :
Type
Ls id
: Router
: 10.0.5.5
r c e
Adv rtr : 10.0.5.5
o u
Ls age : 621
es
Len : 48
R
Options
seq#
: ABR

i n g
: 80000005
E

chksum
rn
: 0x1291

a
L e
Link count: 2
* Link ID: 10.0.5.0

r e
Data : 255.255.255.0

o Link Type: StubNet

M Metric : 0
Priority : Low
* Link ID: 10.0.3.3
Data : 10.0.35.5
Link Type: Virtual
Metric : 1562
Area: 0.0.0.1
Link State Database

HC Series HUAWEI TECHNOLOGIES 131


HCNP-IERS Chapter 1 OSPF Features and Configurations

Type : Router
Ls id : 10.0.5.5
Adv rtr : 10.0.5.5
Ls age : 621
Len : 48
Options : ABR VIRTUAL E
seq# : 80000004
chksum : 0x3530
e n
Link count: 2
/
* Link ID: 10.0.3.3
o m
i.c
Data : 10.0.35.5
Link Type: P-2-P
Metric : 1562
w e
* Link ID: 10.0.35.0
u a
Data : 255.255.255.0

g .h
n
Link Type: StubNet
Metric : 1562
ni
r
lea
Priority : Low

: //
t t p
The preceding command output shows that this LSA describes the network

hnetwork segment between R3 and R5.


10.0.5.0/24. Therefore, R3 has the corresponding route. The Type 1 LSA learned in
:
s
Area 1 describes only the interconnected
e
r c
Check the LSDB of R5.
o u
[R5]display ospf lsdb
e s
R
n g
OSPF Process 1 with Router ID 10.0.5.5

i
rn
Link State Database

e a
L
Area: 0.0.0.0
Type

r e LinkState ID AdvRouter Age Len Sequence Metric

o
Router 10.0.5.5 10.0.5.5 577 48 80000005 0

M
Router 10.0.3.3 10.0.3.3 577 72 80000008 0
Router 10.0.2.2 10.0.2.2 401 60 80000006 0
Sum-Net 10.0.35.0 10.0.5.5 45 28 80000002 1562
Sum-Net 10.0.35.0 10.0.3.3 312 28 80000002 1562
Sum-Net 10.0.12.0 10.0.2.2 606 28 80000002 1562
Sum-Net 10.0.1.0 10.0.2.2 593 28 80000002 1562

Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric

HC Series HUAWEI TECHNOLOGIES 132


HCNP-IERS Chapter 1 OSPF Features and Configurations

Router 10.0.5.5 10.0.5.5 578 48 80000004 1562


Router 10.0.3.3 10.0.3.3 578 48 80000003 1562
Sum-Net 10.0.12.0 10.0.3.3 313 28 80000002 3124
Sum-Net 10.0.3.0 10.0.3.3 313 28 80000002 0
Sum-Net 10.0.2.0 10.0.3.3 313 28 80000002 1562
Sum-Net 10.0.1.0 10.0.3.3 313 28 80000002 3124
Sum-Net 10.0.5.0 10.0.5.5 46 28 80000002 0
Sum-Net 10.0.23.0 10.0.3.3 313 28 80000002 1562

e n
/
You can see that the LSDB of R5 is the same as that of R3. After the virtual link is
o m
established, R3 and R5 both have interfaces that belong to Area 0. Therefore,
i . c their
LSDBs are synchronized.
w e
Step 5 Connect Area 3 to Area 0 through a virtual link.u
a
. h
Configure a virtual link on R1 and R2.
i n g
r n
[R1]ospf 1

l e a
//
[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
t tp
[R1-ospf-1]quit

: h
e s
c
[R2]ospf
[R2-ospf-1]area 2
ur
s o
[R2-ospf-1-area-0.0.0.2]vlink-peer 10.0.1.1

[R2-ospf-1]quit
R e
[R2-ospf-1-area-0.0.0.2]quit

i n g
a
Check the OSPFrnrouting table of R4.
L e
r e
[R4]display ip routing-table protocol ospf

o
Route Flags: R - relay, D - download to fib

M----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 7 Routes : 7

OSPF routing table status : <Active>


Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

HC Series HUAWEI TECHNOLOGIES 133


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.0.1.0/24 OSPF 10 1562 D 10.0.14.1 Serial1/0/0


10.0.2.0/24 OSPF 10 3124 D 10.0.14.1 Serial1/0/0
10.0.3.0/24 OSPF 10 4686 D 10.0.14.1 Serial1/0/0
10.0.5.0/24 OSPF 10 6248 D 10.0.14.1 Serial1/0/0
10.0.12.0/24 OSPF 10 3124 D 10.0.14.1 Serial1/0/0
10.0.23.0/24 OSPF 10 4686 D 10.0.14.1 Serial1/0/0
10.0.35.0/24 OSPF 10 6248 D 10.0.14.1 Serial1/0/0

e n
OSPF routing table status : <Inactive>
/
Destinations : 0 Routes : 0
o m
e i.c
The preceding command output shows that R4 has network-wide routes.
aw
u
.h
Test network connectivity.
[R4]ping -c 1 10.0.5.5
i n g
PING 10.0.5.5: 56 data bytes, press CTRL_C to break
r n
lea
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=252 time=132 ms

--- 10.0.5.5 ping statistics ---


: //
1 packet(s) transmitted
t t p
:h
1 packet(s) received
0.00% packet loss

e s
c
round-trip min/avg/max = 132/132/132 ms
r
s ou
Check the LSDB of R1.
Re
[R1]display ospf lsdb

i n g
n
ar
OSPF Process 1 with Router ID 10.0.1.1

Le
Link State Database

r e Area: 0.0.0.0

o
Type LinkState ID AdvRouter Age Len Sequence Metric

MRouter
Router
10.0.5.5
10.0.3.3
10.0.5.5
10.0.3.3
419 48
418 72
80000006
80000009
0
0
Router 10.0.2.2 10.0.2.2 232 72 8000000A 0
Router 10.0.1.1 10.0.1.1 233 36 80000001 1562
Sum-Net 10.0.35.0 10.0.3.3 151 28 80000003 1562
Sum-Net 10.0.35.0 10.0.5.5 1687 28 80000002 1562
Sum-Net 10.0.14.0 10.0.1.1 291 28 80000001 1562
Sum-Net 10.0.12.0 10.0.1.1 291 28 80000001 1562

HC Series HUAWEI TECHNOLOGIES 134


HCNP-IERS Chapter 1 OSPF Features and Configurations

Sum-Net 10.0.12.0 10.0.2.2 444 28 80000003 1562


Sum-Net 10.0.1.0 10.0.1.1 291 28 80000001 0
Sum-Net 10.0.1.0 10.0.2.2 430 28 80000003 1562
Sum-Net 10.0.4.0 10.0.1.1 291 28 80000001 1562

Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.2.2 10.0.2.2 235 48 80000005 1562
Router 10.0.1.1 10.0.1.1 234 60 80000009 0
e n
Sum-Net 10.0.35.0 10.0.2.2 151 28 80000003 3124
/
Sum-Net 10.0.14.0 10.0.1.1 291 28 80000001 1562
o m
i.c
Sum-Net 10.0.3.0 10.0.2.2 234 28 80000003 1562
Sum-Net
Sum-Net
10.0.2.0
10.0.5.0
10.0.2.2
10.0.2.2
443 28
402 28
80000003
80000002
0
3124
w e
Sum-Net 10.0.4.0 10.0.1.1 292 28 80000001 1562
u a
Sum-Net 10.0.23.0 10.0.2.2 286 28 80000003

g .h
1562

Area: 0.0.0.3
ni n
r
lea
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.4.4 10.0.4.4 1193 60 80000005 0
Router 10.0.1.1 10.0.1.1 292 48
: //80000004 1562
Sum-Net 10.0.35.0 10.0.1.1

t t p
292 28 80000001 4686

:h
Sum-Net 10.0.12.0 10.0.1.1 294 28 80000001 1562

es
Sum-Net 10.0.3.0 10.0.1.1 294 28 80000001 3124

c
Sum-Net 10.0.2.0 10.0.1.1 294 28 80000001 1562

r
ou
Sum-Net 10.0.1.0 10.0.1.1 294 28 80000001 0
Sum-Net 10.0.5.0 10.0.1.1 294 28 80000001 4686
Sum-Net 10.0.23.0
es
10.0.1.1 294 28 80000001 3124

R
i n g
Because a virtual link is created, R1 has LSAs of Area 0. Then Area 0 and Area 3 can

a rn directly. R1 uses a Type 3 LA to advertise routing information about


exchange routes

L eArea 3.
Area 0 into
r ethe LSDB of R4.
o
Check
M[R4]display ospf lsdb

OSPF Process 1 with Router ID 10.0.4.4


Link State Database

Area: 0.0.0.3
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.4.4 10.0.4.4 1303 60 80000005 0

HC Series HUAWEI TECHNOLOGIES 135


HCNP-IERS Chapter 1 OSPF Features and Configurations

Router 10.0.1.1 10.0.1.1 404 48 80000004 1562


Sum-Net 10.0.35.0 10.0.1.1 404 28 80000001 4686
Sum-Net 10.0.12.0 10.0.1.1 404 28 80000001 1562
Sum-Net 10.0.3.0 10.0.1.1 404 28 80000001 3124
Sum-Net 10.0.2.0 10.0.1.1 404 28 80000001 1562
Sum-Net 10.0.1.0 10.0.1.1 405 28 80000001 0
Sum-Net 10.0.5.0 10.0.1.1 405 28 80000001 4686
Sum-Net 10.0.23.0 10.0.1.1 405 28 80000001 3124

e n
/
The preceding command output shows that R4 learns the Type 3 LSA advertised by
o m
R1.
i . c
R4 has routes of other areas.
w e
a
Step 6 Configure inter-area route filtering.
. hu
Control advertisement of the route to 10.0.4.0/24 so that R1 i n gcan learn this route but
r n
R2, R3, and R5 cannot.
l e a
Configure an ACL.
: //
t tp
h
[R1]acl number 2000

:
[R1-acl-basic-2000]rule deny source 10.0.4.0 0.0.0.255
s
[R1-acl-basic-2000]rule permit
[R1-acl-basic-2000]permit
r c e
o u
e s on R1 when R1 sends routing updates from Area 3 to
R
Configure Type 3 LSA filtering
other areas.
i n g
[R1]ospf 1

a rn
L e
[R1-ospf-1]area 3
[R1-ospf-1-area-0.0.0.3]filter 2000 export

r e
[R1-ospf-1-area-0.0.0.3]quit

o
[R1-ospf-1]quit

M
Check route filtering on R2.
[R2]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5

HC Series HUAWEI TECHNOLOGIES 136


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF routing table status : <Active>


Destinations : 5 Routes : 5

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 OSPF 10 1562 D 10.0.12.1 Serial1/0/0


10.0.3.0/24 OSPF 10 1562 D 10.0.23.3 Serial2/0/0
10.0.5.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0
e n
10.0.14.0/24 OSPF 10 3124 D 10.0.12.1 Serial1/0/0
/
10.0.35.0/24 OSPF 10 3124 D 10.0.23.3 Serial2/0/0
o m
OSPF routing table status : <Inactive>
e i.c
Destinations : 0 Routes : 0

aw
u
R2 cannot learn the route 10.0.4.0/24.
g .h
i n
R1 still has this route. This is because R1 and R4 belong to the same area and R4 uses
n
r
lea
a Type 1 LSA to advertise this route to R1.
[R1]display ip routing-table protocol ospf

: //
Route Flags: R - relay, D - download to fib

t t p
----------------------------------------------------------------------------
Public routing table : OSPF

s :h
Destinations : 6
e
Routes : 6

r c
ou
OSPF routing table status : <Active>
Destinations : 6
es Routes : 6

R
ing
Destination/Mask Proto Pre Cost Flags NextHop Interface

n
ar
10.0.2.0/24 OSPF 10 1562 D 10.0.12.2 Serial1/0/0

Le
10.0.3.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0
10.0.4.0/24 OSPF 10 1562 D 10.0.14.4 Serial3/0/0

r e10.0.5.0/24 OSPF 10 4686 D 10.0.12.2 Serial1/0/0

o 10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0

M 10.0.35.0/24 OSPF 10 4686 D 10.0.12.2 Serial1/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

----End

HC Series HUAWEI TECHNOLOGIES 137


HCNP-IERS Chapter 1 OSPF Features and Configurations

Additional Exercises: Analysis and Verification

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

e n
/
[V200R007C00SPC600]

m
#
sysname R1
o
#
acl number 2000
e i.c
rule 5 deny source 10.0.4.0 0.0.0.255
aw
rule 10 permit
u
#
g .h
interface Serial1/0/0

ni n
r
link-protocol ppp

lea
ip address 10.0.12.1 255.255.255.0

//
#
interface Serial3/0/0
p :
link-protocol ppp
t t
:h
ip address 10.0.14.1 255.255.255.0
#
e s
interface LoopBack0
r c
ou
ip address 10.0.1.1 255.255.255.0
ospf network-type broadcast

es
R
#

g
ospf 1 router-id 10.0.1.1
area 0.0.0.0

n i n
ar
area 0.0.0.2

e
network 10.0.1.1 0.0.0.0

L
network 10.0.12.1 0.0.0.0

e
or
vlink-peer 10.0.2.2
area 0.0.0.3

M filter 2000 export


network 10.0.14.1 0.0.0.0
#
return

<R2>display current-configuration
[V200R007C00SPC600]
#

HC Series HUAWEI TECHNOLOGIES 138


HCNP-IERS Chapter 1 OSPF Features and Configurations

sysname R2
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.2 255.255.255.0
#
interface Serial2/0/0
link-protocol ppp
ip address 10.0.23.2 255.255.255.0
e n
#
/
interface LoopBack0
o m
i.c
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
w e
ospf 1 router-id 10.0.2.2
u a
area 0.0.0.0

g .h
n
network 10.0.23.2 0.0.0.0
network 10.0.2.2 0.0.0.0
ni
r
lea
area 0.0.0.2
network 10.0.12.2 0.0.0.0
vlink-peer 10.0.1.1
: //
#

t t p
:h
return

e s
c
<R3>display current-configuration

r
ou
[V200R007C00SPC600]
#
sysname R3
es
#
R
interface Serial2/0/0

i n g
link-protocol ppp
n
ar
ip address 10.0.23.3 255.255.255.0

e
L
#

e
interface Serial3/0/0

or
link-protocol ppp

M
ip address 10.0.35.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 139


HCNP-IERS Chapter 1 OSPF Features and Configurations

network 10.0.23.3 0.0.0.0


area 0.0.0.1
network 10.0.35.3 0.0.0.0
vlink-peer 10.0.5.5
#
return

<R4>display current-configuration
[V200R007C00SPC600]
e n
#
/
sysname R4
o m
i.c
#
interface Serial1/0/0
link-protocol ppp
w e
ip address 10.0.14.4 255.255.255.0
u a
#

g .h
n
interface LoopBack0
ip address 10.0.4.4 255.255.255.0
ni
r
lea
ospf network-type broadcast
#
ospf 1 router-id 10.0.4.4
: //
area 0.0.0.3

t t p
:h
network 10.0.14.4 0.0.0.0

s
network 10.0.4.4 0.0.0.0
#

r c e
ou
return

es
<R5>display current-configuration
[V200R007C00SPC600]
R
#

i n g
sysname R5
n
#

e ar
L
interface Serial1/0/0

e
link-protocol ppp

or
ip address 10.0.35.5 255.255.255.0

M
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.5.5
area 0.0.0.0
network 10.0.5.5 0.0.0.0
area 0.0.0.1

HC Series HUAWEI TECHNOLOGIES 140


HCNP-IERS Chapter 1 OSPF Features and Configurations

network 10.0.35.5 0.0.0.0


vlink-peer 10.0.3.3
#
return

Lab 1-6 OSPF Troubleshooting

e n
Learning Objectives
/
o m
i.c
The objectives of this lab are to learn and understand:

 How to troubleshoot inconsistent area IDs in a single OSPF area


w e
How to troubleshoot unmatched masks in a single OSPFa

hu area

g .
How to troubleshoot inconsistent Hello intervals in a single OSPF area

n i n

r
How to troubleshoot conflicting router IDs in a single OSPF area
afailures
How to troubleshoot OSPF authentication
l e
//

p :
How to troubleshoot OSPF route summarization failures
t

How to troubleshoot virtual linkt failures


: h
e s
Topology
r c
o u
es
R
i n g
a rn
L e
r e
o
M

Figure 1-6 OSPF troubleshooting

HC Series HUAWEI TECHNOLOGIES 141


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
e n
network. /
o m
Tasks
e i.c
Step 1 Set basic parameters and configure IP addresses.aw

. humask for all


i
loopback interfaces to simulate an independent network segment.n g
Configure IP addresses and masks for all the routers. Set a 24-bit

r n
<R1>system-view

l e a
//
Enter system view, return user view with Ctrl+Z.

:
tp
[R1]interface Serial 1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 24

ht
:
[R1-Serial1/0/0]quit
[R1]interface LoopBack 0
e s
r c
[R1-LoopBack0]ip address 10.1.1.1 24
[R1-LoopBack0]quit
o u
es
<R2>system-view
R
i n g
Enter system view, return user view with Ctrl+Z.
[R2]interface Serial 1/0/0

rn
[R2-Serial1/0/0]ip address 10.0.12.2 24

a
L e
[R2-Serial1/0/0]quit
[R2]interface Serial 2/0/0

r e
[R2-Serial2/0/0]ip address 10.0.23.2 24

o
[R2-Serial2/0/0]quit

M[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24
[R2-LoopBack0]quit

To simulate failures, configure an IP address 10.0.75.3/25 for G0/0/0 of R3 and


configure IP addresses for other interfaces according to the topology.

HC Series HUAWEI TECHNOLOGIES 142


HCNP-IERS Chapter 1 OSPF Features and Configurations

<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface Serial 2/0/0
[R3-Serial2/0/0]ip address 10.0.23.3 24
[R3-Serial2/0/0]quit
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.0.75.3 25
[R3-GigabitEthernet0/0/0]quit
[R3]interface LoopBack 0
e n
[R3-LoopBack0]ip address 10.0.3.3 24
/
[R3-LoopBack0]quit
o m
<R4>system-view
e i.c
Enter system view, return user view with Ctrl+Z.

aw
[R4]interface GigabitEthernet 0/0/0
u
[R4-GigabitEthernet0/0/0]ip address 10.0.75.4 24

g .h
n
[R4-GigabitEthernet0/0/0]quit
[R4]interface LoopBack 0
ni
r
lea
[R4-LoopBack0]ip address 10.1.4.4 24
[R4-LoopBack0]quit

: //
<R5>system-view

t t p
:h
Enter system view, return user view with Ctrl+Z.

s
[R5]interface GigabitEthernet 0/0/0

c e
[R5-GigabitEthernet0/0/0]ip address 10.0.75.5 24

r
ou
[R5-GigabitEthernet0/0/0]quit
[R5]interface LoopBack 0

es
[R5-LoopBack0]ip address 10.0.5.5 24
[R5-LoopBack0]quit
R
i n g
a rn
After the configurations are complete, test direct link connectivity.

L e
[R3]ping -c 1 10.0.75.4

r e
PING 10.0.75.4: 56 data bytes, press CTRL_C to break

o Reply from 10.0.75.4: bytes=56 Sequence=1 ttl=255 time=5 ms

M --- 10.0.75.4 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 5/5/5 ms

[R3]ping -c 1 10.0.75.5

HC Series HUAWEI TECHNOLOGIES 143


HCNP-IERS Chapter 1 OSPF Features and Configurations

PING 10.0.75.5: 56 data bytes, press CTRL_C to break


Reply from 10.0.75.5: bytes=56 Sequence=1 ttl=255 time=5 ms

--- 10.0.75.5 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 5/5/5 ms

e n
[R3]ping -c 1 10.0.23.2
/
PING 10.0.23.2: 56 data bytes, press CTRL_C to break
o m
i.c
Reply from 10.0.23.2: bytes=56 Sequence=1 ttl=255 time=41 ms

--- 10.0.23.2 ping statistics ---


w e
1 packet(s) transmitted
u a
1 packet(s) received

g .h
n
0.00% packet loss
round-trip min/avg/max = 41/41/41 ms
ni
r
[R1]ping -c 1 10.0.12.2

//lea
:
PING 10.0.12.2: 56 data bytes, press CTRL_C to break

p
t
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=37 ms

t
--- 10.0.12.2 ping statistics ---
s:h
1 packet(s) transmitted

r c e
ou
1 packet(s) received
0.00% packet loss

es
round-trip min/avg/max = 37/37/37 ms

R
i n g
Step 2 Configure multiple OSPF areas.
rn
a
ConfigureeSerial1/0/0 and Loopback0 of R1 to belong to Area 2 and configure R1 to

e L
ofo
r
use the address of Loopback0 as its router ID. To enable OSPF to advertise real masks
loopback interfaces, change the OSPF network type of loopback interfaces in all
Mthe areas to broadcast.
[R1]ospf 1 router-id 10.1.1.1
[R1-ospf-1]area 2
[R1-ospf-1-area-0.0.0.2]network 10.0.12.1 0.0.0.0
[R1-ospf-1-area-0.0.0.2]network 10.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.2]quit
[R1-ospf-1]quit

HC Series HUAWEI TECHNOLOGIES 144


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1]interface LoopBack 0
[R1-LoopBack0]ospf network-type broadcast
[R1-LoopBack0]quit

On R2, configure Serial2/0/0 and Loopback0 to belong to Area 1 and Serial1/0/0 to


belong to Area 2. Do not specify a router ID when enabling OSPF.
[R2]ospf 1

e n
[R2-ospf-1]area 1
/
[R2-ospf-1-area-0.0.0.1]network 10.0.23.2 0.0.0.0

o m
i.c
[R2-ospf-1-area-0.0.0.1]network 10.0.2.2 0.0.0.0

e
[R2-ospf-1-area-0.0.0.1]quit

w
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]network 10.0.12.2 0.0.0.0
u a
.h
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit
[R2]interface LoopBack 0
i n g
[R2-LoopBack0]ospf network-type broadcast
r n
lea
[R2-LoopBack0]quit

: //
t t p
On R3, configure Serial2/0/0 and Loopback0 to belong to Area 1 and
GigabitEthernet 0/0/0 to belong to Areah
s : 0.
[R3]ospf 1 router-id 10.0.3.3
r c e
[R3-ospf-1]area 1

o u
s
[R3-ospf-1-area-0.0.0.1]network 10.0.23.3 0.0.0.0

Re
[R3-ospf-1-area-0.0.0.1]network 10.0.3.3 0.0.0.0

i
[R3-ospf-1]area 0
n g
[R3-ospf-1-area-0.0.0.1]quit

rn
[R3-ospf-1-area-0.0.0.0]network 10.0.75.3 0.0.0.0

a
e
[R3-ospf-1-area-0.0.0.0]quit

L
[R3-ospf-1]quit

e
o r
[R3]interface LoopBack 0
[R3-LoopBack0]ospf network-type broadcast

M[R3-LoopBack0]quit

On R4, configure GigabitEthernet0/0/0 to belong to Area 1 and Loopback0 not to


belong to any area. When configuring an OSPF process, run the ospf 1 router-id
command to specify a router ID 10.0.5.5 for R4.
[R4]ospf 1 router-id 10.0.5.5

HC Series HUAWEI TECHNOLOGIES 145


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]network 10.0.75.4 0.0.0.0
[R4-ospf-1-area-0.0.0.1]quit
[R4-ospf-1]quit

On R5, configure GigabitEthernet 0/0/0 and Loopback0 to belong to Area 0.


[R5]ospf 1 router-id 10.0.5.5

e n
/
[R5-ospf-1]area 0

m
[R5-ospf-1-area-0.0.0.0]network 10.0.75.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 10.0.5.5 0.0.0.0
o
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
e i.c
[R5]interface LoopBack 0
aw
u
.h
[R5-LoopBack0]ospf network-type broadcast

g
[R5-LoopBack0]quit

ni n
Step 3 Troubleshoot OSPF failures in areas.ar
/ l e
/ does not establish neighbor
Check the neighbor list of R4. You can see that :R4
relationships with other routers. t tp
: h
[R4]display ospf peer

e s
r c
u
OSPF Process 1 with Router ID 10.0.5.5

o
e s
R command on R3, R4, and R5 to check OSPF errors.
Run the display ospf error

i n g
[R3]display ospf error

a rn
L e
OSPF Process 1 with Router ID 10.0.3.3
OSPF error statistics

r e
o
General packet errors:

M 0
0
: IP: received my own packet 11
: Bad version 0
: Bad packet
: Bad checksum
41 : Bad area id 0 : Drop on unnumbered interface
0 : Bad virtual link 0 : Bad authentication type
0 : Bad authentication key 0 : Packet too small
0 : Packet size > ip length 0 : Transmit error
2 : Interface down 0 : Unknown neighbor
0 : Bad net segment 0 : Extern option mismatch

HC Series HUAWEI TECHNOLOGIES 146


HCNP-IERS Chapter 1 OSPF Features and Configurations

0 : Router id confusion 0 : Bad authentication sequence number

HELLO packet errors:


227 : Netmask mismatch 0 : Hello timer mismatch
0 : Dead timer mismatch 0 : Virtual neighbor unknown
0 : NBMA neighbor unknown 0 : Invalid Source Address

[R4]display ospf error

e n
OSPF Process 1 with Router ID 10.0.5.5
/
OSPF error statistics
o m
General packet errors:
e i.c
0 : IP: received my own packet 0 : Bad packet

aw
0 : Bad version 0 : Bad checksum
u
245 : Bad area id 0
.h
: Drop on unnumbered interface

g
n
0 : Bad virtual link 0 : Bad authentication type
0 : Bad authentication key 0 : Packet too small
ni
r
lea
0 : Packet size > ip length 0 : Transmit error
2 : Interface down 0 : Unknown neighbor
0 : Bad net segment 0
: //
: Extern option mismatch
235 : Router id confusion 0
t p
: Bad authentication sequence number

t
[R5]display ospf error
s :h
r c e
ou
OSPF Process 1 with Router ID 10.0.5.5
OSPF error statistics

es
General packet errors:
R
0
n g
: IP: received my own packet 260

i
: Bad packet
0
n
: Bad version 0 : Bad checksum
0
ar
: Bad area id 0 : Drop on unnumbered interface

Le
0 : Bad virtual link 0 : Bad authentication type

re
0 : Bad authentication key 0 : Packet too small
0
o : Packet size > ip length 0 : Transmit error

M
0
0
: Interface down
: Bad net segment
0
0
: Unknown neighbor
: Extern option mismatch
286 : Router id confusion 0 : Bad authentication sequence number

HELLO packet errors:


260 : Netmask mismatch 0 : Hello timer mismatch
0 : Dead timer mismatch 0 : Virtual neighbor unknown
0 : NBMA neighbor unknown 0 : Invalid Source Address

HC Series HUAWEI TECHNOLOGIES 147


HCNP-IERS Chapter 1 OSPF Features and Configurations

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
e n
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.
o m
i . csubnet
A subnet mask error also indicates a type of error packet. You can rectify the
w e
mask error and then check whether error packets still exist.
a
.
First, solve the router ID conflict. Check the router ID of each router hu in sequence to
manually locate the router with the router ID or check system
i n glogs to locate the
r n system logs.
router. Run the display logbuffer command to check current

l e a
[R5]display logbuffer

: //
tp
Logging buffer configuration and contents: enabled
Allowed max buffer size: 1024

ht
Actual buffer size: 512

s :
e
Channel number: 4, Channel name: logbuffer
Dropped messages: 0
r c
Overwritten messages: 0
o u
Current messages: 66
e s
R
i n g
Oct 26 2016 12:34:51+00:00 R5 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[12]:OSPF Router id
conflict is detected on interface. (ProcessId=1, RouterId=10.0.5.5, AreaId=0.0.0.0,

rn
InterfaceName=GigabitEthernet0/0/0, IpAddr=10.0.75.5, PacketSrcIp=10.0.75.4)

a
L e
r e
The preceding command output of R5 shows that a router ID conflict is detected on
ointerface with IP address 10.0.75.4. According to the topology, 10.0.75.4 is the
the
Minterface address of R4. Check the router ID of R4, finding that its router ID is the
same as that of R5. Additionally, the area ID configuration of R4 is also incorrect.
[R4]display ospf brief

OSPF Process 1 with Router ID 10.0.5.5


OSPF Protocol Information

HC Series HUAWEI TECHNOLOGIES 148


HCNP-IERS Chapter 1 OSPF Features and Configurations

RouterID: 10.0.5.5 Border Router:


Multi-VPN-Instance is not enabled
Global DS-TE Mode: Non-Standard IETF Mode
Graceful-restart capability: disabled
Helper support capability : not configured
Applications Supported: MPLS Traffic-Engineering
Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms
Default ASE parameters: Metric: 1 Tag: 1 Type: 2
Route Preference: 10
e n
ASE Route Preference: 150
/
SPF Computation Count: 2
o m
i.c
RFC 1583 Compatible
Retransmission limitation is disabled
Area Count: 1 Nssa Area Count: 0
w e
ExChange/Loading Neighbors: 0
u a
Process total up interface count: 1

g .h
n
Process valid up interface count: 1

ni
r
lea
Area: 0.0.0.1 (MPLS TE not enabled)
Authtype: None Area flag: Normal
SPF scheduled Count: 2
: //
ExChange/Loading Neighbors: 0

t t p
:h
Router ID conflict state: Normal

s
Area interface up count: 1

r c e
ou
Interface: 10.0.75.4 (GigabitEthernet0/0/0)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 1
es
R
Designated Router: 10.0.75.4

n g
Backup Designated Router: 0.0.0.0

i
n
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

e ar
L
Change the router ID and area ID of R4.
e
or
[R4]ospf 1 router-id 10.1.4.4

M
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]undo network 10.0.75.4 0.0.0.0
[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]network 10.0.75.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit

HC Series HUAWEI TECHNOLOGIES 149


HCNP-IERS Chapter 1 OSPF Features and Configurations

<R4>reset ospf process


Warning: The OSPF process will be reset. Continue? [Y/N]:y

Run the reset ospf counter command to clear OSPF statistics.

The reset command must be used in the user view.


<R4>reset ospf counters
e n
/
o mthe
Wait for a while and then run the display ospf error command to check whether
i . c
problem of router ID conflict and incorrect area ID is solved.
w e
a
hu
<R4>display ospf error

g .
n
OSPF Process 1 with Router ID 10.1.4.4
OSPF error statistics
ni
ar
General packet errors:
l e
0 : IP: received my own packet 13
: //
: Bad packet
0 : Bad version 0

t tp
: Bad checksum
0 : Bad area id 0

: h : Drop on unnumbered interface

s
0 : Bad virtual link 0 : Bad authentication type
0 : Bad authentication key

r c
0
e : Packet too small

u
0 : Packet size > ip length 0 : Transmit error
0 : Interface down
s o 0 : Unknown neighbor
0
0
: Bad net segment

R e
: Router id confusion
0
0
: Extern option mismatch
: Bad authentication sequence number

i n g
rn
HELLO packet errors:
13

e a
: Netmask mismatch 0 : Hello timer mismatch

L
0 : Dead timer mismatch 0 : Virtual neighbor unknown
0

r e
: NBMA neighbor unknown 0 : Invalid Source Address

o
MThe 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
Info: Current terminal debugging is on.

HC Series HUAWEI TECHNOLOGIES 150


HCNP-IERS Chapter 1 OSPF Features and Configurations

<R4>debugging ospf packet hello


Oct 26 2016 14:30:08.350.1+00:00 R4 RM/6/RMDEBUG:
FileID: 0xd0178024 Line: 2271 Level: 0x20
OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0
<R4>
Oct 26 2016 14:30:08.360.1+00:00 R4 RM/6/RMDEBUG: Source Address: 10.0.75.3
Oct 26 2016 14:30:08.360.2+00:00 R4 RM/6/RMDEBUG: Destination Address: 224.0.0.5
Oct 26 2016 14:30:08.360.3+00:00 R4 RM/6/RMDEBUG: Ver# 2, Type: 1 (Hello)
Oct 26 2016 14:30:08.360.4+00:00 R4 RM/6/RMDEBUG: Length: 44, Router: 10.0.3.3
e n
Oct 26 2016 14:30:08.360.5+00:00 R4 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 9a18
/
Oct 26 2016 14:30:08.360.6+00:00 R4 RM/6/RMDEBUG: AuType: 00
o m
i.c
Oct 26 2016 14:30:08.360.7+00:00 R4 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Oct 26 2016 14:30:08.360.8+00:00 R4 RM/6/RMDEBUG: Net Mask: 255.255.255.128

w
Oct 26 2016 14:30:08.360.9+00:00 R4 RM/6/RMDEBUG: Hello Int: 10, Option: _E_e
u a
Oct 26 2016 14:30:08.360.10+00:00 R4 RM/6/RMDEBUG: Rtr Priority: 1, Dead Int: 40
Oct 26 2016 14:30:08.360.11+00:00 R4 RM/6/RMDEBUG: DR: 10.0.75.3

g .h
n
Oct 26 2016 14:30:08.360.12+00:00 R4 RM/6/RMDEBUG: BDR: 0.0.0.0

ni
Oct 26 2016 14:30:08.360.13+00:00 R4 RM/6/RMDEBUG: # Attached Neighbors: 0

r
/ /lea
The preceding command output shows that the subnet mask in the Hello packet
p :
t t
sent from 10.0.75.3 is 255.255.255.128. According to the topology, the interface
configuration of R3 is incorrect.
: h
e s
c
[R3]interface GigabitEthernet 0/0/0

u r
[R3-GigabitEthernet0/0/0]display this
[V200R007C00SPC600]
s o
Re
#
interface GigabitEthernet0/0/0

n g
ip address 10.0.75.3 255.255.255.128
i
rn
#
return

e a
e L
[R3-GigabitEthernet0/0/0]ip address 10.0.75.3 24
[R3-GigabitEthernet0/0/0]quit

o r
MClear OSPF statistics again to check whether OSPF errors still exist.
<R3>reset ospf counters

<R3>display ospf error

OSPF Process 1 with Router ID 10.0.3.3


OSPF error statistics

HC Series HUAWEI TECHNOLOGIES 151


HCNP-IERS Chapter 1 OSPF Features and Configurations

General packet errors:


0 : IP: received my own packet 0 : Bad packet
0 : Bad version 0 : Bad checksum
0 : Bad area id 0 : Drop on unnumbered interface
0 : Bad virtual link 0 : Bad authentication type
0 : Bad authentication key 0 : Packet too small
0 : Packet size > ip length 0 : Transmit error
0 : Interface down 0 : Unknown neighbor
e n
0 : Bad net segment 0 : Extern option mismatch
/
0 : Router id confusion 0 : Bad authentication sequence number
o m
HELLO packet errors:
e i.c
0 : Netmask mismatch 0 : Hello timer mismatch

aw
0 : Dead timer mismatch 0 : Virtual neighbor unknown
u
0 : NBMA neighbor unknown 0 : Invalid Source Address

g .h
i n
n relationships with
r
Check the neighbor list of R3. You can see that its neighbor
a
neighbors are normal.
l e
: //
tp
[R3]display ospf peer brief

ht
:
OSPF Process 1 with Router ID 10.0.3.3

s
r c e
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface
o u Neighbor id State
0.0.0.0
e s
GigabitEthernet0/0/0 10.1.4.4 Full
0.0.0.0
R
GigabitEthernet0/0/0 10.0.5.5 Full
0.0.0.1

i n g
Serial2/0/0 10.0.2.2 Full

rn
----------------------------------------------------------------------------

a
e Hello interval of GigabitEthernet0/0/0 on R4 to 5 seconds to observe
Change Lthe
r e neighbor relationships can be established.
o
whether

M[R4]interface GigabitEthernet 0/0/0


[R4-GigabitEthernet0/0/0]ospf timer hello 5
[R4-GigabitEthernet0/0/0]quit

After about 30 seconds, you can see that all neighbor information of R4 disappears.
[R4]display ospf peer brief

HC Series HUAWEI TECHNOLOGIES 152


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF Process 1 with Router ID 10.1.4.4


Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
----------------------------------------------------------------------------

Clear OSPF statistics of R4 to check whether OSPF errors exist.

e n
/
<R4>reset ospf counters

m
<R4>system-view
Enter system view, return user view with Ctrl+Z.
o
[R4]display ospf error

e i.c
OSPF Process 1 with Router ID 10.1.4.4
aw
u
.h
OSPF error statistics

General packet errors:


i n g
0 : IP: received my own packet 4 : Bad packet
r n
lea
0 : Bad version 0 : Bad checksum

//
0 : Bad area id 0 : Drop on unnumbered interface
0 : Bad virtual link 0
p :
: Bad authentication type
0 : Bad authentication key 0
t t
: Packet too small

:h
0 : Packet size > ip length 0 : Transmit error

es
0 : Interface down 0 : Unknown neighbor
0 : Bad net segment
r c 0 : Extern option mismatch

ou
0 : Router id confusion 0 : Bad authentication sequence number

es
R
HELLO packet errors:

g
0 : Netmask mismatch 4 : Hello timer mismatch
0
i n
: Dead timer mismatch

n
0 : Virtual neighbor unknown

ar
0 : NBMA neighbor unknown 0 : Invalid Source Address

L e
e
The preceding command output shows Hello timer mismatch, indicating that Hello
or
intervals of neighbors are inconsistent.
MCancel the Hello interval configuration and then check the neighbor list again.
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]undo ospf timer hello
[R4-GigabitEthernet0/0/0]quit

[R4]display ospf peer brief

HC Series HUAWEI TECHNOLOGIES 153


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF Process 1 with Router ID 10.1.4.4


Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 10.0.3.3 Full
0.0.0.0 GigabitEthernet0/0/0 10.0.5.5 Full
----------------------------------------------------------------------------

e n
The preceding command output shows that neighbor relationships become normal.
/
o m
i.c
Step 4 Troubleshoot OSPF authentication failures.

Configure interface authentication on R1 and R2.


w e
a
Configure simple authentication on R1 and set the key to 123.
. hu
Configure MD5 authentication on R5 and set the key to huawei.
i n g
r n
[R1]interface Serial 1/0/0

l e a
//
[R1-Serial1/0/0]ospf authentication-mode simple plain 123
[R1-Serial1/0/0]quit
:
t tp
[R2]interface Serial 1/0/0

: h
s
[R2-Serial1/0/0]ospf authentication-mode md5 1 plain huawei

e
c
[R2-Serial1/0/0]quit

ur
o
s complete, clear OSPF statistics of R1 and then check
OSPF errors. R e
After the configurations are

i n g
rn
<R1>reset ospf counters

a
<R1>system-view

L e
Enter system view, return user view with Ctrl+Z.

e
[R1]display ospf error

o r
M
OSPF Process 1 with Router ID 10.1.1.1
OSPF error statistics

General packet errors:


0 : IP: received my own packet 3 : Bad packet
0 : Bad version 0 : Bad checksum
0 : Bad area id 0 : Drop on unnumbered interface
0 : Bad virtual link 3 : Bad authentication type
0 : Bad authentication key 0 : Packet too small

HC Series HUAWEI TECHNOLOGIES 154


HCNP-IERS Chapter 1 OSPF Features and Configurations

0 : Packet size > ip length 0 : Transmit error


0 : Interface down 0 : Unknown neighbor
0 : Bad net segment 0 : Extern option mismatch
0 : Router id confusion 0 : Bad authentication sequence number

Configure MD5 authentication on R1 and then check whether OSPF errors still exist.
[R1]interface Serial 1/0/0

e n
/
[R1-Serial1/0/0]ospf authentication-mode md5 1 plain 123

m
[R1-Serial1/0/0]return
<R1>reset ospf counters
o
<R1>display ospf error

e i.c
OSPF Process 1 with Router ID 10.1.1.1
aw
u
.h
OSPF error statistics

General packet errors:


i n g
0 : IP: received my own packet 9 : Bad packet
r n
lea
0 : Bad version 0 : Bad checksum

//
0 : Bad area id 0 : Drop on unnumbered interface
0 : Bad virtual link 0
p :
: Bad authentication type
9 : Bad authentication key 0
t t
: Packet too small

:h
0 : Packet size > ip length 0 : Transmit error

es
0 : Interface down 0 : Unknown neighbor
0 : Bad net segment
r c 0 : Extern option mismatch

ou
0 : Router id confusion 0 : Bad authentication sequence number

es
The preceding command R output shows that OSPF errors still exist.
i n g
rn
Change the key of R1 to huawei and then check neighbor relationships.

e a
[R1]interface Serial 1/0/0

L
[R1-Serial1/0/0]ospf authentication-mode md5 1 plain huawei

e
o r
[R1-Serial1/0/0]quit
[R1]display ospf peer brief

M OSPF Process 1 with Router ID 10.1.1.1


Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.2 Serial1/0/0 10.0.2.2 Full
----------------------------------------------------------------------------

HC Series HUAWEI TECHNOLOGIES 155


HCNP-IERS Chapter 1 OSPF Features and Configurations

The preceding command output shows that R1 and R2 have established a neighbor
relationship.

Step 5 Troubleshoot virtual link failures.

To ensure connectivity between Area 2 and Area 0, create a virtual link between R2
and R3.

e n
/
[R2]ospf 1

m
[R2-ospf-1]area 1

o
i.c
[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
w e
u a
.h
[R3]ospf 1

g
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]vlink-peer 10.0.2.2

ni n
[R3-ospf-1-area-0.0.0.1]quit
r
lea
[R3-ospf-1]quit

: //
p and whether R1 learns
Check whether the virtual link is establishedtnormally
t
network-wide routes.
: h
e s
[R2]display ospf vlink
r c
o u
s
OSPF Process 1 with Router ID 10.0.2.2

e
R
Virtual Links

i n g
Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Full

a rn
Interface: 10.0.23.2 (Serial2/0/0)

L e
Cost: 1562 State: P-2-P Type: Virtual

r e
Transit Area: 0.0.0.1

o
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1

MGR State: Normal

[R1]display ip routing-table protocol ospf


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5

OSPF routing table status : <Active>

HC Series HUAWEI TECHNOLOGIES 156


HCNP-IERS Chapter 1 OSPF Features and Configurations

Destinations : 5 Routes : 5

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.2.0/24 OSPF 10 1562 D 10.0.12.2 Serial1/0/0


10.0.3.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0
10.0.5.0/24 OSPF 10 3125 D 10.0.12.2 Serial1/0/0
10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0
10.0.75.0/24 OSPF 10 3125 D 10.0.12.2 Serial1/0/0
e n
/
OSPF routing table status : <Inactive>
o m
i.c
Destinations : 0 Routes : 0

e
wthat R1 can
Test connectivity from R1 to R5. The following command output shows a
reach R5.
. hu
[R1]ping -c 1 10.0.5.5
i n g
PING 10.0.5.5: 56 data bytes, press CTRL_C to break
r n
l e a
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=81 ms

: //
tp
--- 10.0.5.5 ping statistics ---
1 packet(s) transmitted
ht
1 packet(s) received

s :
0.00% packet loss

r c e
round-trip min/avg/max = 81/81/81 ms

o u
e smeet test requirements.
R
Delete Loopback0 of R2 to

i n g
[R2]undo interface LoopBack 0

rn
a
e because of an accident. Here, you restart an OSPF process to simulate
R2 is restarted
L
e of R2.
r
the restart
o
M
<R2>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y

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

HC Series HUAWEI TECHNOLOGIES 157


HCNP-IERS Chapter 1 OSPF Features and Configurations

PING 10.0.5.5: 56 data bytes, press CTRL_C to break


Request time out

--- 10.0.5.5 ping statistics ---


1 packet(s) transmitted
0 packet(s) received
100.00% packet loss

e n
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.
o m
[R2]display ospf vlink
e i.c
OSPF Process 1 with Router ID 10.0.23.2
aw
u
.h
Virtual Links

Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Down


i n g
r n
lea
Interface: 10.0.23.2 (Serial2/0/0)
Cost: 1562 State: P-2-P Type: Virtual
: //
Transit Area: 0.0.0.1

t t p
:h
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
GR State: Normal

e s
r con the router ID of the peer device. The router ID of
A virtual link is established based
o u
e
R2 changes, so the virtual links fails.
Rrouter ID from changing during the operation of a router, you
Generally, to prevent
i n g a

rn
need to specify a router ID for this router when starting an OSPF process.
a
On R2, setethe router ID to 10.0.2.2, add the address of Loopback0, and then restart

e Lprocess.
or
the OSPF

M
[R2]ospf 1 router-id 10.0.2.2
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]ip address 10.0.2.2 24
[R2-LoopBack0]quit
<R2>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y

HC Series HUAWEI TECHNOLOGIES 158


HCNP-IERS Chapter 1 OSPF Features and Configurations

Check the virtual link status again.


[R2]display ospf vlink

OSPF Process 1 with Router ID 10.0.2.2


Virtual Links

Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Full

e n
Interface: 10.0.23.2 (Serial2/0/0)
/
Cost: 1562 State: P-2-P Type: Virtual

o m
i.c
Transit Area: 0.0.0.1
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
GR State: Normal
w e
u a
The virtual link has recovered.
g .h
For security, the administrator uses area authentication n i n
ar in Area 0, enable MD5

l e
encryption to encrypt packets, and set the key to huawei.

: //
tp
[R3]ospf 1
[R3-ospf-1]area 0

ht
:
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei
[R3-ospf-1-area-0.0.0.0]quit
e s
[R3-ospf-1]quit
r c
o u
[R4]ospf 1

e s
[R4-ospf-1]area 0
R
i n g
[R4-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei
[R4-ospf-1-area-0.0.0.0]quit

rn
[R4-ospf-1]quit

a
L e
[R5]ospf 1

r e
[R5-ospf-1]area 0

o
[R5-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei

M[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.
[R2]display ospf vlink

HC Series HUAWEI TECHNOLOGIES 159


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF Process 1 with Router ID 10.0.2.2


Virtual Links

Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Down

Interface: 10.0.23.2 (Serial2/0/0)


Cost: 1562 State: P-2-P Type: Virtual
Transit Area: 0.0.0.1
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
e n
/
o m
Clear OSPF statistics and then check OSPF errors. The following command output
i . c
shows that authentication errors occur.
w e
<R2>reset ospf counters
a
<R2>display ospf error
. hu
OSPF Process 1 with Router ID 10.0.2.2
i n g
OSPF error statistics
r n
l e a
General packet errors:
: //
tp
0 : IP: received my own packet 7 : Bad packet
0 : Bad version 0
ht : Bad checksum
0 : Bad area id

s
0
: : Drop on unnumbered interface
0
9
: Bad virtual link
: Bad authentication key
r c e 7
0
: Bad authentication type
: Packet too small
0
o u
: Packet size > ip length 0 : Transmit error
0 : Interface down
es 0 : Unknown neighbor
0 : Bad net segment
R 0 : Extern option mismatch
0

i n g
: Router id confusion 0 : Bad authentication sequence number

a rnbelongs to Area 0. Area authentication is enabled in Area 0, so area


e also needs to be enabled on the virtual link.
The virtual link
L
e
authentication
r
o
[R2]ospf 1

M[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei
[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.

HC Series HUAWEI TECHNOLOGIES 160


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R2]display ospf vlink

OSPF Process 1 with Router ID 10.0.2.2


Virtual Links

Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Full

Interface: 10.0.23.2 (Serial2/0/0)


Cost: 1562 State: P-2-P Type: Virtual
e n
Transit Area: 0.0.0.1
/
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
o m
i.c
GR State: Normal

[R1]ping -c 1 10.0.5.5
w e
PING 10.0.5.5: 56 data bytes, press CTRL_C to break
u a
Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=73 ms

g .h
--- 10.0.5.5 ping statistics ---
ni n
r
lea
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
: //
round-trip min/avg/max = 73/73/73 ms

t t p
s :h
r c e
Step 6 Troubleshoot OSPF route summarization failures.

o u
On R4, import the address of Loopback0 as an external route and configure route
s subnet mask.
summarization using thee16-bit
R
[R4]ospf 1

i n g
rn
[R4-ospf-1]import-route direct

a
[R4-ospf-1]asbr-summary 10.1.0.0 255.255.0.0

L e
[R4-ospf-1]quit

r e
o a certain period, the administrator configures inter-area route summarization
After
Mon R2 and summarizes the network segment connected to Loopback0 of R1 into a
route with a 16-bit mask.
[R2]ospf 1
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]abr-summary 10.1.0.0 255.255.0.0
[R2-ospf-1-area-0.0.0.2]quit
[R2-ospf-1]quit

HC Series HUAWEI TECHNOLOGIES 161


HCNP-IERS Chapter 1 OSPF Features and Configurations

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.
e n
/
Why is this incorrect route generated?
o m
i.c
[R5]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib

w e
a
----------------------------------------------------------------------------
Public routing table : OSPF
u
Destinations : 5 Routes : 5

g .h
OSPF routing table status : <Active>
ni n
r
lea
Destinations : 5 Routes : 5

Destination/Mask Proto Pre Cost Flags NextHop


: // Interface

t t p
:h
10.0.2.0/24 OSPF 10 1563 D 10.0.75.3 GigabitEthernet0/0/0

es
10.0.3.0/24 OSPF 10 1 D 10.0.75.3 GigabitEthernet0/0/0
10.0.12.0/24 OSPF 10

r c
3125 D 10.0.75.3 GigabitEthernet0/0/0

ou
10.0.23.0/24 OSPF 10 1563 D 10.0.75.3 GigabitEthernet0/0/0

s
10.1.0.0/16 OSPF 10 3125 D 10.0.75.3 GigabitEthernet0/0/0

Re
OSPF routing table status : <Inactive>

i n g
Destinations : 0 Routes : 0

n
e ar
L
Check the LSDB of R5.

e
or
[R5]display ospf lsdb

M OSPF Process 1 with Router ID 10.0.5.5


Link State Database

Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 10.0.5.5 10.0.5.5 214 48 80000025 0
Router 10.0.3.3 10.0.3.3 1246 48 80000024 1
Router 10.0.2.2 10.0.2.2 1247 36 80000005 1562

HC Series HUAWEI TECHNOLOGIES 162


HCNP-IERS Chapter 1 OSPF Features and Configurations

Router 10.1.4.4 10.1.4.4 648 36 8000000D 1


Network 10.0.75.4 10.1.4.4 206 36 80000004 0
Sum-Net 10.0.12.0 10.0.2.2 916 28 80000002 1562
Sum-Net 10.0.3.0 10.0.3.3 893 28 80000008 0
Sum-Net 10.0.3.0 10.0.2.2 916 28 80000002 1562
Sum-Net 10.0.2.0 10.0.3.3 919 28 80000003 1562
Sum-Net 10.0.2.0 10.0.2.2 916 28 80000002 0
Sum-Net 10.1.0.0 10.0.2.2 538 28 80000001 1562
Sum-Net 10.0.23.0 10.0.3.3 893 28 80000008 1562
e n
Sum-Net 10.0.23.0 10.0.2.2 917 28 80000002 1562
/
o m
AS External Database
e i.c
Type LinkState ID AdvRouter Age Len Sequence Metric

aw
External 10.0.75.0 10.1.4.4 649 36 80000001
u 1
External 10.1.0.0 10.1.4.4 620 36

g
80000001
.h 2

i n
n Check detailed
r
The LSDB of R5 has two LSAs describing the route to 10.1.0.0.
a
information about LSAs. The following Type 3 LSA iseoriginated
/ l by R2, and the Type 5
/ same network segment.
LSA is originated by R5. The two LSAs describe:the
t tp
[R5]display ospf lsdb summary 10.1.0.0

: h
e s
c
OSPF Process 1 with Router ID 10.0.5.5

ur
Area: 0.0.0.0

s o
Link State Database

Type : Sum-Net
R e
Ls id
n g
: 10.1.0.0
i
rn
Adv rtr : 10.0.2.2
Ls age

e a : 767
Len

e L
Options
: 28
: E

o r
seq# : 80000001

M chksum : 0xa380
Net mask : 255.255.0.0
Tos 0 metric: 1562
Priority : Low

[R5]display ospf lsdb ase 10.1.0.0

OSPF Process 1 with Router ID 10.0.5.5


Link State Database

HC Series HUAWEI TECHNOLOGIES 163


HCNP-IERS Chapter 1 OSPF Features and Configurations

Type : External
Ls id : 10.1.0.0
Adv rtr : 10.1.4.4
Ls age : 871
Len : 36
Options : E
seq# : 80000001
chksum : 0xe3cd
e n
Net mask : 255.255.0.0
/
TOS 0 Metric: 2
o m
i.c
E type : 2
Forwarding Address : 0.0.0.0
Tag : 1
w e
Priority : Low
u a
g .h
i n
In OSPF, Type 3 LSAs are always preferred over Type 5 LSAs. Therefore, in the OSPF
n is R3.
ar
routing table of R5, the next hop of the route to 10.1.0.0/16
l e
: //
To prevent this problem, cancel external route summarization. This route then will

t tp
appear in the OSPF routing tables of other routers.

: h
s
[R4]ospf 1

c e
[R4-ospf-1]undo asbr-summary 10.1.0.0 255.255.0.0

r
u
[R4-ospf-1]quit

s o
R e
[R5]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib

n g
----------------------------------------------------------------------------

i
rn
Public routing table : OSPF

e a
Destinations : 6 Routes : 6

e L
OSPF routing table status : <Active>

o r Destinations : 6 Routes : 6

MDestination/Mask Proto Pre Cost Flags NextHop Interface

10.0.2.0/24 OSPF 10 1563 D 10.0.75.3 GigabitEthernet0/0/0


10.0.3.0/24 OSPF 10 1 D 10.0.75.3 GigabitEthernet0/0/0
10.0.12.0/24 OSPF 10 3125 D 10.0.75.3 GigabitEthernet0/0/0
10.0.23.0/24 OSPF 10 1563 D 10.0.75.3 GigabitEthernet0/0/0
10.1.0.0/16 OSPF 10 3125 D 10.0.75.3 GigabitEthernet0/0/0
10.1.4.4/24 O_ASE 150 1 D 10.0.75.4 GigabitEthernet0/0/0

HC Series HUAWEI TECHNOLOGIES 164


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF routing table status : <Inactive>


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

e n
PING 10.1.4.4: 56 data bytes, press CTRL_C to break
/
Reply from 10.1.4.4: bytes=56 Sequence=1 ttl=253 time=71 ms

o m
--- 10.1.4.4 ping statistics ---
e i.c
w
1 packet(s) transmitted
1 packet(s) received
u a
.h
0.00% packet loss
round-trip min/avg/max = 71/71/71 ms

i n g
r nrecovers.
The preceding command output shows that the network
l e a
----End : //
t tp
h
Additional Exercises: Analysis and: Verification
e s
r c authentication be enabled in the same area?
Can area authentication and interface
o u
e s areas be the same?
Can area IDs of non-backbone
R
i n
Device Configurationsg
rn
<R1>display current-configuration
a
# L e
[V200R007C00SPC600]

r e
sysname R1
#o
Minterface Serial1/0/0
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
ospf authentication-mode md5 1 plain huawei
#
interface LoopBack0
ip address 10.1.1.1 255.255.255.0
ospf network-type broadcast

HC Series HUAWEI TECHNOLOGIES 165


HCNP-IERS Chapter 1 OSPF Features and Configurations

#
ospf 1 router-id 10.1.1.1
area 0.0.0.2
network 10.0.12.1 0.0.0.0
network 10.1.1.1 0.0.0.0
#
return

<R2>display current-configuration
e n
[V200R007C00SPC600]
/
#
o m
i.c
sysname R2
#
interface Serial1/0/0
w e
link-protocol ppp
u a
ip address 10.0.12.2 255.255.255.0

g .h
n
ospf authentication-mode md5 1 plain huawei
#
ni
r
lea
interface LoopBack0
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
: //
#

t t p
:h
ospf 1 router-id 10.0.2.2

s
area 0.0.0.0

c e
authentication-mode md5 1 plain huawei

r
ou
area 0.0.0.1
network 10.0.23.2 0.0.0.0
network 10.0.2.2 0.0.0.0
es
vlink-peer 10.0.3.3
R
area 0.0.0.2

i n g
n
abr-summary 10.1.0.0 255.255.0.0

ar
network 10.0.12.2 0.0.0.0

e
L
#
return
e
or
M
<R3>display current-configuration
[V200R007C00SPC600]
#
sysname R3
#
interface Serial2/0/0
link-protocol ppp
ip address 10.0.23.3 255.255.255.0
#

HC Series HUAWEI TECHNOLOGIES 166


HCNP-IERS Chapter 1 OSPF Features and Configurations

interface GigabitEthernet0/0/0
ip address 10.0.75.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
e n
authentication-mode md5 1 plain huawei
/
network 10.0.75.3 0.0.0.0
o m
i.c
area 0.0.0.1
network 10.0.23.3 0.0.0.0
network 10.0.3.3 0.0.0.0
w e
vlink-peer 10.0.2.2
u a
#

g .h
n
return

ni
r
lea
<R4>display current-configuration
[V200R007C00SPC600]
#
: //
sysname R4

t t p
:h
#

s
interface GigabitEthernet0/0/0
ip address 10.0.75.4 255.255.255.0

r c e
ou
#
interface LoopBack0

es
ip address 10.1.4.4 255.255.255.0
#
R
n g
ospf 1 router-id 10.1.4.4

i
n
import-route direct
area 0.0.0.0

e ar
L
authentication-mode md5 1 plain huawei

e
network 10.0.75.4 0.0.0.0
#
or
M
return

<R5>display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
interface GigabitEthernet0/0/0
ip address 10.0.75.5 255.255.255.0

HC Series HUAWEI TECHNOLOGIES 167


HCNP-IERS Chapter 1 OSPF Features and Configurations

#
interface LoopBack0
ip address 10.0.5.5 255.255.255.0
ospf network-type broadcast
#
ospf 1 router-id 10.0.5.5
area 0.0.0.0
authentication-mode md5 1 plain huawei
network 10.0.75.5 0.0.0.0
e n
network 10.0.5.5 0.0.0.0
/
#
o m
i.c
Return

Lab 1-7 Advanced OSPF Features w e


u a
Learning Objectives
g .h
The objectives of this lab are to learn and understand: n
i n
ar
/ l e in an NBMA network
How to manually configure OSPF neighbors

: / network
How to affect DR election in an NBMA

t tp
How to configure OSPF in anh

s : NBMA network
How to configure an OSPF

r c e broadcast network in FR

o
How to configure an u OSPF P2MP network in FR
s an OSPF P2MP/P2P mixed network

R e
How to configure


i n g
How to configure an OSPF P2P network in FR

a rn
L e
r e
o
M

HC Series HUAWEI TECHNOLOGIES 168


HCNP-IERS Chapter 1 OSPF Features and Configurations

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
lea
Figure 1-7 Advanced OSPF features

: //
Scenario
t p
t
: h The company’s network uses OSPF
You are a network administrator of a company.
e s has three branches, which use routers R1, R2,
cthe company leases and deploys a virtual link
as the routing protocol. The company
r
u
and R3 respectively. To save costs,
o
e s R1 and R3. There is no virtual ink between R2 and
between R1 and R2 and between
R3. Configure OSPF in Ran NBMA network and then change the network type to
broadcast, P2MP, n
i g
combination of P2MP and P2P, and P2P.

a rn
Tasks e
e L
or 1 Perform basic FR interconnection configurations and
Step
Mconfigure IP addresses.
Configure IP addresses and masks for all the routers. Set a 24-bit mask for all
loopback interfaces to simulate an independent network segment.

By default, FR inverse ARP is enabled on routers. You need to disable this feature and
manually establish ARP mappings between R1 and R2 and between R1 and R3.

HC Series HUAWEI TECHNOLOGIES 169


HCNP-IERS Chapter 1 OSPF Features and Configurations

By default, broadcast packets cannot be transmitted over an FR link. To ensure that


OSPF neighbors can be discovered normally, specify the broadcast parameter when
configuring FR address mappings so that broadcast packets can be transmitted over
an FR link.
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface Serial 2/0/0

e n
[R1-Serial2/0/0]link-protocol fr
/
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y

o m
i.c
[R1-Serial2/0/0]ip address 10.0.123.1 24
[R1-Serial2/0/0]undo fr inarp
[R1-Serial2/0/0]fr map ip 10.0.123.2 102 broadcast
w e
[R1-Serial2/0/0]fr map ip 10.0.123.3 103 broadcast
u a
.h
[R1-Serial2/0/0]quit
[R1]interface LoopBack 0

i n g
n
[R1-LoopBack0]ip address 10.0.1.1 24

r
lea
[R1-LoopBack0]quit

<R2>system-view
: //
t
Enter system view, return user view with Ctrl+Z.

t p
:h
[R2]interface Serial 3/0/0

s
[R2-Serial3/0/0]link-protocol fr

r c e
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[R2-Serial3/0/0]ip address 10.0.123.2 24
[R2-Serial3/0/0]undo fr inarp

s ou
[R2-Serial3/0/0]quit
Re
[R2-Serial3/0/0]fr map ip 10.0.123.1 201 broadcast

n g
[R2]interface LoopBack 0

i
n
[R2-LoopBack0]ip address 10.0.2.2 24

ar
[R2-LoopBack0]quit

L e
e
<R3>system-view

or
Enter system view, return user view with Ctrl+Z.

M
[R3]interface Serial 1/0/0
[R3-Serial1/0/0]link-protocol fr
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[R3-Serial1/0/0]ip address 10.0.123.3 24
[R3-Serial1/0/0]undo fr inarp
[R3-Serial1/0/0]fr map ip 10.0.123.1 301 broadcast
[R3-Serial1/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 24

HC Series HUAWEI TECHNOLOGIES 170


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3-LoopBack0]quit

After the configurations are complete, run the display fr map-info command to
check FR address mapping information and test link connectivity.
[R1]display fr map-info
Map Statistics for interface Serial2/0/0 (DTE)
DLCI = 102, IP 10.0.123.2, Serial2/0/0

e n
create time = 2011/11/30 09:06:43, status = ACTIVE
/
encapsulation = ietf, vlink = 3, broadcast

o m
i.c
DLCI = 103, IP 10.0.123.3, Serial2/0/0

e
create time = 2011/11/30 09:06:53, status = ACTIVE

w
encapsulation = ietf, vlink = 4, broadcast

u a
.h
[R1]ping -c 1 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break

i
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=66 ms
n g
r n
lea
--- 10.0.123.2 ping statistics ---
1 packet(s) transmitted
: //
1 packet(s) received

t t p
:h
0.00% packet loss
round-trip min/avg/max = 66/66/66 ms

e s
[R1]ping -c 1 10.0.123.3
r c
ou
PING 10.0.123.3: 56 data bytes, press CTRL_C to break

es
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=56 ms

R
i n g
--- 10.0.123.3 ping statistics ---

n
1 packet(s) transmitted

ar
1 packet(s) received

e
0.00% packet loss

L
e
round-trip min/avg/max = 56/56/56 ms

or
MStep 2 Configure an OSPF NBMA network.
Configure 10.0.123.0/24 and Loopback0 address of each router to belong to Area 0.
Change the OSPF network type of Loopback0 on all routers to broadcast and
configure these routers to use Loopback0 address as their router IDs.

When configuring the network command, use the wildcard mask 0.0.0.0.

HC Series HUAWEI TECHNOLOGIES 171


HCNP-IERS Chapter 1 OSPF Features and Configurations

In an FR network, the default OSPF network type is NBMA. In an NBMA network,


OSPF neighbors need to be manually configured. After the configurations are
complete, check neighbor relationships of routers.
[R1]ospf 1 router-id 10.0.123.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.123.1 0.0.0.0

n
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]quit
/ e
[R1-ospf-1]peer 10.0.123.2

o m
i.c
[R1-ospf-1]peer 10.0.123.3
[R1-ospf-1]quit
[R1]interface LoopBack 0
w e
[R1-LoopBack0]ospf network-type broadcast

u a
.h
[R1-LoopBack0]quit

[R2]ospf 1 router-id 10.0.2.2


i n g
[R2-ospf-1]area 0
r n
lea
[R2-ospf-1-area-0.0.0.0]network 10.0.123.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0

: //
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]peer 10.0.123.1
t t p
:h
[R2-ospf-1]quit
[R2]interface LoopBack 0
e s
r c
[R2-LoopBack0]ospf network-type broadcast

ou
[R2-LoopBack0]quit

es
R
[R3]ospf 1 router-id 10.0.3.3
[R3-ospf-1]area 0

i n g
[R3-ospf-1-area-0.0.0.0]network 10.0.123.3 0.0.0.0

n
ar
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0

L e
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]peer 10.0.123.1

e
or
[R3-ospf-1]quit
[R3]interface LoopBack 0

M
[R3-LoopBack0]ospf network-type broadcast
[R3-LoopBack0]quit

Because OSPF is first configured on R1, R1 becomes the DR of the network segment
10.0.123.0. Run the reset ospf process command on R1 to restart the OSPF process.
<R1>reset ospf process

HC Series HUAWEI TECHNOLOGIES 172


HCNP-IERS Chapter 1 OSPF Features and Configurations

Warning: The OSPF process will be reset. Continue? [Y/N]:y

[R2]display ospf peer

OSPF Process 1 with Router ID 10.0.2.2


Neighbors

Area 0.0.0.0 interface 10.0.123.2(Serial3/0/0)'s neighbors


Router ID: 10.0.123.1 Address: 10.0.123.1
e n
State: Full Mode:Nbr is Master Priority: 1
/
DR: 10.0.123.2 BDR: 10.0.123.1 MTU: 0
o m
i.c
Dead timer due in 93 sec
Retrans timer interval: 6
Neighbor is up for 00:01:23
w e
Authentication Sequence: [ 0 ]
u a
g .h
i n
The preceding command output shows that R2 becomes the DR. Check the OSPF
n
r
lea
routing table of R2.
[R2]display ip routing-table protocol ospf
: //
Route Flags: R - relay, D - download to fib

t t p
:h
----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 1
e s
Routes : 1

r c
ou
OSPF routing table status : <Active>
Destinations : 1
es Routes : 1

R
ing
Destination/Mask Proto Pre Cost Flags NextHop Interface

n
ar
10.0.1.0/24 OSPF 10 1562 D 10.0.123.1 Serial3/0/0

L e
e
OSPF routing table status : <Inactive>

or
Destinations : 0 Routes : 0

MThe preceding command output shows that R2 has only one OSPF route, which is the
route to the network segment connected to Loopback0 of R1. R2 does not learn the
route to the network segment where Loopback0 of R3 resides. What is the reason for
this problem?

HC Series HUAWEI TECHNOLOGIES 173


HCNP-IERS Chapter 1 OSPF Features and Configurations

An NBMA network must be fully meshed. In the company’s network, there is no


virtual link between R2 and R3, so R2 and R3 are not directly connected. R2 functions
as the DR, so routing information of F3 cannot be transmitted to R2.

In this scenario, you need to ensure that R1 is always the DR. To do this, change the
OSPF interface priorities of R2 and R3.

In OSPF, routers with interface priority 0 do not participate in DR/BDR election.


e n
/
[R2]interface s3/0/0

o m
i.c
[R2-Serial3/0/0]ospf dr-priority 0

e
[R2-Serial3/0/0]quit

[R3]interface Serial 1/0/0


aw
u
.h
[R3-Serial1/0/0]ospf dr-priority 0
[R3-Serial1/0/0]quit

i n g
r nwhether R2 learns the route
Check the OSPF routing table of R2 again to determine
l e a
to the network segment where Loopback0 of R3 /resides.
: /
t
[R2]display ip routing-table protocol ospf
tp
: h
Route Flags: R - relay, D - download to fib

e s
----------------------------------------------------------------------------
Public routing table : OSPF
r c
Destinations : 2

o u Routes : 2

es
R
OSPF routing table status : <Active>

g
Destinations : 2 Routes : 2

i n
a rn
Destination/Mask Proto Pre Cost Flags NextHop Interface

L e
10.0.1.0/24 OSPF 10 1562 D 10.0.123.1 Serial3/0/0

r e10.0.3.0/24 OSPF 10 1562 D 10.0.123.3 Serial3/0/0

o
MOSPF routing table status : <Inactive>
Destinations : 0 Routes : 0

The preceding command output shows that R2 learns the route to the network
segment where Loopback0 of R3 resides. Then check network connectivity on R2.
[R2]ping -c 1 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break

HC Series HUAWEI TECHNOLOGIES 174


HCNP-IERS Chapter 1 OSPF Features and Configurations

Request time out

--- 10.0.3.3 ping statistics ---


1 packet(s) transmitted
0 packet(s) received
100.00% packet loss

The preceding command output shows that R2 cannot access the Loopback0
e n
address of R3. What is the reason for this problem? /
o m
Check the OSPF routing table of R2. You can see that the next hop of the route
i . c to
10.0.3.3 is 10.0.123.3.
w e
a
hu
Check connectivity to this next-hop address.
[R2]ping -c 1 10.0.123.3
g .
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
ni n
Request time out
ar
l e
--- 10.0.123.3 ping statistics ---
: //
tp
1 packet(s) transmitted
0 packet(s) received
ht
100.00% packet loss
s :
r e
c address 10.0.123.2 of R1 belong to the same
u
The address 10.0.123.3 and interface
o
network segment. Check FR
e s address mapping information.
R
i n g
[R2]display fr map-info
Map Statistics for interface Serial3/0/0 (DTE)

rn
DLCI = 201, IP 10.0.123.1, Serial3/0/0

a
L e
create time = 2011/11/30 10:03:37, status = ACTIVE
encapsulation = ietf, vlink = 1, broadcast

r e
o preceding command output shows that there is only the mapping to 10.0.123.1
M
The
but no mapping to 10.0.123.3.

Manually add the interface address mappings from R2 to R3 and from R3 to R2.
[R2]interface Serial 3/0/0
[R2-Serial3/0/0]fr map ip 10.0.123.3 201
[R2-Serial3/0/0]quit

HC Series HUAWEI TECHNOLOGIES 175


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3]interface Serial 1/0/0


[R3-Serial1/0/0]fr map ip 10.0.123.2 301
[R3-Serial1/0/0]quit

Test the connectivity between R2 and R3.


[R2]ping -c 1 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break

e n
/
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=122 ms

--- 10.0.3.3 ping statistics ---


o m
1 packet(s) transmitted
1 packet(s) received
e i.c
0.00% packet loss
aw
u
.h
round-trip min/avg/max = 122/122/122 ms

i n g
The preceding command output shows that R2 can access R3.
r n
Step 3 Configure an OSPF broadcast network. l e a
: / /
t p
By default, broadcast packets cannot be transmitted over an FR link. To enable OSPF
tthe broadcast parameter when
: h
to use the broadcast network type, specify
configuring FR address mappings so sthat broadcast packets can be transmitted over
r c e
an FR link.
u
o so that OSPF can broadcast packets on FR
s
Re
Set the network type to broadcast
interfaces.

i n g
rn
[R1]interface Serial 2/0/0

a
[R1-Serial2/0/0]ospf network-type broadcast

e
L
[R1-Serial2/0/0]quit

r e
o
[R2]interface Serial 3/0/0

M[R2-Serial3/0/0]ospf network-type broadcast

[R3]interface Serial 1/0/0


[R3-Serial1/0/0]ospf network-type broadcast

HC Series HUAWEI TECHNOLOGIES 176


HCNP-IERS Chapter 1 OSPF Features and Configurations

OSPF neighbors do not need to be manually configured in a broadcast network.


Therefore, you need to delete the manually configured neighbors in the OSPF
process.
[R1]ospf 1
[R1-ospf-1]undo peer 10.0.123.2
[R1-ospf-1]undo peer 10.0.123.3

n
[R1-ospf-1]quit

/ e
[R2]ospf 1

o m
i.c
[R2-ospf-1]undo peer 10.0.123.1
[R2-ospf-1]quit

w e
[R3]ospf 1

u a
.h
[R3-ospf-1]undo peer 10.0.123.1
[R3-ospf-1]quit

i n g
r n table of R2, and test
l e a
Check neighbor relationships of R1, check the OSPF routing
connectivity.
: //
[R1]display ospf peer brief
t tp
: h
s
OSPF Process 1 with Router ID 10.0.123.1

e
r c
Peer Statistic Information

u
----------------------------------------------------------------------------

o
Area Id

es
Interface Neighbor id State

R
0.0.0.0 Serial2/0/0 10.0.2.2 Full

g
0.0.0.0 Serial2/0/0 10.0.3.3 Full

i n
----------------------------------------------------------------------------

a rn
e
[R2]display ip routing-table protocol ospf

L
Route Flags: R - relay, D - download to fib

e
r
----------------------------------------------------------------------------

o
Public routing table : OSPF

M Destinations : 2 Routes : 2

OSPF routing table status : <Active>


Destinations : 2 Routes : 2

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 OSPF 10 1562 D 10.0.123.1 Serial3/0/0

HC Series HUAWEI TECHNOLOGIES 177


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.0.3.0/24 OSPF 10 1562 D 10.0.123.3 Serial3/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

The network recovers and is working normally.

The preceding command output shows that the next hop of the route to 10.0.3.0/24
e n
is 10.0.123.3, which is the same as that in the NBMA network type configuration. In a /
broadcast network, FR mappings are required for interface addresses of R2 and m
. co R3.

On R2, test whether the network is running normally. e i


aw
hu
[R2]ping -c 1 10.0.3.3

.
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=114 ms

i n g
--- 10.0.3.3 ping statistics ---
r n
1 packet(s) transmitted
l e a
1 packet(s) received
: //
tp
0.00% packet loss
round-trip min/avg/max = 114/114/114 ms
ht
s :
Step 4 Configure an OSPF rP2MP
e
c network.
Neighbors do not need to s o u
be manually configured in a P2MP network.
R e
i n gthese interfaces.
Change the network type of each interface to P2MP and delete the DR priority

n
configuration from
r
e a
DR/BDR election is not required in a P2MP network.

e L
o r
[R1]interface Serial 2/0/0
[R1-Serial2/0/0]ospf network-type p2mp

M[R1-Serial2/0/0]quit

[R2]interface Serial 3/0/0


[R2-Serial3/0/0]undo ospf dr-priority
[R2-Serial3/0/0]ospf network-type p2mp
[R2-Serial3/0/0]quit

[R3]interface Serial 1/0/0

HC Series HUAWEI TECHNOLOGIES 178


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3-Serial1/0/0]undo ospf dr-priority


[R3-Serial1/0/0]ospf network-type p2mp
[R3-Serial1/0/0]quit

Check neighbor relationships of R1.


[R1]display ospf peer brief

e n
/
OSPF Process 1 with Router ID 10.0.123.1

m
Peer Statistic Information
----------------------------------------------------------------------------
o
Area Id
0.0.0.0
Interface
Serial2/0/0
Neighbor id
10.0.2.2
State
Full
e i.c
0.0.0.0 Serial2/0/0 10.0.3.3 Full
aw
u
.h
----------------------------------------------------------------------------

i n g
n
Check OSPF routing tables of R1 and R2. The following command output shows that
r
lea
routing information is transmitted normally.
[R1]display ip routing-table protocol ospf
: //
Route Flags: R - relay, D - download to fib
t t p
:h
----------------------------------------------------------------------------
Public routing table : OSPF

e s
Destinations : 4
c
Routes : 4

r
s
OSPF routing table status : <Active>
ou
Destinations : 2

Re Routes : 2

Destination/Mask
i n gProto Pre Cost Flags NextHop Interface

n
e ar
10.0.2.0/24 OSPF 10 1562 D 10.0.123.2 Serial2/0/0

e L
10.0.3.0/24 OSPF 10 1562 D 10.0.123.3 Serial2/0/0

or
OSPF routing table status : <Inactive>

M Destinations : 2 Routes : 2

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.123.2/32 OSPF 10 1562 10.0.123.2 Serial2/0/0


10.0.123.3/32 OSPF 10 1562 10.0.123.3 Serial2/0/0

[R2]display ip routing-table protocol ospf


Route Flags: R - relay, D - download to fib

HC Series HUAWEI TECHNOLOGIES 179


HCNP-IERS Chapter 1 OSPF Features and Configurations

----------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 4 Routes : 4

OSPF routing table status : <Active>


Destinations : 2 Routes : 2

Destination/Mask Proto Pre Cost Flags NextHop Interface

e n
10.0.1.0/24 OSPF 10 1562 D 10.0.123.1 Serial3/0/0
/
10.0.3.0/24 OSPF 10 3124 D 10.0.123.1 Serial3/0/0
o m
OSPF routing table status : <Inactive>
e i.c
Destinations : 2 Routes : 2

aw
u
Destination/Mask Proto Pre Cost Flags NextHop
.h
Interface

g
10.0.123.1/32 OSPF 10 1562 10.0.123.1
ni n
Serial3/0/0

r
lea
10.0.123.3/32 OSPF 10 3124 10.0.123.1 Serial3/0/0

: //
t t p
The preceding command output of R2 shows that the next hop of the route to

:h
10.0.3.0/24 becomes 10.0.123.1. R2 only needs to have FR mapping to the address
10.0.123.1.
e s
r c and then test network connectivity.
u
Delete unnecessary address mappings
o
[R2]interface Serial 3/0/0
es
R
[R2-Serial3/0/0]undo fr map ip 10.0.123.3 201

n
[R2-Serial3/0/0]quit

i g
a rn
[R3]interface Serial 1/0/0

L e
[R3-Serial1/0/0]undo fr map ip 10.0.123.2 301

e
[R3-Serial1/0/0]quit

r
o
MTest connectivity of R2. The following command output shows that R2 can
communicate with R3 normally.
[R2]ping -c 1 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=119 ms

--- 10.0.3.3 ping statistics ---

HC Series HUAWEI TECHNOLOGIES 180


HCNP-IERS Chapter 1 OSPF Features and Configurations

1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 119/119/119 ms

Check whether the OSPF routing table of R2 changes after the mapping to 10.0.123.3
is deleted.

e n
[R2-Serial3/0/0]display ip routing-table protocol ospf
/
Route Flags: R - relay, D - download to fib

o m
i.c
----------------------------------------------------------------------------

e
Public routing table : OSPF

w
Destinations : 4 Routes : 4

u a
.h
OSPF routing table status : <Active>
Destinations : 3 Routes : 3

i n g
Destination/Mask Proto Pre Cost Flags NextHop
r n Interface

lea
://
10.0.1.0/24 OSPF 10 1562 D 10.0.123.1 Serial3/0/0

tp
10.0.3.0/24 OSPF 10 3124 D 10.0.123.1 Serial3/0/0

t
:h
10.0.123.3/32 OSPF 10 3124 D 10.0.123.1 Serial3/0/0

OSPF routing table status : <Inactive>


e s
Destinations : 1
r c
Routes : 1

s ou
e
Destination/Mask Proto Pre Cost Flags NextHop Interface

R
ing
10.0.123.1/32 OSPF 10 1562 10.0.123.1 Serial3/0/0

a rn
e
The preceding command output shows that the route to 10.0.123.3/32 is inactive
L
e
because it appears in the OSPF routing table as a direct route. After the mapping to

or is deleted, this route appears in the OSPF routing table as an OSPF route.
10.0.123.3
MStep 5 Configure an OSPF P2MP/P2P mixed network.
The P2MP and P2P network types can coexist.

Change the network type of R2 and R3 to P2P and retain the network type of R1 as
P2MP.
[R2]interface Serial 3/0/0

HC Series HUAWEI TECHNOLOGIES 181


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R2-Serial3/0/0]ospf network-type p2p


[R2-Serial3/0/0]quit

[R3]interface Serial 1/0/0


[R3-Serial1/0/0]ospf network-type p2p
[R3-Serial1/0/0]quit

The preceding command output shows that neighbor relationship between R2 and
e n
R3 does not exist and cannot be established after a certain period. Check OSPF /
errors. The following command output shows that Hello intervals on both ends o m
are
i. c
inconsistent.

w e
a
Nov 30 2011 14:16:10+00:00 R2 %%01OSPF/3/NBR_CHG_DOWN(l)[0]:Neighbor event:neighbor state

hu
changed to Down. (ProcessId=1, NeighborAddress=10.0.123.1, NeighborEvent=KillNbr,
NeighborPreviousState=Full, NeighborCurrentState=Down)
g .
ni n
r
[R2]display ospf error

l e a
//
OSPF Process 1 with Router ID 10.0.2.2

:
tp
OSPF error statistics

ht
:
General packet errors:
0 : IP: received my own packet
e s
6 : Bad packet
0 : Bad version
r c 0 : Bad checksum
0 : Bad area id

o u 0 : Drop on unnumbered interface


0 : Bad virtual link

es 0 : Bad authentication type

R
0 : Bad authentication key 0 : Packet too small
0
0
i n g
: Packet size > ip length
: Interface down
0
0
: Transmit error
: Unknown neighbor
0

a rn
: Bad net segment 0 : Extern option mismatch

e
0 : Router id confusion 0 : Bad authentication sequence number

e L
0 r
HELLO packet errors:

o : Netmask mismatch 6 : Hello timer mismatch

M 0
0
: Dead timer mismatch
: NBMA neighbor unknown
0
0
: Virtual neighbor unknown
: Invalid Source Address

In a P2MP network, the default Hello interval is 30s. In a P2P network, the default
Hello interval is 10s.

To solve the preceding problem, adjust the Hello interval of R1.

HC Series HUAWEI TECHNOLOGIES 182


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R1]interface Serial 2/0/0


[R1-Serial2/0/0]ospf timer hello 10

Wait for about 30 seconds, check whether neighbor relationship can be established
on R1.
[R1]display ospf peer brief

e n
OSPF Process 1 with Router ID 10.0.123.1
/
Peer Statistic Information

o m
i.c
----------------------------------------------------------------------------

e
Area Id Interface Neighbor id State

w
0.0.0.0 Serial2/0/0 10.0.2.2 Full
0.0.0.0 Serial2/0/0 10.0.3.3 Full
u a
.h
----------------------------------------------------------------------------

i n g
r n
The preceding command output shows that neighbor relationships are established
on R1.
l e a
: // between routers normally. First,
tp
Check whether routing information is transmitted
t
check the OSPF routing table of R1.
: h
e s
[R1]display ip routing-table protocol ospf

r c
Route Flags: R - relay, D - download to fib

o u
----------------------------------------------------------------------------

es
Public routing table : OSPF

R
Destinations : 3 Routes : 4

i n g
OSPF routing table status : <Active>

a rn
Destinations : 2 Routes : 2

L e
Destination/Mask Proto Pre Cost Flags NextHop Interface

r e
o 10.0.2.0/24 OSPF 10 1562 D 10.0.123.2 Serial2/0/0

M 10.0.3.0/24 OSPF 10 1562 D 10.0.123.3 Serial2/0/0

OSPF routing table status : <Inactive>


Destinations : 1 Routes : 2

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.123.0/24 OSPF 10 3124 10.0.123.2 Serial2/0/0

HC Series HUAWEI TECHNOLOGIES 183


HCNP-IERS Chapter 1 OSPF Features and Configurations

10.0.123.0/24 OSPF 10 3124 10.0.123.3 Serial2/0/0

The preceding command output shows that R1 has routes to the network segments
of loopback interfaces on R2 and R3.

Check the OSPF routing table of R2.

n
[R2]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
/ e
----------------------------------------------------------------------------

o m
i.c
Public routing table : OSPF
Destinations : 3 Routes : 3

w e
OSPF routing table status : <Active>

u a
.h
Destinations : 2 Routes : 2

Destination/Mask Proto Pre Cost Flags NextHop


i n g
Interface

r n
lea
10.0.1.0/24 OSPF 10 1562 D 10.0.123.1 Serial3/0/0

://
10.0.3.0/24 OSPF 10 3124 D 10.0.123.1 Serial3/0/0

OSPF routing table status : <Inactive>


t tp
Destinations : 1 Routes : 1

s :h
Destination/Mask Proto Pre
r c
Coste Flags NextHop Interface

s ou
e
10.0.123.1/32 OSPF 10 1562 10.0.123.1 Serial3/0/0

R
i n g
The preceding command output shows that R2 has routes to R1 and R3. Can R2

rn with R1 and R3?


directly communicates
a
L e
[R2]ping -c 1 10.0.3.3

r e
PING 10.0.3.3: 56 data bytes, press CTRL_C to break

o Request time out

M --- 10.0.3.3 ping statistics ---


1 packet(s) transmitted
0 packet(s) received
100.00% packet loss

[R2]ping -c 1 10.0.1.1
PING 10.0.1.1: 56 data bytes, press CTRL_C to break

HC Series HUAWEI TECHNOLOGIES 184


HCNP-IERS Chapter 1 OSPF Features and Configurations

Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=63 ms

--- 10.0.1.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 63/63/63 ms

e n
The preceding command output shows that R2 cannot directly communicate with R3
but can directly communicate with R1. Check which router discards the packet m
/
. co
destined for 10.0.3.3.
e i
[R2]tracert 10.0.3.3
aw
hu
traceroute to 10.0.3.3(10.0.3.3), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.0.123.1 61 ms 42 ms 42 ms

g .
n
2 * * *
...
ni
ar
l e
/ has reached R1 but is
The preceding command output shows that the/packet
:
t tp table of R3.
discarded after reaching R3. Check the IP routing

: h
s
[R3]display ip routing-table

r c e
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
o u
e s
Destinations : 13 Routes : 13

R
Destination/Mask

i n g Proto Pre Cost Flags NextHop Interface

a rn
10.0.1.0/24 OSPF 10 1562 D 10.0.123.1 Serial1/0/0

L e
10.0.2.0/24 OSPF 10 3124 D 10.0.123.1 Serial1/0/0

e
10.0.3.0/24 Direct 0 0 D 10.0.3.3 LoopBack0

o r 10.0.3.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0

M
10.0.3.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.123.0/24 Direct 0 0 D 10.0.123.3 Serial1/0/0
10.0.123.1/32 Direct 0 0 D 10.0.123.1 Serial1/0/0
10.0.123.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.123.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 185


HCNP-IERS Chapter 1 OSPF Features and Configurations

When R2 pings the loopback interface address of R3, the source address of the Layer
3 packet header is the interface address of R2, 10.0.123.2.

The IP routing table of R3 does not have the route to 10.0.123.2/32, indicating that
this packet is discarded. This indicates that after the network type is changed from
P2MP to P2P, R2 and R3 cannot learn directly-connected interface addresses of each
e n
other. This does not affect communication of users connected to R2 and R3. You can/
use the source address to test connectivity.
o m
The following command output shows that R2 can communicate with R3ewhen i.c the
a
loopback interface address of R2 is set as the source address of the pingw packet.
[R2]ping -c 1 -a 10.0.2.2 10.0.3.3
. hu
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
i n g
n
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=123 ms
r
l e a
//
--- 10.0.3.3 ping statistics ---
1 packet(s) transmitted
:
1 packet(s) received
t tp
0.00% packet loss

: h
s
round-trip min/avg/max = 123/123/123 ms

e
r c
Step 6 Configure an OSPF o uP2P network.
e s
R
i n g
a rn
L e
r e
o
M

HC Series HUAWEI TECHNOLOGIES 186


HCNP-IERS Chapter 1 OSPF Features and Configurations

You need to plan the IP addresses again. In the preceding figure, R1 is connected to
R2 through the network segment 10.0.12.0/24, and R1 is connected to R3 through
the network segment 10.0.13.0/24.

Configure subinterfaces and their IP addresses. When configuring subinterfaces, set


the interface type to P2P.
e n
/
[R1]interface s2/0/0

o m
i.c
[R1-Serial2/0/0]undo fr map ip 10.0.123.2 102

e
[R1-Serial2/0/0]undo fr map ip 10.0.123.3 103

w
[R1-Serial2/0/0]undo ospf network-type
[R1-Serial2/0/0]undo ospf timer hello

u a
.h
[R1-Serial2/0/0]interface Serial 2/0/0.102 p2p
[R1-Serial2/0/0.102]ip address 10.0.12.1 24
[R1-Serial2/0/0.102]ospf network-type p2p
i n g
[R1-Serial2/0/0.102]fr dlci 102
r n
lea
[R1-fr-dlci-Serial2/0/0.102-102]quit
[R1-Serial2/0/0.102]interface Serial 2/0/0.103 p2p
: //
[R1-Serial2/0/0.103]ip address 10.0.13.1 24
[R1-Serial2/0/0.103]ospf network-type p2p
t t p
[R1-Serial2/0/0.103]fr dlci 103

s :h
[R1-Serial2/0/0.103]quit
r c e
[R1-fr-dlci-Serial2/0/0.103-103]quit

s ou
e
[R2]interface Serial 3/0/0

R
[R2-Serial3/0/0]undo fr map ip 10.0.123.1 201

i n g
[R2-Serial3/0/0]undo ip address
[R2-Serial3/0/0]undo ospf network-type

n
ar
[R2-Serial3/0/0]interface Serial 3/0/0.201 p2p

L e
[R2-Serial3/0/0.201]ip address 10.0.12.2 24
[R2-Serial3/0/0.201]ospf network-type p2p

e
or
[R2-Serial3/0/0.201]fr dlci 201
[R2-fr-dlci-Serial3/0/0.201-201]quit

M
[R2-Serial3/0/0.201]quit

[R3]interface Serial 1/0/0


[R3-Serial1/0/0]undo ip address
[R3-Serial1/0/0]undo fr map ip 10.0.123.1 301
[R3-Serial1/0/0]undo ospf network-type
[R3-Serial1/0/0]interface Serial 1/0/0.301 p2p
[R3-Serial1/0/0.301]ip address 10.0.13.3 24

HC Series HUAWEI TECHNOLOGIES 187


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R3-Serial1/0/0.301]ospf network-type p2p


[R3-Serial1/0/0.301]fr dlci 301
[R3-fr-dlci-Serial1/0/0.301-301]quit
[R3-Serial1/0/0.301]quit

After the configurations are complete, test link connectivity.


[R1]ping -c 1 10.0.12.2

e n
/
PING 10.0.12.2: 56 data bytes, press CTRL_C to break

m
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=59 ms

o
--- 10.0.12.2 ping statistics ---
1 packet(s) transmitted
e i.c
1 packet(s) received
aw
u
.h
0.00% packet loss

g
round-trip min/avg/max = 59/59/59 ms

ni n
r
[R1]ping -c 1 10.0.13.3

lea
PING 10.0.13.3: 56 data bytes, press CTRL_C to break

//
Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=59 ms

p :
--- 10.0.13.3 ping statistics ---
t t
:h
1 packet(s) transmitted
1 packet(s) received
e s
0.00% packet loss
r c
ou
round-trip min/avg/max = 59/59/59 ms

e s
Modify informationg
R
about the network segment to be advertised.
i n
[R1]ospf 1

a rn
e
[R1-ospf-1]area 0

L
[R1-ospf-1-area-0.0.0.0]undo network 10.0.123.1 0.0.0.0

e
o r
[R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 10.0.13.1 0.0.0.0

M[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit

[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]undo network 10.0.123.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]quit

HC Series HUAWEI TECHNOLOGIES 188


HCNP-IERS Chapter 1 OSPF Features and Configurations

[R2-ospf-1]quit

[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]undo network 10.0.123.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.13.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit

e n
/
Check the OSPF neighbor table.
o m
[R1]display ospf peer brief

e i.c
OSPF Process 1 with Router ID 10.0.123.1
aw
u
.h
Peer Statistic Information

g
----------------------------------------------------------------------------
Area Id Interface Neighbor id

ni n
State

r
0.0.0.0 Serial2/0/0.102 10.0.2.2 Full

lea
0.0.0.0 Serial2/0/0.103 10.0.3.3 Full

//
----------------------------------------------------------------------------

p :
t t
:h
Check the OSPF routing tables of R1 and R2.
[R1]display ip routing-table protocol ospf
e s
r c
Route Flags: R - relay, D - download to fib

ou
----------------------------------------------------------------------------

s
e
Public routing table : OSPF
Destinations : 2
R Routes : 2

i n g
n
OSPF routing table status : <Active>

ar
Destinations : 2 Routes : 2

L e
e
Destination/Mask Proto Pre Cost Flags NextHop Interface

or
M
10.0.2.0/24 OSPF 10 1562 D 10.0.12.2 Serial2/0/0.102
10.0.3.0/24 OSPF 10 1562 D 10.0.13.3 Serial2/0/0.103

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

[R2]display ip routing-table protocol ospf


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

HC Series HUAWEI TECHNOLOGIES 189


HCNP-IERS Chapter 1 OSPF Features and Configurations

Public routing table : OSPF


Destinations : 3 Routes : 3

OSPF routing table status : <Active>


Destinations : 3 Routes : 3

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.0/24 OSPF 10 1562 D 10.0.12.1 Serial3/0/0.201


e n
10.0.3.0/24 OSPF 10 3124 D 10.0.12.1 Serial3/0/0.201
/
10.0.13.0/24 OSPF 10 3124 D 10.0.12.1 Serial3/0/0.201
o m
OSPF routing table status : <Inactive>
e i.c
Destinations : 0 Routes : 0

aw
u
Test network connectivity.
g .h
ni n
r
[R2]ping -c 1 10.0.1.1

lea
PING 10.0.1.1: 56 data bytes, press CTRL_C to break

//
Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=65 ms

p :
--- 10.0.1.1 ping statistics ---
t t
:h
1 packet(s) transmitted
1 packet(s) received
e s
0.00% packet loss
r c
ou
round-trip min/avg/max = 65/65/65 ms

es
R
[R2]ping -c 1 10.0.3.3

g
PING 10.0.3.3: 56 data bytes, press CTRL_C to break

i n
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=95 ms

n
e ar
--- 10.0.3.3 ping statistics ---

L
1 packet(s) transmitted

e
or
1 packet(s) received
0.00% packet loss

M
round-trip min/avg/max = 95/95/95 ms

----End

HC Series HUAWEI TECHNOLOGIES 190


HCNP-IERS Chapter 1 OSPF Features and Configurations

Additional Exercises: Analysis and Verification

What are the considerations when using an NBMA network on a non-fully-meshed


network?

Compare NBMA, P2MP, and P2P in their usage.

Device Configurations
e n
<R1>display current-configuration /
[V200R007C00SPC600]
o m
i.c
#
sysname R1

w e
a
#
interface Serial2/0/0
u
link-protocol fr

g .h
undo fr inarp
#
ni n
r
lea
interface Serial2/0/0.102 p2p

//
fr dlci 102
ip address 10.0.12.1 255.255.255.0

p :
ospf network-type p2p
t t
:h
#
interface Serial2/0/0.103 p2p

e s
fr dlci 103

r c
ou
ip address 10.0.13.1 255.255.255.0

s
ospf network-type p2p
#
Re
g
interface LoopBack0

i n
ip address 10.0.1.1 255.255.255.0

n
ar
ospf network-type broadcast
#

L e
ospf 1 router-id 10.0.123.1

e
or
area 0.0.0.0
network 10.0.1.1 0.0.0.0

M network 10.0.12.1 0.0.0.0


network 10.0.13.1 0.0.0.0
#
return

<R2>display current-configuration
[V200R007C00SPC600]
#
sysname R2

HC Series HUAWEI TECHNOLOGIES 191


HCNP-IERS Chapter 1 OSPF Features and Configurations

#
interface Serial3/0/0
link-protocol fr
undo fr inarp
#
interface Serial3/0/0.201 p2p
fr dlci 201
ip address 10.0.12.2 255.255.255.0
ospf network-type p2p
e n
#
/
interface LoopBack0
o m
i.c
ip address 10.0.2.2 255.255.255.0
ospf network-type broadcast
#
w e
ospf 1 router-id 10.0.2.2
u a
area 0.0.0.0

g .h
n
network 10.0.2.2 0.0.0.0
network 10.0.12.2 0.0.0.0
ni
r
lea
#
return

: //
<R3>display current-configuration

t t p
:h
[V200R007C00SPC600]

s
#
sysname R3

r c e
ou
#
interface Serial1/0/0
link-protocol fr
es
R
fr map ip 10.0.13.1 301 broadcast

n g
ip address 10.0.13.3 255.255.255.0

i
n
ospf network-type p2p
#

e ar
L
interface LoopBack0

e
ip address 10.0.3.3 255.255.255.0

or
ospf network-type broadcast

M
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.13.3 0.0.0.0
#
return

HC Series HUAWEI TECHNOLOGIES 192


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Chapter 2 IS-IS Features and Configurations

Lab 2-1 IS-IS Configurations

Learning Objectives

The objectives of this lab are to learn and understand:


e n
/
Basic IS-IS configurations
o m
How to configure the IS-IS designated intermediate system (DIS)c

e i . priority
How to configure the IS-IS network type
aw
How to import external routes into IS-IS
hu
How to configure the IS-IS interface cost g .

ni n
How to configure IS-IS route leaking
ar
l e
Topology : //
t tp
: h
e s
r c
o u
e s
R
i n g
a rn
L e
r e
o
M
Figure 3-1 IS-IS 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

HC Series HUAWEI TECHNOLOGIES 193


HCNP-IERS Chapter 2 IS-IS Features and Configurations

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.

e n
Tasks /
o m
Step 1 Set basic parameters and configure IP addresses.
e i.c
Configure IP addresses for all the routers.
aw
u
[R1]interface loopback 0

g .h
n
[R1-LoopBack0]ip address 10.0.1.1 32
[R1-LoopBack0]quit
ni
r
lea
[R1]interface GigabitEthernet 0/0/0

//
[R1-GigabitEthernet0/0/0]ip address 10.0.15.1 24
[R1-GigabitEthernet0/0/0]quit

p :
[R1]interface GigabitEthernet 0/0/1
t t
:h
[R1-GigabitEthernet0/0/1]ip address 10.0.13.1 24
[R1-GigabitEthernet0/0/1]quit

e s
c
[R1]interface interface Serial1/0/0

r
ou
[R1-Serial1/0/0]ip address 10.0.12.1 24

s
[R1-Serial1/0/0]quit

[R2]interface LoopBack 0 Re
i n g
[R2-LoopBack0]ip address 10.0.2.2 32

n
[R2-LoopBack0]quit

ar
[R2]interface GigabitEthernet 0/0/0

e
L
[R2-GigabitEthernet0/0/0]ip address 10.0.234.2 24

e
or
[R2-GigabitEthernet0/0/0]quit
[R2]interface Serial1/0/0

M
[R2-Serial1/0/0]ip address 10.0.12.2 24
[R2-Serial1/0/0]quit

[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 32
[R3-LoopBack0]quit
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.0.234.3 24
[R3-GigabitEthernet0/0/0]quit

HC Series HUAWEI TECHNOLOGIES 194


HCNP-IERS Chapter 2 IS-IS Features and Configurations

[R3]interface GigabitEthernet 0/0/1


[R3-GigabitEthernet0/0/1]ip address 10.0.13.3 24
[R3-GigabitEthernet0/0/1]quit

[R4]interface LoopBack 0
[R4-LoopBack0]ip address 10.0.4.4 32
[R4-LoopBack0]quit
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 10.0.234.4 24
e n
[R4-GigabitEthernet0/0/0]quit
/
o m
i.c
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 10.0.5.5 32
[R5-LoopBack0]quit
w e
[R5]interface GigabitEthernet 0/0/0
u a
[R5-GigabitEthernet0/0/0]ip address 10.0.15.5 24

g .h
n
[R5-GigabitEthernet0/0/0]quit

ni
r
a from R1 to directly
l e
After the configurations are complete, test connectivity
connected interfaces of R2, R3, and R5.
: //
t tp
h
[R1]ping -c 1 10.0.13.3

:
PING 10.0.13.3: 56 data bytes, press CTRL_C to break

s
r c e
Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=1 ms

o u
--- 10.0.13.3 ping statistics ---

e
1 packet(s) transmitted
s
R
1 packet(s) received
0.00% packet loss

i n g
rn
round-trip min/avg/max = 1/1/1 ms

e a
[R1]ping -c 1 10.0.12.2

e L
PING 10.0.12.2: 56 data bytes, press CTRL_C to break

o r
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=26 ms

M --- 10.0.12.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 26/26/26 ms

[R1]ping -c 1 10.0.15.5
PING 10.0.15.5: 56 data bytes, press CTRL_C to break

HC Series HUAWEI TECHNOLOGIES 195


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Reply from 10.0.15.5: bytes=56 Sequence=1 ttl=255 time=1 ms

--- 10.0.15.5 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms

e n
Test connectivity from R4 to directly connected interfaces of R2 and R3.
/
[R4]ping -c 1 10.0.234.2
o m
PING 10.0.234.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.234.2: bytes=56 Sequence=1 ttl=255 time=1 ms
e i.c
aw
u
.h
--- 10.0.234.2 ping statistics ---

g
1 packet(s) transmitted
1 packet(s) received

ni n
r
0.00% packet loss

lea
round-trip min/avg/max = 1/1/1 ms

: //
p
[R4]ping -c 1 10.0.234.3
PING 10.0.234.3: 56
t t
data bytes, press CTRL_C to break

:h
Reply from 10.0.234.3: bytes=56 Sequence=1 ttl=255 time=1 ms

e s
r c
--- 10.0.234.3 ping statistics ---

ou
1 packet(s) transmitted
1 packet(s) received

es
R
0.00% packet loss

g
round-trip min/avg/max = 1/1/1 ms

n i n
a r
L e
Step 2 Perform basic IS-IS configurations.

r e an IS-IS process 1 for each router according to the topology. The following
Configure
o
M
example configures IS-IS process 1 for R1.

R1 resides in Area 49.0002 and uses network-entity 49.0002.0000.0000.0001.


[R1]isis
[R1-isis-1]network-entity 49.0002.0000.0000.0001.00

HC Series HUAWEI TECHNOLOGIES 196


HCNP-IERS Chapter 2 IS-IS Features and Configurations

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

Enable IS-IS on related interfaces, including loopback interfaces. When no IS-IS


e n
/
process ID is specified, by default, IS-IS is enabled in IS-IS process 1.
o m
[R1]interface LoopBack 0
[R1-LoopBack0]isis enable
e i.c
[R1-LoopBack0]quit
aw
[R1]interface GigabitEthernet 0/0/0
u
[R1-GigabitEthernet0/0/0]isis enable
g .h
[R1-GigabitEthernet0/0/0]quit

ni n
r
[R1]interface GigabitEthernet 0/0/1

lea
[R1-GigabitEthernet0/0/1]isis enable

//
[R1-GigabitEthernet0/0/1]quit
[R1]interface Serial 1/0/0
p :
[R1-Serial1/0/0]isis enable
t t
:h
[R1-Serial1/0/0]quit

e s
r c on interfaces.
u
On R1, check IS-IS enabling information
o
e s
[R1]display isis interface

R
i n g Interface information for ISIS(1)
---------------------------------
Interface
a rn Id IPV4.State IPV6.State MTU Type DIS
Loop0
GE0/0/0L e 001
001
Up
Up
Down
Down
1500 L1/L2 --
1497 L1/L2 No/No

r e
GE0/0/1 002 Up Down 1497 L1/L2 No/No

o
S1/0/0 002 Up Down 1500 L1/L2 --

M
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.

HC Series HUAWEI TECHNOLOGIES 197


HCNP-IERS Chapter 2 IS-IS Features and Configurations

[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]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]isis enable
[R2-GigabitEthernet0/0/0]quit
e n
[R2]interface Serial 1/0/0
/
[R2-Serial1/0/0]isis enable
o m
i.c
[R2-Serial1/0/0]quit

w e
On R2, check IS-IS enabling information on interfaces.
u a
[R2]display isis interface
g .h
ni n
r
Interface information for ISIS(1)

lea
---------------------------------

://
Interface Id IPV4.State IPV6.State MTU Type DIS

tp
Loop0 002 Up Down 1500 L1/L2 --
GE0/0/0 001 Up
tDown 1497 L1/L2 No/No

:h
S1/0/0 001 Up Down 1500 L1/L2 --

e s
r c
Configure IS-IS on R3.
s ou
[R3]isis 1
Re
i n g
[R3-isis-1]network-entity 49.0001.0000.0000.0003.00

n
[R3-isis-1]quit

ar
[R3]interface LoopBack 0

e
[R3-LoopBack0]isis enable
L
e
[R3-LoopBack0]quit

or
[R3]interface GigabitEthernet 0/0/0

M
[R3-GigabitEthernet0/0/0]isis enable
[R3-GigabitEthernet0/0/0]quit
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]isis enable
[R3-GigabitEthernet0/0/1]quit

On R3, check IS-IS enabling information on interfaces.


[R3]display isis interface

HC Series HUAWEI TECHNOLOGIES 198


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Interface information for ISIS(1)


---------------------------------
Interface Id IPV4.State IPV6.State MTU Type DIS
Loop0 001 Up Down 1500 L1/L2 --
GE0/0/0 002 Up Down 1497 L1/L2 No/No
GE0/0/1 001 Up Down 1497 L1/L2 No/No

e n
Configure IS-IS on R4.
/
[R4]isis 1
o m
[R4-isis-1]network-entity 49.0001.0000.0000.0004.00
[R4-isis-1]is-level level-1
e i.c
[R4-isis-1]quit
aw
u
.h
[R4]interface LoopBack 0

g
[R4-LoopBack0]isis enable
[R4-LoopBack0]quit

ni n
r
[R4]interface GigabitEthernet 0/0/0

lea
[R4-GigabitEthernet0/0/0]isis enable

//
[R4-GigabitEthernet0/0/0]quit

p :
t t
:h
On R4, check IS-IS enabling information on interfaces.
[R4]display isis interface
e s
r c
ou
Interface information for ISIS(1)

s
e
---------------------------------
Interface Id
R
IPV4.State IPV6.State MTU Type DIS

ing
Loop0 001 Up Down 1500 L1/L2 --

rn
GE0/0/0 001 Up Down 1497 L1/L2 No/No

e a
L
Configure IS-IS on R5.
e
o r
[R5]isis 1

M
[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]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]isis enable
[R5-GigabitEthernet0/0/0]quit

HC Series HUAWEI TECHNOLOGIES 199


HCNP-IERS Chapter 2 IS-IS Features and Configurations

On R5, check IS-IS enabling information on interfaces.


[R5]display isis interface

Interface information for ISIS(1)


---------------------------------
Interface Id IPV4.State IPV6.State MTU Type DIS

e n
/
Loop0 001 Up Down 1500 L1/L2 --

m
GE0/0/0 001 Up Down 1497 L1/L2 No/No

. o
c The
e i
After the configurations are complete, check IS-IS neighbor statuses of routers.
following example displays the IS-IS neighbor status of R1. R1 has three
aw neighbors:
R2, R3, and R5.
. hu
[R1]display isis peer
i n g
r n
Peer information for ISIS(1)

l e a
: //
tp
System Id Interface Circuit Id State HoldTime Type PRI

t
----------------------------------------------------------------------------

h
:
0000.0000.0005 GE0/0/0 0000.0000.0005.01 Up 7s L2 64
0000.0000.0003 GE0/0/1
e s
0000.0000.0001.02 Up 21s L2 64
0000.0000.0002 S1/0/0
r c0000000001 Up 28s L2 --

o u
Total Peer(s): 3

e s
R
i n g output, the System Id field is similar to the Router Id
In the preceding command

rn protocols. You can see that R2, R3, and R5 are in Up state. Their
field of other routing
a
L e relationships with R1 are normal.
IS-IS neighbor

r e to check IS-IS neighbor statuses of other devices.


Continue
o
M[R2]display isis peer

Peer information for ISIS(1)

System Id Interface Circuit Id State HoldTime Type PRI


----------------------------------------------------------------------------
0000.0000.0001 S1/0/0 0000000001 Up 22s L2 --
0000.0000.0003 GE0/0/0 0000.0000.0004.01 Up 24s L1(L1L2) 64

HC Series HUAWEI TECHNOLOGIES 200


HCNP-IERS Chapter 2 IS-IS Features and Configurations

0000.0000.0004 GE0/0/0 0000.0000.0004.01 Up 7s L1 64


0000.0000.0003 GE0/0/0 0000.0000.0002.01 Up 26s L2(L1L2) 64

Total Peer(s): 4

[R3]display isis peer

Peer information for ISIS(1)

e n
System Id Interface Circuit Id State HoldTime Type PRI
/
----------------------------------------------------------------------------
o m
i.c
0000.0000.0001 GE0/0/1 0000.0000.0001.02 Up 8s L2 64
0000.0000.0002 GE0/0/0
0000.0000.0004 GE0/0/0
0000.0000.0004.01 Up
0000.0000.0004.01 Up
30s
7s
L1(L1L2)
L1
w e 64
64
0000.0000.0002 GE0/0/0 0000.0000.0002.01 Up 9s L2(L1L2)
u a 64

g .h
n
Total Peer(s): 4

ni
r
lea
[R4]display isis peer

Peer information for ISIS(1)


: //
t t p
:h
System Id Interface Circuit Id State HoldTime Type PRI

s
----------------------------------------------------------------------------
0000.0000.0003 GE0/0/0

r c e
0000.0000.0004.01 Up 29s L1 64

ou
0000.0000.0002 GE0/0/0 0000.0000.0004.01 Up 23s L1 64

Total Peer(s): 2
es
R
n
[R5]display isis peer

i g
n
e ar Peer information for ISIS(1)

e L
System Id Interface Circuit Id State HoldTime Type PRI

or
----------------------------------------------------------------------------

M
0000.0000.0001 GE0/0/0 0000.0000.0005.01 Up 29s L2 64

Total Peer(s): 1

Step 3 Change the DIS priority.

HC Series HUAWEI TECHNOLOGIES 201


HCNP-IERS Chapter 2 IS-IS Features and Configurations

R2, R3, and R4 establish IS-IS neighbor relationships in a broadcast network.


Therefore, the DIS needs to be elected. By default, the DIS priority is 64. If these
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]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]isis dis-priority 120
[R4-GigabitEthernet0/0/0]quit

e n
/
[R4]display isis interface

o m
Interface information for ISIS(1)
e i.c
---------------------------------

aw
u
Interface Id IPV4.State IPV6.State MTU Type DIS

.h
GE0/0/0 001 Up Down 1497 L1/L2 Yes/No
Loop0 001 Up Down
g
1500 L1/L2 –

i n
r n
Check DIS priorities of neighbors on R2 and R3.

// lea
[R2]display isis peer
p :
t t
:h
Peer information for ISIS(1)

e s
System Id Interface
r c
Circuit Id State HoldTime Type PRI

ou
----------------------------------------------------------------------------
0000.0000.0001 S1/0/0

es 0000000001 Up 29s L2 --

R
0000.0000.0003 GE0/0/0 0000.0000.0004.01 Up 25s L1(L1L2) 64

g
0000.0000.0004 GE0/0/0 0000.0000.0004.01 Up 8s L1 120

n i n
0000.0000.0003 GE0/0/0 0000.0000.0002.01 Up 20s L2(L1L2) 64

e ar
Total Peer(s): 4

e L
or
[R3]display isis peer

M Peer information for ISIS(1)

System Id Interface Circuit Id State HoldTime Type PRI


----------------------------------------------------------------------------
0000.0000.0001 GE0/0/1 0000.0000.0001.02 Up 8s L2 64
0000.0000.0002 GE0/0/0 0000.0000.0004.01 Up 22s L1(L1L2) 64
0000.0000.0004 GE0/0/0 0000.0000.0004.01 Up 7s L1 120
0000.0000.0002 GE0/0/0 0000.0000.0002.01 Up 8s L2(L1L2) 64

HC Series HUAWEI TECHNOLOGIES 202


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Total Peer(s): 4

Step 4 Configure the IS-IS network type.

In a broadcast network, by default, an IS-IS router sets the circuit-type of interfaces


to broadcast and participates in DIS election. In the topology, the Ethernet between

e n
R1 and R5 has only two routers. You can set the circuit-type of interfaces between
/
the two routers to P2P for optimization.
o m
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]isis circuit-type p2p e i.c
[R1-GigabitEthernet0/0/0]quit
aw
u
[R5]interface GigabitEthernet 0/0/0
g .h
[R5-GigabitEthernet0/0/0]isis circuit-type p2p

ni n
[R5-GigabitEthernet0/0/0]quit
r
// lea
:
During the change of the circuit-type, neighbor relationships are established again.
p
t t
Check the configuration. The Circuit Id field format changes and the Circuit

: h uses the display of R1 as an example.


s
Parameters field displays p2p. The following
e
[R1]display isis peer
r c
o u
e s
Peer information for ISIS(1)

R
System Id

i n g
Interface Circuit Id State HoldTime Type
----------------------------------------------------------------------------
PRI

a rn
0000.0000.0005 GE0/0/0 0000000002 Up 22s L2 --

L e
0000.0000.0003 GE0/0/1
0000.0000.0002 S1/0/0
0000.0000.0001.02
0000000001
Up
Up
27s
22s
L2
L2
64
--

r e
o
[R1]display isis interface GigabitEthernet 0/0/0 verbose

M Interface information for ISIS(1)


---------------------------------
Interface Id IPV4.State IPV6.State MTU Type DIS
GE0/0/0 003 Up Down 1497 L1/L2 --
Circuit MT State : Standard
Circuit Parameters : p2p
Description : HUAWEI, AR Series, GigabitEthernet0/0/0 Interface

HC Series HUAWEI TECHNOLOGIES 203


HCNP-IERS Chapter 2 IS-IS Features and Configurations

SNPA Address : d0d0-4b03-d3fc


IP Address : 10.0.15.1
IPV6 Link Local Address :
IPV6 Global Address(es) :
Csnp Timer Value : L12 10
Hello Timer Value : 10
DIS Hello Timer Value :
Hello Multiplier Value : 3
Cost : L1 10 L2 10
e n
Ipv6 Cost : L1 10 L2 10
/
Retransmit Timer Value : L12 5
o m
i.c
LSP-Throttle Timer : L12 50
Bandwidth-Value
Static Bfd
: Low
: NO
100000000 High 0

w e
Dynamic Bfd : NO
u a
Fast-Sense Rpr : NO

g .h
n
Extended-Circuit-Id Value : 0000000003

ni
ar
l e
Step 5 Configure IS-IS to import external
: // routes.
p current route learning. The
Before importing external routes into IS-IS, tcheck
t
: h from R1 to R4 is load balanced
following command output shows that traffic
e s
between GE0/0/1 and S1/0/0.
r c
[R1]display isis route
o u
es
R
Route information for ISIS(1)

i n g-----------------------------

a rn ISIS(1) Level-2 Forwarding Table

L e --------------------------------

r e
o
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
----------------------------------------------------------------------------
M10.0.4.4/32 20 NULL GE0/0/1
S1/0/0
10.0.13.3
10.0.12.2
A/-/-/-

10.0.5.5/32 10 NULL GE0/0/0 10.0.15.5 A/-/-/-


10.0.12.0/24 10 NULL S1/0/0 Direct D/-/L/-
10.0.13.0/24 10 NULL GE0/0/1 Direct D/-/L/-
10.0.234.0/24 20 NULL S1/0/0 10.0.12.2 A/-/-/-
GE0/0/1 10.0.13.3
10.0.15.0/24 10 NULL GE0/0/0 Direct D/-/L/-

HC Series HUAWEI TECHNOLOGIES 204


HCNP-IERS Chapter 2 IS-IS Features and Configurations

10.0.1.1/32 0 NULL Loop0 Direct D/-/L/-


10.0.2.2/32 10 NULL S1/0/0 10.0.12.2 A/-/-/-
10.0.3.3/32 10 NULL GE0/0/1 10.0.13.3 A/-/-/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set

[R1]display ip routing-table protocol isis


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
e n
Public routing table : ISIS
/
Destinations : 5 Routes : 7
o m
ISIS routing table status : <Active>
e i.c
Destinations : 5 Routes : 7

aw
u
Destination/Mask Proto Pre Cost Flags NextHop Interface

g .h
10.0.2.2/32 ISIS-L2 15 10 D 10.0.12.2
ni n
Serial1/0/0

r
lea
10.0.3.3/32 ISIS-L2 15 10 D 10.0.13.3 GigabitEthernet0/0/1
10.0.4.4/32 ISIS-L2 15 20 D 10.0.13.3 GigabitEthernet0/0/1
ISIS-L2 15 20 D 10.0.12.2
: // Serial1/0/0
10.0.5.5/32 ISIS-L2 15 10 D
t p
10.0.15.5

t
GigabitEthernet0/0/0

:h
10.0.234.0/24 ISIS-L2 15 20 D 10.0.12.2 Serial1/0/0

es
ISIS-L2 15 20 D 10.0.13.3 GigabitEthernet0/0/1

r c
ou
ISIS routing table status : <Inactive>
Destinations : 0 Routes : 0

es
Rand so generates different routes for Level-1 and Level-2
i n g
R2 is a Level-1-2 router

n exists on R3.
routers. For Level-1 router, it generates a default route pointing to the null interface.
ralso
e a
This situation

e L
[R2]display isis route

o r
M Route information for ISIS(1)
-----------------------------

ISIS(1) Level-1 Forwarding Table


--------------------------------

IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags


----------------------------------------------------------------------------
0.0.0.0/0 10 NULL

HC Series HUAWEI TECHNOLOGIES 205


HCNP-IERS Chapter 2 IS-IS Features and Configurations

10.0.4.4/32 10 NULL GE0/0/0 10.0.234.4 A/-/L/-


10.0.12.0/24 10 NULL S1/0/0 Direct D/-/L/-
10.0.13.0/24 20 NULL GE0/0/0 10.0.234.3 A/-/L/-
10.0.234.0/24 10 NULL GE0/0/0 Direct D/-/L/-
10.0.2.2/32 0 NULL Loop0 Direct D/-/L/-
10.0.3.3/32 10 NULL GE0/0/0 10.0.234.3 A/-/L/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set

e n
ISIS(1) Level-2 Forwarding Table
/
--------------------------------
o m
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
e i.c
----------------------------------------------------------------------------

aw
10.0.4.4/32 20 NULL
u
10.0.5.5/32 20 NULL S1/0/0 10.0.12.1

g .h
A/-/-/-

n
10.0.12.0/24 10 NULL S1/0/0 Direct D/-/L/-
10.0.13.0/24 20 NULL
ni
r
lea
10.0.234.0/24 10 NULL GE0/0/0 Direct D/-/L/-
10.0.15.0/24 20 NULL S1/0/0 10.0.12.1 A/-/-/-
10.0.1.1/32 10 NULL S1/0/0
: //
10.0.12.1 A/-/-/-
10.0.2.2/32 0 NULL Loop0

t t p Direct D/-/L/-

:h
10.0.3.3/32 10 NULL

s
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,

c e
U-Up/Down Bit Set

r
ou
[R2]display ip routing-table protocol isis
s
Re
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

n g
Public routing table : ISIS

i
n
Destinations : 6 Routes : 6

e ar
L
ISIS routing table status : <Active>

e Destinations : 6 Routes : 6

or
M
Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 ISIS-L2 15 10 D 10.0.12.1 Serial1/0/0


10.0.3.3/32 ISIS-L1 15 10 D 10.0.234.3 GigabitEthernet0/0/0
10.0.4.4/32 ISIS-L1 15 10 D 10.0.234.4 GigabitEthernet0/0/0
10.0.5.5/32 ISIS-L2 15 20 D 10.0.12.1 Serial1/0/0
10.0.13.0/24 ISIS-L1 5 20 D 10.0.234.3 GigabitEthernet0/0/0
10.0.15.0/24 ISIS-L2 15 20 D 10.0.12.1 Serial1/0/0

HC Series HUAWEI TECHNOLOGIES 206


HCNP-IERS Chapter 2 IS-IS Features and Configurations

ISIS routing table status : <Inactive>


Destinations : 0 Routes : 0

[R3]display isis route

Route information for ISIS(1)


-----------------------------

ISIS(1) Level-1 Forwarding Table


e n
--------------------------------
/
o m
i.c
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
----------------------------------------------------------------------------
0.0.0.0/0 10 NULL
w e
10.0.4.4/32 10 NULL GE0/0/0 10.0.234.4
u a
A/-/L/-
10.0.12.0/24 20 NULL GE0/0/0 10.0.234.2

g .h
A/-/L/-

n
10.0.13.0/24 10 NULL GE0/0/1 Direct D/-/L/-
10.0.234.0/24 10 NULL GE0/0/0 Direct
ni D/-/L/-

r
lea
10.0.2.2/32 10 NULL GE0/0/0 10.0.234.2 A/-/L/-
10.0.3.3/32 0 NULL Loop0 Direct D/-/L/-

: //
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set

t t p
s :h
ISIS(1) Level-2 Forwarding Table

c e
--------------------------------

r
IPV4 Destination IntCost
s ou
ExtCost ExitInterface NextHop Flags

10.0.4.4/32 20 e
----------------------------------------------------------------------------

R NULL
10.0.5.5/32

i n
20
g NULL GE0/0/1 10.0.13.1 A/-/-/-
10.0.12.0/24
n 20 NULL
10.0.13.0/24
ar 10 NULL GE0/0/1 Direct D/-/L/-

Le
10.0.234.0/24 10 NULL GE0/0/0 Direct D/-/L/-

re
10.0.15.0/24 20 NULL GE0/0/1 10.0.13.1 A/-/-/-

o
10.0.1.1/32 10 NULL GE0/0/1 10.0.13.1 A/-/-/-

M
10.0.2.2/32
10.0.3.3/32
10
0
NULL
NULL Loop0 Direct D/-/L/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set

[R3]display ip routing-table protocol isis


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : ISIS

HC Series HUAWEI TECHNOLOGIES 207


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Destinations : 6 Routes : 6

ISIS routing table status : <Active>


Destinations : 6 Routes : 6

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 ISIS-L2 15 10 D 10.0.13.1 GigabitEthernet0/0/1


10.0.2.2/32 ISIS-L1 15 10 D 10.0.234.2 GigabitEthernet0/0/0
e n
10.0.4.4/32 ISIS-L1 15 10 D 10.0.234.4 GigabitEthernet0/0/0
/
10.0.5.5/32 ISIS-L2 15 20 D 10.0.13.1 GigabitEthernet0/0/1
o m
i.c
10.0.12.0/24 ISIS-L1 15 20 D 10.0.234.2 GigabitEthernet0/0/0
10.0.15.0/24 ISIS-L2 15 20 D 10.0.13.1
e
GigabitEthernet0/0/1

w
ISIS routing table status : <Inactive>
u a
Destinations : 0 Routes : 0

g .h
i n
n relationships with Level-1
r
R4 is a Level-1 router and can only establish IS-IS neighbor
a router cannot learn
or Level-1-2 routers in the same area. By default, a e
routing information of Level-2 routers and can :only
l Level-1
// access external networks
t
through default routes. The following command tp output shows that R4 has two
: hthe two routes work in load balancing
s
default routes pointing to R2 and R3, and
e
mode.
r c
o u
s
[R4]display isis route

R eRoute information for ISIS(1)

i n g -----------------------------

a rn ISIS(1) Level-1 Forwarding Table

L e --------------------------------

r e
o
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags

M----------------------------------------------------------------------------
0.0.0.0/0 10 NULL GE0/0/0 10.0.234.3 A/-/-/-
GE0/0/0 10.0.234.2
10.0.4.4/32 0 NULL Loop0 Direct D/-/L/-
10.0.12.0/24 20 NULL GE0/0/0 10.0.234.2 A/-/-/-
10.0.13.0/24 20 NULL GE0/0/0 10.0.234.3 A/-/-/-
10.0.234.0/24 10 NULL GE0/0/0 Direct D/-/L/-
10.0.2.2/32 10 NULL GE0/0/0 10.0.234.2 A/-/-/-
10.0.3.3/3 10 NULL GE0/0/0 10.0.234.3 A/-/-/-

HC Series HUAWEI TECHNOLOGIES 208


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,


U-Up/Down Bit Set

[R4]display ip routing protocol isis


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : ISIS
Destinations : 5 Routes : 6

e n
ISIS routing table status : <Active>
/
Destinations : 5 Routes : 6
o m
Destination/Mask Proto Pre Cost Flags NextHop Interface
e i.c
aw
0.0.0.0/0 ISIS-L1 15 10 D 10.0.234.3
u
GigabitEthernet0/0/0
ISIS-L1 15 10 D 10.0.234.2
.h
GigabitEthernet0/0/0

g
n
10.0.2.2/32 ISIS-L1 15 10 D 10.0.234.2 GigabitEthernet0/0/0
10.0.3.3/32 ISIS-L1 15 10 D 10.0.234.3
ni
GigabitEthernet0/0/0

r
lea
10.0.12.0/24 ISIS-L1 15 20 D 10.0.234.2 GigabitEthernet0/0/0
10.0.13.0/24 ISIS-L1 15 20 D 10.0.234.3 GigabitEthernet0/0/0

: //
ISIS routing table status : <Inactive>

t t p
:h
Destinations : 0 Routes : 0

e s
Before configuring IS-IS to importcexternal routes, check route learning.
ur
[R5]display isis route
s o
Re
g
Route information for ISIS(1)

i n -----------------------------

a rn
e
ISIS(1) Level-2 Forwarding Table

e L --------------------------------

o r
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags

M----------------------------------------------------------------------------10.0.4.4/32
30 NULL GE0/0/0 10.0.15.1 A/-/-/-
10.0.5.5/32 0 NULL Loop0 Direct D/-/L/-
10.0.12.0/24 20 NULL GE0/0/0 10.0.15.1 A/-/-/-
10.0.13.0/24 20 NULL GE0/0/0 10.0.15.1 A/-/-/-
10.0.234.0/24 30 NULL GE0/0/0 10.0.15.1 A/-/-/-
10.0.15.0/24 10 NULL GE0/0/0 Direct D/-/L/-
10.0.1.1/32 10 NULL GE0/0/0 10.0.15.1 A/-/-/-

HC Series HUAWEI TECHNOLOGIES 209


HCNP-IERS Chapter 2 IS-IS Features and Configurations

10.0.2.2/32 20 NULL GE0/0/0 10.0.15.1 A/-/-/-


10.0.3.3/32 20 NULL GE0/0/0 10.0.15.1 A/-/-/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set

[R5]display ip routing-table protocol isis


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : ISIS
e n
Destinations : 7 Routes : 7
/
o m
i.c
ISIS routing table status : <Active>
Destinations : 7 Routes : 7

w e
Destination/Mask Proto Pre Cost Flags NextHop
u
Interfacea
g .h
n
10.0.1.1/32 ISIS-L2 15 10 D 10.0.15.1 GigabitEthernet0/0/0
10.0.2.2/32 ISIS-L2 15 20 D 10.0.15.1
ni
GigabitEthernet0/0/0

r
lea
10.0.3.3/32 ISIS-L2 15 20 D 10.0.15.1 GigabitEthernet0/0/0
10.0.4.4/32 ISIS-L2 15 30 D 10.0.15.1 GigabitEthernet0/0/0
10.0.12.0/24 ISIS-L2 15 20 D 10.0.15.1
: // GigabitEthernet0/0/0
10.0.13.0/24 ISIS-L2 15 20 D
t p
10.0.15.1

t
GigabitEthernet0/0/0

:h
10.0.234.0/24 ISIS-L2 15 30 D 10.0.15.1 GigabitEthernet0/0/0

e s
c
ISIS routing table status : <Inactive>

r
ou
Destinations : 0 Routes : 0

e s
Create new loopback interfaces on R5 and import direct routes into the Level-2
R 1.
routing table in IS-IS process

i n g
rn
[R5]interface LoopBack 1

a
[R5-LoopBack1]ip address 192.168.1.1 24

e
[R5-LoopBack1]quit

L
e
[R5]interface LoopBack 2

o r
[R5-LoopBack2]ip address 192.168.2.1 24
[R5-LoopBack2]quit
M[R5]interface LoopBack 3
[R5-LoopBack3]ip address 192.168.3.1 24
[R5-LoopBack3]quit
[R5]isis
[R5-isis-1]import-route direct level-2
[R5-isis-1]quit

HC Series HUAWEI TECHNOLOGIES 210


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Check IS-IS routes of R5.


[R5]display isis route

Route information for ISIS(1)


-----------------------------

ISIS(1) Level-2 Forwarding Table


--------------------------------

e n
/
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags

o m
i.c
----------------------------------------------------------------------------
10.0.4.4/32
10.0.5.5/32
30
0
NULL
NULL
GE0/0/0
Loop0
10.0.15.1
Direct
A/-/-/-

w
D/-/L/- e
10.0.12.0/24 20 NULL GE0/0/0 10.0.15.1
u a
A/-/-/-

.h
10.0.13.0/24 20 NULL GE0/0/0 10.0.15.1 A/-/-/-
10.0.234.0/24 30 NULL GE0/0/0 10.0.15.1

i n g A/-/-/-

n
10.0.15.0/24 10 NULL GE0/0/0 Direct D/-/L/-

r
lea
10.0.1.1/32 10 NULL GE0/0/0 10.0.15.1 A/-/-/-
10.0.2.2/32 20 NULL GE0/0/0 10.0.15.1 A/-/-/-
10.0.3.3/32 20 NULL GE0/0/0
: //
10.0.15.1 A/-/-/-

t p
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,

t
:h
U-Up/Down Bit Set

e s
ISIS(1) Level-2 Redistribute Table

r c
----------------------------------

s ou
Type IPV4 Destination

ReIntCost ExtCost Tag


----------------------------------------------------------------------------

ing
D 192.168.1.0/24 0 0

rn
D 192.168.2.0/24 0 0

a
D 192.168.3.0/24 0 0

L e
e
Type: D-Direct, I-ISIS, S-Static, O-OSPF, B-BGP, R-RIP, U-UNR

o r
MCheck 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.
[R4]display ip routing-table protocol isis
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Public routing table : ISIS

HC Series HUAWEI TECHNOLOGIES 211


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Destinations : 5 Routes : 6

ISIS routing table status : <Active>


Destinations : 5 Routes : 6

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 ISIS-L1 15 10 D 10.0.234.3 GigabitEthernet0/0/0


ISIS-L1 15 10 D 10.0.234.2 GigabitEthernet0/0/0
e n
10.0.2.2/32 ISIS-L1 15 10 D 10.0.234.2 GigabitEthernet0/0/0
/
10.0.3.3/32 ISIS-L1 15 10 D 10.0.234.3 GigabitEthernet0/0/0
o m
i.c
10.0.12.0/24 ISIS-L1 15 20 D 10.0.234.2 GigabitEthernet0/0/0
10.0.13.0/24 ISIS-L1 15 20 D 10.0.234.3
e
GigabitEthernet0/0/0

w
ISIS routing table status : <Inactive>
u a
Destinations : 0 Routes : 0

g .h
[R4]ping -c 1 192.168.1.1
ni n
r
lea
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=253 time=14 ms

: //
--- 192.168.1.1 ping statistics ---

t t p
:h
1 packet(s) transmitted

s
1 packet(s) received
0.00% packet loss

r c e
ou
round-trip min/avg/max = 14/14/14 ms

[R4]ping -c 1 192.168.2.1
es
PING 192.168.2.1: 56
R
data bytes, press CTRL_C to break

n g
Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=253 time=13 ms

i
n
ar
--- 192.168.2.1 ping statistics ---

e
L
1 packet(s) transmitted

e
1 packet(s) received

or0.00% packet loss

M round-trip min/avg/max = 13/13/13 ms

[R4]ping -c 1 192.168.3.1
PING 192.168.3.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.3.1: bytes=56 Sequence=1 ttl=253 time=1 ms

--- 192.168.3.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received

HC Series HUAWEI TECHNOLOGIES 212


HCNP-IERS Chapter 2 IS-IS Features and Configurations

0.00% packet loss


round-trip min/avg/max = 1/1/1 ms

Step 6 Change the IS-IS interface cost.

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.

e n
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
o m
to control route selection of R1.
i . c
Increase the outbound interface cost. w e
a
[R1]interface Serial 1/0/0
. hu
[R1-Serial1/0/0]isis cost 15
[R1-Serial1/0/0]quit
i n g
r n
[R1]display isis route
l e a
: //
tp
Route information for ISIS(1)

ht
-----------------------------

s :
r c e
ISIS(1) Level-2 Forwarding Table
--------------------------------

o u
IPV4 Destination
e s
IntCost ExtCost ExitInterface NextHop Flags

R
----------------------------------------------------------------------------
10.0.4.4/32

i n g
20 NULL GE0/0/1 10.0.13.3 A/-/-/-

rn
10.0.5.5/32 10 NULL GE0/0/0 10.0.15.5 A/-/-/-

a
192.168.1.0/24 10 0 GE0/0/0 10.0.15.5 A/-/-/-

L e
10.0.12.0/24 15 NULL S1/0/0 Direct D/-/L/-

e
192.168.2.0/24 10 0 GE0/0/0 10.0.15.5 A/-/-/-

o r
10.0.13.0/24
192.168.3.0/24
10
10
NULL
0
GE0/0/1
GE0/0/0
Direct
10.0.15.5
D/-/L/-
A/-/-/-
M10.0.234.0/24
10.0.15.0/24
20
10
NULL
NULL
GE0/0/1
GE0/0/0
10.0.13.3
Direct
A/-/-/-
D/-/L/-
10.0.1.1/32 0 NULL Loop0 Direct D/-/L/-
10.0.2.2/32 15 NULL S1/0/0 10.0.12.2 A/-/-/-
10.0.3.3/32 10 NULL GE0/0/1 10.0.13.3 A/-/-/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set

HC Series HUAWEI TECHNOLOGIES 213


HCNP-IERS Chapter 2 IS-IS Features and Configurations

The preceding command output shows that traffic from R1 to R4 is forwarded


through Ethernet interfaces.

Step 7 Configure IS-IS route leaking.

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.
e n
/
According to the longest match principle, R3 forwards packets destined for R5.
o m
Before performing a tracert operation, enable interface unreachable response
i . c on R5.
w e
By default, interface unreachable response is disabled. If it is disabled, the last hop
will expire.
u a
. h
Before interface unreachable response is enabled:
i n g
[R4]tracert 192.168.1.1
r n
traceroute to
e a
192.168.1.1(192.168.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break
l
1 10.0.234.2 2 ms 10.0.234.3 2 ms 10.0.234.2 2 ms
: //
tp
2 10.0.13.1 11 ms 10.0.12.1 9 ms 10.0.13.1 11 ms
3 * * *

h t
:
sis enabled on R5:
r c
After interface unreachable responsee
o u
s
[R5]icmp port-unreachable send

[R4]tracert 192.168.1.1
R e
traceroute to
n g
192.168.1.1(192.168.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break

i
rn
1 10.0.234.2 2 ms 10.0.234.3 2 ms 10.0.234.2 2 ms

a
2 10.0.13.1 2 ms 10.0.12.1 9 ms 10.0.13.1 1 ms

e
e L
3 192.168.1.1 8 ms 1 ms 9 ms

r
o preceding command output shows that tracert packets sent each time are load
The
Mbalanced 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]import-route isis level-2 into level-1
[R3-isis-1]quit

[R4]display isis route

HC Series HUAWEI TECHNOLOGIES 214


HCNP-IERS Chapter 2 IS-IS Features and Configurations

Route information for ISIS(1)


-----------------------------

ISIS(1) Level-1 Forwarding Table


--------------------------------

IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags


----------------------------------------------------------------------------
e n
0.0.0.0/0 10 NULL GE0/0/0 10.0.234.3 A/-/-/-
/
GE0/0/0 10.0.234.2
o m
i.c
10.0.4.4/32 0 NULL Loop0 Direct D/-/L/-
10.0.5.5/32
192.168.1.0/24
30
10
NULL
20
GE0/0/0
GE0/0/0
10.0.234.3
10.0.234.3
A/-/-/U

w
A/-/-/Ue
10.0.12.0/24 20 NULL GE0/0/0 10.0.234.2
u a
A/-/-/-
192.168.2.0/24 10 20 GE0/0/0 10.0.234.3

g .h
A/-/-/U

n
10.0.13.0/24 20 NULL GE0/0/0 10.0.234.3 A/-/-/-
192.168.3.0/24 10 20 GE0/0/0
n
10.0.234.3
i A/-/-/U

r
lea
10.0.234.0/24 10 NULL GE0/0/0 Direct D/-/L/-
10.0.15.0/24 30 NULL GE0/0/0 10.0.234.3 A/-/-/U
10.0.1.1/32 20 NULL GE0/0/0
: //
10.0.234.3 A/-/-/U
10.0.2.2/32 10 NULL GE0/0/0

t t p 10.0.234.2 A/-/-/-

:h
10.0.3.3/32 10 NULL GE0/0/0 10.0.234.3 A/-/-/-

s
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,

c e
U-Up/Down Bit Set

r
ou
[R4]display ip routing-table protocol isis
s
Re
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

n g
Public routing table : ISIS

i
n
Destinations : 11 Routes : 12

e ar
L
ISIS routing table status : <Active>

e Destinations : 11 Routes : 12

or
M
Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 ISIS-L1 15 10 D 10.0.234.3 GigabitEthernet0/0/0


ISIS-L1 15 10 D 10.0.234.2 GigabitEthernet0/0/0
10.0.1.1/32 ISIS-L1 15 20 D 10.0.234.3 GigabitEthernet0/0/0
10.0.2.2/32 ISIS-L1 15 10 D 10.0.234.2 GigabitEthernet0/0/0
10.0.3.3/32 ISIS-L1 15 10 D 10.0.234.3 GigabitEthernet0/0/0
10.0.5.5/32 ISIS-L1 15 30 D 10.0.234.3 GigabitEthernet0/0/0
10.0.12.0/24 ISIS-L1 15 20 D 10.0.234.2 GigabitEthernet0/0/0

HC Series HUAWEI TECHNOLOGIES 215


HCNP-IERS Chapter 2 IS-IS Features and Configurations

10.0.13.0/24 ISIS-L1 15 20 D 10.0.234.3 GigabitEthernet0/0/0


10.0.15.0/24 ISIS-L1 15 30 D 10.0.234.3 GigabitEthernet0/0/0
192.168.1.0/24 ISIS-L1 15 94 D 10.0.234.3 GigabitEthernet0/0/0
192.168.2.0/24 ISIS-L1 15 94 D 10.0.234.3 GigabitEthernet0/0/0
192.168.3.0/24 ISIS-L1 15 94 D 10.0.234.3 GigabitEthernet0/0/0

ISIS routing table status : <Inactive>


Destinations : 0 Routes : 0

e n
[R4]tracert 192.168.1.1
/
traceroute to
o m
192.168.1.1(192.168.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break

i.c
1 10.0.234.3 2 ms 1 ms 1 ms
2 10.0.13.1 2 ms
3 192.168.1.1 1 ms
2 ms 2 ms
1 ms 2 ms
w e
u a
. h
i n g
The preceding tracert operation proves the impact of route leaking on IS-IS route
selection.
r n
----End
l e a
: //
Device Configurations t tp
: h
<R1>display current-configuration

e s
c
[V200R007C00SPC600]
#
ur
sysname R1
s o
#
isis 1 Re
is-level level-2
i n g
rn
network-entity 49.0002.0000.0000.0001.00
#

e a
L
interface Serial1/0/0

e
r
link-protocol ppp

o
ip address 10.0.12.1 255.255.255.0

M isis enable 1
isis cost 15
#
interface GigabitEthernet0/0/0
ip address 10.0.15.1 255.255.255.0
isis enable 1
isis circuit-type p2p
#
interface GigabitEthernet0/0/1

HC Series HUAWEI TECHNOLOGIES 216


HCNP-IERS Chapter 2 IS-IS Features and Configurations

ip address 10.0.13.1 255.255.255.0


isis enable 1
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
isis enable 1
#
return

e n
<R2>display current-configuration
/
[V200R007C00SPC600]
o m
i.c
#
sysname R2
#
w e
isis 1
u a
network-entity 49.0001.0000.0000.0002.00

g .h
n
#
interface Serial1/0/0
ni
r
lea
link-protocol ppp
ip address 10.0.12.2 255.255.255.0
isis enable 1
: //
#

t t p
:h
interface GigabitEthernet0/0/0

s
ip address 10.0.234.2 255.255.255.0
isis enable 1

r c e
ou
#
interface LoopBack0

es
ip address 10.0.2.2 255.255.255.255
isis enable 1
R
#

i n g
return
n
e ar
L
<R3>display current-configuration

e
[V200R007C00SPC600]
#
or
M
sysname R3
#
isis 1
network-entity 49.0001.0000.0000.0003.00
import-route isis level-2 into level-1
#
interface GigabitEthernet0/0/0
ip address 10.0.234.3 255.255.255.0
isis enable 1

HC Series HUAWEI TECHNOLOGIES 217


HCNP-IERS Chapter 2 IS-IS Features and Configurations

#
interface GigabitEthernet0/0/1
ip address 10.0.13.3 255.255.255.0
isis enable 1
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
isis enable 1
#
e n
return
/
o m
i.c
<R4>display current-configuration
[V200R007C00SPC600]
#
w e
sysname R4
u a
#

g .h
n
isis 1
is-level level-1
ni
r
lea
network-entity 49.0001.0000.0000.0004.00
#
interface GigabitEthernet0/0/0
: //
ip address 10.0.234.4 255.255.255.0

t t p
:h
isis enable 1

s
isis dis-priority 120
#

r c e
ou
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
isis enable 1
es
#
R
return

i n g
n
ar
<R5>display current-configuration

e
L
[V200R007C00SPC600]
#
e
or
sysname R5

M
#
icmp port-unreachable send
#
isis 1
is-level level-2
network-entity 49.0002.0000.0000.0005.00
import-route direct
#
interface GigabitEthernet0/0/0

HC Series HUAWEI TECHNOLOGIES 218


HCNP-IERS Chapter 2 IS-IS Features and Configurations

ip address 10.0.15.5 255.255.255.0


isis enable 1
isis circuit-type p2p
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
isis enable 1
#
interface LoopBack1
e n
ip address 192.168.1.1 255.255.255.0
/
#
o m
i.c
interface LoopBack2
ip address 192.168.2.1 255.255.255.0
#
w e
interface LoopBack3
u a
ip address 192.168.3.1 255.255.255.0

g .h
n
#
return
ni
r
//lea
p :
t t
s:h
r c e
sou
Re
i n g
n
e ar
e L
or
M

HC Series HUAWEI TECHNOLOGIES 219


HCNP-IERS Chapter 3 BGP Features and Configurations

Chapter 3 BGP Features and Configurations

Lab 3-1 IBGP and EBGP

Learning Objectives

The objectives of this lab are to learn and understand:


e n
/
 How to configure IBGP
o m
 How to configure BGP in multiple areas
e i.c
 How to check the BGP neighbor table and database
a w
How to configure a BGP source address for initiating auconnection

. h
How to configure EBGP multihop g
inEBGP routes

r
How to observe next-hop changes in IBGP and n
How to configure a next hop in IBGP le
a
// in BGP

:

t tp
How to configure the network command

: h
Topology
e s
r c
o u
es
R
i n g
a rn
L e
r e
o
M
Figure 4-1 IBGP and EBGP

HC Series HUAWEI TECHNOLOGIES 220


HCNP-IERS Chapter 3 BGP Features and Configurations

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
e n
information transmission. /
o m
Tasks
e i.c
Step 1 Set basic parameters and configure IP addresses.aw

Configure IP addresses and masks for all the routers. The mask.of huIP addresses for
Loopback1 of R4 and R5 is 24 bits, which is used to simulatei n ga user network.
r n
<R1>system-view

l e a
//
Enter system view, return user view with Ctrl+Z.

:
tp
[R1]interface Serial 1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 24

ht
:
[R1-Serial1/0/0]quit
[R1]interface Serial 3/0/0
e s
r c
[R1-Serial3/0/0]ip address 10.0.14.1 24
[R1-Serial3/0/0]quit
o u
[R1]interface LoopBack 0

es
R
[R1-LoopBack0]ip address 10.0.1.1 32
[R1-LoopBack0]quit

i n g
rn
<R2>system-view

a
L e
Enter system view, return user view with Ctrl+Z.
[R2]interface Serial 1/0/0

r e
[R2-Serial1/0/0]ip address 10.0.12.2 24

o
[R2-Serial1/0/0]quit

M[R2]interface Serial 2/0/0


[R2-Serial2/0/0]ip address 10.0.23.2 24
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 32

<R3>system-view
Enter system view, return user view with Ctrl+Z.

HC Series HUAWEI TECHNOLOGIES 221


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3]interface Serial 2/0/0


[R3-Serial2/0/0]ip address 10.0.23.3 24
[R3-Serial2/0/0]quit
[R3]interface Serial 3/0/0
[R3-Serial3/0/0]ip address 10.0.35.3 24
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 32

e n
<R4>system-view
/
Enter system view, return user view with Ctrl+Z.
o m
i.c
[R4]interface Serial 1/0/0
[R4-Serial1/0/0]ip address 10.0.14.4 24
[R4-Serial1/0/0]quit
w e
[R3]interface LoopBack 0
u a
[R4-LoopBack0]ip address 10.0.4.4 32

g .h
<R5>system-view
ni n
r
lea
Enter system view, return user view with Ctrl+Z.
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]ip address 10.0.35.5 24
: //
[R5-Serial1/0/0]quit

t t p
:h
[R3]interface LoopBack 0

s
[R5-LoopBack0]ip address 10.0.5.5 32

r c e
Test direct link connectivity. u
s o
Re
<R1>ping -c 1 10.0.12.2

g
PING 10.0.12.2: 56 data bytes, press CTRL_C to break

i n
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=34 ms

a rn
e
--- 10.0.12.2 ping statistics ---

L
1 packet(s) transmitted

e
o r
1 packet(s) received
0.00% packet loss

M round-trip min/avg/max = 34/34/34 ms

<R1>ping -c 1 10.0.14.4
PING 10.0.14.4: 56 data bytes, press CTRL_C to break
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=40 ms

--- 10.0.14.4 ping statistics ---


1 packet(s) transmitted

HC Series HUAWEI TECHNOLOGIES 222


HCNP-IERS Chapter 3 BGP Features and Configurations

1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/40/40 ms

<R3>ping -c 1 10.0.23.2
PING 10.0.23.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.2: bytes=56 Sequence=1 ttl=255 time=33 ms

--- 10.0.23.2 ping statistics ---


e n
1 packet(s) transmitted
/
1 packet(s) received
o m
i.c
0.00% packet loss
round-trip min/avg/max = 33/33/33 ms

w e
<R3>ping -c 1 10.0.35.5
u a
PING 10.0.35.5: 56 data bytes, press CTRL_C to break

g .h
n
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=35 ms

ni
r
lea
--- 10.0.35.5 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
: //
0.00% packet loss

t t p
:h
round-trip min/avg/max = 35/35/35 ms

e s
r c that direct link connectivity is normal.
The preceding command output shows

o u
Step 2 Configure an IGP
e s in an AS.
Use OSPF as an IGPg
R
in AS 64512 and advertise the network segment connected to
i n
n Run OSPF on the network segment connected to S1/0/0 of R1.
Loopback0 into OSPF.
a r
L e
[R1]router id 10.0.1.1
[R1]ospf 1
e
or
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0

M[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.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

HC Series HUAWEI TECHNOLOGIES 223


HCNP-IERS Chapter 3 BGP Features and Configurations

[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit

Run OSPF on the network segment connected to S2/0/0 of R3.


e n
/
m
[R3]router id 10.0.3.3
[R3]ospf 1
o
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0
e i.c
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
aw
u
.h
[R3-ospf-1-area-0.0.0.0]quit

g
[R3-ospf-1]quit

ni n
When configuring the network command, use the e
r
a mask 0.0.0.0.
l wildcard

After the configurations are complete, check p :// OSPF neighbor relationships
t t whether
are established.
: h
[R2]display ospf peer
e s
r c
o u
OSPF Process 1 with Router ID 10.0.2.2

e
Neighbors s
R
n g
Area 0.0.0.0 interface 10.0.12.2(Serial1/0/0)'s neighbors

i
rn
Router ID: 10.0.1.1 Address: 10.0.12.1

a
State: Full Mode:Nbr is Slave Priority: 1

L e
DR: None BDR: None MTU: 0

e
Dead timer due in 37 sec

o r
Retrans timer interval: 5

M
Neighbor is up for 00:01:05
Authentication Sequence: [ 0 ]

Neighbors

Area 0.0.0.0 interface 10.0.23.2(Serial2/0/0)'s neighbors


Router ID: 10.0.3.3 Address: 10.0.23.3
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 0

HC Series HUAWEI TECHNOLOGIES 224


HCNP-IERS Chapter 3 BGP Features and Configurations

Dead timer due in 33 sec


Retrans timer interval: 5
Neighbor is up for 00:00:19
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.

e n
[R1]display ip routing-table
/
Route Flags: R - relay, D - download to fib

o m
i.c
----------------------------------------------------------------------------

e
Routing Tables: Public

w
Destinations : 15 Routes : 15

u a
.h
Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 Direct 0 0 D 127.0.0.1


i n g
LoopBack0
10.0.2.2/32 OSPF 10 1562 D 10.0.12.2
r n
Serial1/0/0

lea
10.0.3.3/32 OSPF 10 3124 D 10.0.12.2 Serial1/0/0

://
10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial1/0/0

tp
10.0.12.1/32 Direct 0 0 D 127.0.0.1 Serial1/0/0

t
:h
10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.14.0/24 Direct 0 0
e s D 10.0.14.1 Serial3/0/0
10.0.14.1/32 Direct 0 0
r c D 127.0.0.1 Serial3/0/0

ou
10.0.14.4/32 Direct 0 0 D 10.0.14.4 Serial3/0/0
10.0.14.255/32 Direct 0
es 0 D 127.0.0.1 Serial3/0/0
10.0.23.0/24 OSPF
R 10 3124 D 10.0.12.2 Serial1/0/0

ing
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

n
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

ar
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Le
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

r e
[R2]display ip routing-table
o
Route Flags: R - relay, D - download to fib
M
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 OSPF 10 1562 D 10.0.12.1 Serial1/0/0


10.0.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0

HC Series HUAWEI TECHNOLOGIES 225


HCNP-IERS Chapter 3 BGP Features and Configurations

10.0.3.3/32 OSPF 10 1562 D 10.0.23.3 Serial2/0/0


10.0.12.0/24 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.1/32 Direct 0 0 D 10.0.12.1 Serial1/0/0
10.0.12.2/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.23.0/24 Direct 0 0 D 10.0.23.2 Serial2/0/0
10.0.23.2/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
10.0.23.3/32 Direct 0 0 D 10.0.23.3 Serial2/0/0
10.0.23.255/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
e n
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
/
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
o m
i.c
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

w e
[R3]display ip routing-table
u a
Route Flags: R - relay, D - download to fib

g .h
n
----------------------------------------------------------------------------
Routing Tables: Public
ni
r
lea
Destinations : 16 Routes : 16

Destination/Mask Proto Pre Cost


: //
Flags NextHop Interface

t t p
:h
10.0.1.1/32 OSPF 10 3124 D 10.0.23.2 Serial2/0/0

es
10.0.2.2/32 OSPF 10 1562 D 10.0.23.2 Serial2/0/0

c
10.0.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0

r
ou
10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0
10.0.23.0/24 Direct 0 0 D 10.0.23.3 Serial2/0/0
10.0.23.2/32 Direct 0
es 0 D 10.0.23.2 Serial2/0/0
10.0.23.3/32
R
Direct 0 0 D 127.0.0.1 Serial2/0/0
10.0.23.255/32

i n g
Direct 0 0 D 127.0.0.1 Serial2/0/0
10.0.35.0/24
n Direct 0 0 D 10.0.35.3 Serial3/0/0

ar
10.0.35.3/32 Direct 0 0 D 127.0.0.1 Serial3/0/0

Le
10.0.35.5/32 Direct 0 0 D 10.0.35.5 Serial3/0/0

re
10.0.35.255/32 Direct 0 0 D 127.0.0.1 Serial3/0/0

o 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

M 127.0.0.1/32 Direct 0
127.255.255.255/32 Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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.

HC Series HUAWEI TECHNOLOGIES 226


HCNP-IERS Chapter 3 BGP Features and Configurations

Step 3 Configure IBGP peers.

Configure IBGP full mesh on R1, R2, and R3. Use Loopback0 address as a source
address.
[R1]bgp 64512
[R1-bgp]peer 10.0.2.2 as-number 64512
[R1-bgp]peer 10.0.2.2 connect-interface LoopBack 0
[R1-bgp]peer 10.0.3.3 as-number 64512
e n
/
m
[R1-bgp]peer 10.0.3.3 connect-interface LoopBack 0
[R1-bgp]quit
o
[R2]bgp 64512
e i.c
[R2-bgp]peer 10.0.1.1 as-number 64512
aw
[R2-bgp]peer 10.0.1.1 connect-interface loopback 0
u
[R2-bgp]peer 10.0.3.3 as-number 64512
g .h
[R2-bgp]peer 10.0.3.3 connect-interface LoopBack 0

ni n
r
[R2-bgp]quit

[R3]bgp 64512
//lea
[R3-bgp]peer 10.0.1.1 as-number 64512
p :
t t
[R3-bgp]peer 10.0.1.1 connect-interface loopback 0

:h
[R3-bgp]peer 10.0.2.2 as-number 64512

s
[R3-bgp]peer 10.0.2.2 connect-interface LoopBack 0

e
[R3-bgp]quit
r c
s ou
e
Run the display tcp status command to check the TCP port connection status.
R
[R2]display tcp status
TCPCB
i n g
Tid/Soid Local Add:port Foreign Add:port VPNID State
n
ar
37a32f14 76 /1 0.0.0.0:80 0.0.0.0:0 23553 Listening

Le
37a33b34 239/2 0.0.0.0:179 10.0.1.1:0 0 Listening
39052914 239/6 0.0.0.0:179 10.0.3.3:0 0 Listening

r e
37a3321c 76 /3 0.0.0.0:443 0.0.0.0:0 23553 Listening
o
39052c1c 239/11 10.0.2.2:179 10.0.3.3:54086 0 Established

M
3905260c 239/5 10.0.2.2:61635 10.0.1.1:179 0 Established

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.

HC Series HUAWEI TECHNOLOGIES 227


HCNP-IERS Chapter 3 BGP Features and Configurations

Run the display bgp peer command to check BGP peer relationships of routers.
[R1]display bgp peer

BGP local router ID : 10.0.1.1


Local AS number : 64512
Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

e n
/
10.0.2.2 4 64512 273 277 0 02:15:53 Established 0

o m
i.c
10.0.3.3 4 64512 276 276 0 02:15:53 Established 0

[R2]display bgp peer


w e
u a
.h
BGP local router ID : 10.0.2.2
Local AS number : 64512

i n g
n
Total number of peers : 2 Peers in established state : 2

r
lea
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

: //
10.0.1.1 4 64512 38 38

t t p
0 00:18:02 Established 0

:h
10.0.3.3 4 64512 1000 1000 0 16:38:38 Established 0

[R3]display bgp peer


e s
r c
BGP local router ID : 10.0.3.3

s ou
Local AS number : 64512
Total number of peers : 2
Re Peers in established state : 2

i n g
n
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

ar
Le
10.0.1.1 4 64512 39 39 0 00:18:35 Established 0

e
10.0.2.2 4 64512 1001 1001 0 16:39:11 Established 0

o r
MThe 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

HC Series HUAWEI TECHNOLOGIES 228


HCNP-IERS Chapter 3 BGP Features and Configurations

R2 is established and run the display bgp peer verbose command to check the
negotiation interval after the BGP peer relationship is established.
[R1-bgp] bgp 64512
[R1-bgp] timer keepalive 30 hold 90
Warning: Changing the parameter in this command resets the peer session. Continue?[Y/N]:y
[R1-bgp]quit

e n
Note that changing the Keepalive time and hold time will restart the BGP session. /
o m
i.c
[R2]display bgp peer verbose

BGP Peer is 10.0.1.1, remote AS 64512


w e
Type: IBGP link

u a
.h
BGP version 4, Remote router ID 10.0.1.1
Update-group ID: 1
BGP current state: Established, Up for 00h07m19s
i n g
BGP current event: KATimerExpired
r n
lea
BGP last state: OpenConfirm
BGP Peer Up count: 2

: //
Received total routes: 0
Received active routes total: 0
t t p
Advertised total routes: 0

s :h
Port: Local - 50117

r c e
Remote - 179
Configured: Connect-retry Time: 32 sec

ou
Configured: Active Hold Time: 180 sec Keepalive Time:60 sec

es
Received : Active Hold Time: 90 sec

R
Negotiated: Active Hold Time: 90 sec Keepalive Time:30 sec

i n g
Peer optional capabilities:
Peer supports bgp multi-protocol extension

n
ar
Peer supports bgp route refresh capability

L e
Peer supports bgp 4-byte-as capability
Address family IPv4 Unicast: advertised and received

e
or
Received: Total 16 messages
Update messages 0

M Open messages
KeepAlive messages
1
15
Notification messages 0
Refresh messages 0
Sent: Total 16 messages
Update messages 0
Open messages 1
KeepAlive messages 15

HC Series HUAWEI TECHNOLOGIES 229


HCNP-IERS Chapter 3 BGP Features and Configurations

Notification messages 0
Refresh messages 0
Authentication type configured: None
Last keepalive received: 2011/12/07 08:33:52
Minimum route advertisement interval is 15 seconds
Optional capabilities:
Route refresh capability has been enabled
4-byte-as capability has been enabled
Connect-interface has been configured
e n
Peer Preferred Value: 0
/
Routing policy configured:
o m
i.c
No routing policy is configured

BGP Peer is 10.0.3.3, remote AS 64512


w e
Type: IBGP link
u a
BGP version 4, Remote router ID 10.0.3.3

g .h
n
Update-group ID: 1
BGP current state: Established, Up for 16h28m14s
ni
r
lea
BGP current event: RecvKeepalive
BGP last state: OpenConfirm
BGP Peer Up count: 1
: //
Received total routes: 0

t t p
:h
Received active routes total: 0

s
Advertised total routes: 0
Port: Local - 179
c e
Remote - 49663

r
ou
Configured: Connect-retry Time: 32 sec
Configured: Active Hold Time: 180 sec Keepalive Time:60 sec

es
Received : Active Hold Time: 180 sec

R
Negotiated: Active Hold Time: 180 sec Keepalive Time:60 sec

n g
Peer optional capabilities:

i
n
Peer supports bgp multi-protocol extension

ar
Peer supports bgp route refresh capability

e
L
Peer supports bgp 4-byte-as capability

e Address family IPv4 Unicast: advertised and received

or
Received: Total 990 messages

M Update messages
Open messages
0
1
KeepAlive messages 989
Notification messages 0
Refresh messages 0
Sent: Total 990 messages
Update messages 0
Open messages 1
KeepAlive messages 989

HC Series HUAWEI TECHNOLOGIES 230


HCNP-IERS Chapter 3 BGP Features and Configurations

Notification messages 0
Refresh messages 0
Authentication type configured: None
Last keepalive received: 2011/12/07 08:34:17
Minimum route advertisement interval is 15 seconds
Optional capabilities:
Route refresh capability has been enabled
4-byte-as capability has been enabled
Connect-interface has been configured
e n
Peer Preferred Value: 0
/
Routing policy configured:
o m
i.c
No routing policy is configured

e
w Active Hold
The preceding command output of R2 shows that the default parameter a
Time is 180s and Keepalive Time is 60s.
. hu
After parameters of R1 are changed, the Active Hold Timein
g
r nvalue. Therefore, the Active
of packets received by R2
becomes 90s. The negotiated parameters use the smaller
l e a
Hold Time and Keepalive Timer that are negotiated
: / / between R2 and R1 are 90s and
t p
30s respectively, but the parameters of R3 still
t
use the default values.

Therefore, the negotiated parameters :arehthe same as the configured parameters.


e s
r c
That is, the Active Hold Time and Keepalive Timer on R2 and R3 are 180s and 60s
respectively.
o u
s
Step 4 Configure EBGP
Re peers.
g
Configure BGP onnR4, set the local AS number to 64513, and establish an EBGP peer
i
a rn R4 and R1. During EBGP peer relationship establishment,
relationship between

L
specify theeaddress of Loopback0 as the source address and set ebgp-max-hop to 2.
Add ae32-bit static route to the Loopback0 address of the peer device to ensure that
r
anoEBGP peer relationship can be established normally.
M[R1]ip route-static 10.0.4.4 32 10.0.14.4

[R4]ip route-static 10.0.1.1 32 10.0.14.1

[R1]bgp 64512
[R1-bgp]peer 10.0.4.4 as-number 64513
[R1-bgp]peer 10.0.4.4 ebgp-max-hop 2

HC Series HUAWEI TECHNOLOGIES 231


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1-bgp]peer 10.0.4.4 connect-interface LoopBack0


[R1-bgp]quit

[R4]router id 10.0.4.4
[R4]bgp 64513
[R4-bgp]peer 10.0.1.1 as-number 64512
[R4-bgp]peer 10.0.1.1 ebgp-max-hop 2
[R4-bgp]peer 10.0.1.1 connect-interface LoopBack0
[R4-bgp]quit
e n
/
o m
After an EBGP peer relationship is established, run the display bgp peer command
i . c
to check the peer relationship status.
w e
[R4]display bgp peer
a
. hu
BGP local router ID : 10.0.4.4
Local AS number : 64513
i n g
Total number of peers : 1
r n
Peers in established state : 1

l e a
Peer V AS MsgRcvd MsgSent
: //
OutQ Up/Down State PrefRcv

t tp
h
10.0.1.1 4 64512 4 5 0 00:01:18 Established 0

:
s command on R4 to check the TTL value of
r
Run the debugging ip packet verbosec e
Keepalive packets.
o u
e s
<R4>terminal monitor
R
i n g
<R4>terminal debugging
<R4>debugging ip packet
<R4>

a rn
e
Oct 31 2016 17:22:44.900.2+00:00 R4 IP/7/debug_case:

L
Receiving, interface = Serial1/0/0, version = 4, headlen = 20, tos = 192,

e
o r
pktlen = 40, pktid = 429, offset = 0, ttl = 2, protocol = 6,
checksum = 40287, s = 10.0.1.1, d = 10.0.4.4

Mprompt: IP Process By Board Begin!

45 c0 00 28 01 ad 00 00 02 06 9d 5f 0a 00 01 01
0a 00 04 04

Oct 31 2016 17:22:44.900.3+00:00 R4 IP/7/debug_case:


Receiving, interface = Serial1/0/0, version = 4, headlen = 20, tos = 192,
pktlen = 40, pktid = 429, offset = 0, ttl = 2, protocol = 6,

HC Series HUAWEI TECHNOLOGIES 232


HCNP-IERS Chapter 3 BGP Features and Configurations

checksum = 40287, s = 10.0.1.1, d = 10.0.4.4


prompt: Before search fib per flow in IP Forward.

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.

e n
[R3]bgp 64512
/
[R3-bgp]peer 10.0.35.5 as-number 64514

o m
i.c
[R3-bgp]quit

[R5]router id 10.0.5.5
w e
[R5]bgp 64514

u a
.h
[R5-bgp]peer 10.0.35.3 as-number 64512
[R5-bgp]quit

i n g
[R5]display bgp peer
r n
BGP local router ID : 10.0.5.5
//lea
Local AS number : 64514
p :
Total number of peers : 1
t t
Peers in established state : 1

s:h
Peer V AS
e
MsgRcvd MsgSent OutQ Up/Down State PrefRcv

r c
ou
10.0.35.3 4 64512 2 3 0 00:00:46 Established 0

es
R command to advertise routing information.
i n g
Step 5 Run the network

rn on R4 and configure an IP address 10.1.4.4/24 for Loopback1.


Configure Loopback1

e a command to advertise the network segment of Loopback1 into


Run the network
BGP.
e L
or
M
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 10.1.4.4 24
[R4-LoopBack1]quit
[R4]bgp 64513
[R4-bgp]network 10.1.4.4 24
[R4-bgp]quit

HC Series HUAWEI TECHNOLOGIES 233


HCNP-IERS Chapter 3 BGP Features and Configurations

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
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
e n
Destinations : 18 Routes : 18
/
o m
i.c
Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0


w e
10.0.2.2/32 OSPF 10 1562 D 10.0.12.2
u a
Serial1/0/0
10.0.3.3/32 OSPF 10 3124 D 10.0.12.2
.h
Serial1/0/0

g
n
10.0.4.4/32 Static 60 0 RD 10.0.14.4 Serial3/0/0
10.0.12.0/24 Direct 0 0 D 10.0.12.1
ni
Serial1/0/0

r
lea
10.0.12.1/32 Direct 0 0 D 127.0.0.1 Serial1/0/0

//
10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.255/32 Direct 0 0 D
:
127.0.0.1

p
Serial1/0/0
10.0.14.0/24 Direct 0 0
t t
D 10.0.14.1 Serial3/0/0

:h
10.0.14.1/32 Direct 0 0 D 127.0.0.1 Serial3/0/0

es
10.0.14.4/32 Direct 0 0 D 10.0.14.4 Serial3/0/0

c
10.0.14.255/32 Direct 0 0 D 127.0.0.1 Serial3/0/0

r
ou
10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial1/0/0

s
10.1.4.0/24 EBGP 255 0 RD 10.0.4.4 Serial3/0/0
127.0.0.0/8
127.0.0.1/32
Direct 0

R
Direct 0
e 0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0

i n g
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

n
255.255.255.255/3 Direct 0 0 D 127.0.0.1 InLoopBack0

e ar
e L
The command output shows that R1 has learned the EBGP route to 10.1.4.0/24.

or
Check whether R3 has the route to 10.1.4.0/24.
M
[R3]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16

Destination/Mask Proto Pre Cost Flags NextHop Interface

HC Series HUAWEI TECHNOLOGIES 234


HCNP-IERS Chapter 3 BGP Features and Configurations

10.0.1.1/32 OSPF 10 3124 D 10.0.23.2 Serial2/0/0


10.0.2.2/32 OSPF 10 1562 D 10.0.23.2 Serial2/0/0
10.0.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0
10.0.23.0/24 Direct 0 0 D 10.0.23.3 Serial2/0/0
10.0.23.2/32 Direct 0 0 D 10.0.23.2 Serial2/0/0
10.0.23.3/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
10.0.23.255/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
e n
10.0.35.0/24 Direct 0 0 D 10.0.35.3 Serial3/0/0
/
10.0.35.3/32 Direct 0 0 D 127.0.0.1 Serial3/0/0
o m
i.c
10.0.35.5/32 Direct 0 0 D 10.0.35.5 Serial3/0/0
10.0.35.255/32
127.0.0.0/8
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
Serial3/0/0
InLoopBack0
w e
127.0.0.1/32 Direct 0 0 D 127.0.0.1
u a
InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1

g .h
InLoopBack0

n
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

ni
The preceding command output shows that R3 doesa
r
l e not have any BGP route to
10.1.4.4.
: //
t tp
Check the BGP routing table of R3.
: h
[R3]display bgp routing-table
e s
r c
o u
BGP Local router ID is 10.0.3.3

es
Status codes: * - valid, > - best, d - damped,

R
h - history, i - internal, s - suppressed, S - Stale

i n g
Origin : i - IGP, e - EGP, ? - incomplete

rn
Total Number of Routes: 1

a
L e
Network NextHop MED LocPrf PrefVal Path/Ogn

i
r e10.1.4.0/24 10.0.4.4 0 100 0 64513i

o preceding command output shows that there is a BGP route to 10.1.4.0/24, but
M
The
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.

HC Series HUAWEI TECHNOLOGIES 235


HCNP-IERS Chapter 3 BGP Features and Configurations

Run the next-hop-local command on R1 and check the BGP routing table of R3
again.
[R1]bgp 64512
[R1-bgp]peer 10.0.3.3 next-hop-local
[R1-bgp]peer 10.0.2.2 next-hop-local
[R1-bgp]quit

[R3]display bgp routing-table


e n
/
BGP Local router ID is 10.0.3.3
o m
i.c
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale

w e
a
Origin : i - IGP, e - EGP, ? - incomplete

u
Total Number of Routes: 1

g .h
Network NextHop MED LocPrf
n
PrefVal Path/Ogn

ni
r
lea
*>i 10.1.4.0/24 10.0.1.1 0 100 0 64513i

: / /
The preceding command output shows that the
t p next hop of the BGP route
t with * and >, indicating that this route
h
10.1.4.0/24 is 10.0.1.1 and this route is marked
:
is correct and the optimal route.
e s
r c
u
Check the IP routing table of R3.
o
s
Re
[R3]display ip routing-table
Route Flags: R - relay, D - download to fib

i n g
----------------------------------------------------------------------------

rn
Routing Tables: Public

e a
Destinations : 17 Routes : 17

e L
r
Destination/Mask Proto Pre Cost Flags NextHop Interface

o
M 10.0.1.1/32
10.0.2.2/32
OSPF
OSPF
10
10
3124
1562
D
D
10.0.23.2
10.0.23.2
Serial2/0/0
Serial2/0/0
10.0.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial2/0/0
10.0.23.0/24 Direct 0 0 D 10.0.23.3 Serial2/0/0
10.0.23.2/32 Direct 0 0 D 10.0.23.2 Serial2/0/0
10.0.23.3/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
10.0.23.255/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
10.0.35.0/24 Direct 0 0 D 10.0.35.3 Serial3/0/0

HC Series HUAWEI TECHNOLOGIES 236


HCNP-IERS Chapter 3 BGP Features and Configurations

10.0.35.3/32 Direct 0 0 D 127.0.0.1 Serial3/0/0


10.0.35.5/32 Direct 0 0 D 10.0.35.5 Serial3/0/0
10.0.35.255/32 Direct 0 0 D 127.0.0.1 Serial3/0/0
10.1.4.0/24 IBGP 255 0 RD 10.0.1.1 Serial2/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e n
/
The IP routing table of R3 contains the route 10.1.4.0/24.
o m
Create Loopback1 on R5, configure an IP address 10.1.5.5/24 for Loopback1, i . c
advertise it into BGP, and configure next-hop-local.
w e
a
[R5]interface LoopBack 1

. hu
[R5-LoopBack1]ip address 10.1.5.5 24
[R5-LoopBack1]quit
i n g
r n
[R5]bgp 64514

l e a
[R5-bgp]network 10.1.5.0 24

: //
[R3]bgp 64512
t tp
[R3-bgp]peer 10.0.1.1 next-hop-local
: h
[R3-bgp]peer 10.0.2.2 next-hop-local
e s
r c
u
Check the BGP routing tableoof R4 to determine whether R4 learns a route to the
e s to Loopback1 of R5. Analyze the display bgp
R
network segment connected

n
routing-table command
i g output.
rn
[R4]display bgp routing-table
a
L e
BGP Local router ID is 10.0.4.4

r e
Status codes: * - valid, > - best, d - damped,

o h - history, i - internal, s - suppressed, S - Stale

M Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 2


Network NextHop MED LocPrf PrefVal Path/Ogn

*> 10.1.4.0/24 0.0.0.0 0 0 i


*> 10.1.5.0/24 10.0.1.1 0 64512 64514i

HC Series HUAWEI TECHNOLOGIES 237


HCNP-IERS Chapter 3 BGP Features and Configurations

Perform a ping with the source address on R5 to test connectivity to Loopback1


address of R4.
[R5]ping -c 1 -a 10.1.5.5 10.1.4.4
PING 10.1.4.4: 56 data bytes, press CTRL_C to break
Reply from 10.1.4.4: bytes=56 Sequence=1 ttl=252 time=125 ms

e n
--- 10.1.4.4 ping statistics ---
/
1 packet(s) transmitted

o m
i.c
1 packet(s) received

e
0.00% packet loss
round-trip min/avg/max = 125/125/125 ms

aw
u
Additional Exercises: Analysis and Verification
g .h
ni n
In which situation is it suitable to establish an EBGP peer relationship using physical
r
lea
addresses?

: //
Why does the TTL value of packets sent to EBGP peers default to 1? What is the

t t p
default configuration of the peer group_name ebgp-max-hop [ hop-count ]
command?
s :h
r c e
ou
Device Configurations

es
[R1]display current-configuration
[V200R007C00SPC600]
R
#
sysname R1
i n g
n
ar
#

# L e
router id 10.0.1.1

e
or
interface Serial1/0/0
link-protocol ppp

M
ip address 10.0.12.1 255.255.255.0
#
interface Serial3/0/0
link-protocol ppp
ip address 10.0.14.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255

HC Series HUAWEI TECHNOLOGIES 238


HCNP-IERS Chapter 3 BGP Features and Configurations

#
bgp 64512
timer keepalive 30 hold 90
peer 10.0.2.2 as-number 64512
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.3.3 as-number 64512
peer 10.0.3.3 connect-interface LoopBack0
peer 10.0.4.4 as-number 64513
peer 10.0.4.4 ebgp-max-hop 2
e n
peer 10.0.4.4 connect-interface LoopBack0
/
#
o m
i.c
ipv4-family unicast
undo synchronization
peer 10.0.2.2 enable
w e
peer 10.0.2.2 next-hop-local
u a
peer 10.0.3.3 enable

g .h
n
peer 10.0.3.3 next-hop-local
peer 10.0.4.4 enable
ni
r
lea
#
ospf 1
area 0.0.0.0
: //
network 10.0.12.0 0.0.0.255

t t p
:h
network 10.0.1.1 0.0.0.0

s
#

c e
ip route-static 10.0.4.4 255.255.255.255 10.0.14.4

r
ou
return

es
[R2]display current-configuration
[V200R007C00SPC600]
R
#

i n g
sysname R2
n
#

e ar
L
router id 10.0.2.2
#
e
or
interface Serial1/0/0

M
link-protocol ppp
ip address 10.0.12.2 255.255.255.0
#
interface Serial2/0/0
link-protocol ppp
ip address 10.0.23.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255

HC Series HUAWEI TECHNOLOGIES 239


HCNP-IERS Chapter 3 BGP Features and Configurations

#
bgp 64512
peer 10.0.1.1 as-number 64512
peer 10.0.1.1 connect-interface LoopBack0
peer 10.0.3.3 as-number 64512
peer 10.0.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
e n
peer 10.0.1.1 enable
/
peer 10.0.3.3 enable
o m
i.c
#
ospf 1
area 0.0.0.0
w e
network 10.0.12.0 0.0.0.255
u a
network 10.0.23.0 0.0.0.255

g .h
n
network 10.0.2.2 0.0.0.0
return
ni
r
[R3]display current-configuration

//lea
[V200R007C00SPC600]

p :
#

t t
:h
sysname R3

s
#
router id 10.0.3.3

r c e
ou
#
interface Serial2/0/0
link-protocol ppp
es
R
ip address 10.0.23.3 255.255.255.0
#

i n g
n
interface Serial3/0/0

ar
link-protocol ppp

e
L
ip address 10.0.35.3 255.255.255.0
#
e
or
interface LoopBack0

M
ip address 10.0.3.3 255.255.255.255
#
bgp 64512
peer 10.0.1.1 as-number 64512
peer 10.0.1.1 connect-interface LoopBack0
peer 10.0.2.2 as-number 64512
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.35.5 as-number 64514
#

HC Series HUAWEI TECHNOLOGIES 240


HCNP-IERS Chapter 3 BGP Features and Configurations

ipv4-family unicast
undo synchronization
peer 10.0.1.1 enable
peer 10.0.1.1 next-hop-local
peer 10.0.2.2 enable
peer 10.0.2.2 next-hop-local
peer 10.0.35.5 enable
#
ospf 1
e n
area 0.0.0.0
/
network 10.0.23.0 0.0.0.255
o m
i.c
network 10.0.3.3 0.0.0.0
return

w e
[R4]display current-configuration
u a
[V200R007C00SPC600]

g .h
n
#
sysname R4
ni
r
lea
#
router id 10.0.4.4
#
: //
interface Serial1/0/0

t t p
:h
link-protocol ppp

s
ip address 10.0.14.4 255.255.255.0
#

r c e
ou
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
es
interface LoopBack1
R
n g
ip address 10.1.4.4 255.255.255.0

i
#
n
bgp 64513

e ar
L
peer 10.0.1.1 as-number 64512

e
peer 10.0.1.1 ebgp-max-hop 2

or
peer 10.0.1.1 connect-interface LoopBack0

M
#
ipv4-family unicast
undo synchronization
network 10.0.4.0 255.255.255.0
network 10.1.4.0 255.255.255.0
peer 10.0.1.1 enable
#
ip route-static 10.0.1.1 255.255.255.255 10.0.14.1
return

HC Series HUAWEI TECHNOLOGIES 241


HCNP-IERS Chapter 3 BGP Features and Configurations

[R5]display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
router id 10.0.5.5
#
interface Serial1/0/0
e n
link-protocol ppp
/
ip address 10.0.35.5 255.255.255.0
o m
i.c
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
w e
#
u a
interface LoopBack1

g .h
n
ip address 10.1.5.5 255.255.255.0
#
ni
r
lea
bgp 64514
peer 10.0.35.3 as-number 64512
#
: //
ipv4-family unicast

t t p
:h
undo synchronization

s
network 10.1.5.0 255.255.255.0
peer 10.0.35.3 enable

r c e
ou
return

e s
Lab 3-2 BGP RouteRSummarization
i n g
rn
Learning Objectives
a
L e of this lab are to learn and understand:
The objectives
r e
o How to run the network command to implement BGP route

M summarization
 How to configure BGP route summarization to suppress specific routes
 How to change attributes of summarized routes
 How to use the AS_Set during route summarization

HC Series HUAWEI TECHNOLOGIES 242


HCNP-IERS Chapter 3 BGP Features and Configurations

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
lea
Figure 4-2 BGP route summarization

: //
Scenario
t p
t
: h The company’s network uses BGP as
s
You are a network administrator of a company.
the routing protocol. This network e
r c consists of multiple ASs, and different branches
use different AS numbers. As the
o u company expands, routers have more and more
routing tables. It is urgent s
R e to summarize BGP routes to reduce the routing table size.

summarize routes. i n g
You test several route summarization methods and select a suitable method to

a rn
Tasks e
e L
or 1 Set basic parameters and configure IP addresses.
Step
MConfigure IP addresses and masks for physical interfaces and loopback interfaces of
all the routers. Each loopback interface address uses the 32-bit mask.
[R1]interface Serial 1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 255.255.255.0
[R1-Serial1/0/0]quit
[R1]interface Serial 3/0/0
[R1-Serial3/0/0]ip address 10.0.14.1 255.255.255.0

HC Series HUAWEI TECHNOLOGIES 243


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1-Serial3/0/0]quit
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.0.15.1 255.255.255.0
[R1-GigabitEthernet0/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.1.1.1 255.255.255.255
[R1-LoopBack0]quit

[R2]interface Serial 1/0/0


e n
[R2-Serial1/0/0]ip address 10.0.12.2 255.255.255.0
/
[R2-Serial1/0/0]quit
o m
i.c
[R2]interface Serial 2/0/0
[R2-Serial2/0/0]ip address 10.0.23.2 255.255.255.0
[R2-Serial2/0/0]quit
w e
[R2]interface loopback 0
u a
[R2-LoopBack0]ip address 10.1.2.2 255.255.255.255

g .h
n
[R2-LoopBack0]quit

ni
r
lea
[R3]interface Serial 2/0/0
[R3-Serial2/0/0]quit
[R3]ip address 10.0.23.3 255.255.255.0
: //
[R3-Serial2/0/0]quit

t t p
:h
[R3]interface loopback 1

s
[R3-LoopBack1]ip address 10.1.3.3 255.255.255.255
[R3-LoopBack1]quit

r c e
[R4]interface Serial 1/0/0
s ou
[R4-Serial1/0/0]quit
Re
[R4-Serial1/0/0]ip address 10.0.14.4 255.255.255.0

n g
[R4]interface loopback 0

i
n
[R4-LoopBack0]ip address 10.0.4.4 255.255.255.255

ar
[R4-LoopBack0]quit

e
e L
[R5]interface GigabitEthernet 0/0/0

or
[R5-GigabitEthernet0/0/0]ip address 10.0.15.5 255.255.255.0

M
[R5-GigabitEthernet0/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]ip address 10.1.5.5 255.255.255.255
[R5-LoopBack0]quit

After the configurations are complete, test direct link connectivity.


[R1]ping -c 1 10.0.12.2

HC Series HUAWEI TECHNOLOGIES 244


HCNP-IERS Chapter 3 BGP Features and Configurations

PING 10.0.12.2: 56 data bytes, press CTRL_C to break


Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=41 ms

--- 10.0.12.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 41/41/41 ms

e n
[R1]ping -c 1 10.0.14.4
/
PING 10.0.14.4: 56 data bytes, press CTRL_C to break
o m
i.c
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=41 ms

--- 10.0.14.4 ping statistics ---


w e
1 packet(s) transmitted
u a
1 packet(s) received

g .h
n
0.00% packet loss
round-trip min/avg/max = 41/41/41 ms
ni
r
[R1]ping -c 1 10.0.15.5

//lea
:
PING 10.0.15.5: 56 data bytes, press CTRL_C to break

p
t
Reply from 10.0.15.5: bytes=56 Sequence=1 ttl=255 time=34 ms

t
--- 10.0.15.5 ping statistics ---
s :h
1 packet(s) transmitted

r c e
ou
1 packet(s) received
0.00% packet loss

es
round-trip min/avg/max = 34/34/34 ms

R
n g
[R2]ping -c 1 10.0.23.3

i
n
PING 10.0.23.3: 56 data bytes, press CTRL_C to break

ar
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=34 ms

e
e L
--- 10.0.23.3 ping statistics ---

or1 packet(s) transmitted

M 1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/34/34 ms

Step 2 Configure EBGP and advertise routes.

HC Series HUAWEI TECHNOLOGIES 245


HCNP-IERS Chapter 3 BGP Features and Configurations

Configure directly connected routers to establish BGP peer relationships using


physical interface addresses.
[R1]router id 10.1.1.1
[R1]bgp 64513
[R1-bgp]peer 10.0.12.2 as-number 64514
[R1-bgp]peer 10.0.14.4 as-number 64512
[R1-bgp]peer 10.0.15.5 as-number 64516
[R1-bgp]quit
e n
/
[R2]router id 10.1.2.2
o m
i.c
[R2]bgp 64514
[R2-bgp]peer 10.0.12.1 as-number 64513

w e
a
[R2-bgp]peer 10.0.23.3 as-number 64515
[R2-bgp]quit
u
g .h
[R3]router id 10.1.3.3
[R3]bgp 64515
ni n
r
lea
[R3-bgp]peer 10.0.23.2 as-number 64514

//
[R3-bgp]quit

p :
[R4]router id 10.0.4.4
t t
:h
[R4]bgp 64512
[R4-bgp]peer 10.0.14.1 as-number 64513

e s
[R4-bgp]quit

r c
[R5]router id 10.1.5.5
s ou
[R5]bgp 64516
Re
g
[R5-bgp]peer 10.0.15.1 as-number 64513
[R5-bgp]quit

n i n
e ar
L
After the configurations are complete, check BGP peer relationships.

e
or
[R1]display bgp peer

M
BGP local router ID : 10.1.1.1
Local AS number : 64513
Total number of peers : 3 Peers in established state : 3

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.12.2 4 64514 4 6 0 00:02:19 Established 0


10.0.14.4 4 64512 2 4 0 00:00:40 Established 0

HC Series HUAWEI TECHNOLOGIES 246


HCNP-IERS Chapter 3 BGP Features and Configurations

10.0.15.5 4 64516 2 4 0 00:00:17 Established 0

[R2]display bgp peer

BGP local router ID : 10.1.2.2


Local AS number : 64514
Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv


e n
/
10.0.12.1 4 64513 5 6 0 00:03:42 Established 0
o m
i.c
10.0.23.3 4 64515 4 6 0 00:02:25 Established 0

[R3]display bgp peer


w e
u a
BGP local router ID : 10.1.3.3

g .h
n
Local AS number : 64515
Total number of peers : 1
ni
Peers in established state : 1

r
Peer V AS MsgRcvd
lea
MsgSent OutQ Up/Down

//
State PrefRcv

p :
10.0.23.2 4 64514 6

t
7
t 0 00:04:55 Established 0

[R4]display bgp peer


s :h
r c e
ou
BGP local router ID : 10.0.4.4
Local AS number : 64512
Total number of peers : 1
es Peers in established state : 1

R
Peer V

i n g AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

n
10.0.14.1

e ar 4 64513 7 8 0 00:05:11 Established 0

e L
[R5]display bgp peer

or
M
BGP local router ID : 10.1.5.5
Local AS number : 64516
Total number of peers : 1 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.15.1 4 64513 7 8 0 00:05:16 Established 0

HC Series HUAWEI TECHNOLOGIES 247


HCNP-IERS Chapter 3 BGP Features and Configurations

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]network 10.1.1.1 255.255.255.255

e n
/
[R1-bgp]quit

[R2]bgp 64514
o m
[R2-bgp]network 10.1.2.2 255.255.255.255
[R2-bgp]quit
e i.c
aw
u
.h
[R3]bgp 64515

g
[R3-bgp]network 10.1.3.3 255.255.255.255
[R3-bgp]quit

ni n
r
lea
[R4]bgp 64512

//
[R4-bgp]network 10.0.4.4 255.255.255.255
[R4-bgp]quit
p :
t t
:h
[R5]bgp 64516
[R5-bgp]network 10.1.5.5 255.255.255.255
e s
[R5-bgp]quit
r c
s ou
e
Check the BGP routing table of R4 and observe the AS_Path attribute.
R
i n g
[R4]display bgp routing-table

n
ar
BGP Local router ID is 10.0.4.4

L e
Status codes: * - valid, > - best, d - damped,

e
h - history, i - internal, s - suppressed, S - Stale

or
Origin : i - IGP, e - EGP, ? - incomplete

M
Total Number of Routes: 5
Network NextHop MED LocPrf PrefVal Path/Ogn

*> 10.0.4.4/32 0.0.0.0 0 0 i


*> 10.1.1.1/32 10.0.14.1 0 0 64513i
*> 10.1.2.2/32 10.0.14.1 0 64513 64514i
*> 10.1.3.3/32 10.0.14.1 0 64513 64514 64515i
*> 10.1.5.5/32 10.0.14.1 0 64513 64516i

HC Series HUAWEI TECHNOLOGIES 248


HCNP-IERS Chapter 3 BGP Features and Configurations

Step 3 Run the network command to summarize BGP routes.

You need to summarize routes on R1.

On R1, add the static route 10.1.0.0/16 pointing to interface Null0 and run the
network command to advertise this route.

e n
[R1]ip route-static 10.1.0.0 16 NULL 0
/
[R1]bgp 64513

o m
i.c
[R1-bgp]network 10.1.0.0 255.255.0.0

e
[R1-bgp]quit

aw
Check the BGP routing table of R4 to determine whether the summarized
hu route
exists.
g .
nin
r
<R4>display bgp routing-table

l e a
BGP Local router ID is 10.0.4.4

: / /
tp
Status codes: * - valid, > - best, d - damped,

t
h - history, i - internal, s - suppressed, S - Stale

h
:
Origin : i - IGP, e - EGP, ? - incomplete

e s
Total Number of Routes: 6
r c
Network NextHop

o u MED LocPrf PrefVal Path/Ogn

e s
R
*> 10.0.4.4/32 0.0.0.0 0 0 i
*>
*>
10.1.0.0/16
10.1.1.1/32
i n g 10.0.14.1
10.0.14.1
0
0
0
0
64513i
64513i
*>

a rn
10.1.2.2/32 10.0.14.1 0 64513 64514i

e
*> 10.1.3.3/32 10.0.14.1 0 64513 64514 64515i
*>

e L
10.1.5.5/32 10.0.14.1 0 64513 64516i

o r
MSet 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]ip ip-prefix pref_detail_control index 10 permit 10.1.0.0 8 less-equal 24
[R1]bgp 64513
[R1-bgp]peer 10.0.14.4 ip-prefix pref_detail_control export
[R1-bgp]quit

HC Series HUAWEI TECHNOLOGIES 249


HCNP-IERS Chapter 3 BGP Features and Configurations

Check the BGP routing table of R4 again. Observe the AS_Path attribute of the
summarized route.
<R4>display bgp routing-table

BGP Local router ID is 10.0.4.4


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
e n
/
Total Number of Routes: 2
o m
i.c
Network NextHop MED LocPrf PrefVal Path/Ogn

w e
a
*> 10.0.4.4/32 0.0.0.0 0 0 i
*> 10.1.0.0/16 10.0.14.1 0 0 64513i
u
g .h
i n
n BGP routes.
Step 4 Run the aggregate command to summarize
ar
l e
/ summarized route advertised
/
Delete the IP prefix list configured in step 3 and the
:
using the network command.
t tp
Run the aggregate command to summarize
: h routes to 10.1.0.0/16 using the default
e s
mode.
r c
[R1]bgp 64513
o u
e s
[R1-bgp]undo network 10.1.0.0 255.255.0.0

R
[R1-bgp]undo peer 10.0.14.4 ip-prefix pref_detail_control export
[R1-bgp]quit

i n g
rn
[R1]undo ip ip-prefix pref_detail_control

a
[R1]undo ip route-static 10.1.0.0 16 NULL 0

L e
e
[R1]bgp 64513

o r
[R1-bgp]aggregate 10.1.0.0 255.255.0.0

M
[R1-bgp]quit

Check the BGP routing tables of R1 and R4 and observe the Origin attribute of the
summarized route.
[R1]display bgp routing-table

BGP Local router ID is 10.1.1.1

HC Series HUAWEI TECHNOLOGIES 250


HCNP-IERS Chapter 3 BGP Features and Configurations

Status codes: * - valid, > - best, d - damped,


h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 6


Network NextHop MED LocPrf PrefVal Path/Ogn

*> 10.0.4.4/32 10.0.14.4 0 0 64512i


*> 10.1.0.0/16 127.0.0.1 0 i
e n
*> 10.1.1.1/32 0.0.0.0 0 0 i
/
*> 10.1.2.2/32 10.0.12.2 0 0 64514i
o m
i.c
*> 10.1.3.3/32 10.0.12.2 0 64514 64515i
*> 10.1.5.5/32 10.0.15.5 0 0 64516i

w e
<R4>display bgp routing-table
u a
g .h
n
BGP Local router ID is 10.0.4.4
Status codes: * - valid, > - best, d - damped,
ni
r
lea
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

: //
Total Number of Routes: 6

t t p
:h
Network NextHop MED LocPrf PrefVal Path/Ogn

e s
c
*> 10.0.4.4/32 0.0.0.0 0 0 i

r
ou
*> 10.1.0.0/16 10.0.14.1 0 64513i
*> 10.1.1.1/32 10.0.14.1 0 0 64513i
*> 10.1.2.2/32
es
10.0.14.1 0 64513 64514i
*> 10.1.3.3/32
R
10.0.14.1 0 64513 64514 64515i
*> 10.1.5.5/32

i n g 10.0.14.1 0 64513 64516i

rn
e a
The preceding command output shows that the Origin attribute of the summarized

e L
route retains unchanged and is still IGP.
r
o configuring route summarization on R1, suppress specific routes and
Madvertise only the summarized route.
When

[R1]bgp 64513
[R1-bgp]aggregate 10.1.0.0 255.255.0.0 detail-suppressed
[R1-bgp]quit

Check the BGP routing table of R4.

HC Series HUAWEI TECHNOLOGIES 251


HCNP-IERS Chapter 3 BGP Features and Configurations

[R4]display bgp routing-table

BGP Local router ID is 10.0.4.4


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 2


Network NextHop MED LocPrf PrefVal Path/Ogn
e n
/
*> 10.0.4.4/32 0.0.0.0 0 0 i
o m
i.c
*> 10.1.0.0/16 10.0.14.1 0 64513i

w e
The preceding command output shows that the BGP routing table of a R4 does not
contain specific routes.
. hu
i n g
Check the IP routing table of R1 to view the next hop of the
r n route to 10.1.0.0/16.
[R1]display ip routing-table

l e a
Route Flags: R - relay, D - download to fib

: //
tp
----------------------------------------------------------------------------
Routing Tables: Public

ht
Destinations : 21
:
Routes : 21

s
Destination/Mask Proto
r c
Pre e Cost Flags NextHop Interface

o u
10.0.4.4/32
e s
EBGP 255 0 D 10.0.14.4 Serial3/0/0
10.0.12.0/24
R
Direct 0 0 D 10.0.12.1 Serial1/0/0
10.0.12.1/32

i
10.0.12.2/32
n g Direct 0
Direct 0
0
0
D
D
127.0.0.1
10.0.12.2
Serial1/0/0
Serial1/0/0

a rn
10.0.12.255/32 Direct 0 0 D 127.0.0.1 Serial1/0/0

L e
10.0.14.0/24
10.0.14.1/32
Direct 0
Direct 0
0
0
D
D
10.0.14.1
127.0.0.1
Serial3/0/0
Serial3/0/0

r e 10.0.14.4/32 Direct 0 0 D 10.0.14.4 Serial3/0/0

o 10.0.14.255/32 Direct 0 0 D 127.0.0.1 Serial3/0/0

M 10.0.15.0/24
10.0.15.1/32
Direct 0
Direct 0
0
0
D
D
10.0.15.1
127.0.0.1
GigabitEthernet0/0/0
GigabitEthernet0/0/0
10.0.15.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.1.0.0/16 IBGP 255 0 D 0.0.0.0 NULL0
10.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.1.2.2/32 EBGP 255 0 D 10.0.12.2 Serial1/0/0
10.1.3.3/32 EBGP 255 0 D 10.0.12.2 Serial1/0/0
10.1.5.5/32 EBGP 255 0 D 10.0.15.5 GigabitEthernet0/0/0

HC Series HUAWEI TECHNOLOGIES 252


HCNP-IERS Chapter 3 BGP Features and Configurations

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0


127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

The route to 10.1.0.0/16 is a summarized route, which is configured on R1. Therefore,


the outbound interface is interface Null0. This configuration can prevent routing

e n
loops.
/
Check the BGP routing table of R1 to view specific routes.
o m
[R1]display bgp routing-table
e i.c
aw
u
BGP Local router ID is 10.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
g .h
Origin : i - IGP, e - EGP, ? - incomplete
ni n
r
Total Number of Routes: 6

//lea
Network NextHop MED
:
LocPrf

p
PrefVal Path/Ogn

t t
:h
*> 10.0.4.4/32 10.0.14.4 0 0 64512i

s
*> 10.1.0.0/16 127.0.0.1 0 i
s> 10.1.1.1/32 0.0.0.0

r c e0 0 i

ou
s> 10.1.2.2/32 10.0.12.2 0 0 64514i
s> 10.1.3.3/32 10.0.12.2 0 64514 64515i
s> 10.1.5.5/32
es
10.0.15.5 0 0 64516i

R
i n g
rn
If the detail-suppressed parameter is specified, only summarized routes are sent.

e a are marked with s, indicating that they are suppressed during route
Specific routes

e L
summarization.

or 5 Change the attributes of summarized routes.


Step
M
By default, BGP does not advertise the Community attribute to any peer.

Configure R5 and R1 to advertise the Community attribute to R1 and R4 respectively.


[R5]bgp 64516
[R5-bgp]peer 10.0.15.1 advertise-community
[R5-bgp]quit

HC Series HUAWEI TECHNOLOGIES 253


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1]bgp 64513
[R1-bgp]peer 10.0.14.4 advertise-community
[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
e n
and advertise this route to R1. /
o m
i.c
[R5]acl number 2000
[R5-acl-basic-2000]rule 0 permit source 10.1.5.5 0
[R5-acl-basic-2000]quit
w e
[R5]route-policy set_comm permit node 10

u a
.h
[R5-route-policy]if-match acl 2000
[R5-route-policy]apply community 100
[R5-route-policy]quit
i n g
[R5]bgp 64516
r n
lea
[R5-bgp]peer 10.0.15.1 route-policy set_comm export
[R5-bgp]quit

: //
t t p
:h
On R1, check whether the route 10.1.5.5/32 carries the Community attribute 100.
s
<R1>display bgp routing-table community

r c e
BGP Local router ID is 10.1.1.1
s ou
Re
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale

n g
Origin : i - IGP, e - EGP, ? - incomplete

i
n
ar
Total Number of Routes: 2

Le
Network NextHop MED LocPrf PrefVal Community

r e
o
*> 10.1.5.0/24 10.0.15.5 0 <0:100>

M
On R4, check whether the summarized route carries the Community attribute 100.
<R4>display bgp routing-table community

Total Number of Routes: 0

HC Series HUAWEI TECHNOLOGIES 254


HCNP-IERS Chapter 3 BGP Features and Configurations

The preceding command output shows that R4 does not have any route that carries
the Community attribute.

Configure a route policy add_comm on R1 to add the Community attribute 100:2 to


the summarized route.
[R1]acl number 2000
[R1-acl-basic-2000]rule 0 permit source 10.1.0.0 0.0.255.255

e n
/
[R1-acl-basic-2000]quit

m
[R1]route-policy add_comm permit node 10
[R1-route-policy]if-match acl 2000
o
[R1-route-policy]apply community 100:2
[R1-route-policy]quit
e i.c
[R1]bgp 64513
aw
u
.h
[R1-bgp]aggregate 10.1.0.0 255.255.0.0 attribute-policy add_comm

i n g
n
On R4, check whether the summarized route carries the Community attribute 100:2.
r
lea
<R4>display bgp routing-table community

: //
BGP Local router ID is 10.0.4.4

t t p
:h
Status codes: * - valid, > - best, d - damped,

s
h - history, i - internal, s - suppressed, S - Stale

r c e
Origin : i - IGP, e - EGP, ? - incomplete

s ou
Total Number of Routes: 2
Network
Re
NextHop MED LocPrf PrefVal Community

i n g
n
*> 10.1.0.0/16 10.0.14.1 0 <100:2>

ar
*> 10.1.5.5/32 10.0.14.1 0 <0:100>

L e
r e
The preceding command output shows that the summarized route learned by R4
o the Community attribute 100:2.
M
carries

Step 6 Use the AS_Set attribute to configure the AS_Path attribute.

HC Series HUAWEI TECHNOLOGIES 255


HCNP-IERS Chapter 3 BGP Features and Configurations

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

e n
[R1-bgp]aggregate 10.1.0.0 255.255.0.0 detail-suppressed as-set
/
[R1-bgp]quit

o m
Check the AS_Path attribute of the summarized route in the BGP routing tables of R1 e i.c
aw
and R4.
u
[R1]display bgp routing-table
g .h
ni n
BGP Local router ID is 10.1.1.1
r
lea
Status codes: * - valid, > - best, d - damped,

//
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
p :
t t
:h
Total Number of Routes: 6
Network NextHop
e s
MED LocPrf PrefVal Path/Ogn

r c
ou
*> 10.0.4.4/32 10.0.14.4 0 0 64512i
*> 10.1.0.0/16
s
127.0.0.1

e
0 {64514 64515 64516}i
s> 10.1.1.1/32
R
0.0.0.0 0 0 i

ing
s> 10.1.2.2/32 10.0.12.2 0 0 64514i
s> 10.1.3.3/32 10.0.12.2 0 64514 64515i

n
ar
s> 10.1.5.5/32 10.0.15.5 0 0 64516i

L e
<R4>display bgp routing-table

e
or
BGP Local router ID is 10.0. 4.4

M
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 2


Network NextHop MED LocPrf PrefVal Path/Ogn

*> 10.0.4.4/32 0.0.0.0 0 0 i

HC Series HUAWEI TECHNOLOGIES 256


HCNP-IERS Chapter 3 BGP Features and Configurations

*> 10.1.0.0/16 10.0.14.1 0 64513 {64514 64515 64516}i

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
e n
[R3-bgp]undo network 10.1.3.3 255.255.255.255
/
[R3-bgp]return
o m
i.c
<R3>reset bgp all

e
w of the
a
hu
After the peer relationship is established again, check the AS_Path attribute
summarized route learned by R4.
g .
<R4>display bgp routing-table
ni n
ar
BGP Local router ID is 10.0.4.4
l e
Status codes: * - valid, > - best, d - damped,
: //
tp
h - history, i - internal, s - suppressed, S - Stale

t
h
Origin : i - IGP, e - EGP, ? - incomplete

s :
Total Number of Routes: 2
Network NextHop
r c e MED LocPrf PrefVal Path/Ogn

o u
*> 10.0.4.4/32
e s
0.0.0.0 0 0 i
*> 10.1.0.0/16
R 10.0.14.1 0 64513 {64514 64516}i

i n g
a
The preceding rncommand output shows that the AS_Path attribute does not contain
L e 64515.
the AS number
r e
o ----End
M
Additional Exercises: Analysis and Verification

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?

HC Series HUAWEI TECHNOLOGIES 257


HCNP-IERS Chapter 3 BGP Features and Configurations

Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
#
sysname R1
#
router id 10.1.1.1
#

e n
acl number 2000
/
rule 0 permit source 10.1.0.0 0.0.255.255

o m
i.c
#

e
interface Serial1/0/0

w
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
u a
.h
#
interface Serial3/0/0
link-protocol ppp
i n g
ip address 10.0.14.1 255.255.255.0
r n
lea
#
interface GigabitEthernet0/0/0
: //
ip address 10.0.15.1 255.255.255.0

t t p
:h
#
interface NULL0
#
e s
interface LoopBack0
r c
ou
ip address 10.1.1.1 255.255.255.255
#
es
bgp 64513
R
i n g
peer 10.0.12.2 as-number 64514
peer 10.0.14.4 as-number 64512
n
ar
peer 10.0.15.5 as-number 64516
#

L e
e
ipv4-family unicast

or
undo synchronization
aggregate 10.1.0.0 255.255.0.0 as-set detail-suppressed

M network 10.1.1.1 255.255.255.255


peer 10.0.12.2 enable
peer 10.0.14.4 enable
peer 10.0.14.4 advertise-community
peer 10.0.15.5 enable
#
route-policy add_comm permit node 10
if-match acl 2000

HC Series HUAWEI TECHNOLOGIES 258


HCNP-IERS Chapter 3 BGP Features and Configurations

apply community 100:2


#
return

<R2>display current-configuration
[V200R007C00SPC600]
#
sysname R2
#
e n
router id 10.1.2.2
/
#
o m
i.c
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.2 255.255.255.0
w e
#
u a
interface Serial2/0/0

g .h
n
link-protocol ppp
ip address 10.0.23.2 255.255.255.0
ni
r
lea
#
interface LoopBack0
ip address 10.1.2.2 255.255.255.255
: //
#

t t p
:h
bgp 64514

s
peer 10.0.12.1 as-number 64513
peer 10.0.23.3 as-number 64515

r c e
ou
#
ipv4-family unicast
undo synchronization
es
R
network 10.1.2.2 255.255.255.255

n g
peer 10.0.12.1 enable

i
n
peer 10.0.23.3 enable
#

e ar
L
return

e
or
<R3>display current-configuration

M
[V200R007C00SPC600]
#
sysname R3
#
router id 10.1.3.3
#
interface Serial2/0/0
link-protocol ppp
ip address 10.0.23.3 255.255.255.0

HC Series HUAWEI TECHNOLOGIES 259


HCNP-IERS Chapter 3 BGP Features and Configurations

#
interface LoopBack1
ip address 10.1.3.3 255.255.255.255
#
bgp 64515
peer 10.0.23.2 as-number 64514
#
ipv4-family unicast
undo synchronization
e n
peer 10.0.23.2 enable
/
#
o m
i.c
return

<R4>display current-configuration
w e
[V200R007C00SPC600]
u a
#

g .h
n
sysname R4
#
ni
r
lea
router id 10.0.4.4
#
interface Serial1/0/0
: //
link-protocol ppp

t t p
:h
ip address 10.0.14.4 255.255.255.0

s
#
interface LoopBack0

r c e
ou
ip address 10.0.4.4 255.255.255.255
#
bgp 64512
es
R
peer 10.0.14.1 as-number 64513
#

i n g
n
ipv4-family unicast

ar
undo synchronization

e
L
network 10.0.4.4 255.255.255.255

e
peer 10.0.14.1 enable
#
or
M
return

<R5>display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
router id 10.1.5.5
#

HC Series HUAWEI TECHNOLOGIES 260


HCNP-IERS Chapter 3 BGP Features and Configurations

acl number 2000


rule 0 permit source 10.1.5.5 0
#
interface GigabitEthernet0/0/0
ip address 10.0.15.5 255.255.255.0
#
interface LoopBack0
ip address 10.1.5.5 255.255.255.255
#
e n
bgp 64516
/
peer 10.0.15.1 as-number 64513
o m
i.c
#
ipv4-family unicast
undo synchronization
w e
network 10.1.5.5 255.255.255.255
u a
peer 10.0.15.1 enable

g .h
n
peer 10.0.15.1 advertise-community
peer 10.0.15.1 route-policy set_comm export
ni
r
lea
#
route-policy set_comm permit node 10
if-match acl 2000
: //
apply community 100

t t p
:h
#

s
return

r e
cRoute Selection 1
Lab 3-3 BGP Attributes and
o u
e s
Learning Objectives R
The objectives ofin
g
this lab are to learn and understand:

a rnto configure the AS_Path attribute to affect route selection


L e How

e How to modify the Origin attribute to affect route selection


or How to modify the Local_Pref attribute to affect route selection

M

How to modify the MED attribute to affect route selection


HC Series HUAWEI TECHNOLOGIES 261


HCNP-IERS Chapter 3 BGP Features and Configurations

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
lea
Figure 4-3 BGP attributes and route selection

: //
Scenario
t t p
: h The company’s network uses BGP to
s (ISPs). The company uses a private AS
You are a network administrator of a company.
e
c
connect to two Internet Service Providers
r
number 64512 and connects to
o uISP1 through two links, and ISP1 uses the AS number
e s 200, and the company leases a line to connect to ISP2.
100. ISP2 uses the AS number
R that access to the company website is slow. You change
i n g to optimize route selection.
Some Internet users reflect
various BGP attributes

a rn
Tasks e
e L
or 1 Set basic parameters and configure IP addresses.
Step
MConfigure IP addresses and masks for physical interfaces and loopback interfaces of
all the routers. Each Loopback0 uses the 32-bit mask.
[R1]interface Serial 1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 24
[R1-Serial1/0/0]quit
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ip address 10.0.15.1 24

HC Series HUAWEI TECHNOLOGIES 262


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1-GigabitEthernet0/0/2]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.0.111.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 32
[R1-LoopBack0]quit

[R2]interface Serial 1/0/0


e n
[R2-Serial1/0/0]ip address 10.0.12.2 24
/
[R2-Serial1/0/0]quit
o m
i.c
[R2]interface Serial 2/0/0
[R2-Serial2/0/0]ip address 10.0.23.2 24
[R2-Serial2/0/0]quit
w e
[R2]interface LoopBack 0
u a
[R2-LoopBack0]ip address 10.0.2.2 24

g .h
n
[R2-LoopBack0]quit

ni
r
lea
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ip address 10.0.15.3 24
[R3-GigabitEthernet0/0/2]quit
: //
[R3]interface Serial 2/0/0

t t p
:h
[R3-Serial2/0/0]ip address 10.0.23.3 24

s
[R3-Serial2/0/0]quit
[R3]interface Serial 3/0/0

r c e
ou
[R3-Serial3/0/0]ip address 10.0.35.3 24
[R3-Serial3/0/0]quit
[R3]interface loopback 0
es
R
[R3-LoopBack0]ip address 10.0.3.3 32
[R3-LoopBack0]quit

i n g
n
ar
[R4]interface GigabitEthernet 0/0/1

e
L
[R4-GigabitEthernet0/0/1]ip address 10.0.114.4 24

e
[R4-GigabitEthernet0/0/1]quit

or
[R4]interface GigabitEthernet 0/0/0

M
[R4-GigabitEthernet0/0/0]ip address 10.0.45.4 24
[R4-GigabitEthernet0/0/0]quit
[R4]interface loopback 0
[R4-LoopBack0]ip address 10.0.4.4 32
[R4-LoopBack0]quit

[R5]interface Serial 1/0/0


[R5-Serial1/0/0]ip address 10.0.35.5 24
[R5-Serial1/0/0]quit

HC Series HUAWEI TECHNOLOGIES 263


HCNP-IERS Chapter 3 BGP Features and Configurations

[R5]interface GigabitEthernet 0/0/0


[R5-GigabitEthernet0/0/0]ip address 10.0.45.5 24
[R5-GigabitEthernet0/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]ip address 10.0.5.5 32
[R5-LoopBack0]quit

After the configurations are complete, test direct link connectivity.


e n
/
m
<R1>ping -c 1 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
o
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=29 ms

e i.c
--- 10.0.12.2 ping statistics ---
aw
u
.h
1 packet(s) transmitted

g
1 packet(s) received
0.00% packet loss

ni n
r
round-trip min/avg/max = 29/29/29 ms

[R1]ping -c 1 10.0.15.3
//lea
p :
PING 10.0.15.3: 56 data bytes, press CTRL_C to break

t t
Reply from 10.0.15.3: bytes=56 Sequence=1 ttl=255 time=59 ms

s :h
e
--- 10.0.15.3 ping statistics ---
1 packet(s) transmitted
r c
ou
1 packet(s) received
0.00% packet loss

es
R
round-trip min/avg/max = 59/59/59 ms

i n g
<R2>ping -c 1 10.0.23.3

n
ar
PING 10.0.23.3: 56 data bytes, press CTRL_C to break

e
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=32 ms

e L
or
--- 10.0.23.3 ping statistics ---
1 packet(s) transmitted

M 1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 32/32/32 ms

[R3]ping -c 1 10.0.35.5
PING 10.0.35.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=36 ms

HC Series HUAWEI TECHNOLOGIES 264


HCNP-IERS Chapter 3 BGP Features and Configurations

--- 10.0.35.5 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 36/36/36 ms

<R4>ping -c 1 10.0.45.5
PING 10.0.45.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.45.5: bytes=56 Sequence=1 ttl=255 time=11 ms
e n
/
--- 10.0.45.5 ping statistics ---
o m
i.c
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
w e
round-trip min/avg/max = 11/11/11 ms
u a
g .h
Step 2 Configure IGP and BGP.
ni n
r
ato belong to Area 0.
Configure OSPF in AS 64512 and configure all devices
l e
//
Run OSPF on the network segments connected: to G0/0/1 and Loopback0 of R1.
t tp
[R1]router id 10.0.1.1
: h
[R1]ospf 1
e s
[R1-ospf-1]area 0
r c
u
[R1-ospf-1-area-0.0.0.0]network 10.0.111.1 0.0.0.0

o
s
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0

e
R
[R1-ospf-1-area-0.0.0.0]quit

g
[R1-ospf-1]quit

i n
a rn on S1 and configure a VLANIF address for interconnection with R1.
Create VLAN 111

L e 114 on S1 and configure a VLANIF address for interconnection with R4.


e
Create VLAN
r
othe link type of interconnected interfaces to access, and run OSPF on the network
Set
Msegments connected to S1's VLANIF 111, VLANIF 114, and Loopback0.
[S1]router id 10.0.11.11
[S1]vlan batch 111 114
[S1]interface vlan 111
[S1-Vlanif111]ip address 10.0.111.11 24
[S1-Vlanif111]quit
[S1]interface vlan 114

HC Series HUAWEI TECHNOLOGIES 265


HCNP-IERS Chapter 3 BGP Features and Configurations

[S1-Vlanif114]ip address 10.0.114.11 24


[S1-Vlanif114]quit
[S1]interface loopback 0
[S1-LoopBack0]ip address 10.0.11.11 32
[S1-LoopBack0]quit
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]port link-type access
[S1-GigabitEthernet0/0/1]port default vlan 111
[S1-GigabitEthernet0/0/1]quit
e n
[S1]interface GigabitEthernet 0/0/4
/
[S1-GigabitEthernet0/0/4]port link-type access
o m
i.c
[S1-GigabitEthernet0/0/4]port default vlan 114
[S1-GigabitEthernet0/0/4]quit
[S1]ospf 1
w e
[S1-ospf-1]area 0
u a
[S1-ospf-1-area-0.0.0.0]network 10.0.111.11 0.0.0.0

g .h
n
[S1-ospf-1-area-0.0.0.0]network 10.0.114.11 0.0.0.0
[S1-ospf-1-area-0.0.0.0]network 10.0.11.11 0.0.0.0
ni
r
lea
[S1-ospf-1-area-0.0.0.0]quit
[S1-ospf-1]quit

: //
t t p
Run OSPF on the network segments connected to G0/0/1 and Loopback0 of R4.

s :h
e
[R4]router id 10.0.4.4
[R4]ospf 1
r c
ou
[R4-ospf-1]area 0

s
[R4-ospf-1-area-0.0.0.0]network 10.0.114.4 0.0.0.0

e
R
[R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0

g
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit

n i n
e ar
L
Check whether the devices learn the network segment where Loopback0 of other
e resides.
r
devices
o
M[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 18 Routes : 18

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0

HC Series HUAWEI TECHNOLOGIES 266


HCNP-IERS Chapter 3 BGP Features and Configurations

10.0.4.4/32 OSPF 10 2 D 10.0.111.11 GigabitEthernet0/0/1


10.0.11.11/32 OSPF 10 1 D 10.0.111.11 GigabitEthernet0/0/1
10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial1/0/0
10.0.12.1/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.15.0/24 Direct 0 0 D 10.0.15.1 GigabitEthernet0/0/2
10.0.15.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
10.0.15.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
e n
10.0.111.0/24 Direct 0 0 D 10.0.111.1 GigabitEthernet0/0/1
/
10.0.111.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
o m
i.c
10.0.111.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
10.0.114.0/24
127.0.0.0/8
OSPF
Direct 0
10 2
0
D
D 127.0.0.1 InLoopBack0
w e
10.0.111.11 GigabitEthernet0/0/1

127.0.0.1/32 Direct 0 0 D 127.0.0.1


u a
InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1
.h
InLoopBack0

g
n
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

ni
r
lea
[S1]display ip routing-table
Route Flags: R - relay, D - download to fib

: //
----------------------------------------------------------------------------
Routing Tables: Public

t t p
:h
Destinations : 9 Routes : 9

e s
c
Destination/Mask Proto Pre Cost Flags NextHop Interface

r
10.0.1.1/32 OSPF 10
s ou
1 D 10.0.111.1 Vlanif111
10.0.4.4/32
10.0.11.11/32
OSPF

R
Direct 0e
10 1
0
D
D
10.0.114.4
127.0.0.1
Vlanif114
LoopBack0
10.0.111.0/24

i n g
Direct 0 0 D 10.0.111.11 Vlanif111

n
10.0.111.11/32 Direct 0 0 D 127.0.0.1 Vlanif111

ar
10.0.114.0/24 Direct 0 0 D 10.0.114.11 Vlanif114

Le
10.0.114.11/32 Direct 0 0 D 127.0.0.1 Vlanif114

re
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

o 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

M
<R4>display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14

Destination/Mask Proto Pre Cost Flags NextHop Interface

HC Series HUAWEI TECHNOLOGIES 267


HCNP-IERS Chapter 3 BGP Features and Configurations

10.0.1.1/32 OSPF 10 2 D 10.0.114.11 GigabitEthernet0/0/1


10.0.4.4/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.11.11/32 OSPF 10 1 D 10.0.114.11 GigabitEthernet0/0/1
10.0.45.0/24 Direct 0 0 D 10.0.45.4 GigabitEthernet0/0/0
10.0.45.4/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.45.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.111.0/24 OSPF 10 2 D 10.0.114.11 GigabitEthernet0/0/1
10.0.114.0/24 Direct 0 0 D 10.0.114.4 GigabitEthernet0/0/1
10.0.114.4/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
e n
10.0.114.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
/
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
o m
i.c
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0
255.255.255.255/32 Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0

w
InLoopBack0e
u a
. h
i n gnamed as64512.
Configure BGP on R1, R4, and S1, enable them to establish BGP peer relationships

n
using their Loopback0 interfaces, and configure a peer group
r
l
By default, BGP load balancing is disabled. Enable BGPe a load balancing on all the
routers and set the maximum number of equal-cost: // routes to 4 for load balancing.
t tp
[R1]bgp 64512

: h
s
[R1-bgp]group as64512 internal

c e
[R1-bgp]peer 10.0.11.11 group as64512

r
u
[R1-bgp]peer 10.0.11.11 connect-interface LoopBack 0

o
[R1-bgp]maximum load-balancing 4

s
[R1-bgp]quit

Re
[S1]bgp 64512

i n g
rn
[S1-bgp]group as64512 internal

a
[S1-bgp]peer 10.0.4.4 group as64512

e
L
[S1-bgp]peer 10.0.4.4 connect-interface LoopBack 0

e
[S1-bgp]maximum load-balancing 4

r
o
[S1-bgp]peer 10.0.1.1 group as64512

M
[S1-bgp]peer 10.0.1.1 connect-interface LoopBack 0
[S1-bgp]quit

[R4]bgp 64512
[R4-bgp]group as64512 internal
[R4-bgp]peer 10.0.11.11 group as64512
[R4-bgp]peer 10.0.11.11 connect-interface LoopBack 0
[R4-bgp]maximum load-balancing 4
[R4-bgp]quit

HC Series HUAWEI TECHNOLOGIES 268


HCNP-IERS Chapter 3 BGP Features and Configurations

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]peer 10.0.12.2 as-number 200
[R1-bgp]peer 10.0.15.3 as-number 100
[R1-bgp]quit

e n
/
[R2]router id 10.0.2.2

o m
i.c
[R2]bgp 200

e
[R2-bgp]peer 10.0.12.1 as-number 64512

w
[R2-bgp]peer 10.0.23.3 as-number 100
[R2-bgp]maximum load-balancing 4
u a
.h
[R2-bgp]quit

[R3]router id 10.0.3.3
i n g
[R3]bgp 100
r n
lea
[R3-bgp]peer 10.0.23.2 as-number 200
[R3-bgp]peer 10.0.35.5 as-number 100
: //
[R3-bgp]peer 10.0.15.1 as-number 64512

t t p
:h
[R3-bgp]maximum load-balancing 4
[R3-bgp]quit

e s
[R4]bgp 64512
r c
ou
[R4-bgp]peer 10.0.45.5 as-number 100
[R4-bgp]quit
es
R
[R5]router id 10.0.5.5

i n g
n
[R5]bgp 100

ar
[R5-bgp]peer 10.0.35.3 as-number 100

e
[R5-bgp]peer 10.0.45.4 as-number 64512

L
e
[R5-bgp]maximum load-balancing 4

or
[R5-bgp]quit

M
Step 3 Configure the AS_Path attribute.

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]ip address 10.1.11.11 24

HC Series HUAWEI TECHNOLOGIES 269


HCNP-IERS Chapter 3 BGP Features and Configurations

[S1-LoopBack1]quit
[S1]bgp 64512
[S1-bgp]network 10.1.11.11 255.255.255.0
[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.

e n
[R2]display bgp routing-table
/
o m
i.c
BGP Local router ID is 10.0.2.2

e
Status codes: * - valid, > - best, d - damped,

w
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
u a
Total Number of Routes: 2
g .h
Network NextHop MED LocPrf
i n
PrefVal Path/Ogn

n
r
lea
*> 10.1.11.0/24 10.0.12.1 0 64512i

://
* 10.0.23.3 0 100 64512i

t tp
Bandwidth between R1 and R4 is limited.hIt is expected that R2 accesses the network
s :
c e
segment 10.1.11.0/24 through AS 100.
r to affect route selection.
o u
You can use the AS_Path attribute
s
e on R1 to add two duplicate AS numbers to the route
R
Create a route policy as_path
10.1.11.0/24.
i n g
rn
[R1]acl number 2001

a
L e
[R1-acl-basic-2001]rule 5 permit source 10.1.11.0 0.0.0.255
[R1-acl-basic-2001]quit

r e
[R1]route-policy as_path permit node 10

o
[R1-route-policy]if-match acl 2001

M[R1-route-policy]apply as-path 64512 64512 additive


[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

HC Series HUAWEI TECHNOLOGIES 270


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1-bgp]peer 10.0.12.2 route-policy as_path export


[R1-bgp]quit

Check the BGP routing table of R2.


<R2>display bgp routing-table

BGP Local router ID is 10.0.2.2

e n
/
Status codes: * - valid, > - best, d - damped,

m
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
o
Total Number of Routes: 2
e i.c
Network NextHop MED LocPrf PrefVal Path/Ogn
aw
u
*> 10.1.11.0/24 10.0.23.3 0
g .h
100 64512i
* 10.0.12.1

ni n0 64512 64512 64512i

r
a the network segment
l e
//
The preceding command output shows that R2 accesses
:
tp
10.1.11.0/24 through AS 100.

Step 4 Configure the Origin attribute. ht


s :
r c
Check the BGP routing table of R3. e
o u
s
<R3>display bgp routing-table

Re
BGP Local router ID is 10.0.3.3

n g
Status codes: * - valid, > - best, d - damped,
i
rn
h - history, i - internal, s - suppressed, S - Stale

e a Origin : i - IGP, e - EGP, ? - incomplete

e L
r
Total Number of Routes: 2

o Network NextHop MED LocPrf PrefVal Path/Ogn

M *> 10.1.11.0/24 10.0.15.1 0 64512i


* i 10.0.35.5 100 0 64512i

The preceding command output shows that the next hop for the route 10.1.11.0/24
is R1. Analyze the cause.

HC Series HUAWEI TECHNOLOGIES 271


HCNP-IERS Chapter 3 BGP Features and Configurations

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 22 permit node 10
[R1-route-policy]if-match acl 2001

e n
/
[R1-route-policy]apply origin incomplete

m
[R1-route-policy]quit
[R1]bgp 64512
o
[R1-bgp]peer 10.0.15.3 route-policy 22 export
[R1-bgp]quit
e i.c
aw
After the configured route-policy takes effect, check the BGP routing
hu table of R3.
<R3>display bgp routing-table
g .
ni n
BGP Local router ID is 10.0.3.3
ar
Status codes: * - valid, > - best, d - damped,
l e
: //
h - history, i - internal, s - suppressed, S - Stale

tp
Origin : i - IGP, e - EGP, ? - incomplete

ht
Total Number of Routes: 2
s :
Network NextHop

r c e MED LocPrf PrefVal Path/Ogn

*>i 10.1.11.0/24
o u
10.0.35.5 100 0 64512i
*
e s
10.0.15.1 0 64512?

R
i n
The preceding command
g output shows that the next hop for the route 10.1.11.0/24
is R5.
a rn
Step 5 L
e
r e Configure the Local_Pref attribute.
o Local_Pref attribute has a high priority in route selection.
M
The

You can change the Local_Pref attribute to affect route selection.

Create Loopback1 on R3, assign an address 10.1.3.3/24 to Loopback1, and advertise


this address into BGP.
[R3]interface loopback 1
[R3-LoopBack1]ip address 10.1.3.3 255.255.255.0

HC Series HUAWEI TECHNOLOGIES 272


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3-LoopBack1]quit
[R3]bgp 100
[R3-bgp]network 10.1.3.3 255.255.255.0
[R3-bgp]quit

Create Loopback1 on R5, assign an address 10.1.5.5/24 to Loopback1, and advertise


this address into BGP.

e n
[R5]interface loopback 1
/
[R5-LoopBack1]ip address 10.1.5.5 255.255.255.0

o m
i.c
[R5-LoopBack1]quit

e
[R5]bgp 100

w
[R5-bgp]network 10.1.5.5 24
[R5-bgp]quit
u a
g .h
Check the BGP routing table of S1.
ni n
r
lea
[S1]display bgp routing-table

BGP Local router ID is 10.0.11.11


: //
Status codes: * - valid, > - best, d - damped,
t t p
:h
h - history, i - internal, s - suppressed, S - Stale

s
Origin : i - IGP, e - EGP, ? - incomplete

e
r c
ou
Total Number of Routes: 5

s
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.1.3.0/24 Re
10.0.1.1 0 100 0 100i
* i
i n g
10.0.4.4 100 0 100i

n
ar
*>i 10.1.5.0/24 10.0.1.1 100 0 100i
* i 10.0.4.4 0 100 0 100i
*>
L e
10.1.11.0/24 0.0.0.0 0 0 i

e
or
Mthe network segment 10.1.3.0/24 needs to be sent from R1.
Traffic to the network segment 10.1.5.0/24 needs to be sent from R4, and traffic to

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.

HC Series HUAWEI TECHNOLOGIES 273


HCNP-IERS Chapter 3 BGP Features and Configurations

[R4]acl number 2001


[R4-acl-basic-2001]rule 5 permit source 10.1.5.0 0.0.0.255
[R4-acl-basic-2001]quit
[R4]route-policy Pref4 permit node 10
[R4-route-policy]if-match acl 2001
[R4-route-policy]apply local-preference 110
[R4-route-policy]quit
[R4]route-policy Pref4 permit node 20
[R4-route-policy]quit
e n
[R4]bgp 64512
/
[R4-bgp]peer as64512 route-policy Pref4 export
o m
i.c
[R4-bgp]quit

[R1]acl number 2002


w e
[R1-acl-basic-2002]rule 5 permit source 10.1.3.0 0.0.0.255
u a
[R1-acl-basic-2002]quit

g .h
n
[R1]route-policy Pref1 permit node 10
[R1-route-policy]if-match acl 2002
ni
r
lea
[R1-route-policy]apply local-preference 110
[R1-route-policy]quit
[R1]route-policy Pref1 permit node 20
: //
[R1-route-policy]quit

t t p
:h
[R1]bgp 64512

s
[R1-bgp]peer as64512 route-policy Pref1 export
[R1-bgp]quit

r c e
s ou
e
Check the BGP routing table of S1.
R
n g
[S1]display bgp routing-table

i
n
ar
BGP Local router ID is 10.0.11.11

e
L
Status codes: * - valid, > - best, d - damped,

e h - history, i - internal, s - suppressed, S - Stale

or Origin : i - IGP, e - EGP, ? – incomplete

M
Total Number of Routes: 5
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.1.3.0/24 10.0.1.1 0 110 0 100i


* i 10.0.4.4 100 0 100i
*>i 10.1.5.0/24 10.0.4.4 0 110 0 100i
* i 10.0.1.1 0 100 0 100i
*> 10.1.11.0/24 0.0.0.0 0 0 i

HC Series HUAWEI TECHNOLOGIES 274


HCNP-IERS Chapter 3 BGP Features and Configurations

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.

Step 6 Configure the MED attribute.

Delete the route-policy configured in step 4 and change the MED attribute to affect
route selection.

e n
/
[R1]bgp 64512

m
[R1-bgp]undo peer 10.0.15.3 route-policy 22 export

o
i.c
[R1-bgp]quit
[R1]undo route-policy 22

e
Create a route-policy med on R1 to match the route 10.1.11.0/24,u aw the MED
change
attribute of this route to 100, and apply this route-policy to R3..h
i n g
[R1]route-policy med permit node 10
r n
[R1-route-policy]if-match acl 2001

l e a
//
[R1-route-policy]apply cost 100
[R1-route-policy]quit
:
[R1]bgp 64512
t tp
h
[R1-bgp]peer 10.0.15.3 route-policy med export

:
[R1-bgp]quit

e s
r c
Check the BGP routing table of
o uR3.
es
R
<R3>display bgp routing-table

i n g
BGP Local router ID is 10.0.15.3

rn
Status codes: * - valid, > - best, d - damped,

a
L e h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

r e
o
Total Number of Routes: 4

M Network NextHop MED LocPrf PrefVal Path/Ogn

*> 10.1.3.0/24 0.0.0.0 0 0 i


*>i 10.1.5.0/24 10.0.35.5 0 100 0 i
*>i 10.1.11.0/24 10.0.35.5 100 0 64512i
* 10.0.15.1 100 0 64512i

[R3]display bgp routing-table 10.1.11.0

HC Series HUAWEI TECHNOLOGIES 275


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP local router ID : 10.0.3.3


Local AS number : 100
Paths: 2 available, 1 best, 1 select
BGP routing table entry information of 10.1.11.0/24:
From: 10.0.35.5 (10.0.5.5)
Route Duration: 00h00m33s
Relay IP Nexthop: 0.0.0.0
Relay IP Out-Interface: Serial3/0/0
e n
Original nexthop: 10.0.35.5
/
Qos information : 0x0
o m
i.c
AS-path 64512, origin igp, localpref 100, pref-val 0, valid, internal, best, select, active,
pre 255
Advertised to such 2 peers:
w e
10.0.23.2
u a
10.0.15.1

g .h
n
BGP routing table entry information of 10.1.11.0/24:
From: 10.0.15.1 (10.0.1.1)
ni
r
lea
Route Duration: 18h52m36s
Direct Out-interface: GigabitEthernet0/0/2
Original nexthop: 10.0.15.1
: //
Qos information : 0x0

t t p
:h
AS-path 64512, origin igp, MED 100, pref-val 0, valid, external, pre 255, not preferred for

s
MED
Not advertised to any peer yet

r c e
o
The route with the smallest MED u value is preferred.
s
The route selection resultein step 6 is the same as that in step 4.
R
----End
i n g
a rn
Additional
L e Exercises: Analysis and Verification
r estep 6 is complete and S1/0/0 of R1 is shut down, what is the MED value of the
o 10.1.11.0/24 learned on R2?
After
M
route

Whether a route-policy can be used to delete an AS from the AS_Path attribute?

Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
#

HC Series HUAWEI TECHNOLOGIES 276


HCNP-IERS Chapter 3 BGP Features and Configurations

sysname R1
#
router id 10.0.2.2
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
#
interface Serial3/0/0
e n
link-protocol ppp
/
ip address 10.0.14.1 255.255.255.0
o m
i.c
#
interface GigabitEthernet0/0/1
ip address 10.0.111.1 255.255.255.0
w e
#
u a
interface GigabitEthernet0/0/2

g .h
n
ip address 10.0.15.1 255.255.255.0
#
ni
r
lea
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
: //
bgp 64512

t t p
:h
peer 10.0.12.2 as-number 200

s
peer 10.0.15.3 as-number 100
group as64512 internal

r c e
ou
peer 10.0.11.11 as-number 64512
peer 10.0.11.11 group as64512

es
peer 10.0.11.11 connect-interface LoopBack0
#
R
ipv4-family unicast

i n g
n
undo synchronization

ar
maximum load-balancing 4

e
L
peer 10.0.12.2 enable

e
peer 10.0.12.2 route-policy as_path export

or peer 10.0.15.3 enable

M peer 10.0.15.3 route-policy med export


peer as64512 enable
peer as64512 route-policy Pref1 export
peer 10.0.11.11 enable
peer 10.0.11.11 group as64512
#
ospf 1
area 0.0.0.0
network 10.0.1.1 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 277


HCNP-IERS Chapter 3 BGP Features and Configurations

network 10.0.111.1 0.0.0.0


#
route-policy as_path permit node 10
if-match acl 2001
apply as-path 64512 64512 additive
#
route-policy Pref1 permit node 10
if-match acl 2002
apply local-preference 110
e n
#
/
route-policy Pref1 permit node 20
o m
i.c
#
route-policy med permit node 10
if-match acl 2001
w e
apply cost 100
u a
#

g .h
n
return

ni
r
lea
<R2>display current-configuration
[V200R007C00SPC600]
#
: //
sysname R2

t t p
:h
#

s
router id 10.0.2.2
#

r c e
ou
interface Serial1/0/0
link-protocol ppp

es
ip address 10.0.12.2 255.255.255.0
#
R
interface Serial2/0/0

i n g
link-protocol ppp
n
ar
ip address 10.0.23.2 255.255.255.0

e
L
#

e
interface LoopBack0

or
ip address 10.0.2.2 255.255.255.0

M
#
bgp 200
peer 10.0.12.1 as-number 64512
peer 10.0.23.3 as-number 100
#
ipv4-family unicast
undo synchronization
maximum load-balancing 4
peer 10.0.12.1 enable

HC Series HUAWEI TECHNOLOGIES 278


HCNP-IERS Chapter 3 BGP Features and Configurations

peer 10.0.23.3 enable


#
return

<R3>display current-configuration
[V200R007C00SPC600]
#
sysname R3
#
e n
router id 10.0.3.3
/
#
o m
i.c
interface Serial2/0/0
link-protocol ppp
ip address 10.0.23.3 255.255.255.0
w e
#
u a
interface Serial3/0/0

g .h
n
link-protocol ppp
ip address 10.0.35.3 255.255.255.0
ni
r
lea
#
interface GigabitEthernet0/0/2
ip address 10.0.15.3 255.255.255.0
: //
#

t t p
:h
interface LoopBack0

s
ip address 10.0.3.3 255.255.255.255
#

r c e
ou
interface LoopBack1
ip address 10.1.3.3 255.255.255.0
#
es
bgp 100
R
n g
peer 10.0.15.1 as-number 64512

i
n
peer 10.0.23.2 as-number 200

ar
peer 10.0.35.5 as-number 100

e
L
#

e
ipv4-family unicast

or undo synchronization

M network 10.1.3.0 255.255.255.0


maximum load-balancing 4
peer 10.0.15.1 enable
peer 10.0.23.2 enable
peer 10.0.35.5 enable
#
return

<R4>display current-configuration

HC Series HUAWEI TECHNOLOGIES 279


HCNP-IERS Chapter 3 BGP Features and Configurations

[V200R007C00SPC600]
#
sysname R4
#
router id 10.0.4.4
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.14.4 255.255.255.0
e n
#
/
interface GigabitEthernet0/0/0
o m
i.c
ip address 10.0.45.4 255.255.255.0
#
interface GigabitEthernet0/0/1
w e
ip address 10.0.114.4 255.255.255.0
u a
#

g .h
n
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
ni
r
lea
#
bgp 64512
peer 10.0.45.5 as-number 100
: //
group as64512 internal

t t p
:h
peer 10.0.11.11 as-number 64512

s
peer 10.0.11.11 group as64512

c e
peer 10.0.11.11 connect-interface LoopBack0

r
ou
#
ipv4-family unicast
undo synchronization
es
maximum load-balancing 4
R
n g
peer 10.0.45.5 enable

i
n
peer as64512 enable

ar
peer as64512 route-policy Pref4 export

e
L
peer 10.0.11.11 enable

e
peer 10.0.11.11 group as64512
#
or
M
ospf 1
area 0.0.0.0
network 10.0.114.4 0.0.0.0
network 10.0.4.4 0.0.0.0
#
route-policy Pref4 permit node 10
if-match acl 2001
apply local-preference 110
#

HC Series HUAWEI TECHNOLOGIES 280


HCNP-IERS Chapter 3 BGP Features and Configurations

route-policy Pref4 permit node 20


#
return

<R5>display current-configuration
[V200R007C00SPC600]
#
sysname R5
#
e n
router id 10.0.5.5
/
#
o m
i.c
interface Serial1/0/0
link-protocol ppp
ip address 10.0.35.5 255.255.255.0
w e
#
u a
interface GigabitEthernet0/0/0

g .h
n
ip address 10.0.45.5 255.255.255.0
#
ni
r
lea
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
#
: //
interface LoopBack1

t t p
:h
ip address 10.1.5.5 255.255.255.0

s
#
bgp 100

r c e
ou
peer 10.0.35.3 as-number 100
peer 10.0.45.4 as-number 64512
#
es
ipv4-family unicast
R
n
undo synchronization

i g
n
network 10.1.5.0 255.255.255.0

ar
maximum load-balancing 4

e
L
peer 10.0.35.3 enable

e
peer 10.0.45.4 enable
#
or
M
return

Lab 3-4 BGP Attributes and Route Selection 2 (Optional)

Learning Objectives

The objectives of this lab are to learn and understand:

HC Series HUAWEI TECHNOLOGIES 281


HCNP-IERS Chapter 3 BGP Features and Configurations

 How to modify the Community attribute to affect route selection


 How to use a route-policy to filter BGP routes

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
//lea
p :
t t
:h
Figure 4-4 BGP attributes and route selection 2
s
r c e
ou
Scenario

e s
You are a network administrator of a company. The company's network uses BGP for
RAS numbers according to the topology. To ensure network
i n g of branches cannot communicate with each other. To
interconnection. Design
security, some departments

a
control routingrninformation transmission, you need to use the Community attribute
L e routes.
to filter BGP
r e
o
Tasks
M
Step 1 Set basic parameters and configure IP addresses.

Configure IP addresses and masks for physical interfaces and Loopback0 of all the
routers. Each Loopback0 uses the 32-bit mask.
<R1>system-view
Enter system view, return user view with Ctrl+Z.

HC Series HUAWEI TECHNOLOGIES 282


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1]interface Serial 1/0/0


[R1-Serial1/0/0]ip address 10.0.12.1 255.255.255.0
[R1-Serial1/0/0]quit
[R1]interface Serial 3/0/0
[R1-Serial3/0/0]ip address 10.0.14.1 255.255.255.0
[R1-Serial3/0/0]quit
[R1]interface loopback 0
[R1-LoopBack0]ip address 10.0.1.1 255.255.255.255
[R1-LoopBack0]quit
e n
/
<R2>system-view
o m
i.c
Enter system view, return user view with Ctrl+Z.
[R2]interface Serial 1/0/0
[R2-Serial1/0/0]ip address 10.0.12.2 255.255.255.0
w e
[R2-Serial1/0/0]quit
u a
[R2]interface Serial 2/0/0

g .h
n
[R2-Serial2/0/0]ip address 10.0.23.2 255.255.255.0
[R2-Serial2/0/0]quit
ni
r
lea
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.0.25.2 255.255.255.0
[R2-GigabitEthernet0/0/0]quit
: //
[R2]interface loopback 0

t t p
:h
[R2-LoopBack0]ip address 10.0.2.2 255.255.255.255

s
[R2-LoopBack0]quit

r c e
ou
<R3>system-view
Enter system view, return user view with Ctrl+Z.
[R3]interface Serial 2/0/0
es
R
[R3-Serial2/0/0]ip address 10.0.23.3 255.255.255.0
[R3-Serial2/0/0]

i n g
n
[R3]interface loopback 0

ar
[R3-LoopBack0]ip address 10.0.3.3 255.255.255.255

e
L
[R3-LoopBack0]quit

e
or
<R4>system-view

M
Enter system view, return user view with Ctrl+Z.
[R4]interface Serial 1/0/0
[R4-Serial1/0/0]ip address 10.0.14.4 255.255.255.0
[R4-Serial1/0/0]quit
[R4]interface loopback 0
[R4-LoopBack0]ip address 10.0.4.4 255.255.255.255
[R4-LoopBack0]quit

<R5>system-view

HC Series HUAWEI TECHNOLOGIES 283


HCNP-IERS Chapter 3 BGP Features and Configurations

Enter system view, return user view with Ctrl+Z.


[R5]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]ip address 10.0.25.5 255.255.255.0
[R5-GigabitEthernet0/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]ip address 10.0.5.5 255.255.255.255
[R5-LoopBack0]quit

e n
After the configurations are complete, test direct link connectivity.
/
<R1>ping -c 1 10.0.12.2
o m
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=40 ms
e i.c
aw
u
.h
--- 10.0.12.2 ping statistics ---

g
1 packet(s) transmitted
1 packet(s) received

ni n
r
0.00% packet loss

lea
round-trip min/avg/max = 40/40/40 ms

: //
p
<R1>ping -c 1 10.0.14.4

t t
PING 10.0.14.4: 56 data bytes, press CTRL_C to break

:h
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=61 ms

e s
--- 10.0.14.4 ping statistics ---
r c
ou
1 packet(s) transmitted
1 packet(s) received

es
R
0.00% packet loss

g
round-trip min/avg/max = 61/61/61 ms

n i n
ar
<R2>ping -c 1 10.0.25.5

e
PING 10.0.25.5: 56 data bytes, press CTRL_C to break

L
Reply from 10.0.25.5: bytes=56 Sequence=1 ttl=255 time=14 ms

e
or
--- 10.0.25.5 ping statistics ---

M 1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 14/14/14 ms

<R2>ping -c 1 10.0.23.3
PING 10.0.23.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=2 ms

HC Series HUAWEI TECHNOLOGIES 284


HCNP-IERS Chapter 3 BGP Features and Configurations

--- 10.0.23.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms

Step 2 Configure BGP.

e n
Establish an IBGP peer relationship between R1 and R2 and establish EBGP peer /
relationships between other routers.
o m
[R1]router id 10.0.1.1
e i.c
[R1]bgp 64513

aw
u
[R1-bgp]peer 10.0.12.2 as-number 64513

.h
[R1-bgp]peer 10.0.14.4 as-number 64512
[R1-bgp]quit

i n g
r n
lea
[R2]router id 10.0.2.2
[R2]bgp 64513
[R2-bgp]peer 10.0.12.1 as-number 64513
: //
[R2-bgp]peer 10.0.23.3 as-number 64514

t t p
:h
[R2-bgp]peer 10.0.25.5 as-number 64515

s
[R2-bgp]quit

[R3]router id 10.0.3.3
r c e
[R3]bgp 64514

sou
[R3-bgp]quit
Re
[R3-bgp]peer 10.0.23.2 as-number 64513

i n g
n
[R4]router id 10.0.4.4

ar
[R4]bgp 64512

L e
[R4-bgp]peer 10.0.14.1 as-number 64513

e
[R4-bgp]quit

or
M
[R5]router id 10.0.5.5
[R5]bgp 64515
[R5-bgp]peer 10.0.25.2 as-number 64513
[R5-bgp]quit

After the configurations are complete, check whether BGP peer relationships are
established between routers.

HC Series HUAWEI TECHNOLOGIES 285


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1]display bgp peer

BGP local router ID : 10.0.1.1


Local AS number : 64513
Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.12.2 4 64513 5 6 0 00:03:28 Established 0


e n
10.0.14.4 4 64512 2 3 0 00:00:39 Established 0
/
o m
i.c
[R2]display bgp peer

BGP local router ID : 10.0.2.2


w e
Local AS number : 64513
u a
Total number of peers : 3 Peers in established state : 3

g .h
Peer V AS MsgRcvd MsgSent OutQ Up/Down
ni nState PrefRcv

r
10.0.12.1 4 64513 6 5 0
lea
00:04:00

//
Established 0
10.0.23.3 4 64514 4 6 0

p : 00:02:44 Established 0
10.0.25.5 4 64515 2 3

t t 0 00:00:41 Established 0

[R3]display bgp peer


s :h
r c e
ou
BGP local router ID : 10.0.3.3
Local AS number : 64514
Total number of peers : 1
es Peers in established state : 1

R
Peer V

i n g AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

n
10.0.23.2

e ar 4 64513 4 4 0 00:02:59 Established 0

e L
[R4]display bgp peer

or
M
BGP local router ID : 10.0.4.4
Local AS number : 64512
Total number of peers : 1 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.14.1 4 64513 3 3 0 00:01:40 Established 0

[R5]display bgp peer

HC Series HUAWEI TECHNOLOGIES 286


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP local router ID : 10.0.5.5


Local AS number : 64515
Total number of peers : 1 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.25.2 4 64513 3 3 0 00:01:23 Established 0

e n
The preceding command output shows that all BGP peer relationships are in
/
Established state.
o m
e i.c
Step 3 Configure a common Community attribute. a w
. hu 10.1.5.5/24,
Create Loopback1, Loopack2, and Loopback3 on R5, assign addresses
i n grespectively, and run
10.2.5.5/24, and 10.3.5.5/24 to the three loopback interfaces
r nBGP.
the network command to advertise these addresses into
l e a
[R5]interface loopback 1
: //
tp
[R5-LoopBack1]ip address 10.1.5.5 255.255.255.0

t
[R5-LoopBack1]quit

: h
s
[R5]interface loopback 2

c e
[R5-LoopBack2]ip address 10.2.5.5 255.255.255.0

r
u
[R5-LoopBack2]quit
[R5]interface loopback 3

s o
[R5-LoopBack3]quit
R e
[R5-LoopBack3]ip address 10.3.5.5 255.255.255.0

[R5]bgp 64515

i n g
rn
[R5-bgp]network 10.1.5.5 255.255.255.0

a
[R5-bgp]network 10.2.5.5 255.255.255.0

e
L
[R5-bgp]network 10.3.5.5 255.255.255.0

e
[R5-bgp]quit

r
o
M
[R2]bgp 64513
[R2-bgp]peer 10.0.12.1 next-hop-local
[R2-bgp]quit

Check whether the routing information is correctly transmitted on R2 and R4.


[R2]display bgp routing-table

HC Series HUAWEI TECHNOLOGIES 287


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP Local router ID is 10.0.2.2


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 3


Network NextHop MED LocPrf PrefVal Path/Ogn

*> 10.1.5.0/24 10.0.25.5 0 0 64515i


e n
*> 10.2.5.0/24 10.0.25.5 0 0 64515i
/
*> 10.3.5.0/24 10.0.25.5 0 0 64515i
o m
[R4]display bgp routing-table
e i.c
aw
BGP Local router ID is 10.0.4.4
u
Status codes: * - valid, > - best, d - damped,

g .h
n
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
ni
r
Total Number of Routes: 3

//lea
Network NextHop MED LocPrf

p : PrefVal Path/Ogn

t t
:h
*> 10.1.5.0/24 10.0.14.1 0 64513 64515i

es
*> 10.2.5.0/24 10.0.14.1 0 64513 64515i

c
*> 10.3.5.0/24 10.0.14.1 0 64513 64515i

r
s ou
route 10.1.5.0/24. Re
On R5, create a route-policy comm_r5 to add the Community attribute 100 to the

i n g
n
[R5]acl number 2000

ar
[R5-acl-basic-2000]rule 0 permit source 10.1.5.0 0.0.0.255

e
[R5-acl-basic-2000]quit

L
e
[R5]route-policy comm_r5 permit node 10

or
[R5-route-policy]if-match acl 2000
[R5-route-policy]apply community 100
M
[R5-route-policy]quit

[R5]bgp 64515
[R5-bgp]peer 10.0.25.2 route-policy comm_r5 export
[R5-bgp]quit

Configure all BGP peers to advertise the Community attribute between each other.

HC Series HUAWEI TECHNOLOGIES 288


HCNP-IERS Chapter 3 BGP Features and Configurations

[R1]bgp 64513
[R1-bgp]peer 10.0.14.4 advertise-community
[R1-bgp]peer 10.0.12.2 advertise-community
[R1-bgp]quit

[R2]bgp 64513
[R2-bgp]peer 10.0.12.1 advertise-community
[R2-bgp]peer 10.0.23.3 advertise-community
[R2-bgp]peer 10.0.25.5 advertise-community
e n
[R2-bgp]quit
/
o m
i.c
[R3]bgp 64514
[R3-bgp]peer 10.0.23.2 advertise-community
[R3-bgp]quit
w e
u a
[R4]bgp 64512

g .h
n
[R4-bgp]peer 10.0.14.1 advertise-community
[R4-bgp]quit
ni
r
[R5]bgp 64515

//lea
[R5-bgp]peer 10.0.25.2 advertise-community

p :
[R5-bgp]quit

t t
s :h
r c e
On R2 and R4, check whether the Community attribute is transmitted normally.

ou
<R2>display bgp routing-table community

es
R
BGP Local router ID is 10.0.2.2

g
Status codes: * - valid, > - best, d - damped,

i n
h - history, i - internal, s - suppressed, S - Stale

n
ar
Origin : i - IGP, e - EGP, ? - incomplete

L e
Total Number of Routes: 5

e
or
Network NextHop MED LocPrf PrefVal Community

M
*> 10.1.5.0/24 10.0.25.5 0 0 <0:100>

<R4>display bgp routing-table community

BGP Local router ID is 10.0.4.4


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

HC Series HUAWEI TECHNOLOGIES 289


HCNP-IERS Chapter 3 BGP Features and Configurations

Total Number of Routes: 5


Network NextHop MED LocPrf PrefVal Community

*> 10.1.5.0/24 10.0.25.5 0 0 <0:100>

Step 4 Configure a special Community attribute.

e n
Use a route-policy on R5 to add a special Community attribute no-export for the
/
o
route 10.2.5.0/24 and add a special Community attribute no-advertise for the route m
10.3.5.0/24.
i . c
w e
a
You only need to add two new nodes and if-match clauses to the route-policy
comm_r5 created on R5.
. hu
[R5]acl 2001
i n g
r
[R5-acl-basic-2001]rule 0 permit source 10.2.5.0 0.0.0.255
n
[R5-acl-basic-2001]quit

l e a
//
[R5]route-policy comm_r5 permit node 20

:
tp
[R5-route-policy]if-match acl 2001

t
[R5-route-policy]apply community no-export

h
:
[R5-route-policy]quit
[R5]acl number 2002
e s
r c
[R5-acl-basic-2002]rule 0 permit source 10.3.5.0 0.0.0.255
[R5-acl-basic-2002]quit

o u
s
[R5]route-policy comm_r5 permit node 30

e
R
[R5-route-policy]if-match acl 2002

g
[R5-route-policy]apply community no-advertise

i n
[R5-route-policy]quit

a rn
Check theeCommunity attribute of the routes learned by R2.
e L
or
<R2>dis bgp routing-table community

M BGP Local router ID is 10.0.2.2


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 4


Network NextHop MED LocPrf PrefVal Community

HC Series HUAWEI TECHNOLOGIES 290


HCNP-IERS Chapter 3 BGP Features and Configurations

*> 10.1.5.0/24 10.0.25.5 0 0 <0:100>


*> 10.2.5.0/24 10.0.25.5 0 0 no-export
*> 10.3.5.0/24 10.0.25.5 0 0 no-advertise

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.
<R2>display bgp routing-table

e n
/
BGP Local router ID is 10.0.2.2

o m
i.c
Status codes: * - valid, > - best, d - damped,

e
h - history, i - internal, s - suppressed, S - Stale

w
Origin : i - IGP, e - EGP, ? - incomplete

u a
.h
Total Number of Routes: 3
Network NextHop MED LocPrf
g
PrefVal Path/Ogn

i n
*> 10.1.5.0/24 10.0.25.5 0
r0n 64515i

lea
*> 10.2.5.0/24 10.0.25.5 0 0 64515i

://
*> 10.3.5.0/24 10.0.25.5 0 0 64515i

t tp
<R1>display bgp routing-table

s :h
BGP Local router ID is 10.0.1.1
r c e
ou
Status codes: * - valid, > - best, d - damped,

es
h - history, i - internal, s - suppressed, S - Stale

R
Origin : i - IGP, e - EGP, ? - incomplete

i n g
Total Number of Routes: 2
n
ar
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i L e
10.1.5.0/24 10.0.12.2 0 100 0 64515i
e
or
*>i 10.2.5.0/24 10.0.12.2 0 100 0 64515i

M
[R4]display bgp routing-table

BGP Local router ID is 10.0.4.4


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 1

HC Series HUAWEI TECHNOLOGIES 291


HCNP-IERS Chapter 3 BGP Features and Configurations

Network NextHop MED LocPrf PrefVal Path/Ogn

*> 10.1.5.0/24 10.0.14.1 0 64513 64515i

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
e n
carrying the special Community attribute no-advertise to any BGP peer. /
o m
Step 5 Configure the Community attribute for route summarization.
i . c
e
w 10.2.3.3/24
Create Loopback1 and Loopack2 on R3, assign addresses 10.1.3.3/24 and
to the two loopback interfaces respectively, and run the network u
a
. h command to
advertise these addresses into BGP.
i n g
[R3]interface LoopBack 1
r n
[R3-LoopBack1]ip address 10.1.3.3 255.255.255.0
l e a
[R3-LoopBack1]quit
: //
tp
[R3]interface loopback 2

t
[R3-LoopBack2]ip address 10.2.3.3 255.255.255.0

h
[R3-LoopBack2]quit

s :
[R3]bgp 64514

r c
[R3-bgp]network 10.1.3.3 255.255.255.0e
o u
[R3-bgp]network 10.2.3.3 255.255.255.0
[R3-bgp]quit
e s
R
i n g requirements need to be met: The route 10.1.5.0/24
Currently, the following
advertised byrR5n and the route 10.2.3.0/24 advertised by R3 need to be summarized
a
e A network segment 10.0.0.0/8. The specific routes need to be suppressed
L
into a Class
whenethe summarized route is advertised, and the Community attribute of the
or
Madvertised toroute
summarized
R4.
advertised to R4 must be 200. Specific routes 10.1.3.0/24 must be

To meet these requirements, create a route-policy comm_r3 on R3 to add the


Community attribute 100 to the route 10.2.3.0/24 advertised by R3.
[R3]acl number 2001
[R3-acl-basic-2001]rule 0 permit source 10.2.3.0 0.0.0.255
[R3-acl-basic-2001]quit

HC Series HUAWEI TECHNOLOGIES 292


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3]route-policy comm_r3 permit node 10


[R3-route-policy]if-match acl 2001
[R3-route-policy]apply community 100
[R3-route-policy]quit
[R3]route-policy comm_r3 permit node 20
[R3-route-policy]quit
[R3]bgp 64514
[R3-bgp]peer 10.0.23.2 route-policy comm_r3 export
[R3-bgp]quit
e n
/
On R1, check whether the learned routes 10.1.5.0/24 and 10.2.3.0/24 carry theo
m
i . c
Community attribute 100.
w e
<R1>display bgp routing-table community
a
. hu
BGP Local router ID is 10.0.1.1
Status codes: * - valid, > - best, d - damped,
i n g
r n
h - history, i - internal, s - suppressed, S - Stale

l e a
Origin : i - IGP, e - EGP, ? - incomplete

: //
tp
Total Number of Routes: 3
Network NextHop
h
MED
t LocPrf PrefVal Community

s :
*>i
*>i
10.1.5.0/24
10.2.3.0/24
10.0.12.2

r c
10.0.12.2e 0
0
100
100
0
0
<0:100>
<0:100>
*>i 10.2.5.0/24
o u
10.0.12.2 0 100 0 no-export

e s
R to filter the route with the Community attribute 100.
i n g
Create a community filter

rn
[R1]ip community-filter 1 permit 100

e a
L
ea route-policy match_comm to match the route with the Community
r
Create
o 100.
attribute
M[R1]route-policy match_comm permit node 10
[R1-route-policy]if-match community-filter 1
[R1-route-policy]quit

HC Series HUAWEI TECHNOLOGIES 293


HCNP-IERS Chapter 3 BGP Features and Configurations

Create a route-policy add_comm to add the Community attribute 200:1 to the


summarized route.
[R1]route-policy add_comm permit node 10
[R1-route-policy]apply community 200:1 additive
[R1-route-policy]quit

On R1, summarize the route matching the route-policy match_comm and use the
e n
route-policy add_comm to add the Community attribute. /
o m
i.c
[R1]bgp 64513
[R1-bgp]aggregate 10.0.0.0 255.0.0.0 detail-suppressed origin-policy match_comm
attribute-policy add_comm
w e
[R1-bgp]quit
u a
g .h
Check the BGP routing table of R4.
ni n
r
lea
<R4>display bgp routing-table

: //
p
BGP Local router ID is 10.0.4.4
Status codes: * - valid, > - best, d - damped,
t t
:h
h - history, i - internal, s - suppressed, S - Stale

s
Origin : i - IGP, e - EGP, ? - incomplete
e
r c
ou
Total Number of Routes: 2
Network

es
NextHop MED LocPrf PrefVal Path/Ogn

R
g
*> 10.0.0.0 10.0.14.1 0 64513i
*> 10.1.3.0/24

n i n 10.0.14.1 0 64513 64514i

e ar
L
On R4, check the Community attribute of the summarized route.
e
or
<R4>display bgp routing-table community

M
BGP Local router ID is 10.0.4.4
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 1


Network NextHop MED LocPrf PrefVal Community

HC Series HUAWEI TECHNOLOGIES 294


HCNP-IERS Chapter 3 BGP Features and Configurations

*> 10.0.0.0 10.0.14.1 0 <200:1>

----End

Additional Exercises: Analysis and Verification

If in step 4, the Community attribute of the route 10.2.5.0/24 is also changed to no


advertise, check the BGP routing tables of R2, R1, and R4 to analyze transmission of
e n
the routes 10.1.5.0/24, 10.2.5.0/24, and 10.3.5.0/24. /
o m
. c
Consider how to retain specific routes of the two routes 10.1.3.0/24 and 10.2.3.0/24
i
and suppress only specific routes of the route 10.1.5.0/24 on R4.
w e
a
Device Configurations
. hu
<R1>display current-configuration

i n g
[V200R007C00SPC600]

r n
#

l e a
//
sysname R1
#
:
router id 10.0.1.1
t tp
#

: h
interface Serial1/0/0

e s
c
link-protocol ppp

u r
ip address 10.0.12.1 255.255.255.0
#
s o
interface Serial3/0/0
link-protocol ppp Re
i n g
ip address 10.0.14.1 255.255.255.0

rn
#

a
interface LoopBack0

e
L
ip address 10.0.1.1 255.255.255.255

e
r
#

o
bgp 64513

M peer 10.0.12.2 as-number 64513


peer 10.0.14.4 as-number 64512
#
ipv4-family unicast
undo synchronization
aggregate 10.0.0.0 255.0.0.0 detail-suppressed origin-policy match_comm attribute-policy
add_comm
peer 10.0.12.2 enable
peer 10.0.12.2 advertise-community

HC Series HUAWEI TECHNOLOGIES 295


HCNP-IERS Chapter 3 BGP Features and Configurations

peer 10.0.14.4 enable


peer 10.0.14.4 advertise-community
#
route-policy match_comm permit node 10
if-match community-filter 1
#
route-policy add_comm permit node 10
apply community 200:1 additive
#
e n
ip community-filter 1 permit 100
/
#
o m
i.c
return

<R2>display current-configuration
w e
[V200R007C00SPC600]
u a
#

g .h
n
sysname R2
#
ni
r
lea
router id 10.0.2.2
#
interface Serial1/0/0
: //
link-protocol ppp

t t p
:h
ip address 10.0.12.2 255.255.255.0

s
#
interface Serial2/0/0

r c e
ou
link-protocol ppp
ip address 10.0.23.2 255.255.255.0
#
es
R
interface GigabitEthernet0/0/0

n g
ip address 10.0.25.2 255.255.255.0

i
#
n
ar
interface LoopBack0

e
L
ip address 10.0.2.2 255.255.255.255
#
e
or
bgp 64513

M
peer 10.0.12.1 as-number 64513
peer 10.0.23.3 as-number 64514
peer 10.0.25.5 as-number 64515
#
ipv4-family unicast
undo synchronization
peer 10.0.12.1 enable
peer 10.0.12.1 next-hop-local
peer 10.0.12.1 advertise-community

HC Series HUAWEI TECHNOLOGIES 296


HCNP-IERS Chapter 3 BGP Features and Configurations

peer 10.0.23.3 enable


peer 10.0.23.3 advertise-community
peer 10.0.25.5 enable
peer 10.0.25.5 advertise-community
#
return

<R3>display current-configuration
[V200R007C00SPC600]
e n
#
/
sysname R3
o m
i.c
#
router id 10.0.3.3
#
w e
acl number 2001
u a
rule 0 permit source 10.2.3.0 0.0.0.255

g .h
n
#
interface Serial2/0/0
ni
r
lea
link-protocol ppp
ip address 10.0.23.3 255.255.255.0
#
: //
interface LoopBack0

t t p
:h
ip address 10.0.3.3 255.255.255.255

s
#
interface LoopBack1

r c e
ou
ip address 10.1.3.3 255.255.255.0
#
interface LoopBack2
es
R
ip address 10.2.3.3 255.255.255.0
#

i n g
bgp 64514
n
ar
peer 10.0.23.2 as-number 64513

e
L
#

e
ipv4-family unicast

or undo synchronization

M network 10.1.3.0 255.255.255.0


network 10.2.3.0 255.255.255.0
peer 10.0.23.2 enable
peer 10.0.23.2 route-policy comm_r3 export
peer 10.0.23.2 advertise-community
#
route-policy comm_r3 permit node 10
if-match acl 2001
apply community 100

HC Series HUAWEI TECHNOLOGIES 297


HCNP-IERS Chapter 3 BGP Features and Configurations

#
route-policy comm_r3 permit node 20
#
return

<R4>display current-configuration
[V200R007C00SPC600]
#
sysname R4
e n
#
/
router id 10.0.4.4
o m
i.c
#
interface Serial1/0/0
link-protocol ppp
w e
ip address 10.0.14.4 255.255.255.0
u a
#

g .h
n
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
ni
r
lea
#
bgp 64512
peer 10.0.14.1 as-number 64513
: //
#

t t p
:h
ipv4-family unicast

s
undo synchronization
peer 10.0.14.1 enable

r c e
ou
peer 10.0.14.1 advertise-community
#
Return
es
R
n g
<R5>display current-configuration

i
n
[V200R007C00SPC600]
#

e ar
L
sysname R5
#
e
or
router id 10.0.5.5

M
#
interface GigabitEthernet0/0/0
ip address 10.0.25.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
#
interface LoopBack1
ip address 10.1.5.5 255.255.255.0

HC Series HUAWEI TECHNOLOGIES 298


HCNP-IERS Chapter 3 BGP Features and Configurations

#
interface LoopBack2
ip address 10.2.5.5 255.255.255.0
#
interface LoopBack3
ip address 10.3.5.5 255.255.255.0
#
bgp 64515
peer 10.0.25.2 as-number 64513
e n
#
/
ipv4-family unicast
o m
i.c
undo synchronization
network 10.1.5.0 255.255.255.0
network 10.2.5.0 255.255.255.0
w e
network 10.3.5.0 255.255.255.0
u a
peer 10.0.25.2 enable

g .h
n
peer 10.0.25.2 route-policy comm_r5 export
peer 10.0.25.2 advertise-community
ni
r
lea
#
route-policy comm_r5 permit node 10
if-match acl 2000
: //
apply community 100

t t p
:h
#

s
route-policy comm_r5 permit node 20
if-match acl 2001

r c e
ou
apply community no-export
#

es
route-policy comm_r5 permit node 30
if-match acl 2002
R
n g
apply community no-advertise

i
#
n
return

e ar
e L
Lab 3-5 BGP Multi-homing
or
MLearning Objectives
The objectives of this lab are to learn and understand:

 How to use only default routes in BGP multi-homing scenario


 How to use default routes to filter some routes in BGP multi-homing
scenario

HC Series HUAWEI TECHNOLOGIES 299


HCNP-IERS Chapter 3 BGP Features and Configurations

 How to use only BGP routes in BGP multi-homing scenario

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
//lea
p :
t t
s :h
r c e
Figure 4-5 BGP multi-homing

s ou
Scenario
Re
n g
You are a network administrator of a company. The company's network uses BGP to
i
r nThe company uses a private AS number 64512 and connects to ISP1
connect to ISP1.

e
through two arouters, and ISP1 uses the AS number 100. The company initially used
e L
default routes to connect to the Internet through ISP1. With the development of the
or this Internet access mode cannot meet requirements. You need to import
company,
Msome 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.

HC Series HUAWEI TECHNOLOGIES 300


HCNP-IERS Chapter 3 BGP Features and Configurations

Tasks

Step 1 Set basic parameters and configure IP addresses.

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

e n
/
Enter system view, return user view with Ctrl+Z.

m
[R1]interface Serial 1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 24
o
[R1-Serial1/0/0]quit
[R1]interface Serial 3/0/0
e i.c
[R1-Serial3/0/0]ip address 10.0.14.1 24
aw
u
.h
[R1-Serial3/0/0]quit

g
[R1]interface loopback 0
[R1-LoopBack0]ip address 10.0.1.1 32

ni n
r
[R1-LoopBack0]quit

<R2>system-view
//lea
Enter system view, return user view with Ctrl+Z.
p :
[R2]interface Serial 1/0/0
t t
:h
[R2-Serial1/0/0]ip address 10.0.12.2 24
[R2-Serial1/0/0]quit
e s
[R2]interface Serial 2/0/0
r c
ou
[R2-Serial2/0/0]ip address 10.0.23.2 24
[R2-Serial2/0/0]quit

es
R
[R2]interface GigabitEthernet 0/0/0

g
[R2-GigabitEthernet0/0/0]ip address 10.0.25.2 24

i n
[R2-GigabitEthernet0/0/0]quit

n
ar
[R2]interface loopback 0

e
[R2-LoopBack0]ip address 10.0.2.2 32

L
[R2-LoopBack0]quit

e
or
<R3>system-view

M
Enter system view, return user view with Ctrl+Z.
[R3]interface Serial 2/0/0
[R3-Serial2/0/0]ip address 10.0.23.3 24
[R3-Serial2/0/0]quit
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 10.0.113.3 24
[R3-GigabitEthernet0/0/1]quit
[R3]interface loopback 0

HC Series HUAWEI TECHNOLOGIES 301


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3-LoopBack0]ip address 10.0.3.3 32


[R3-LoopBack0]quit

<R4>system-view
Enter system view, return user view with Ctrl+Z.
[R4]interface Serial 1/0/0
[R4-Serial1/0/0]ip address 10.0.14.4 24
[R4-Serial1/0/0]quit
[R4]interface GigabitEthernet 0/0/1
e n
[R4-GigabitEthernet0/0/1]ip address 10.0.114.4 24
/
[R4-GigabitEthernet0/0/1]quit
o m
i.c
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 10.0.4.4 32
[R4-LoopBack0]quit
w e
u a
<R5>system-view

g .h
n
Enter system view, return user view with Ctrl+Z.
[R5]interface GigabitEthernet 0/0/0
ni
r
lea
[R5-GigabitEthernet0/0/0]ip address 10.0.25.5 24
[R5-GigabitEthernet0/0/0]quit
[R5]interface GigabitEthernet 0/0/1
: //
t
[R5-GigabitEthernet0/0/1]ip address 10.0.115.5 24

t p
:h
[R5-GigabitEthernet0/0/1]quit

s
[R5]interface loopback 0
[R5-LoopBack0]ip address 10.0.5.5 32

r c e
ou
[R5-LoopBack0]quit

es
After the configurations are complete, test direct link connectivity.
R
g
<R1>ping -c 1 10.0.14.4

i n
PING 10.0.14.4: 56 data bytes, press CTRL_C to break

n
ar
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=33 ms

L e
--- 10.0.14.4 ping statistics ---

e
or
1 packet(s) transmitted
1 packet(s) received

M 0.00% packet loss


round-trip min/avg/max = 33/33/33 ms

<R1>ping -c 1 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=34 ms

--- 10.0.12.2 ping statistics ---

HC Series HUAWEI TECHNOLOGIES 302


HCNP-IERS Chapter 3 BGP Features and Configurations

1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/34/34 ms

<R2>ping -c 1 10.0.25.5
PING 10.0.25.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.25.5: bytes=56 Sequence=1 ttl=255 time=13 ms

e n
--- 10.0.25.5 ping statistics ---
/
1 packet(s) transmitted
o m
i.c
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 13/13/13 ms
w e
u a
<R2>ping -c 1 10.0.23.3

g .h
n
PING 10.0.23.3: 56 data bytes, press CTRL_C to break

ni
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=39 ms

r
--- 10.0.23.3 ping statistics ---

//lea
1 packet(s) transmitted

p :
1 packet(s) received

t t
:h
0.00% packet loss

s
round-trip min/avg/max = 39/39/39 ms

r c e
Step 2 Configure IGP anduBGP.
s o
Re and configure all devices to belong to Area 0.
Configure OSPF in AS 64512

Run OSPF on thein


g
network segments connected to G0/0/1 and Loopback0 of R3.

a rn
e
[R3]router id 10.0.3.3

L
[R3]ospf 1

e
o r
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.113.3 0.0.0.0

M[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0


[R3-ospf-1-area-0.0.0.0]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

HC Series HUAWEI TECHNOLOGIES 303


HCNP-IERS Chapter 3 BGP Features and Configurations

[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.0.114.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.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.

e n
/
[R5]router id 10.0.5.5

m
[R5]ospf 1
[R5-ospf-1]area 0
o
[R5-ospf-1-area-0.0.0.0]network 10.0.115.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 10.0.5.5 0.0.0.0
e i.c
[R5-ospf-1-area-0.0.0.0]quit
aw
u
.h
[R5-ospf-1]quit

i n g
n
Create VLAN 13 on S1 and configure a VLANIF address for interconnection with R3.
r
Create VLAN 14 on S1 and configure a VLANIF address
l e a for interconnection with R4.
: // for interconnection with R5.
Create VLAN 15 on S1 and configure a VLANIF
t tp address

: h to access, and run OSPF on the network


Set the link type of interconnected interfaces
e s13, VLANIF 14, VLANIF 15, and Loopback0.
segments connected to S1's VLANIF
r c
[S1]vlan batch 13 to 15
o u
[S1]interface vlan 13
es
R
[S1-Vlanif13]ip address 10.0.113.1 255.255.255.0
[S1-Vlanif13]quit

i n g
rn
[S1]interface vlan 14

a
[S1-Vlanif14]ip address 10.0.114.1 255.255.255.0

e
[S1-Vlanif14]quit

L
e
[S1]interface vlan 15

o r
[S1-Vlanif15]ip address 10.0.115.1 255.255.255.0
[S1-Vlanif15]quit
M[S1]interface GigabitEthernet 0/0/3
[S1-GigabitEthernet0/0/3]port link-type access
[S1-GigabitEthernet0/0/3]port default vlan 13
[S1-GigabitEthernet0/0/3]quit
[S1]interface GigabitEthernet 0/0/4
[S1-GigabitEthernet0/0/4]port link-type access
[S1-GigabitEthernet0/0/4]port default vlan 14
[S1-GigabitEthernet0/0/4]quit

HC Series HUAWEI TECHNOLOGIES 304


HCNP-IERS Chapter 3 BGP Features and Configurations

[S1]interface GigabitEthernet 0/0/5


[S1-GigabitEthernet0/0/5]port link-type access
[S1-GigabitEthernet0/0/5]port default vlan 15
[S1-GigabitEthernet0/0/5]quit
[S1]interface loopback 0
[S1-LoopBack0]ip address 10.0.1.11 32
[S1-LoopBack0]quit
[S1]router id 10.0.1.11
[S1]ospf 1
e n
[S1-ospf-1]area 0
/
[S1-ospf-1-area-0.0.0.0]network 10.0.113.1 0.0.0.0
o m
i.c
[S1-ospf-1-area-0.0.0.0]network 10.0.114.1 0.0.0.0
[S1-ospf-1-area-0.0.0.0]network 10.0.115.1 0.0.0.0
[S1-ospf-1-area-0.0.0.0]network 10.0.1.11 0.0.0.0
w e
[S1-ospf-1-area-0.0.0.0]quit
u a
[S1-ospf-1]quit

g .h
ni
Check whether the devices learn the network segmentrconnected
n to Loopback0 of
other devices.
l e a
: / /
tp
<R3>display ip routing-table

ht
Route Flags: R - relay, D - download to fib

:
----------------------------------------------------------------------------

s
Routing Tables: Public
Destinations : 17
r c eRoutes : 17

o u
Destination/Mask
es
Proto Pre Cost Flags NextHop Interface

R
10.0.1.11/32

i n gOSPF 10 1 D 10.0.113.1 GigabitEthernet0/0/1

rn
10.0.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0

a
10.0.4.4/32 OSPF 10 2 D 10.0.113.1 GigabitEthernet0/0/1

L e
10.0.5.5/32 OSPF 10 2 D 10.0.113.1 GigabitEthernet0/0/1

e
10.0.23.0/24 Direct 0 0 D 10.0.23.3 Serial2/0/0

o r 10.0.23.2/32
10.0.23.3/32
Direct 0
Direct 0
0
0
D
D
10.0.23.2
127.0.0.1
Serial2/0/0
Serial2/0/0
M 10.0.23.255/32
10.0.113.0/24
Direct 0
Direct 0
0
0
D
D
127.0.0.1 Serial2/0/0
10.0.113.3 GigabitEthernet0/0/1
10.0.113.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
10.0.113.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
10.0.114.0/24 OSPF 10 2 D 10.0.113.1 GigabitEthernet0/0/1
10.0.115.0/24 OSPF 10 2 D 10.0.113.1 GigabitEthernet0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 305


HCNP-IERS Chapter 3 BGP Features and Configurations

127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0


255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

<R4>display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17

e n
Destination/Mask Proto Pre Cost Flags NextHop Interface
/
o m
i.c
10.0.1.11/32 OSPF 10 1 D 10.0.114.1 GigabitEthernet0/0/1
10.0.3.3/32
10.0.4.4/32
OSPF
Direct 0
10 2
0
D
D 127.0.0.1 LoopBack0
w e
10.0.114.1 GigabitEthernet0/0/1

10.0.5.5/32 OSPF 10 2 D
u a
10.0.114.1 GigabitEthernet0/0/1
10.0.14.0/24 Direct 0 0 D 10.0.14.4
.h
Serial1/0/0

g
n
10.0.14.1/32 Direct 0 0 D 10.0.14.1 Serial1/0/0
10.0.14.4/32 Direct 0 0 D 127.0.0.1
niSerial1/0/0

r
lea
10.0.14.255/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.113.0/24 OSPF 10 2 D 10.0.114.1 GigabitEthernet0/0/1
10.0.114.0/24 Direct 0 0 D
: //
10.0.114.4 GigabitEthernet0/0/1
10.0.114.4/32 Direct 0 0

t t
D
p
127.0.0.1 GigabitEthernet0/0/1

:h
10.0.114.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1

es
10.0.115.0/24 OSPF 10 2 D 10.0.114.1 GigabitEthernet0/0/1

c
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

r
ou
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0
es 0 D 127.0.0.1 InLoopBack0

R
n g
<R5>display ip routing-table

i
n
Route Flags: R - relay, D - download to fib

ar
----------------------------------------------------------------------------

e
L
Routing Tables: Public

e Destinations : 16 Routes : 16

or
M
Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.11/32 OSPF 10 1 D 10.0.115.1 GigabitEthernet0/0/1


10.0.3.3/32 OSPF 10 2 D 10.0.115.1 GigabitEthernet0/0/1
10.0.4.4/32 OSPF 10 2 D 10.0.115.1 GigabitEthernet0/0/1
10.0.5.5/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.25.0/24 Direct 0 0 D 10.0.25.5 GigabitEthernet0/0/0
10.0.25.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.0.25.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0

HC Series HUAWEI TECHNOLOGIES 306


HCNP-IERS Chapter 3 BGP Features and Configurations

10.0.113.0/24 OSPF 10 2 D 10.0.115.1 GigabitEthernet0/0/1


10.0.114.0/24 OSPF 10 2 D 10.0.115.1 GigabitEthernet0/0/1
10.0.115.0/24 Direct 0 0 D 10.0.115.5 GigabitEthernet0/0/1
10.0.115.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
10.0.115.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
e n
/
[S1]display ip routing-table
o m
i.c
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
w e
Destinations : 12 Routes : 12
u a
g .h
n
Destination/Mask Proto Pre Cost Flags NextHop Interface

ni
r
lea
10.0.1.11/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.3.3/32 OSPF 10 1 D 10.0.113.3 Vlanif13
10.0.4.4/32 OSPF 10 1 D
: //
10.0.114.4 Vlanif14
10.0.5.5/32 OSPF 10 1

t t
D
p
10.0.115.5 Vlanif15

:h
10.0.113.0/24 Direct 0 0 D 10.0.113.1 Vlanif13

es
10.0.113.1/32 Direct 0 0 D 127.0.0.1 Vlanif13

c
10.0.114.0/24 Direct 0 0 D 10.0.114.1 Vlanif14

r
ou
10.0.114.1/32 Direct 0 0 D 127.0.0.1 Vlanif14
10.0.115.0/24 Direct 0 0 D 10.0.115.1 Vlanif15
10.0.115.1/32 Direct 0
es 0 D 127.0.0.1 Vlanif15
127.0.0.0/8
R
Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32

i n g
Direct 0 0 D 127.0.0.1 InLoopBack0

r n
e a
Configure EBGP on R2, R3, and R5.
L
e R2, R3, and R5 to establish EBGP peer relationships using physical interfaces
r
Enable
o to the topology. Do not run BGP on SI.
M
according
[R2]router id 10.0.2.2
[R2]bgp 100
[R2-bgp]peer 10.0.25.5 as-number 64512
[R2-bgp]peer 10.0.23.3 as-number 64512
[R2-bgp]quit

[R3]bgp 64512

HC Series HUAWEI TECHNOLOGIES 307


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3-bgp]peer 10.0.23.2 as-number 100


[R3-bgp]quit

[R5]bgp 64512
[R5-bgp]peer 10.0.25.2 as-number 100
[R5-bgp]quit

After the configurations are complete, check whether EBGP peer relationships are
e n
established. /
o m
i.c
[R2]display bgp peer

BGP local router ID : 10.0.2.2


w e
Local AS number : 100
u a
.h
Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent


i n
OutQ Up/Down State g PrefRcv

r n
lea
10.0.23.3 4 64512 7 9 0 00:05:55 Established 0

://
10.0.25.5 4 64512 6 7 0 00:04:17 Established 0

t tp
:h
[R3]display bgp peer

BGP local router ID : 10.0.3.3


e s
Local AS number : 64512
r c
ou
Total number of peers : 1 Peers in established state : 1

es
Peer V
R
AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

i n g
n
10.0.23.2 4 100 8 8 0 00:06:09 Established 0

e ar
<R5>display bgp peer

e L
or
BGP local router ID : 10.0.5.5
Local AS number : 64512
M
Total number of peers : 1 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.25.2 4 100 7 7 0 00:05:31 Established 0

Step 3 Use only default routes to connect to a single ISP.

HC Series HUAWEI TECHNOLOGIES 308


HCNP-IERS Chapter 3 BGP Features and Configurations

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
e n
[R2-bgp]maximum load-balancing 4 /
[R2-bgp]quit
o m
[R3]bgp 64512
e i.c
[R3-bgp]maximum load-balancing 4
aw
[R3-bgp]quit
u
g .h
[R4]bgp 64512
[R4-bgp]maximum load-balancing 4
ni n
r
lea
[R4-bgp]quit

[R5]bgp 64512
: //
[R5-bgp]maximum load-balancing 4
t t p
:h
[R5-bgp]quit

e s
Create Loopback1 and Loopback2 r con R2 and assign addresses 10.1.2.2/24 and
u
10.2.2.2/24 to them. Run theonetwork command to advertise the two addresses into
e s
BGP.
R
i n g
[R2]interface LoopBack 1

rn
[R2-LoopBack1]ip address 10.1.2.2 24

e a
[R2-LoopBack1]quit

L
[R2]interface LoopBack 2

e
r
[R2-LoopBack2]ip address 10.2.2.2 24

o
[R2-LoopBack2]quit

M[R2]bgp 100
[R2-bgp]network 10.1.2.0 255.255.255.0
[R2-bgp]network 10.2.2.0 255.255.255.0
[R2-bgp]quit

Check whether R3 and R5 learn the two routes to 10.1.2.2/24 and 10.2.2.2/24.

HC Series HUAWEI TECHNOLOGIES 309


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3]display bgp routing-table

BGP Local router ID is 10.0.3.3


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 2


Network NextHop MED LocPrf PrefVal Path/Ogn
e n
/
*> 10.1.2.0/24 10.0.23.2 0 0 100i
o m
i.c
*> 10.2.2.0/24 10.0.23.2 0 0 100i

<R5>display bgp routing-table


w e
u a
BGP Local router ID is 10.0.5.5

g .h
n
Status codes: * - valid, > - best, d - damped,

ni
h - history, i - internal, s - suppressed, S - Stale

r
lea
Origin : i - IGP, e - EGP, ? - incomplete

Total Number of Routes: 2


: //
Network NextHop MED

t t p
LocPrf PrefVal Path/Ogn

:h
es
*> 10.1.2.0/24 10.0.25.2 0 0 100i

c
*> 10.2.2.0/24 10.0.25.2 0 0 100i

r
s ou
e
The link from R1 to ISP1 is the primary link, and the link from R5 to ISP1 is the
backup link. On R3 andRR5, run the import-route command to import OSPF routes
into BGP.
i n g
a
[R3]bgp 64512rn
L e
[R3-bgp]import-route ospf 1

e
[R3-bgp]quit
r
o
M[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.

HC Series HUAWEI TECHNOLOGIES 310


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3]ospf 1
[R3-ospf-1]default-route-advertise always cost 20 type 1
[R3-ospf-1]quit

[R5]ospf 1
[R5-ospf-1]default-route-advertise always cost 40 type 1
[R5-ospf-1]quit

e n
Check the IP routing table of S1.
/
[S1]display ip routing-table
o m
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
e i.c
Routing Tables: Public
aw
u
.h
Destinations : 14 Routes : 14

Destination/Mask Proto Pre Cost Flags NextHop


i n g
Interface

r n
lea
0.0.0.0/0 O_ASE 150 21 D 10.0.113.3 Vlanif13

://
10.0.1.0/24 Direct 0 0 D 10.0.1.11 LoopBack0

tp
10.0.1.11/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.3.3/32 OSPF 10 1
t D 10.0.113.3 Vlanif13

:h
10.0.4.4/32 OSPF 10 1 D 10.0.114.4 Vlanif14

es
10.0.5.5/32 OSPF 10 1 D 10.0.115.5 Vlanif15
10.0.113.0/24 Direct 0 0
r c D 10.0.113.1 Vlanif13

ou
10.0.113.1/32 Direct 0 0 D 127.0.0.1 Vlanif13
10.0.114.0/24 Direct 0

es 0 D 10.0.114.1 Vlanif14

R
10.0.114.1/32 Direct 0 0 D 127.0.0.1 Vlanif14

g
10.0.115.0/24 Direct 0 0 D 10.0.115.1 Vlanif15
10.0.115.1/32

n i n Direct 0 0 D 127.0.0.1 Vlanif15

ar
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

e
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e L
or
On S1, check the route to 10.1.2.2.
M
[S1]tracert 10.1.2.2
traceroute to 10.1.2.2(10.1.2.2), max hops: 30 ,packet length: 40
1 10.0.113.3 10 ms 1 ms 1 ms
2 10.0.23.2 40 ms 20 ms 20 ms

HC Series HUAWEI TECHNOLOGIES 311


HCNP-IERS Chapter 3 BGP Features and Configurations

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

e n
/
After route convergence is complete, check the IP routing table of S1. Check
o m
connectivity to 10.1.2.2.
i . c
[S1]display ip routing-table
w e
a
hu
Route Flags: R - relay, D - download to fib

.
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
i n g
r n
Destination/Mask Proto Pre Cost
l e a
Flags NextHop Interface

: //
tp
0.0.0.0/0 O_ASE 150 21 D 10.0.113.3 Vlanif13
10.0.1.11/32 Direct 0 0
ht D 127.0.0.1 InLoopBack0
10.0.3.3/32 OSPF 10 1
s : D 10.0.113.3 Vlanif13
10.0.4.4/32
10.0.5.5/32
OSPF
OSPF
10
10
r c
1
1
e D
D
10.0.114.4
10.0.115.5
Vlanif14
Vlanif15
10.0.113.0/24
o
Direct 0u 0 D 10.0.113.1 Vlanif13
10.0.113.1/32
es
Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.114.0/24
R
Direct 0 0 D 10.0.114.1 Vlanif14
10.0.114.1/32

i n g Direct 0 0 D 127.0.0.1 InLoopBack0

rn
10.0.115.0/24 Direct 0 0 D 10.0.115.1 Vlanif15

a
10.0.115.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

L e
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

e
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

o r
M
[S1]ping 10.1.2.2
PING 10.1.2.2: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out

--- 10.1.2.2 ping statistics ---

HC Series HUAWEI TECHNOLOGIES 312


HCNP-IERS Chapter 3 BGP Features and Configurations

5 packet(s) transmitted
0 packet(s) received
100.00% packet loss

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
e n
the costs of the default routes advertised by R3 and R5. Therefore, the network /
o m
cannot operate normally.
i . c
Restore S2/0/0 of R3 and shut down G0/0/1 of R3 to simulate a downlinkefailure of
aw
R3.
hu
Check route convergence and connectivity.
g .
ni n
r
[R3]interface s2/0/0
[R3-Serial2/0/0]undo shutdown

l e a
//
[R3-Serial2/0/0]quit

:
[R3]interface g0/0/1
t tp
[R3-GigabitEthernet0/0/1]shutdown
: h
[R3-GigabitEthernet0/0/1]quit
e s
r c
[S1]display ip routing-table

o u
s
Route Flags: R - relay, D - download to fib

e
R
----------------------------------------------------------------------------

g
Routing Tables: Public

i n
Destinations : 10 Routes : 10

a rn
e
Destination/Mask Proto Pre Cost Flags NextHop Interface

e L
o r 0.0.0.0/01
10.0.1.11/32
O_ASE 150 41
Direct 0 0
D
D
10.0.115.5
127.0.0.1
Vlanif15
InLoopBack0

M 10.0.4.4/32
10.0.5.5/32
OSPF
OSPF
10
10
1
1
D
D
10.0.114.4
10.0.115.5
Vlanif14
Vlanif15
10.0.114.0/24 Direct 0 0 D 10.0.114.1 Vlanif14
10.0.114.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.115.0/24 Direct 0 0 D 10.0.115.1 Vlanif15
10.0.115.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 313


HCNP-IERS Chapter 3 BGP Features and Configurations

[S1]ping 10.1.2.2
PING 10.1.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.2.2: bytes=56 Sequence=1 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=5 ttl=254 time=1 ms

e n
--- 10.1.2.2 ping statistics ---
/
5 packet(s) transmitted
o m
i.c
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms
w e
u a
. h
i n g
S1 selects the default route learned from R5. That is, S1 accesses the target network
through the backup link.
r n
Restore G0/0/1 of R3.
l e a
: //
tp
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]undo shutdown

ht
[R3-GigabitEthernet0/0/1]quit

s :
r e
c using default routes and some filtered
Step 4 Connect to a single
o u ISP
routes. e s
Establish IBGP peer g
R
i n relationships between R3 and S1, between R4 and S1, and

nS1, and specify the next-hop-local parameter to ensure that S1 can


between R5 and
r
a Update message sent from the ISP.
e
learn the route
L
e
or
[R3]bgp 64512
[R3-bgp]peer 10.0.113.1 as-number 64512

M[R3-bgp]peer 10.0.113.1 next-hop-local


[R3-bgp]quit

[R4]bgp 64512
[R4-bgp]peer 10.0.114.1 as-number 64512
[R4-bgp]peer 10.0.114.1 next-hop-local
[R4-bgp]quit

HC Series HUAWEI TECHNOLOGIES 314


HCNP-IERS Chapter 3 BGP Features and Configurations

[R5]bgp 64512
[R5-bgp]peer 10.0.115.1 as-number 64512
[R5-bgp]peer 10.0.115.1 next-hop-local
[R5-bgp]quit

[S1]bgp 64512
[S1-bgp]peer 10.0.113.3 as-number 64512
[S1-bgp]peer 10.0.114.4 as-number 64512
[S1-bgp]peer 10.0.115.5 as-number 64512
e n
[S1-bgp]quit
/
o m
Check whether S1 learns the routes 10.1.2.0/24 and 10.2.2.0/24.
e i.c
[S1]display ip routing-table
aw
u
.h
Route Flags: R - relay, D - download to fib

g
----------------------------------------------------------------------------
Routing Tables: Public

ni n
r
Destinations : 15 Routes : 15

lea
://
Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 O_ASE 150 21


t tp
D 10.0.113.3 Vlanif13

:h
10.0.1.11/32 Direct 0 0 D 127.0.0.1 InLoopBack0

es
10.0.3.3/32 OSPF 10 1 D 10.0.113.3 Vlanif13
10.0.4.4/32 OSPF 10 1
r c D 10.0.114.4 Vlanif14

ou
10.0.5.5/32 OSPF 10 1 D 10.0.115.5 Vlanif15
10.0.113.0/24 Direct 0

es 0 D 10.0.113.1 Vlanif13

R
10.0.113.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

g
10.0.114.0/24 Direct 0 0 D 10.0.114.1 Vlanif14
10.0.114.1/32

n i nDirect 0 0 D 127.0.0.1 InLoopBack0

ar
10.0.115.0/24 Direct 0 0 D 10.0.115.1 Vlanif15

e
10.0.115.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e L
10.1.2.0/24 BGP 255 0 RD 10.0.113.3 Vlanif13

or
10.2.2.0/24 BGP 255 0 RD 10.0.113.3 Vlanif13
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

M 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

To affect route selection through BGP, configure a route-policy policy_r3 on R3 to


filter the route 10.1.2.0/24.
[R3]acl number 2001
[R3-acl-basic-2001]rule 0 permit source 10.1.2.0 0.0.0.255
[R3-acl-basic-2001]quit

HC Series HUAWEI TECHNOLOGIES 315


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3]route-policy policy_r3 deny node 10


[R3-route-policy]if-match acl 2001
[R3-route-policy]quit
[R3]route-policy policy_r3 permit node 20
[R3-route-policy]bgp 64512
[R3-bgp]peer 10.0.113.1 route-policy policy_r3 export
[R3-bgp]quit

e n
Configure a route-policy policy_r5 on R5 to filter the route 10.2.2.0/24.
/
[R5]acl number 2001
o m
[R5-acl-basic-2001]rule 0 permit source 10.2.2.0 0.0.0.255
[R5-acl-basic-2001]quit
e i.c
[R5]route-policy policy_r5 deny node 10
aw
u
.h
[R5-route-policy]if-match acl 2001

g
[R5-route-policy]quit
[R5]route-policy policy_r5 permit node 20

ni n
r
[R5-route-policy]quit

lea
[R5]bgp 64512

//
[R5-bgp]peer 10.0.115.1 route-policy policy_r5 export
[R5-bgp]quit
p :
t t
Check the IP routing table of S1.
s :h
[S1]display ip routing-table
r c e
ou
Route Flags: R - relay, D - download to fib

s
e
----------------------------------------------------------------------------
Routing Tables: Public
R
ing
Destinations : 15 Routes : 15

n
ar
Destination/Mask Proto Pre Cost Flags NextHop Interface

L e
e
0.0.0.0/0 O_ASE 150 21 D 10.0.113.3 Vlanif13

or
10.0.1.11/32 Direct 0 0 D 127.0.0.1 InLoopBack0

M
10.0.3.3/32 OSPF 10 1 D 10.0.113.3 Vlanif13
10.0.4.4/32 OSPF 10 1 D 10.0.114.4 Vlanif14
10.0.5.5/32 OSPF 10 1 D 10.0.115.5 Vlanif15
10.0.113.0/24 Direct 0 0 D 10.0.113.1 Vlanif13
10.0.113.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.114.0/24 Direct 0 0 D 10.0.114.1 Vlanif14
10.0.114.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.115.0/24 Direct 0 0 D 10.0.115.1 Vlanif15
10.0.115.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 316


HCNP-IERS Chapter 3 BGP Features and Configurations

10.1.2.0/24 BGP 255 0 RD 10.0.115.5 Vlanif15


10.2.2.0/24 BGP 255 0 RD 10.0.113.3 Vlanif13
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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.

e n
Shut down S2/0/0 of R3. /
o m
i.c
[R3]interface s2/0/0
[R3-Serial2/0/0]shutdown
[R3-Serial2/0/0]quit
w e
a
Check the IP routing table of S1 and test connectivity to 10.1.2.2.. hu
i n g
n
[S1]display ip routing-table
Route Flags: R - relay, D - download to fib
ar
l e
----------------------------------------------------------------------------
Routing Tables: Public
: //
Destinations : 14 Routes : 14

t tp
: h
s
Destination/Mask Proto Pre Cost Flags NextHop Interface

r c e
u
0.0.0.0/0 O_ASE 150 21 D 10.0.113.3 Vlanif13
10.0.1.11/32 Direct 0
s o 0 D 127.0.0.1 InLoopBack0
10.0.3.3/32
10.0.4.4/32
Re
OSPF
OSPF
10
10
1
1
D
D
10.0.113.3
10.0.114.4
Vlanif13
Vlanif14
10.0.5.5/32

i n gOSPF 10 1 D 10.0.115.5 Vlanif15

rn
10.0.113.0/24 Direct 0 0 D 10.0.113.1 Vlanif13

e a
10.0.113.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

L
10.0.114.0/24 Direct 0 0 D 10.0.114.1 Vlanif14

r e
10.0.114.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

o 10.0.115.0/24 Direct 0 0 D 10.0.115.1 Vlanif15

M 10.0.115.1/32
10.1.2.0/24
Direct 0
BGP 255 0
0 D
RD
127.0.0.1
10.0.115.5
InLoopBack0
Vlanif15
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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.

HC Series HUAWEI TECHNOLOGIES 317


HCNP-IERS Chapter 3 BGP Features and Configurations

[S1]ping 10.1.2.2
PING 10.1.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.2.2: bytes=56 Sequence=1 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 10.1.2.2: bytes=56 Sequence=5 ttl=254 time=1 ms

--- 10.1.2.2 ping statistics ---


e n
5 packet(s) transmitted
/
5 packet(s) received
o m
i.c
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms

w e
u a
Restore S2/0/0 of R3.
g .h
[R3]interface s2/0/0

ni n
r
[R3-Serial2/0/0]undo shutdown

lea
[R3-Serial2/0/0]quit

: //
Step 5 Connect to multiple ISPs using
t tpBGP routes.
: hto connect to ISP2. To select routes among
s
The company applies for an Internet line
e
r c advertised by OSPF.
BGP routes, delete the default routes

o u
s
[R3]ospf

e
[R3-ospf-1]undo default-route-advertise
R
g
[R3-ospf-1]quit

i n
rn
[R5]ospf

a
[R5-ospf-1]undo default-route-advertise

e
L
[R5-ospf-1]quit

e
r
o the route-policies configured on R3 and R5.
M
Delete
[R3]undo route-policy policy1

[R5]undo route-policy policy2

On R3 and R5, delete the command used to import OSPF routes into BGP.
[R3]bgp 64512

HC Series HUAWEI TECHNOLOGIES 318


HCNP-IERS Chapter 3 BGP Features and Configurations

[R3-bgp]undo import-route ospf 1


[R3-bgp]quit

[R5]bgp 64512
[R5-bgp]undo import-route ospf 1
[R5-bgp]quit

Establish EBGP peer relationships between R1 and R2 and between R1 and R4 so that
e n
ISP2 can also transmit the routes 10.1.2.0/24 and 10.2.2.0/24. /
o m
i.c
[R1]bgp 200

e
[R1-bgp]peer 10.0.12.2 as-number 100

w
[R1-bgp]peer 10.0.14.4 as-number 64512
[R1-bgp]quit
u a
[R2]bgp 100
g .h
[R2-bgp]peer 10.0.12.1 as-number 200

ni n
[R2-bgp]quit
r
//lea
:
[R4]bgp 64512
[R4-bgp]peer 10.0.14.1 as-number 200

t t p
:h
[R4-bgp]quit

e s
r c
On S1, check the routes 10.1.2.0/24 and 10.2.2.0/24 and analyze current route
selection rules.
s ou
R
[S1]display bgp routing-tablee
i n g
Total Number of Routes: 6

n
e ar
BGP Local router ID is 10.0.1.11

L
Status codes: * - valid, > - best, d - damped,

e
or
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

M Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.1.2.0/24 10.0.113.3 0 100 0 100i


* i 10.0.115.5 0 100 0 100i
* i 10.0.114.4 100 0 200 100i
*>i 10.2.2.0/24 10.0.113.3 0 100 0 100i
* i 10.0.115.5 0 100 0 100i

HC Series HUAWEI TECHNOLOGIES 319


HCNP-IERS Chapter 3 BGP Features and Configurations

* i 10.0.114.4 100 0 200 100i

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 number 2001
[R4-acl-basic-2001]rule 0 permit source 10.2.2.0 0.0.0.255
e n
[R4-acl-basic-2001]quit
/
[R4]route-policy policy_r4 permit node 10
o m
i.c
[R4-route-policy]if-match acl 2001
[R4-route-policy]apply local-preference 150
[R4-route-policy]quit
w e
[R4]route-policy policy_r4 permit node 20
u a
[R4-route-policy]quit

g .h
ni n
Configure R4 to advertise this route-policy to S1.
ar
l e
//
[R4]bgp 64512

:
tp
[R4-bgp]peer 10.0.114.1 route-policy policy_r4 export
[R4-bgp]quit

h t
s :
Check the BGP routing table of S1. e
r c
o
[S1]display bgp routing-tableu
e s
R
Total Number of Routes: 6

i n g
rn
BGP Local router ID is 10.0.1.11

a
Status codes: * - valid, > - best, d - damped,

L e h - history, i - internal, s - suppressed, S - Stale

e
Origin : i - IGP, e - EGP, ? - incomplete

o r
M
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.1.2.0/24 10.0.113.3 0 100 0 100i


* i 10.0.115.5 0 100 0 100i
* i 10.0.114.4 100 0 200 100i
*>i 10.2.2.0/24 10.0.114.4 150 0 200 100i
* i 10.0.113.3 0 100 0 100i
* i 10.0.115.5 0 100 0 100i

HC Series HUAWEI TECHNOLOGIES 320


HCNP-IERS Chapter 3 BGP Features and Configurations

The preceding command output shows that S1 accesses 10.2.2.0/24 through the
route obtained from ISP2 connected to R4.

Shut down S1/0/0 of R4 to simulate a failure.


[R4]interface s1/0/0
[R4-Serial1/0/0]shutdown
[R4-Serial1/0/0]quit

e n
/
Check the BGP routing table of S1.
o m
[S1]display bgp routing-table

ei.c
Total Number of Routes: 4
aw
u
BGP Local router ID is 10.0.1.11
g .h
Status codes: * - valid, > - best, d - damped,

ni n
h - history, i - internal, s - suppressed, S - Stale
r
lea
Origin : i - IGP, e - EGP, ? - incomplete

: //
p
Network NextHop MED LocPrf PrefVal Path/Ogn

t t
:h
*>i 10.1.2.0/24 10.0.113.3 0 100 0 100i
* i 10.0.115.5 0
e s 100 0 100i
*>i 10.2.2.0/24 10.0.113.3
r c
0 100 0 100i

ou
* i 10.0.115.5 0 100 0 100i

e s
The preceding command R output shows that S1 obtains the routes 10.1.2.0/24 and
i
10.2.2.0/24 through n gISP1 connected to R3.
a rnof R4.
e
Enable S1/0/0
L
e
[R4]interface s1/0/0
r
o
[R4-Serial1/0/0]undo shutdown

M[R4-Serial1/0/0]quit

Check the BGP routing table of S1 to determine whether the failure is rectified.
[S1]display bgp routing-table

Total Number of Routes: 6

HC Series HUAWEI TECHNOLOGIES 321


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP Local router ID is 10.0.1.11


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.1.2.0/24 10.0.113.3 0 100 0 100i


* i 10.0.115.5 0 100 0 100i
e n
* i 10.0.114.4 100 0 200 100i
/
*>i 10.2.2.0/24 10.0.114.4 150 0 200 100i
o m
i.c
* i 10.0.113.3 0 100 0 100i
* i 10.0.115.5 0 100 0 100i

w e
u a
----End
g .h
Additional Exercises: Analysis and Verification n i n
ar
e link from the company to
After S2/0/0 of R3 is shut down in step 3, and the lprimary
/
/
ISP1 fails, the backup link between R5 and ISP1: still works normally. How to address
t tp
the connectivity problem?
: h
This company is dual-homed to two e sISPs. Analyze how to load balance incoming
r c
u
traffic of the same network segment.
o
Device Configurationse
s
R
i n g
<R1>display current-configuration

rn
[V200R007C00SPC600]
#

e a
L
sysname R1

e
r
#

o
router id 10.0.1.1

M#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
#
interface Serial3/0/0
link-protocol ppp
ip address 10.0.14.1 255.255.255.0
#

HC Series HUAWEI TECHNOLOGIES 322


HCNP-IERS Chapter 3 BGP Features and Configurations

interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
bgp 200
peer 10.0.12.2 as-number 100
peer 10.0.14.4 as-number 64512
#
ipv4-family unicast
undo synchronization
e n
maximum load-balancing 4
/
peer 10.0.12.2 enable
o m
i.c
peer 10.0.14.4 enable
#
return
w e
u a
<R2>display current-configuration

g .h
n
[V200R007C00SPC600]
#
ni
r
lea
sysname R2
#

: //
router id 10.0.2.2
t t p
#
s :h
interface Serial1/0/0
r c e
ou
link-protocol ppp

s
ip address 10.0.12.2 255.255.255.0

e
R
#

g
interface Serial2/0/0
link-protocol ppp

n i n
ar
ip address 10.0.23.2 255.255.255.0
#

L e
interface GigabitEthernet0/0/0

e
or
ip address 10.0.25.2 255.255.255.0
#

M
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
interface LoopBack1
ip address 10.1.2.2 255.255.255.0
#
interface LoopBack2
ip address 10.2.2.2 255.255.255.0
#

HC Series HUAWEI TECHNOLOGIES 323


HCNP-IERS Chapter 3 BGP Features and Configurations

bgp 100
peer 10.0.12.1 as-number 200
peer 10.0.23.3 as-number 64512
peer 10.0.25.5 as-number 64512
#
ipv4-family unicast
undo synchronization
network 10.1.2.0 255.255.255.0
network 10.2.2.0 255.255.255.0
e n
maximum load-balancing 4
/
peer 10.0.12.1 enable
o m
i.c
peer 10.0.23.3 enable

#
peer 10.0.25.5 enable

w e
return
u a
g .h
n
<R3>display current-configuration
[V200R007C00SPC600]
ni
r
lea
#
sysname R3
#
: //
router id 10.0.3.3 t t p
s :h
#
r c e
ou
acl number 2001

s
rule 0 permit source 10.1.2.0 0.0.0.255

e
R
#

g
interface Serial2/0/0
link-protocol ppp

n i n
ar
ip address 10.0.23.3 255.255.255.0
#

L e
interface GigabitEthernet0/0/1

e
or
ip address 10.0.113.3 255.255.255.0
#

M
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
bgp 64512
peer 10.0.23.2 as-number 100
peer 10.0.113.1 as-number 64512
#
ipv4-family unicast
undo synchronization

HC Series HUAWEI TECHNOLOGIES 324


HCNP-IERS Chapter 3 BGP Features and Configurations

maximum load-balancing 4
peer 10.0.23.2 enable
peer 10.0.113.1 enable
peer 10.0.113.1 next-hop-local
#
ospf 1
area 0.0.0.0
network 10.0.113.3 0.0.0.0
network 10.0.3.3 0.0.0.0
e n
#
/
return
o m
<R4>display current-configuration
e i.c
[V200R007C00SPC600]

aw
#
u
sysname R4

g .h
n
#

ni
router id 10.0.4.4 r
#
//lea
p :
interface Serial1/0/0
t t
:h
link-protocol ppp
ip address 10.0.14.4 255.255.255.0

e s
#
r c
ou
interface GigabitEthernet0/0/1

s
ip address 10.0.114.4 255.255.255.0

e
R
#

g
interface LoopBack0

i n
ip address 10.0.4.4 255.255.255.255

n
ar
#
bgp 64512

L e
peer 10.0.14.1 as-number 200

e
or
peer 10.0.114.1 as-number 64512
#

M
ipv4-family unicast
undo synchronization
maximum load-balancing 4
peer 10.0.14.1 enable
peer 10.0.114.1 enable
peer 10.0.114.1 route-policy policy_r4 export
peer 10.0.114.1 next-hop-local
#
ospf 1

HC Series HUAWEI TECHNOLOGIES 325


HCNP-IERS Chapter 3 BGP Features and Configurations

area 0.0.0.0
network 10.0.114.4 0.0.0.0
network 10.0.4.4 0.0.0.0
#
route-policy policy_r4 permit node 10
if-match acl 2001
apply local-preference 150
route-policy policy_r4 permit node 20
#
e n
Return
/
o m
i.c
<R5>display current-configuration
[V200R007C00SPC600]
#
w e
sysname R5
u a
#

g .h
router id 10.0.5.5
ni n
r
lea
#
interface GigabitEthernet0/0/0
: //
ip address 10.0.25.5 255.255.255.0
t t p
:h
#
interface GigabitEthernet0/0/1

e s
ip address 10.0.115.5 255.255.255.0
r c
ou
#
interface LoopBack0

es
R
ip address 10.0.5.5 255.255.255.255

g
#
bgp 64512

n i n
ar
peer 10.0.25.2 as-number 100
peer 10.0.115.1 as-number 64512
#
L e
e
or
ipv4-family unicast
undo synchronization

M maximum load-balancing 4
peer 10.0.25.2 enable
peer 10.0.115.1 enable
peer 10.0.115.1 next-hop-local
#
ospf 1
area 0.0.0.0
network 10.0.115.5 0.0.0.0
network 10.0.5.5 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 326


HCNP-IERS Chapter 3 BGP Features and Configurations

#
return

<S1>display current-configuration
#
!Software Version V100R005C01SPC100
sysname S1
#

e n
router id 10.0.1.11
/
o m
i.c
#
interface Vlanif13

w e
a
ip address 10.0.113.1 255.255.255.0
#
u
interface Vlanif14

g .h
ip address 10.0.114.1 255.255.255.0

ni n
r
#

lea
interface Vlanif15

//
ip address 10.0.115.1 255.255.255.0
#
p :
interface GigabitEthernet0/0/3
t t
:h
port link-type access
port default vlan 13

e s
#
r c
ou
interface GigabitEthernet0/0/4
port link-type access

es
R
port default vlan 14

g
#

i n
interface GigabitEthernet0/0/5

n
ar
port link-type access
port default vlan 15
#
L e
e
or
interface LoopBack0
ip address 10.0.1.11 255.255.255.255

M
#
bgp 64512
peer 10.0.113.3 as-number 64512
peer 10.0.114.4 as-number 64512
peer 10.0.115.5 as-number 64512
#
ipv4-family unicast
undo synchronization
peer 10.0.113.3 enable

HC Series HUAWEI TECHNOLOGIES 327


HCNP-IERS Chapter 3 BGP Features and Configurations

peer 10.0.114.4 enable


peer 10.0.115.5 enable
#
ospf 1
area 0.0.0.0
network 10.0.113.1 0.0.0.0
network 10.0.114.1 0.0.0.0
network 10.0.115.1 0.0.0.0
network 10.0.1.11 0.0.0.0
e n
#
/
return
o m
Lab 3-6 BGP Troubleshooting e i.c
aw
u
Learning Objectives
g .h
The objectives of this lab are to learn and understand:
i n
rn
How to troubleshoot a failure to establishaa BGP peer relationship

/ l e
How to use BGP debugging commands
: /
tp

h t
Topology
s :
r c e
o u
es
R
i n g
a rn
L e
r e Figure 4-6 BGP troubleshooting
o
MScenario
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

HC Series HUAWEI TECHNOLOGIES 328


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP configurations, you encountered many problems and have rectified all network
failures.

Tasks

Step 1 Set basic parameters and configure IP addresses.

Configure IP addresses and masks for physical interfaces and loopback interfaces of
e n
/
all the routers. Each Loopback0 uses the 32-bit mask.
o m
i.c
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface Serial 1/0/0
w e
[R1-Serial1/0/0]ip address 10.0.12.1 24
u a
[R1-Serial1/0/0]quit

g .h
n
[R1]interface LoopBack 0
[R1-LoopBack0]ip add 10.0.1.1 32
ni
r
lea
[R1-LoopBack0]quit

[R2]interface Serial 1/0/0


: //
[R2-Serial1/0/0]ip address 10.0.12.2 24
t t p
:h
[R2-Serial1/0/0]quit
[R2]interface Serial 2/0/0

e s
c
[R2-Serial2/0/0]ip address 10.0.23.2 24

r
ou
[R2-Serial2/0/0]quit

s
[R2]interface LoopBack 0

[R2-LoopBack0]quit
Re
[R2-LoopBack0]ip address 10.0.2.2 32

i n g
n
[R3]interface Serial 2/0/0

ar
[R3-Serial2/0/0]ip address 10.0.23.3 24

e
e L
[R3-Serial2/0/0]quit
[R3]interface LoopBack 0

or
[R3-LoopBack0]ip address 10.0.3.3 32

M
[R3-LoopBack0]quit

After the configurations are complete, test direct link connectivity.


[R2]ping -c 1 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=40 ms

HC Series HUAWEI TECHNOLOGIES 329


HCNP-IERS Chapter 3 BGP Features and Configurations

--- 10.0.12.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/40/40 ms

[R2]ping -c 1 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=38 ms
e n
/
--- 10.0.23.3 ping statistics ---
o m
i.c
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
w e
round-trip min/avg/max = 38/38/38 ms
u a
g .h
i n
The preceding command output shows that direct link connectivity is normal.
n
r
Step 2 Configure IGP and BGP.
// lea
p :
Configure OSPF in AS 64512 and configure all devices to belong to Area 0. Configure
t t
h of R1.
each router to use Loopback0 address as its router ID. Run OSPF on the network
:
s
segments connected to S1/0/0 and Loopback0
e
r c
u
[R1]router-id 10.0.1.1
[R1]ospf 1
s o
[R1-ospf-1]area 0

Re
[R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0

n g
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0

i
rn
[R1-ospf-1-area-0.0.0.0]quit

a
[R1-ospf-1]quit

e
L
e on the network segments connected to S1/0/0 and Loopback0 of R2.
RunrOSPF
o
M[R2]router id 10.0.2.2
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit

HC Series HUAWEI TECHNOLOGIES 330


HCNP-IERS Chapter 3 BGP Features and Configurations

After the configurations are complete, check connectivity between Loopback0


addresses of R1 and R2.
[R1]ping -c 1 -a 10.0.1.1 10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=40 ms

--- 10.0.2.2 ping statistics ---


1 packet(s) transmitted
e n
1 packet(s) received /
0.00% packet loss
o m
i.c
round-trip min/avg/max = 40/40/40 ms

w e
Configure IBGP between R1 and R2, configure EBGP between R2 and
u a R3, and
configure these routers to establish BGP peer relationships using . hloopback interface
i
addresses. To ensure normal transmission of routing information, n g configure
next-hop-local on R2 and specify R1’s address as thern
l a
eR3.
peer address and incorrectly
set the AS number of the peer 10.0.2.2 to 64514 on
: / /
[R1]bgp 64512

t tp
[R1-bgp]peer 10.0.2.2 as-number 64512

: h
s
[R1-bgp]quit

r c e
u
[R2]bgp 64512

o
[R2-bgp]peer 10.0.1.1 as-number 64512
s
R e
[R2-bgp]peer 10.0.1.1 next-hop-local
[R2-bgp]peer 10.0.3.3 as-number 64513
[R2-bgp]quit

i n g
a rn
[R3]router id 10.0.3.3

L e
[R3]bgp 64513

e
[R3-bgp]peer 10.0.2.2 as-number 64514

r
o
[R3-bgp]quit

M
Step 3 Troubleshoot the failure to establish BGP peer relationships.

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.
[R2]display bgp peer

HC Series HUAWEI TECHNOLOGIES 331


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP local router ID : 10.0.2.2


Local AS number : 64512
Total number of peers : 2 Peers in established state : 0

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.1.1 4 64512 0 0 0 00:05:36 Active 0


10.0.3.3 4 64513 0 0 0 00:05:21 Idle 0

e n
/
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 relationshipciso
m
e
established normally, the State field displays Established. If the State field
i.remains
aw
another state for a long period, a failure occurs and needs to be rectified.
hu
.
g with the peer.
Generally, when a peer IP address is unreachable for a local router, the peer status
i n
n during the establishment
displays Idle. That is, this router does not initiate a TCP connection
When the peer IP address is reachable but an error occurs ar
l e
of a TCP connection, you can see that the peer status
: // remains Active.
First check the BGP peer relationship between t tpR2 and R3 and check connectivity
between loopback interface addresses:ofhR2 and R3.
e s
[R2]ping -c 1 -a 10.0.2.2 10.0.3.3
r c
u
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
o
Request time out

e s
R
i n g
--- 10.0.3.3 ping statistics ---
1 packet(s) transmitted

rn
0 packet(s) received

a
e
100.00% packet loss

L
r e
o
The preceding command output shows that connectivity between loopback
Minterface addresses of R2 and R3 is abnormal.
Check the IP routing table of R2.
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14

HC Series HUAWEI TECHNOLOGIES 332


HCNP-IERS Chapter 3 BGP Features and Configurations

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 OSPF 10 1562 D 10.0.12.1 Serial1/0/0


10.0.2.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.12.0/24 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.1/32 Direct 0 0 D 10.0.12.1 Serial1/0/0
10.0.12.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
e n
10.0.23.0/24 Direct 0 0 D 10.0.23.2 Serial2/0/0
/
10.0.23.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
o m
i.c
10.0.23.3/32 Direct 0 0 D 10.0.23.3 Serial2/0/0
10.0.23.255/32
127.0.0.0/8
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
w e
127.0.0.1/32 Direct 0 0 D 127.0.0.1
u
InLoopBack0a
127.255.255.255/32 Direct 0 0 D 127.0.0.1

g .h
InLoopBack0

n
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

n i
The preceding command output shows that there is a
r
l e no route to 10.0.3.3 of R3.

: //
tp
Check the IP routing table of R3.
[R3]display ip routing-table
ht
s :
Route Flags: R - relay, D - download to fib

c e
----------------------------------------------------------------------------
r
Routing Tables: Public

o u
Destinations : 9

e s Routes : 9

R
g
Destination/Mask Proto Pre Cost Flags NextHop Interface

i n
rn
10.0.3.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e a
10.0.23.0/24 Direct 0 0 D 10.0.23.3 Serial2/0/0

e L
10.0.23.2/32 Direct 0 0 D 10.0.23.2 Serial2/0/0

r
10.0.23.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0

o 10.0.23.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

M 127.0.0.0/8
127.0.0.1/32
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

The preceding command output shows that there is no route to 10.0.2.2 of R2.

HC Series HUAWEI TECHNOLOGIES 333


HCNP-IERS Chapter 3 BGP Features and Configurations

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.
[R2]ip route-static 10.0.3.3 32 10.0.23.3

e n
/
[R3]ip route-static 10.0.2.2 32 10.0.23.2

o m
Check connectivity between R2 and R3.
e i.c
[R2]ping -c 1 -a 10.0.2.2 10.0.3.3

aw
u
PING 10.0.3.3: 56 data bytes, press CTRL_C to break

.h
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=30 ms

--- 10.0.3.3 ping statistics ---


i n g
1 packet(s) transmitted
r n
lea
1 packet(s) received
0.00% packet loss
: //
round-trip min/avg/max = 30/30/30 ms

t t p
s :h
Check BGP peer relationships of R2.

r c e
ou
[R2]display bgp peer

es
BGP local router ID : 10.0.12.2
R
g
Local AS number : 64512

i n
Total number of peers : 2

n
Peers in established state : 0

Peer

e arV AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

e L
or
10.0.1.1 4 64512 0 0 0 05:23:27 Active 0
10.0.3.3 4 64513 0 0 0 05:23:02 Active 0

M
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.

HC Series HUAWEI TECHNOLOGIES 334


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP uses TCP port 179 for communication. Check whether port 179 is enabled on
the routers.

On R1 and R2, check the TCP status.


[R1]display tcp status
TCPCB Tid/Soid Local Add:port Foreign Add:port VPNID State
194b9500 8 /2 0.0.0.0:22 0.0.0.0:0 23553 Listening
194b939c 8 /1 0.0.0.0:23 0.0.0.0:0 23553 Listening
e n
194b90d4 106/1 0.0.0.0:80 0.0.0.0:0 0 Listening
/
194b9a90 234/2 0.0.0.0:179 10.0.2.2:0 0 Listening
o m
i.c
194b9664 8 /3 0.0.0.0:830 0.0.0.0:0 23553 Listening
194b9238 6 /1 0.0.0.0:7547 0.0.0.0:0 0
e
Listening

w
[R2]display tcp status
u a
TCPCB Tid/Soid Local Add:port Foreign Add:port
.h
VPNID State

g
n
1949a048 234/5 0.0.0.0:0 0.0.0.0:0 0 Closed
19499d80 8 /2 0.0.0.0:22 0.0.0.0:0
ni
23553 Listening

r
lea
19499c1c 8 /1 0.0.0.0:23 0.0.0.0:0 23553 Listening

//
19499954 106/1 0.0.0.0:80 0.0.0.0:0 0 Listening
1949a474 234/2 0.0.0.0:179
:
10.0.1.1:0

p
0 Listening
1949a310 234/4 0.0.0.0:179
t t
10.0.3.3:0 0 Listening

:h
19499ee4 8 /3 0.0.0.0:830 0.0.0.0:0 23553 Listening

es
19499ab8 6 /1 0.0.0.0:7547 0.0.0.0:0 0 Listening

r c
The preceding command output
o u shows that port 179 for corresponding peer
e s BGP works normally on a single router.
address is in Listening state.
R
Run the debuggingg
i n command on R1 to check whether R1 receives BGP packets sent
from R2.
a rn
L e
<R1>terminal monitor

e
<R1>terminal debugging

r
o
<R1>debugging tcp packet

MDec 7 2011 10:08:16.620.1+00:00 R1 SOCKET/7/TCP PACKET:


TCP debug packet information:
1323252496: Input: no port,
(src = 10.0.12.2:52688,dst = 10.0.1.1:179,VrfIndex = 0,seq = 2254758724,
ack = 0,datalen = 0,optlen = 4,flag = SYN ,window = 16384,ttl = 0,tos = 0,MSS = 0)

Dec 7 2011 10:08:16.620.2+00:00 R1 SOCKET/7/TCP PACKET:


TCP debug packet information:
1323252496: Output: task = (0), socketid = 0,

HC Series HUAWEI TECHNOLOGIES 335


HCNP-IERS Chapter 3 BGP Features and Configurations

(src = 10.0.1.1:179,dst = 10.0.12.2:52688,VrfIndex = 0,seq = 0,


ack = 2254758725,datalen = 0,optlen = 0,flag = ACK RST ,window = 0,ttl = 255,tos = 0,MSS
= 0)

<R1>undo debugging all


Info: All possible debugging has been turned off

The preceding command output shows that the source address of the packet with
e n
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. o m
e i.c
When establishing BGP peer relationships, you use the loopback interface address of
R2. As a result, the BGP peer relationship between R1 and R2 cannotabe westablished.
Therefore, you need to use connect-interface to specify the source
. hu address during
establishment of BGP peer relationships.
i n g
r n
l
connect-interface to specify the source address /during
a
Similarly, this problem also exists between R2 and R3. Therefore, you need to use
e establishment of BGP peer
: /
relationships.
t tp
[R1]bgp 64512
: h
e s
[R1-bgp]peer 10.0.2.2 connect-interface LoopBack 0
[R1-bgp]quit
r c
o u
[R2]bgp 64512

e s
R
[R2-bgp]peer 10.0.1.1 connect-interface LoopBack 0

[R2-bgp]quit
i n g
[R2-bgp]peer 10.0.3.3 connect-interface LoopBack 0

a rn
L e
[R3]bgp 64513
[R3-bgp]peer 10.0.2.2 connect-interface LoopBack 0

r e
[R3-bgp]quit

o
MAfter the modifications are complete, check BGP peer relationships of R2 again.
[R2]display bgp peer

BGP local router ID : 10.0.2.2


Local AS number : 64512
Total number of peers : 2 Peers in established state : 1

HC Series HUAWEI TECHNOLOGIES 336


HCNP-IERS Chapter 3 BGP Features and Configurations

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.1.1 4 64512 16 17 0 00:14:18 Established 0


10.0.3.3 4 64513 0 0 0 00:14:35 Active 0

The preceding command output shows that the BGP peer relationship between R1
and R2 is in Established state.

e n
Run the debugging command on R3 to check whether R3 receives any BGP packet /
and check the content of the packet.
o m
<R3>terminal monitor
e i.c
<R3>terminal debugging

aw
u
<R3>debugging ip packet
Dec 7 2011 10:51:44.30.5+00:00 R3 IP/7/debug_case:
Delivering, interface = S2/0/0, version = 4, headlen = 20, tos = 192,
g .h
pktlen = 40, pktid = 4752, offset = 0, ttl = 1, protocol = 6,
ni n
r
lea
checksum = 36220, s = 10.0.2.2, d = 10.0.3.3
prompt: Packet is before IP_Reass before really deliver to up.

: //
t
Dec 7 2011 10:51:44.30.6+00:00 R3 IP/7/debug_case:

t p
:h
Sending, interface = S2/0/0, version = 4, headlen = 20, tos = 0,

s
pktlen = 40, pktid = 9953, offset = 0, ttl = 255, protocol = 6,

c e
checksum = 31722, s = 10.0.3.3, d = 10.0.2.2

r
ou
prompt: Sending the packet from local at S2/0/0

<R3>undo debugging all


es
R
Info: All possible debugging has been turned off

i n g
The precedingrn command output shows that the TTL of the BGP packet received by
a
eEBGP, the default TTL of the packet sent from a router to its peer is 1.
L
R3 is 1. For
escenario, R2 and R3 establish a BGP peer relationship using loopback interface
r
o There are two hops from the loopback interface address of R2 to that of
In this

M
addresses.
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]peer 10.0.3.3 ebgp-max-hop 2

HC Series HUAWEI TECHNOLOGIES 337


HCNP-IERS Chapter 3 BGP Features and Configurations

[R2-bgp]quit

[R3]bgp 64513
[R3-bgp]peer 10.0.2.2 ebgp-max-hop 2
[R3-bgp]quit

After the configurations are complete, check the BGP peer relationship of R2 again.

e n
/
[R2]display bgp peer

BGP local router ID : 10.0.2.2


o m
Local AS number : 64512
Total number of peers : 2 Peers in established state : 1
e i.c
aw
u
.h
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.1.1 4 64512 3 4
i n g
0 00:01:34 Established 0
10.0.3.3 4 64513 0 1 0 00:00:44
r n Active 0

le a
: //
The preceding command output shows that the BGP peer relationship between R2
and R3 remains Active.
t t p
Check BGP errors on R3. s :h
r c e
ou
[R3]display bgp error
Error Type : Peer Error
Date/Time
es
: 2011/12/07 11:24:37
Peer Address : 10.0.2.2
R
VRF Name
n g
: Public

i
Error Info
n
: Incorrect remote AS

ar
Le
Error Type : Peer Error

re
Date/Time : 2011/12/07 11:25:09

o
Peer Address : 10.0.2.2

M
VRF Name
Error Info
: Public
: Incorrect remote AS

Error Type : Peer Error


Date/Time : 2011/12/07 11:25:41
Peer Address : 10.0.2.2
VRF Name : Public
Error Info : Incorrect remote AS

HC Series HUAWEI TECHNOLOGIES 338


HCNP-IERS Chapter 3 BGP Features and Configurations

<R3>terminal debugging
<R3>debugging bgp packet verbose
Dec 7 2011 11:31:01.540.1+00:00 R3 RM/6/RMDEBUG:
BGP.Public: Err/SubErr: 2/2 Errdata: 41040000fc00
Identified in OPEN MSG from 10.0.2.2.

Dec 7 2011 11:31:01.540.2+00:00 R3 RM/6/RMDEBUG:

Dec 7 2011 11:31:01.540.3+00:00 R3 RM/6/RMDEBUG:


e n
BGP.Public: Err/SubErr: 2/2 Errdata: 41040000fc00
/
Identified in OPEN MSG from 10.0.2.2.
o m
e i.c
The preceding command output shows an incorrect AS number message.
aw
u
.h
Run the debugging command to troubleshoot this error.

i n g
The preceding command output shows that the error code/suberror code is 2. This
error indicates incorrect AS number. You need to change r nthe peer AS number on R3.
l e a
//
[R3]bgp 64513

:
tp
[R3-bgp]undo peer 10.0.2.2
[R3-bgp]peer 10.0.2.2 as-number 64512

ht
:
[R3-bgp]peer 10.0.2.2 ebgp-max-hop 2

e s
[R3-bgp]peer 10.0.2.2 connect-interface LoopBack0
[R3-bgp]quit
r c
o u
es between R2 and R3.
Check the BGP peer relationship
R
n
[R2]display bgp peer

i g
a rn
BGP local router ID : 10.0.2.2

L e
Local AS number : 64512

e
Total number of peers : 2 Peers in established state : 2

o r
M
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.1.1 4 64512 81 82 0 01:19:18 Established 0


10.0.3.3 4 64513 3 4 0 00:01:12 Established 0

Step 4 Configure BGP security.

HC Series HUAWEI TECHNOLOGIES 339


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP is often used in a backbone network, so BGP security is important. If a BGP


router is attacked, large-scale network breakdown occurs.

To prevent malicious users from forging valid routers to establish BGP peer
relationships with BGP routers, configure MD5 authentication between BGP peers.

Enable MD5 authentication between R1 and R2. First, configure an incorrect


password. Configure the password to huawei on R1 and that to 123 on R2 and then
e n
check the BGP peer relationship changes. /
o m
i.c
[R1]bgp 64512
[R1-bgp]peer 10.0.2.2 password simple huawei
[R1-bgp]quit
w e
u a
[R2]bgp 64512

g .h
n
[R2-bgp]peer 10.0.1.1 password simple 123
[R2-bgp]quit
ni
r
/ / lea
Reset the BGP peer relationship of R1. The following command output shows that
p :
t t
the peer relationship between R1 and R2 remains Connect and Active and cannot
enter the Established state.
: h
e s
c
<R1>reset bgp 10.0.2.2

ur
[R1]display bgp peer
s o
Re
BGP local router ID : 10.0.1.1

n g
Local AS number : 64512
i
rn
Total number of peers : 1 Peers in established state : 0

e a
Peer

e L V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

o r
10.0.2.2 4 64512 0 0 0 00:03:39 Connect 0

M
Change the password of R2 to huawei.
[R2]bgp 64512
[R2-bgp]undo peer 10.0.1.1 password
[R2-bgp]peer 10.0.1.1 password simple huawei
[R2-bgp]quit

HC Series HUAWEI TECHNOLOGIES 340


HCNP-IERS Chapter 3 BGP Features and Configurations

Wait for about 30 seconds, and then check the peer relationship again.
[R2]display bgp peer

BGP local router ID : 10.0.2.2


Local AS number : 64512
Total number of peers : 2 Peers in established state : 2

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

e n
/
10.0.1.1 4 64512 2 2 0 00:00:34 Established 0

o m
i.c
10.0.3.3 4 64513 166 167 0 02:44:05 Established 0

e
w R1 and
The preceding command output shows that the peer relationship between a
R2 has reached the Established state.
. hu
i
In this scenario, the administrator of AS 64512 does not want n gthe routers in AS 64513
r n
to view its actual AS number.
l e a
The fake-as parameter can achieve this purpose.//It can specify a fake AS number for
p :
the peer.
t t
h
Configure this command on R2, specify: R3's address as the peer address, and set the
e s
fake AS number to 100.
r c
o uof the BGP peer R2.
On R3, change the AS number
e s
[R2]bgp 64512 R
i n g
[R2-bgp]peer 10.0.3.3 fake-as 100

rn
[R2-bgp]quit

e a
L
[R3]bgp 64513

e
r
[R3-bgp]undo peer 10.0.2.2

o
[R3-bgp]peer 10.0.2.2 as-number 100

M[R3-bgp]peer 10.0.2.2 ebgp-max-hop 2


[R3-bgp]peer 10.0.2.2 connect-interface LoopBack0
[R3-bgp]quit

Check the BGP peer of R3. The following command output shows that the AS
number of R2 changes to 100.
[R3]display bgp peer

HC Series HUAWEI TECHNOLOGIES 341


HCNP-IERS Chapter 3 BGP Features and Configurations

BGP local router ID : 10.0.3.3


Local AS number : 64513
Total number of peers : 1 Peers in established state : 1

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.2.2 4 100 2 2 0 00:00:28 Established 0

e n
/
On R2, advertise the network segment where its Loopback0 resides and observe the
o m
AS_Path attribute of the BGP route learned from R3.
i . c
[R2]bgp 64512
w e
[R2-bgp]network 10.0.2.2 32
a
[R2-bgp]quit
. hu
[R3]display bgp routing-table
i n g
r n
BGP Local router ID is 10.0.3.3
l e a
Status codes: * - valid, > - best, d - damped,
: //
tp
h - history, i - internal, s - suppressed, S - Stale

ht
Origin : i - IGP, e - EGP, ? - incomplete

s :
Total Number of Routes: 1
Network NextHop
r c e MED LocPrf PrefVal Path/Ogn

o u
10.0.2.2/32
e s
10.0.2.2 0 0 100i

R
i n
The preceding command
g output shows that the AS_Path attribute of the BGP route
a rn from R3 is 100. That is, R3 considers that this route is originated
10.0.2.2/32 learned

L e In this situation, AS 64512 is not displayed.


from AS 100.
e
BGPralso provides a security mechanism: Generalized TTL Security Mechanism
o GTSM protects routers by checking whether the TTL value in the IP header is
M
(GTSM).
within a specified range. That is, if the TTL value of the received BGP packet exceeds
the specified range, this packet is discarded. Both the GTSM and ebgp-max-hop
functions will affect the TTL value of sent BGP packets and the two functions are
mutually exclusive. You can only enable one of the GTSM and ebgp-max-hop
functions on one peer or peer group.

HC Series HUAWEI TECHNOLOGIES 342


HCNP-IERS Chapter 3 BGP Features and Configurations

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.
[R2]gtsm default-action drop

e n
/
In the BGP view of R2, specify R3's address as the peer address and enable GTSM.
o m
Before performing this configuration, you need to delete the ebgp-max-hop
i . c
w
configuration. Because R2 and R3 are directly connected, the valid-ttl-hops e
a
hu
parameter is 1.
[R2]bgp 64512
g .
[R2-bgp]undo peer 10.0.3.3 ebgp-max-hop

ni n
[R2-bgp]peer 10.0.3.3 valid-ttl-hops 1

ar
[R2-bgp]peer 10.0.1.1 valid-ttl-hops 1
l e
[R2-bgp]quit
: //
t t p
Perform the same operation on R1 and R3.
: h
e s
c
[R1]gtsm default-action drop
[R1]bgp 64512
u r
s o
[R1-bgp]peer 10.0.2.2 valid-ttl-hops 1
[R1-bgp]quit

R e
n g
[R3]gtsm default-action drop
i
rn
[R3]bgp 64513

a
[R3-bgp]undo peer 10.0.2.2 ebgp-max-hop

e
e L
[R3-bgp]peer 10.0.2.2 valid-ttl-hops 1
[R3-bgp]quit

o r
MCheck the BGP peer relationship between R2 and R3.
[R3]dis bgp peer

BGP local router ID : 10.0.3.3


Local AS number : 64513
Total number of peers : 1 Peers in established state : 1

HC Series HUAWEI TECHNOLOGIES 343


HCNP-IERS Chapter 3 BGP Features and Configurations

Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv

10.0.2.2 4 100 3 2 0 00:00:06 Established 1

On R3, observe the TTL value of BGP packets.


<R3>terminal monitor
<R3>terminal debugging

e n
/
<R3>debugging ip packet

m
Dec 7 2011 16:34:51.10.1+00:00 R3 IP/7/debug_case:
Receiving, interface = S2/0/0, version = 4, headlen = 20, tos = 192,
o
pktlen = 59, pktid = 8820, offset = 0, ttl = 255, protocol = 6,
checksum = 32644, s = 10.0.2.2, d = 10.0.3.3
e i.c
prompt: Receiving IP packet from S2/0/0
aw
u
Dec 7 2011 16:34:51.10.2+00:00 R3 IP/7/debug_case:
g .h
i n
Receiving, interface = Serial2/0/0, version = 4, headlen = 20, tos = 192,

n
r
pktlen = 59, pktid = 8820, offset = 0, ttl = 255, protocol = 6,

lea
checksum = 32644, s = 10.0.2.2, d = 10.0.3.3

//
prompt: IP_ProcessByBoard Begin!

p :
<R3>undo debugging all
t t
:h
Info: All possible debugging has been turned off

e s
The preceding command outputrshowsc that the TTL value of packets received by R3
u
from R2 is 255 instead of theodefault value 1. To confirm that GTSM discards the BGP
e s
packets whose TTL valueR not within the specified range, enable the GTSM log
is

n
function on R3. When
i g BGP packets are discarded by GTSM, a log is recorded.
a rn
[R3]gtsm log drop-packet all

L e
r e ebgp-max-hop command on R2 to ensure that the TTL value of BGP
Run the
o sent from R2 to R3 is less than 254.
M
packets
[R2]bgp 64512
[R2-bgp]undo peer 10.0.3.3 valid-ttl-hops
[R2-bgp]peer 10.0.3.3 ebgp-max-hop 253
[R2-bgp]quit

HC Series HUAWEI TECHNOLOGIES 344


HCNP-IERS Chapter 3 BGP Features and Configurations

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.
Dec 7 2011 16:48:34+00:00 R3 %%01BGP/3/STATE_CHG_UPDOWN(l)[4]:The status of the peer 10.0.2.2
changed from ESTABLISHED to IDLE. (InstanceName=Public, StateChangeReason=Hold Timer Expired)

n
[R3]display gtsm statistics all
GTSM Statistics Table
/ e
----------------------------------------------------------------

o m
i.c
SlotId Protocol Total Counters Drop Counters Pass Counters
----------------------------------------------------------------
0 BGP 83 27 56
w e
0 OSPF 0 0 0

u a
.h
0 LDP 0 0 0

i n g
----------------------------------------------------------------

r n configuration to the
Run the following commands on R2 to change the current
l e a
previous configuration. Wait for a certain period /and then check whether BGP
: /
packets are discarded.
t tp
[R2]bgp 64512
: h
e s
[R2-bgp]undo peer 10.0.3.3 ebgp-max-hop

r c
[R2-bgp]peer 10.0.3.3 valid-ttl-hops 1
[R2-bgp]quit
o u
es
R
[R3]display gtsm statistics all

i n g
GTSM Statistics Table
----------------------------------------------------------------

rn
SlotId Protocol Total Counters Drop Counters Pass Counters

a
0
L e
----------------------------------------------------------------
BGP 89 27 62
0
r e OSPF 0 0 0

o
0 LDP 0 0 0

M----------------------------------------------------------------

The preceding command output shows that no more BGP packets are discarded.

----End

HC Series HUAWEI TECHNOLOGIES 345


HCNP-IERS Chapter 3 BGP Features and Configurations

Additional Exercises: Analysis and Verification

What type of attacks is GTSM mainly used to defend against?

Can fake-as be used in a confederation?

Device Configurations
<R1>display current-configuration

e n
[V200R007C00SPC600]
/
#

o m
i.c
sysname R1
#

w e
router id 10.0.1.1
u a
#
g .h
gtsm default-action drop
ni n
r
lea
#

//
interface Serial1/0/0
link-protocol ppp

p :
ip address 10.0.12.1 255.255.255.0
t t
:h
#
interface LoopBack0

e s
ip address 10.0.1.1 255.255.255.255

r c
ou
#

s
bgp 64512
peer 10.0.2.2 as-number 64512

Re
peer 10.0.2.2 connect-interface LoopBack0

i n g
peer 10.0.2.2 password simple huawei

n
ar
peer 10.0.2.2 valid-ttl-hops 1
#

L e
ipv4-family unicast

e
or
undo synchronization
peer 10.0.2.2 enable

M
#
ospf 1 router-id 10.0.1.1
area 0.0.0.0
network 10.0.12.1 0.0.0.0
network 10.0.1.1 0.0.0.0
#
return

<R2>display current-configuration

HC Series HUAWEI TECHNOLOGIES 346


HCNP-IERS Chapter 3 BGP Features and Configurations

[V200R007C00SPC600]
#
sysname R2
#

router id 10.0.2.2

#
gtsm default-action drop
e n
# /
acl number 2001
o m
i.c
rule 5 permit source 10.0.2.2 0
#

w e
a
interface Serial1/0/0
link-protocol ppp
u
ip address 10.0.12.2 255.255.255.0

g .h
#

ni n
r
interface Serial2/0/0

lea
link-protocol ppp

//
ip address 10.0.23.2 255.255.255.0
#
p :
interface LoopBack0
t t
:h
ip address 10.0.2.2 255.255.255.255
#

e s
bgp 64512
r c
ou
peer 10.0.1.1 as-number 64512

s
peer 10.0.1.1 connect-interface LoopBack0

e
R
peer 10.0.1.1 password simple huawei

g
peer 10.0.1.1 valid-ttl-hops 1

i n
peer 10.0.3.3 as-number 64513

n
ar
peer 10.0.3.3 connect-interface LoopBack0
peer 10.0.3.3 fake-as 100

L e
peer 10.0.3.3 valid-ttl-hops 1

e
or
#
ipv4-family unicast

M undo synchronization
network 10.0.2.2 255.255.255.255
peer 10.0.1.1 enable
peer 10.0.1.1 next-hop-local
peer 10.0.3.3 enable
#
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.0.12.2 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 347


HCNP-IERS Chapter 3 BGP Features and Configurations

network 10.0.2.2 0.0.0.0


#
route-policy change_origin deny node 10
if-match acl 2001
apply origin egp 100
#
ip route-static 10.0.3.3 255.255.255.255 10.0.23.3
#
return
e n
/
<R3>display current-configuration
o m
i.c
[V200R007C00SPC600]
#
sysname R3
w e
#
u a
router id 10.0.3.3
g .h
ni n
#
r
gtsm default-action drop

//lea
gtsm log drop-packet all
p :
#
t t
:h
interface Serial2/0/0
link-protocol ppp

e s
ip address 10.0.23.3 255.255.255.0
r c
ou
#
interface LoopBack0

es
R
ip address 10.0.3.3 255.255.255.255

g
#
bgp 64513

n i n
ar
peer 10.0.2.2 as-number 100
peer 10.0.2.2 connect-interface LoopBack0

L e
peer 10.0.2.2 valid-ttl-hops 1

e
or
#
ipv4-family unicast

M undo synchronization
peer 10.0.2.2 enable
#
ip route-static 10.0.2.2 255.255.255.255 10.0.23.2
#
return

HC Series HUAWEI TECHNOLOGIES 348


HCNP-IERS Chapter 4 Multicast Protocols

Chapter 4 Multicast Protocols

Lab 4-1 Multicast, IGMP, and PIM DM Protocols

Learning Objectives

The objectives of this lab are to learn and understand:


e n
/
 How to enable multicast routing on routers
o m
 How to configure IGMP on interfaces
e i.c
 How to configure PIM-DM
aw
How to check and test multicast u
.h

 How to configure advanced PIM functions


i n g
r n
lea
Topology

: //
t t p
s :h
r c e
s ou
Re
i n g
n
e ar
e L
or
M

Figure 5-1 Multicast, IGMP, and PIM DM

HC Series HUAWEI TECHNOLOGIES 349


HCNP-IERS Chapter 4 Multicast Protocols

Scenario

You are a network administrator of a company. Multicast needs to be configured to


forward some services. The network size is small, so you can configure PIM DM to
implement multicast route learning. To implement multicast forwarding, you must
consider whether the host applications are compatible with different IGMP versions
and choose appropriate methods to test the multicast service. To improve network
e n
efficiency and security, you can use the PIM DM methods, such as PIM neighbor /
o m
control and graft. You may encounter network failures and need to rectify the faults.
i . c
Tasks
w e
a
Step 1 Set basic parameters and configure IP addresses.
. hu
S2 is located between R1 and R3, but does not need to bein
g
configured. Before the
r n
l e a
experiment, clear the configuration on S2 and restart S2.

: // All loopback interfaces must


Configure IP addresses and masks for all the routers.
have 24-bit masks.
t tp
: h
<Huawei>system-view

e s
c
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
u r
s
[R1]interface Serial 1/0/0
o
[R1-Serial1/0/0]quit Re
[R1-Serial1/0/0]ip address 10.0.12.1 24

i n g
[R1]interface Serial 3/0/0

rn
[R1-Serial3/0/0]ip address 10.0.14.1 24

a
[R1-Serial3/0/0]quit

e
L
[R1]interface GigabitEthernet 0/0/2

e
r
[R1-GigabitEthernet0/0/2]ip address 10.0.13.1 24

o
[R1-GigabitEthernet0/0/2]quit

M[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 24
[R1-LoopBack0]quit

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface Serial 1/0/0
[R2-Serial1/0/0]ip address 10.0.12.2 24

HC Series HUAWEI TECHNOLOGIES 350


HCNP-IERS Chapter 4 Multicast Protocols

[R2-Serial1/0/0]quit
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.0.25.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.0.24.2 24
[R2-GigabitEthernet0/0/1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.0.2.2 24
e n
[R2-LoopBack0]quit
/
o m
i.c
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
w e
[R3]interface GigabitEthernet 0/0/2
u a
[R3-GigabitEthernet0/0/2]ip address 10.0.13.3 24

g .h
n
[R3-GigabitEthernet0/0/2]quit
[R3]interface Serial 3/0/0
ni
r
lea
[R3-Serial3/0/0]ip address 10.0.35.3 24
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
: //
[R3-LoopBack0]ip address 10.0.3.3 24

t t p
:h
[R3-LoopBack0]quit

e s
c
<Huawei>system-view

r
ou
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]interface Serial 1/0/0
es
R
[R4-Serial1/0/0]ip address 10.0.14.4 24

n
[R4-Serial1/0/0]quit

i g
n
[R4]interface GigabitEthernet 0/0/1

ar
[R4-GigabitEthernet0/0/1]ip address 10.0.24.4 24

e
L
[R4-GigabitEthernet0/0/1]

e
[R4]interface LoopBack 0

or
[R4-LoopBack0]ip address 10.0.4.4 24

M
[R4-LoopBack0]quit

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R5
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]ip address 10.0.35.5 24
[R5-Serial1/0/0]quit
[R5]interface GigabitEthernet 0/0/0

HC Series HUAWEI TECHNOLOGIES 351


HCNP-IERS Chapter 4 Multicast Protocols

[R5-GigabitEthernet0/0/0]ip address 10.0.25.5 24


[R5-GigabitEthernet0/0/0]quit
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 10.0.5.5 24
[R5-LoopBack0]quit

After the configurations are complete, test the connectivity between routers.

e n
/
[R1]ping -c 1 10.0.13.3

m
PING 10.0.13.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=5 ms
o
--- 10.0.13.3 ping statistics ---
e i.c
1 packet(s) transmitted
aw
u
.h
1 packet(s) received

g
0.00% packet loss
round-trip min/avg/max = 5/5/5 ms

ni n
r
lea
[R1]ping -c 1 10.0.12.2

//
PING 10.0.12.2: 56 data bytes, press CTRL_C to break

p :
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=37 ms

t t
:h
--- 10.0.12.2 ping statistics ---
1 packet(s) transmitted
e s
1 packet(s) received
r c
ou
0.00% packet loss

s
round-trip min/avg/max = 37/37/37 ms

e
R
g
[R1]ping -c 1 10.0.14.4

i n
PING 10.0.14.4: 56 data bytes, press CTRL_C to break

n
ar
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=38 ms

L e
--- 10.0.14.4 ping statistics ---

e
or
1 packet(s) transmitted
1 packet(s) received

M 0.00% packet loss


round-trip min/avg/max = 38/38/38 ms

[R5]ping -c 1 10.0.35.3
PING 10.0.35.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.35.3: bytes=56 Sequence=1 ttl=255 time=33 ms

--- 10.0.35.3 ping statistics ---

HC Series HUAWEI TECHNOLOGIES 352


HCNP-IERS Chapter 4 Multicast Protocols

1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 33/33/33 ms

[R5]ping -c 1 10.0.25.2
PING 10.0.25.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.25.2: bytes=56 Sequence=1 ttl=255 time=10 ms

e n
--- 10.0.25.2 ping statistics ---
/
1 packet(s) transmitted
o m
i.c
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/10/10 ms
w e
u a
Step 2 Enable multicast routing on all routers. g .h
i n
n multicast, run the
r
Enable multicast routing on R1, R2, R3, R4, and R5. To enable
a
multicast routing-enable command in the systemle
: / / view.

By default, the multicast function is disabled p


t t on VRP. Before using PIM or IGMP,
enable multicast globally.
: h
e s
c
[R1]multicast routing-enable

u r
s o run the pim dm command in the interface view.
Re
To run PIM DM on an interface,

i n g
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]pim dm

rn
[R1-GigabitEthernet0/0/2]quit

a
e
[R1]interface Serial 1/0/0

L
[R1-Serial1/0/0]pim dm

e
o r
[R1-Serial1/0/0]quit
[R1]interface Serial 3/0/0

M[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]interface Serial 1/0/0

HC Series HUAWEI TECHNOLOGIES 353


HCNP-IERS Chapter 4 Multicast Protocols

[R2-Serial1/0/0]pim dm
[R2-Serial1/0/0]quit
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]pim dm
[R2-GigabitEthernet0/0/0]quit

[R3]multicast routing-enable
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]pim dm
e n
[R3-GigabitEthernet0/0/2]quit
/
[R3]interface Serial 3/0/0
o m
i.c
[R3-Serial3/0/0]pim dm
[R3-Serial3/0/0]quit

w e
[R4]multicast routing-enable
u a
[R4]interface Serial 1/0/0

g .h
n
[R4-Serial1/0/0]pim dm
[R4-Serial1/0/0]quit
ni
r
lea
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]pim dm
[R4-GigabitEthernet0/0/1]quit
: //
t t p
:h
[R5]multicast routing-enable

s
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]pim dm

r c e
ou
[R5-Serial1/0/0]quit
[R5]interface GigabitEthernet 0/0/0

es
[R5-GigabitEthernet0/0/0]pim dm

R
[R5-GigabitEthernet0/0/0]quit

i n g
a rn
After the configuration, check the PIM status on interfaces.

L e
[R1]display pim interface

r e
VPN-Instance: public net

o
Interface State NbrCnt HelloInt DR-Pri DR-Address

M GE0/0/2
S1/0/0
up
up
1
1
30
30
1
1
10.0.13.3
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.

HC Series HUAWEI TECHNOLOGIES 354


HCNP-IERS Chapter 4 Multicast Protocols

Check detailed PIM information on R1's G0/0/2.


[R1]display pim interface GigabitEthernet 0/0/2 verbose
VPN-Instance: public net
Interface: GigabitEthernet0/0/2, 10.0.13.1
PIM version: 2
PIM mode: Dense
PIM state: up
PIM DR: 10.0.13.3

e n
PIM DR Priority (configured): 1
/
PIM neighbor count: 1

o m
i.c
PIM hello interval: 30 s
PIM LAN delay (negotiated): 500 ms
PIM LAN delay (configured): 500 ms
w e
PIM hello override interval (negotiated): 2500 ms
u a
.h
PIM hello override interval (configured): 2500 ms
PIM Silent: disabled

i n g
n
PIM neighbor tracking (negotiated): disabled

r
lea
PIM neighbor tracking (configured): disabled
PIM generation ID: 0X5325911
PIM require-GenID: disabled
: //
PIM hello hold interval: 105 s

t t p
:h
PIM assert hold interval: 180 s

s
PIM triggered hello delay: 5 s
PIM J/P interval: 60 s
PIM J/P hold interval: 210 s
r c e
ou
PIM state-refresh processing: enabled

s
Re
PIM state-refresh interval: 60 s
PIM graft retry interval: 3 s

n g
PIM state-refresh capability on link: capable

i
n
PIM dr-switch-delay timer : not configured

ar
Number of routers on link not using DR priority: 0

L e
Number of routers on link not using LAN delay: 0

e
Number of routers on link not using neighbor tracking: 2

or
ACL of PIM neighbor policy: -

M
ACL of PIM ASM join policy: -
ACL of PIM SSM join policy: -
ACL of PIM join policy: -

By default, the hello interval of PIM DM is 30s, the hello hold time is 3.5 times of the
hello interval (105s).

HC Series HUAWEI TECHNOLOGIES 355


HCNP-IERS Chapter 4 Multicast Protocols

Check the neighbor list of R1. Three routers established PIM neighbor relationships
with R1. The default DR priority of neighbors is 1.
[R1]display pim neighbor
VPN-Instance: public net
Total Number of Neighbors = 3

Neighbor Interface Uptime Expires Dr-Priority


10.0.13.3 GE0/0/2 01:40:27 00:01:18 1
e n
10.0.12.2 S1/0/0 01:42:21 00:01:24 1 /
10.0.14.4 S3/0/0 01:38:02 00:01:16 1
o m
e i.c
w delay
Check details about neighbor R3. Uptime indicates the neighbor relationship setup
a
hu interval
time, Expiry time indicates the remaining time of the PIM neighbor, LAN

g .
indicates the delay in transmitting the prune messages, and Override
indicates the interval for overriding the prune messages. in
r n
[R1]display pim neighbor 10.0.13.3 verbose
l e a
VPN-Instance: public net
: //
tp
Neighbor: 10.0.13.3
Interface: GigabitEthernet0/0/2

ht
Uptime: 01:41:00

s :
Expiry time: 00:01:45
DR Priority: 1
r c e
Generation ID: 0XD1A5CA9
o u
Holdtime: 105 s
e s
LAN delay: 500 ms
R
i n g
Override interval: 2500 ms
State refresh interval: 60 s

rn
Neighbor tracking: Disabled

a
L e
Stepr e3 Configure IGMP.
othis experiment, multicast users are connected to S1. Enable IGMP on G0/0/1 of
M
In
R2 and R4. To enable IGMP, run the igmp enable command in the interface view.
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]igmp enable
[R2-GigabitEthernet0/0/1]quit

[R4]interface GigabitEthernet 0/0/1

HC Series HUAWEI TECHNOLOGIES 356


HCNP-IERS Chapter 4 Multicast Protocols

[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]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]igmp static-group 225.1.1.1

e n
[R2-GigabitEthernet0/0/0]quit
/
o m
i.c
[R4]interface GigabitEthernet 0/0/1

e
[R4-GigabitEthernet0/0/1]igmp static-group 225.1.1.1

w
[R4-GigabitEthernet0/0/1]quit

u a
By default, VRP uses IGMPv2. The command output shows that.h
querier of the network segment where G0/0/1 is located. IGMPv2i n g selects the router
R2 (10.0.24.2) is the

r n
with a smaller IP address as the querier.
l e a
[R2]display igmp interface GigabitEthernet 0/0/1
: //
tp
Interface information
GigabitEthernet0/0/1(10.0.24.2):
ht
IGMP is enabled
s :
Current IGMP version is 2
IGMP state: up
r c e
IGMP group policy: none
o u
IGMP limit: -
e s
R
Value of query interval for IGMP (negotiated): -

i n g
Value of query interval for IGMP (configured): 60 s

rn
Value of other querier timeout for IGMP: 0 s

a
Value of maximum query response time for IGMP: 10 s

L e
Querier for IGMP: 10.0.24.2 (this router)

r e
o
[R4]display igmp interface GigabitEthernet 0/0/1

M
Interface information
GigabitEthernet0/0/1(10.0.24.4):
IGMP is enabled
Current IGMP version is 2
IGMP state: up
IGMP group policy: none
IGMP limit: -
Value of query interval for IGMP (negotiated): -
Value of query interval for IGMP (configured): 60 s

HC Series HUAWEI TECHNOLOGIES 357


HCNP-IERS Chapter 4 Multicast Protocols

Value of other querier timeout for IGMP: 123 s


Value of maximum query response time for IGMP: 10 s
Querier for IGMP: 10.0.24.2

Check static IGMP groups on the interfaces. Group 225.1.1.1 is the manually added
multicast group.
[R2]display igmp group static

e n
Static join group information
/
Total 1 entry, Total 1 active entry

o m
i.c
Group Address Source Address Interface State Expires

e
225.1.1.1 0.0.0.0 GE0/0/1 UP never

aw
u
.h
Check IGMP routing table on the interface.
[R2]display igmp routing-table

i n g
Routing table

r n
lea
Total 1 entry

00001. (*, 225.1.1.1)


: //
List of 1 downstream interface
t t p
:h
GigabitEthernet0/0/1 (10.0.24.2),
Protocol: STATIC

e s
r c
o u on an interface only when the interface has
IGMP routing entries are generated
IGMP but not PIM enabled, esand the interface is an IGMP querier. The routing entries
R
i n g
are not displayed on R4 because R2 is the querier of network segment 10.0.24.0/24.

By default, the n
r query interval of the querier is 60s. To increase the speed of user
amulticast groups, run the igmp timer query command to shorten the
addition to
L e
e
interval for sending query packets.
or
M
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]igmp timer query 20
[R2-GigabitEthernet0/0/1]quit

Verify the configuration.


[R2]display igmp interface GigabitEthernet 0/0/1
Interface information of VPN-Instance: public net
GigabitEthernet0/0/1(10.0.24.2):

HC Series HUAWEI TECHNOLOGIES 358


HCNP-IERS Chapter 4 Multicast Protocols

IGMP is enabled
Current IGMP version is 2
IGMP state: up
IGMP group policy: none
IGMP limit: -
Value of query interval for IGMP (negotiated): -
Value of query interval for IGMP (configured): 20 s
Value of other querier timeout for IGMP: 0 s
Value of maximum query response time for IGMP: 10 s
e n
Querier for IGMP: 10.0.24.2 (this router)
/
o m
i . c
The debugging information shows that the interface sends a General-Query
message every 20s. w e
a
<R1>terminal monitor
. hu
<R2>terminal debugging
<R2>
i n g
r n
Sep 14 2016 14:19:53.740.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query

l e a
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
<R2>
: //
tp
Sep 14 2016 14:20:13.830.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query

ht
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
<R2>

s :
r c e
Sep 14 2016 14:20:33.770.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
<R2>
o u
es
Sep 14 2016 14:20:53.760.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query

R
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)

i n g
rn
<R2>undo debugging all

a
Info: All possible debugging has been turned off

L e
r e robustness variable of a router is 2. Shut down the interface to test
The default
o
robustness.
M
Observe the IGMP query message sending in default settings.
<R2>terminal monitor
<R2>terminal debugging
<R2>debugging igmp query send
Sep 14 2016 14:26:13.880.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)

HC Series HUAWEI TECHNOLOGIES 359


HCNP-IERS Chapter 4 Multicast Protocols

<R2>
Sep 14 2016 14:26:33.890.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
<R2>system-view
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]shutdown
[R2-GigabitEthernet0/0/1]undo shutdown
Sep 14 2016 14:26:51.810.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
e n
[R2-GigabitEthernet0/0/1]
/
o m
Sep 14 2016 14:26:56.790.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query

i.c
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
[R2-GigabitEthernet0/0/1]

w e
Sep 14 2016 14:27:16.790.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
u a
[R2-GigabitEthernet0/0/1]

g .h
n
Sep 14 2016 14:27:36.770.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query

ni
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)

r
a sends a General Query
l e
When the interface is not shut down, the router's interface

:
message every 20s. when the interface is shut down// and enabled, the interval for
p a router starts, it sends N General
sending the first two query messages is 5s. tWhen
t
: h The message sending interval is 1/4
Query messages (N is the robustness variable).
e sGeneral Query messages.
c
of the configured interval for sending
r
Run the robust-count command
o u to set the IGMP robustness variable. This
e sIGMPv2 and IGMPv3. Change the robustness variable on
R
parameter is valid only for
R2's G0/0/1 to 3. g
i n
rn
[R2-GigabitEthernet0/0/1]igmp robust-count 3

a
L e
e
Enable debugging and observe General Query message sending.
r
o
[R2-GigabitEthernet0/0/1]shutdown
M[R2-GigabitEthernet0/0/1]undo shutdown
Sep 14 2016 14:33:07.420.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
[R2-GigabitEthernet0/0/1]
Sep 14 2016 14:33:12.340.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)
[R2-GigabitEthernet0/0/1]
Sep 14 2016 14:33:17.340.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query

HC Series HUAWEI TECHNOLOGIES 360


HCNP-IERS Chapter 4 Multicast Protocols

on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)


[R2-GigabitEthernet0/0/1]
Sep 14 2016 14:33:37.420.1+00:00 R2 IGMP/7/QUERY:(public net): Send version 2 general query
on GigabitEthernet0/0/1(10.0.24.2) to destination 224.0.0.1 (G073969)

[R2-GigabitEthernet0/0/1]return
<R2>undo debugging all
Info: All possible debugging has been turned off

e n
/
After the robustness variable is changed to 3, the interval for sending the firsto
m
c
General Query messages is 5s, and the interval for sending later messagesi.is 20s.
three

w e
Step 4 Observe the multicast routing table.
u a
. h
To observe multicast routing, configure OSPF as the unicast routing
i n g protocol.
[R1]ospf 1 router-id 10.0.1.1
r n
[R1-ospf-1]area 0

l e a
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0

: / /
tp
[R1-ospf-1-area-0.0.0.0]network 10.0.14.1 0.0.0.0

t
[R1-ospf-1-area-0.0.0.0]network 10.0.13.1 0.0.0.0

h
:
[R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0

s
e
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
r c
o u
s
[R2]ospf 1 router-id 10.0.2.2
e
[R2-ospf-1]area 0
R
i n g
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.25.2 0.0.0.0

rn
[R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0

a
L e
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit

r e
o
[R3]ospf 1 router-id 10.0.3.3

M[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.13.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.35.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit

[R4]ospf 1 router-id 10.0.4.4

HC Series HUAWEI TECHNOLOGIES 361


HCNP-IERS Chapter 4 Multicast Protocols

[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 10.0.14.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit

[R5]ospf 1 router-id 10.0.5.5


[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 10.0.5.5 0.0.0.0
e n
[R5-ospf-1-area-0.0.0.0]network 10.0.25.5 0.0.0.0
/
[R5-ospf-1-area-0.0.0.0]network 10.0.35.5 0.0.0.0
o m
i.c
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit

w e
a
u addresses
h
After the configuration, check whether the routers can learn the loopback
.
of other routers.
i n g
[R2]display ip routing-table protocol ospf
r n
Route Flags: R - relay, D - download to fib
l e a
: //
----------------------------------------------------------------------------

tp
Public routing table : OSPF
Destinations : 7
ht
Routes : 8

s :
Destinations : 7
r e
OSPF routing table status : <Active>

cRoutes : 8

o u
e s
Destination/Mask Proto Pre Cost Flags NextHop Interface

R
10.0.1.1/32

i n g
OSPF 10 1562 D 10.0.12.1 Serial1/0/0

rn
10.0.3.3/32 OSPF 10 1563 D 10.0.12.1 Serial1/0/0

a
OSPF 10 1563 D 10.0.25.5 GigabitEthernet0/0/0

L e
10.0.4.4/32 OSPF 10 3124 D 10.0.12.1 Serial1/0/0

e
10.0.5.5/32 OSPF 10 1 D 10.0.25.5 GigabitEthernet0/0/0

o r 10.0.13.0/24 OSPF 10
10.0.14.0/24 OSPF 10
1563
3124
D
D
10.0.12.1
10.0.12.1
Serial1/0/0
Serial1/0/0
M 10.0.35.0/24 OSPF 10 1563 D 10.0.25.5 GigabitEthernet0/0/0

OSPF routing table status : <Inactive>


Destinations : 0 Routes : 0

HC Series HUAWEI TECHNOLOGIES 362


HCNP-IERS Chapter 4 Multicast Protocols

To simulate multicast information transmission, configure R3's loopback interface


address as the source address to send ping packets to destination address 225.1.1.1.
[R3]ping -a 10.0.3.3 -c 300 225.1.1.1

After several minutes, the multicast routing entries can be seen on all the other
routers. View the multicast routing table on R2.

e n
[R2]display pim routing-table
/
VPN-Instance: public net
o m
i.c
Total 1(*, G) entry; 1 (S, G) entry

(*, 225.1.1.1)
w e
Protocol: pim-dm, Flag: WC EXT
u a
UpTime: 00:09:04
Upstream interface: NULL
g .h
Upstream neighbor: NULL
ni n
r
lea
RPF prime neighbor: NULL
Downstream interface(s) information: None

: //
(10.0.3.3, 225.1.1.1)

t t p
:h
Protocol: pim-dm, Flag:

s
UpTime: 00:00:52

c e
Upstream interface: GigabitEthernet0/0/0

r
ou
Upstream neighbor: 10.0.25.5
RPF prime neighbor: 10.0.25.5

es
Downstream interface(s) information: None

R
i
There are two entries:n g
a rn(*, 225.1.1.1) is generated after static IGMP group is configured on an
e
The first entry
L
e
interface.
r
o second entry (10.0.3.3, 225.1.1.1) is generated after multicast traffic is spread on
The
Mthe router.
For R2, the upstream router of multicast traffic is 10.0.25.5.

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.

HC Series HUAWEI TECHNOLOGIES 363


HCNP-IERS Chapter 4 Multicast Protocols

[R2]display multicast rpf-info 10.0.3.3


VPN-Instance: public net
RPF information about source: 10.0.3.3
RPF interface: GigabitEthernet0/0/0, RPF neighbor: 10.0.25.5
Referenced route/mask: 10.0.3.3/32
Referenced route type: unicast
Route selection rule: preference-preferred
Load splitting rule: disable

e n
/
Step 5 Adjust PIM DM parameters.
o m
c
If you do not want the traffic to be transmitted to the destination throughia. unicast
route, run the rpf-route-static command to change the RPF path. In this
e
wexperiment,
a
change the RPF path from 10.0.25.5 to 10.0.12.1.
. hu
[R2]ip rpf-route-static 10.0.3.0 255.255.255.0 10.0.12.1

i n g
r n
After the configuration, the RPF neighbor is changed
l e ato 10.0.12.1.
: //
tp
[R2]display multicast rpf-info 10.0.3.3
VPN-Instance: public net

ht
RPF information about source: 10.0.3.3

s :
e
RPF interface: Serial1/0/0, RPF neighbor: 10.0.12.1

r c
Referenced route/mask: 10.0.3.0/24

u
Referenced route type: mstatic
o
s
Route selection rule: preference-preferred
e
R
Load splitting rule: disable

i n g
To observe then
r PIM prune and graft messages, delete and add static IGMP groups to
simulate theauser deletion and addition operations. Enable debugging on R2.
L e
r e
<R1>terminal monitor

o
<R2>terminal debugging

M<R2>debugging pim join-prune

Delete static IGMP group 225.1.1.1 from R2.


<R2>system-view
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]undo igmp static-group 225.1.1.1
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

HC Series HUAWEI TECHNOLOGIES 364


HCNP-IERS Chapter 4 Multicast Protocols

-> 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.310.1+00:00 R2 PIM/7/JP:(public net): Prune: 10.0.3.3/32 (P012707)
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,
e n
Holdtime 207 (P012693)
/
o m
Dec 31 2011 15:00:05.350.3+00:00 R2 PIM/7/JP:(public net): Group: 225.1.1.1/32 --- 0 joins

i.c
1 prunes (P012701)

e
Dec 31 2011 15:00:05.350.4+00:00 R2 PIM/7/JP:(public net): Prune: 10.0.3.3/32 (P012707)

w
a
u interfaces.
h
R2 uses multicast address 224.0.0.13 to send prune messages to upstream
.
n
The IP address of the upstream router is 10.0.12.1. The multicastg
i to R2.
group 225.1.1.1 has
been pruned. R1 sends a prune acknowledgement message
r n
l e a
Add the deleted static IGMP multicast group again.
: / /
tp
[R2-GigabitEthernet0/0/1]igmp static-group 225.1.1.1

t
h
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

:
s
-> 10.0.12.1 on Serial1/0/0 (P012633)

c e
Dec 31 2011 15:00:19.440.2+00:00 R2 PIM/7/JP:(public net): Upstream 10.0.12.1, Groups 1,

r
u
Holdtime 0 (P012639)

o
Dec 31 2011 15:00:19.440.3+00:00 R2 PIM/7/JP:(public net): Group: 225.1.1.1/32 --- 1 joins

s
0 prunes (P012648)

R e
Dec 31 2011 15:00:19.440.4+00:00 R2 PIM/7/JP:(public net): Join: 10.0.3.3/32 (P012654)

n g
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

i
rn
-> 10.0.12.2 on Serial1/0/0 (P012633)

a
Dec 31 2011 15:00:19.480.2+00:00 R2 PIM/7/JP:(public net): Upstream 10.0.12.2, Groups 1,

e
L
Holdtime 0 (P012639)

e
Dec 31 2011 15:00:19.480.3+00:00 R2 PIM/7/JP:(public net): Group: 225.1.1.1/32 --- 1 joins

r
o
0 prunes (P012648)

M
Dec 31 2011 15:00:19.480.4+00:00 R2 PIM/7/JP:(public net): Join: 10.0.3.3/32 (P012654)

[R2-GigabitEthernet0/0/1]return
<R2>undo debugging all
Info: All possible debugging has been turned off

HC Series HUAWEI TECHNOLOGIES 365


HCNP-IERS Chapter 4 Multicast Protocols

R2 immediately sends a prune message to the upstream device through unicast to


join the multicast group 225.1.1.1. R1 returns a prune acknowledgement to R2
through unicast.

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
e n
multicast boundary command on an interface to specify the range of a multicast /
o m
group or multicast address segment.
i . c
Prevent the traffic from multicast group 225.1.1.2 from being transmittedeto R4.
Perform the following configuration on R1's interface connected to a
w
hu
R4:
[R1]interface Serial 3/0/0
g .
[R1-Serial3/0/0]multicast boundary 225.1.1.2 255.255.255.255

ni n
[R1-Serial3/0/0]quit

ar
l e
: // 225.1.1.2 on R3.
Simulate the multicast traffic with destination address

t tp
[R3]ping -a 10.0.3.3 -c 300 225.1.1.2

: h
e s
Check the multicast routing table c
r on R2 and R4. R2 has the entry (10.0.3.3, 225.1.1.2),
u entry of this multicast group. This indicates that
o
while R4 does not have a routing
s to R4.
R e
multicast traffic is not spread

n g
[R2]display pim routing-table

i
rn
VPN-Instance: public net

a
Total 1 (*, G) entry; 2 (S, G) entries

e
e L
(*, 225.1.1.1)

o rProtocol: pim-dm, Flag: WC EXT

M UpTime: 00:09:04
Upstream interface: NULL
Upstream neighbor: NULL
RPF prime neighbor: NULL
Downstream interface(s) information: None

(10.0.3.3, 225.1.1.1)
Protocol: pim-dm, Flag: EXT
UpTime: 00:02:11

HC Series HUAWEI TECHNOLOGIES 366


HCNP-IERS Chapter 4 Multicast Protocols

Upstream interface: Serial1/0/0


Upstream neighbor: 10.0.12.1
RPF prime neighbor: 10.0.12.1
Downstream interface(s) information: None

(10.0.3.3, 225.1.1.2)
Protocol: pim-dm, Flag:
UpTime: 00:00:08
Upstream interface: Serial1/0/0
e n
Upstream neighbor: 10.0.12.1
/
RPF prime neighbor: 10.0.12.1
o m
i.c
Downstream interface(s) information: None

[R4]display pim routing-table


w e
VPN-Instance: public net
u a
Total 1 (*, G) entry; 1 (S, G) entry

g .h
(*, 225.1.1.1)
ni n
r
lea
Protocol: pim-dm, Flag: WC
UpTime: 00:08:03
Upstream interface: NULL
: //
Upstream neighbor: NULL

t t p
:h
RPF prime neighbor: NULL

s
Downstream interface(s) information:
Total number of downstreams: 1

r c e
ou
1: GigabitEthernet0/0/1
Protocol: static, UpTime: 00:08:03, Expires: never

es
(10.0.3.3, 225.1.1.1)
R
n g
Protocol: pim-dm, Flag:

i
n
UpTime: 00:02:43

ar
Upstream interface: Serial1/0/0

e
L
Upstream neighbor: 10.0.14.1

e RPF prime neighbor: 10.0.14.1

or Downstream interface(s) information:

M Total number of downstreams: 1


1: GigabitEthernet0/0/1
Protocol: pim-dm, UpTime: 00:02:43, Expires: -

By default, PIM DM selects the router connected to the interface with a greater IP
address as the DR.
[R2]display pim interface

HC Series HUAWEI TECHNOLOGIES 367


HCNP-IERS Chapter 4 Multicast Protocols

VPN-Instance: public net


Interface State NbrCnt HelloInt DR-Pri DR-Address
GE0/0/0 up 1 30 1 10.0.25.5
S1/0/0 up 1 30 1 10.0.12.2 (local)

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

e n
the following example, change the priority of the R2's interface connected to R5 to
/
100.
o m
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]pim hello-option dr-priority 100
e i.c
[R2-GigabitEthernet0/0/0]quit
aw
u
[R2]display pim interface
g .h
VPN-Instance: public net

ni n
r
Interface State NbrCnt HelloInt DR-Pri DR-Address

lea
GE0/0/0 up 1 30 100 10.0.25.2 (local)

://
S1/0/0 up 1 30 1 10.0.12.2 (local)

t tp
:h
After the interface priority is changed to 100, R2 becomes the DR.

e s
c the pim silent command.
For security purposes, you can disable the user-side interface from sending and
r
u
receiving PIM hello packets by running
o
e s
[R4]interface GigabitEthernet 0/0/1

R
[R4-GigabitEthernet0/0/1]pim silent

n g
[R4-GigabitEthernet0/0/1]quit

i
rn
e a
After the configuration, check whether PIM silent takes effect.

e L
or
[R4]display pim interface GigabitEthernet 0/0/1 verbose
VPN-Instance: public net

M Interface: GigabitEthernet0/0/1, 10.0.24.4


PIM version: 2
PIM mode: Dense
PIM state: up
PIM DR: 10.0.24.4 (local)
PIM DR Priority (configured): 1
PIM neighbor count: 0
PIM hello interval: 30 s

HC Series HUAWEI TECHNOLOGIES 368


HCNP-IERS Chapter 4 Multicast Protocols

PIM LAN delay (negotiated): 500 ms


PIM LAN delay (configured): 500 ms
PIM hello override interval (negotiated): 2500 ms
PIM hello override interval (configured): 2500 ms
PIM Silent: enabled
PIM neighbor tracking (negotiated): disabled
PIM neighbor tracking (configured): disabled
PIM generation ID: 0XAD457D14
PIM require-GenID: disabled
e n
PIM hello hold interval: 105 s
/
PIM assert hold interval: 180 s
o m
i.c
PIM triggered hello delay: 5 s
PIM J/P interval: 60 s
PIM J/P hold interval: 210 s
w e
PIM state-refresh processing: enabled
u a
PIM state-refresh interval: 60 s

g .h
n
PIM graft retry interval: 3 s
PIM state-refresh capability on link: capable
ni
r
lea
PIM dr-switch-delay timer : not configured
Number of routers on link not using DR priority: 0

:
Number of routers on link not using LAN delay: 0
//
t p
Number of routers on link not using neighbor tracking: 1

t
:h
ACL of PIM neighbor policy: -

s
ACL of PIM ASM join policy: -
ACL of PIM SSM join policy: -

r c e
ou
ACL of PIM join policy: -

es
----End R
i n g
rn
Additional Exercises: Analysis and Verification
a
PIM DMLiseapplicable to the high user density scenarios.

r e networks you will configure PIM DM? What are the characteristics of these
o
For which
Mnetworks?
What are the advantages and disadvantages of configuring PIM DM on a large-sized
network?

Device Configurations
<R1>display current-configuration

HC Series HUAWEI TECHNOLOGIES 369


HCNP-IERS Chapter 4 Multicast Protocols

[V200R007C00SPC600]
#
sysname R1
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
pim dm
#
e n
interface Serial3/0/0
/
link-protocol ppp
o m
i.c
ip address 10.0.14.1 255.255.255.0
pim dm
multicast boundary 225.1.1.2 32
w e
#
u a
ip address 10.0.13.1 255.255.255.0

g .h
n
pim dm
#
ni
r
lea
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
: //
ospf 1 router-id 10.0.1.1

t t p
:h
area 0.0.0.0

s
network 10.0.1.1 0.0.0.0
network 10.0.14.1 0.0.0.0

r c e
ou
network 10.0.13.1 0.0.0.0
network 10.0.12.1 0.0.0.0
#
es
return
R
i n g
n
<R2>display current-configuration

ar
[V200R007C00SPC600]

e
L
#

e
sysname R2
#
or
M
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.2 255.255.255.0
pim dm
#
interface GigabitEthernet0/0/0
ip address 10.0.25.2 255.255.255.0
pim hello-option dr-priority 100
pim dm

HC Series HUAWEI TECHNOLOGIES 370


HCNP-IERS Chapter 4 Multicast Protocols

#
interface GigabitEthernet0/0/1
ip address 10.0.24.2 255.255.255.0
igmp enable
igmp robust-count 3
igmp timer query 20
igmp static-group 225.1.1.1
#
interface LoopBack0
e n
ip address 10.0.2.2 255.255.255.255
/
#
o m
i.c
ospf 1 router-id 10.0.2.2
area 0.0.0.0
network 10.0.2.2 0.0.0.0
w e
network 10.0.25.2 0.0.0.0
u a
network 10.0.12.2 0.0.0.0

g .h
n
#
ip rpf-route-static 10.0.3.0 24 10.0.12.1
ni
r
lea
#
return

: //
<R3>display current-configuration

t t p
:h
[V200R007C00SPC600]

s
#
sysname R3

r c e
ou
#
interface Serial3/0/0
link-protocol ppp
es
R
ip address 10.0.35.3 255.255.255.0
pim dm

i n g
#
n
ar
interface GigabitEthernet0/0/2

e
L
ip address 10.0.13.3 255.255.255.0
pim dm
e
#
or
M
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.13.3 0.0.0.0
network 10.0.35.3 0.0.0.0
#

HC Series HUAWEI TECHNOLOGIES 371


HCNP-IERS Chapter 4 Multicast Protocols

return

<R4>display current-configuration
[V200R007C00SPC600]
#
sysname R4
#
interface Serial1/0/0
link-protocol ppp
e n
ip address 10.0.14.4 255.255.255.0
/
pim dm
o m
i.c
#
interface GigabitEthernet0/0/1
ip address 10.0.24.4 255.255.255.0
w e
pim silent
u a
igmp enable

g .h
n
igmp static-group 225.1.1.1
#
ni
r
lea
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
: //
ospf 1 router-id 10.0.4.4

t t p
:h
area 0.0.0.0

s
network 10.0.4.4 0.0.0.0
network 10.0.14.4 0.0.0.0

r c e
ou
#
return

es
R
<R5>display current-configuration
[V200R007C00SPC600]

i n g
#
n
sysname R5

e ar
L
#

e
interface Serial1/0/0

or
link-protocol ppp

M
ip address 10.0.35.5 255.255.255.0
pim dm
#
interface GigabitEthernet0/0/0
ip address 10.0.25.5 255.255.255.0
pim dm
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255

HC Series HUAWEI TECHNOLOGIES 372


HCNP-IERS Chapter 4 Multicast Protocols

#
ospf 1 router-id 10.0.5.5
area 0.0.0.0
network 10.0.5.5 0.0.0.0
network 10.0.25.5 0.0.0.0
network 10.0.35.5 0.0.0.0
#
return

e n
/
Lab 4-2 PIM SM and Static RP
o m
Learning Objectives e i.c
aw
u
.h
The objectives of this lab are to learn and understand:

 How to configure PIM SM


i n g
r n

l e a
How to configure static RP and RP load balancing

: //
tp
Topology

ht
s :
r c e
o u
es
R
i n g
a rn
L e
r e
o
M

HC Series HUAWEI TECHNOLOGIES 373


HCNP-IERS Chapter 4 Multicast Protocols

Figure 5-2 PIM SM and dynamic RP

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
e n
dispersed on the network, multicast service quality degrades. To improve multicast /
reliability, security, and efficiency, you can configure PIM SM.
o m
i . c
In the PIM SM mode, you need to define the RP, which is used as the root
w e of the
shared tree in SM mode. In addition, RPs need to perform load balancing.
a
. hu
You may encounter network failures and need to rectify the faults.

i n g
Tasks r n
l e a
Step 1 Set basic parameters and configure
: // IP addresses.
tp
S2 participates in the experiment, but you tdo not need to configure S2. Before the
: hand restart S2.
experiment, clear the configuration on
e s S2

r cfor all the routers. All loopback interfaces must


Configure IP addresses and masks
o u
have 24-bit masks.
e s
R
[R1]interface GigabitEthernet0/0/2

i n g
[R1-GigabitEthernet0/0/2]ip address 10.0.13.1 24

rn
[R1-GigabitEthernet0/0/2]quit

a
[R1]interface Serial 1/0/0

e
L
[R1-Serial1/0/0]ip address 10.0.12.1 24

e
r
[R1-Serial1/0/0]quit

o
[R1]interface Serial 3/0/0

M[R1-Serial3/0/0]ip address 10.0.14.1 24


[R1-Serial3/0/0]quit
[R1]interface loopback 0
[R1-LoopBack0]ip address 10.0.1.1 24
[R1-LoopBack0]quit

[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.0.25.2 24
[R2-GigabitEthernet0/0/0]quit

HC Series HUAWEI TECHNOLOGIES 374


HCNP-IERS Chapter 4 Multicast Protocols

[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.0.24.2 24
[R2-GigabitEthernet0/0/1]quit
[R2]interface Serial 1/0/0
[R2-Serial1/0/0]ip address 10.0.12.2 24
[R2-Serial1/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]ip address 10.0.2.2 24
[R2-LoopBack0]quit
e n
/
[R3]interface GigabitEthernet0/0/2
o m
i.c
[R3-GigabitEthernet0/0/2]ip address 10.0.13.3 24
[R3-GigabitEthernet0/0/2]quit
[R3]interface Serial 3/0/0
w e
[R3-Serial3/0/0]ip address 10.0.35.3 24
u a
[R3-Serial3/0/0]quit

g .h
n
[R3]interface loopback 0
[R3-LoopBack0]ip address 10.0.3.3 24
ni
r
lea
[R3-LoopBack0]quit

[R4]interface GigabitEthernet0/0/1
: //
t
[R4-GigabitEthernet0/0/1]ip address 10.0.24.4 24

t p
:h
[R4-GigabitEthernet0/0/1]quit

s
[R4]interface Serial 1/0/0

c e
[R4-Serial1/0/0]ip address 10.0.14.4 24

r
ou
[R4-Serial1/0/0]quit
[R4]interface loopback 0

es
[R4-LoopBack0]ip address 10.0.4.4 24
[R4-LoopBack0]quit
R
i n g
n
[R5]interface GigabitEthernet0/0/0

ar
[R5-GigabitEthernet0/0/0]ip address 10.0.25.5 24

e
L
[R5-GigabitEthernet0/0/0]quit

e
[R5]interface Serial 1/0/0

or
[R5-Serial1/0/0]ip address 10.0.35.5 24

M
[R5-Serial1/0/0]quit
[R5]interface loopback 0
[R5-LoopBack0]ip address 10.0.5.5 24
[R5-LoopBack0]quit

[S1]interface Vlanif 1
[S1-Vlanif1]ip address 10.0.24.1 24
[S1-Vlanif1]interface loopback 0
[S1-LoopBack0]ip address 10.0.11.11 24

HC Series HUAWEI TECHNOLOGIES 375


HCNP-IERS Chapter 4 Multicast Protocols

[S1-LoopBack0]quit

After the configurations are complete, test link connectivity.


[R1]ping -c 1 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=41 ms

e n
/
--- 10.0.12.2 ping statistics ---

m
1 packet(s) transmitted
1 packet(s) received
o
0.00% packet loss
round-trip min/avg/max = 41/41/41 ms
e i.c
aw
u
.h
[R1]ping -c 1 10.0.13.3

g
PING 10.0.13.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=5 ms

ni n
r
lea
--- 10.0.13.3 ping statistics ---

//
1 packet(s) transmitted
1 packet(s) received
p :
0.00% packet loss
t t
:h
round-trip min/avg/max = 5/5/5 ms

e s
[R1]ping -c 1 10.0.14.4
r c
ou
PING 10.0.14.4: 56 data bytes, press CTRL_C to break

s
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=62 ms

e
R
g
--- 10.0.14.4 ping statistics ---

i n
1 packet(s) transmitted

n
ar
1 packet(s) received

e
0.00% packet loss

L
round-trip min/avg/max = 62/62/62 ms

e
or
[R5]ping -c 1 10.0.25.2

MPING 10.0.25.2: 56 data bytes, press CTRL_C to break


Reply from 10.0.25.2: bytes=56 Sequence=1 ttl=255 time=7 ms

--- 10.0.25.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 7/7/7 ms

HC Series HUAWEI TECHNOLOGIES 376


HCNP-IERS Chapter 4 Multicast Protocols

[R5]ping -c 1 10.0.35.3
PING 10.0.35.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.35.3: bytes=56 Sequence=1 ttl=255 time=37 ms

--- 10.0.35.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
e n
round-trip min/avg/max = 37/37/37 ms
/
o m
i.c
[S1]ping -c 1 10.0.24.2
PING 10.0.24.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.24.2: bytes=56 Sequence=1 ttl=255 time=1 ms
w e
u a
--- 10.0.24.2 ping statistics ---

g .h
n
1 packet(s) transmitted
1 packet(s) received
ni
r
lea
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms

: //
t t p
Configure OSPF on R1, R2, R3, R4, R5, and S1. Implement network connectivity.

s:h
e
[R1]ospf 1 router-id 10.0.1.1
[R1-ospf-1]area 0
r c
ou
[R1-ospf-1-area-0.0.0.0]network 10.0.14.1 0.0.0.0

s
[R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0

e
R
[R1-ospf-1-area-0.0.0.0]network 10.0.13.1 0.0.0.0

g
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0

i n
[R1-ospf-1-area-0.0.0.0]quit

n
ar
[R1-ospf-1]quit

L e
[R2]ospf 1 router-id 10.0.2.2

e
or
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0

M
[R2-ospf-1-area-0.0.0.0]network 10.0.24.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.25.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit

[R3]ospf 1 router-id 10.0.3.3


[R3-ospf-1]area 0

HC Series HUAWEI TECHNOLOGIES 377


HCNP-IERS Chapter 4 Multicast Protocols

[R3-ospf-1-area-0.0.0.0]network 10.0.13.3 0.0.0.0


[R3-ospf-1-area-0.0.0.0]network 10.0.35.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit

[R4]ospf 1 router-id 10.0.4.4


[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.0.14.4 0.0.0.0
e n
[R4-ospf-1-area-0.0.0.0]network 10.0.24.4 0.0.0.0
/
[R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0
o m
i.c
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit

w e
[R5]ospf 1 router-id 10.0.5.5
u a
[R5-ospf-1]area 0

g .h
n
[R5-ospf-1-area-0.0.0.0]network 10.0.25.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 10.0.35.5 0.0.0.0
ni
r
lea
[R5-ospf-1-area-0.0.0.0]network 10.0.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
: //
t t p
:h
[S1]ospf 1 router-id 10.0.11.11

s
[S1-ospf-1]area 0

c e
[S1-ospf-1-area-0.0.0.0]network 10.0.24.1 0.0.0.0

r
ou
[S1-ospf-1-area-0.0.0.0]network 10.0.11.11 0.0.0.0
[S1-ospf-1-area-0.0.0.0]quit
[S1-ospf-1]quit
es
R
i n g
After the configuration, wait until the OSPF neighbor relationship is set up. When

a rn exchange is complete, test the connectivity between S1 and


route information

L
Loopback0 eof R3.
r e
o
[S1]ping -c 1 10.0.3.3

M PING 10.0.3.3: 56 data bytes, press CTRL_C to break


Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=253 time=37 ms

--- 10.0.3.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 37/37/37 ms

HC Series HUAWEI TECHNOLOGIES 378


HCNP-IERS Chapter 4 Multicast Protocols

The test result shows that the network works normally.

Step 2 Enable PIM SM on all routers.

Enable multicast routing on R1, R2, R3, R4, R5, and S1.
[R1]multicast routing-enable

[R2]multicast routing-enable

e n
/
[R3]multicast routing-enable

o m
[R4]multicast routing-enable
e i.c
aw
u
[R5]multicast routing-enable

[S1]multicast routing-enable
g.h
ni n
ar
Configure PIM SM on all interfaces of all devices.
l e
[R1]interface GigabitEthernet0/0/2
: //
[R1-GigabitEthernet0/0/2]pim sm
t tp
[R1-GigabitEthernet0/0/2]quit

: h
[R1]interface Serial 1/0/0

e s
[R1-Serial1/0/0]pim sm

r c
[R1-Serial1/0/0]quit

o u
s
[R1]interface Serial 3/0/0
[R1-Serial3/0/0]pim sm
Re
g
[R1-Serial3/0/0]quit

i n
[R1]interface loopback 0

rn
[R1-LoopBack0]pim sm

a
[R1-LoopBack0]quit

e
e L
r
[R2]interface GigabitEthernet0/0/0

o
[R2-GigabitEthernet0/0/0]pim sm

M[R2-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]pim sm
[R2-GigabitEthernet0/0/1]quit
[R2]interface Serial 1/0/0
[R2-Serial1/0/0]pim sm
[R2-Serial1/0/0]quit
[R2]interface loopback 0
[R2-LoopBack0]pim sm

HC Series HUAWEI TECHNOLOGIES 379


HCNP-IERS Chapter 4 Multicast Protocols

[R2-LoopBack0]quit

[R3]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2]pim sm
[R3-GigabitEthernet0/0/2]quit
[R3]interface Serial 3/0/0
[R3-Serial3/0/0]pim sm
[R3-Serial3/0/0]quit
[R3]interface loopback 0
e n
[R3-LoopBack0]pim sm
/
[R3-LoopBack0]quit
o m
[R4]interface GigabitEthernet0/0/1
e i.c
[R4-GigabitEthernet0/0/1]pim sm

aw
[R4-GigabitEthernet0/0/1]quit
u
[R4]interface Serial 1/0/0

g .h
n
[R4-Serial1/0/0]pim sm
[R4-Serial1/0/0]quit
ni
r
lea
[R4]interface loopback 0
[R4-LoopBack0]pim sm
[R4-LoopBack0]quit
: //
t t p
:h
[R5]interface GigabitEthernet0/0/0

s
[R5-GigabitEthernet0/0/0]pim sm
[R5-GigabitEthernet0/0/0]quit

r c e
ou
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]pim sm
[R5-Serial1/0/0]quit
es
[R5]interface loopback 0
R
n
[R5-LoopBack0]pim sm

i g
n
[R5-LoopBack0]quit

e ar
L
[S1]interface Vlanif 1

e
[S1-Vlanif1]pim sm

or
[S1-Vlanif1]quit

M
[S1]interface loopback 0
[S1-LoopBack0]pim sm
[S1-LoopBack0]quit

After the configuration, check PIM neighbor learning information on R1, R5, and S1.
<R1>display pim neighbor
VPN-Instance: public net

HC Series HUAWEI TECHNOLOGIES 380


HCNP-IERS Chapter 4 Multicast Protocols

Total Number of Neighbors = 3

Neighbor Interface Uptime Expires Dr-Priority


10.0.13.3 GE0/0/2 00:08:52 00:01:23 1
10.0.12.2 S1/0/0 00:40:44 00:01:30 1
10.0.14.4 S3/0/0 00:07:53 00:01:23 1

[R5]display pim neighbor


VPN-Instance: public net
e n
Total Number of Neighbors = 2
/
o m
i.c
Neighbor Interface Uptime Expires Dr-Priority
10.0.25.2
10.0.35.3
GE0/0/0
S1/0/0
00:08:38 00:01:30 1
00:08:38 00:01:28 1
w e
u a
[S1]display pim neighbor

g .h
n
VPN-Instance: public net
Total Number of Neighbors = 2
ni
r
Neighbor Interface Uptime
lea
Expires Dr-Priority BFD-Session

//
10.0.24.4 Vlanif1 00:01:24 00:01:23 1

p : N
10.0.24.2 Vlanif1
t
00:01:22 00:01:17 1

t
N

s :h
r c e
The command output shows that the PIM protocol has been running.

Step 3 Implement load balance


o u between static RPs.
e s multicast data flows on the network.
R
Specify static RPs to control

i n
Configure R1's S3/0/0
g as the static RP on all devices.
[R1]pim
a rn
L e
[R1-pim]static-rp 10.0.14.1

r e
[R1-pim]quit

o
M[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

HC Series HUAWEI TECHNOLOGIES 381


HCNP-IERS Chapter 4 Multicast Protocols

[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
e n
[S1-pim]quit
/
o m
i . c 0 of
S1. w e
S1 is the Layer 3 switch connected to multicast users. Enable IGMP on Loopback

a
[S1]interface LoopBack 0
. hu
[S1-LoopBack0]igmp enable
[S1-LoopBack0]quit
i n g
r n
l e ato simulate multicast users of
//
Add S1's Loopback 0 to the multicast group 225.0.0.1
:
group 225.0.0.1.
t tp
[S1]interface LoopBack 0
: h
e s
[S1-LoopBack0]igmp static-group 225.0.0.1
[S1-LoopBack0]quit
r c
o u
es
Run the display pim routing-table command on R1, R4, and S1 to check the PIM
R
routing table.
i n g
rn
[R1]display pim routing-table

a
VPN-Instance: public net

e
L
Total 1 (*, G) entry; 0 (S, G) entry

e
o r
(*, 225.0.0.1)

M RP: 10.0.14.1 (local)


Protocol: pim-sm, Flag: WC
UpTime: 00:02:40
Upstream interface: Register
Upstream neighbor: NULL
RPF prime neighbor: NULL
Downstream interface(s) information:
Total number of downstreams: 1
1: Serial3/0/0

HC Series HUAWEI TECHNOLOGIES 382


HCNP-IERS Chapter 4 Multicast Protocols

Protocol: pim-sm, UpTime: 00:02:40, Expires: 00:02:50

[R4]display pim routing-table


VPN-Instance: public net
Total 1 (*, G) entry; 0 (S, G) entry

(*, 225.0.0.1)
RP: 10.0.14.1
Protocol: pim-sm, Flag: WC
e n
UpTime: 00:01:46
/
Upstream interface: Serial1/0/0
o m
i.c
Upstream neighbor: 10.0.14.1
RPF prime neighbor: 10.0.14.1
Downstream interface(s) information:
w e
Total number of downstreams: 1
u a
1: GigabitEthernet0/0/1

g .h
n
Protocol: pim-sm, UpTime: 00:01:46, Expires: 00:02:43

ni
r
lea
[S1-LoopBack0]display pim routing-table
VPN-Instance: public net
Total 1 (*, G) entry; 0 (S, G) entry
: //
t t p
:h
(*, 225.0.0.1)

s
RP: 10.0.14.1
Protocol: pim-sm, Flag: WC

r c e
ou
UpTime: 00:01:19
Upstream interface: Vlanif1

es
Upstream neighbor: 10.0.24.4

R
RPF prime neighbor: 10.0.24.4

n g
Downstream interface(s) information:

i
n
Total number of downstreams: 1

ar
1: LoopBack0

Le
Protocol: static, UpTime: 00:01:19, Expires: -

r e
o command output shows that R1 is the RP on the network. S1 generates a
The
Mmulticast path to R1 through R4.
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

HC Series HUAWEI TECHNOLOGIES 383


HCNP-IERS Chapter 4 Multicast Protocols

[R1-acl-basic-2000]rule permit source 225.0.0.0 0.0.0.255


[R1-acl-basic-2000]quit
[R1]acl 2001
[R1-acl-basic-2001]rule permit source 225.0.1.0 0.0.0.255
[R1-acl-basic-2001]quit
[R1]pim
[R1-pim]static-rp 10.0.14.1 2000
[R1-pim]static-rp 10.0.25.5 2001
[R1-pim]quit
e n
/
[R2]acl 2000
o m
i.c
[R2-acl-basic-2000]rule permit source 225.0.0.0 0.0.0.255
[R2-acl-basic-2000]quit
[R2]acl 2001
w e
[R2-acl-basic-2001]rule permit source 225.0.1.0 0.0.0.255
u a
[R2-acl-basic-2001]quit

g .h
n
[R2]pim
[R2-pim]static-rp 10.0.14.1 2000
ni
r
lea
[R2-pim]static-rp 10.0.25.5 2001
[R2-pim]quit

: //
[R3]acl 2000

t t p
:h
[R3-acl-basic-2000]rule permit source 225.0.0.0 0.0.0.255

s
[R3-acl-basic-2000]quit
[R3]acl 2001

r c e
ou
[R3-acl-basic-2001]rule permit source 225.0.1.0 0.0.0.255
[R3-acl-basic-2001]quit
[R3]pim
es
R
[R3-pim]static-rp 10.0.14.1 2000

n g
[R3-pim]static-rp 10.0.25.5 2001

i
[R3-pim]quit
n
e ar
L
[R4]acl 2000

e
[R4-acl-basic-2000]rule permit source 225.0.0.0 0.0.0.255

or
[R4-acl-basic-2000]quit

M
[R4]acl 2001
[R4-acl-basic-2001]rule permit source 225.0.1.0 0.0.0.255
[R4-acl-basic-2001]quit
[R4]pim
[R4-pim]static-rp 10.0.14.1 2000
[R4-pim]static-rp 10.0.25.5 2001
[R4-pim]quit

[R5]acl 2000

HC Series HUAWEI TECHNOLOGIES 384


HCNP-IERS Chapter 4 Multicast Protocols

[R5-acl-basic-2000]rule permit source 225.0.0.0 0.0.0.255


[R5-acl-basic-2000]quit
[R5]acl 2001
[R5-acl-basic-2001]rule permit source 225.0.1.0 0.0.0.255
[R5-acl-basic-2001]quit
[R5]pim
[R5-pim]static-rp 10.0.14.1 2000
[R5-pim]static-rp 10.0.25.5 2001
[R5-pim]quit
e n
/
[S1]acl 2000
o m
i.c
[S1-acl-basic-2000]rule permit source 225.0.0.0 0.0.0.255
[S1-acl-basic-2000]quit
[S1]acl 2001
w e
[S1-acl-basic-2001]rule permit source 225.0.1.0 0.0.0.255
u a
[S1-acl-basic-2001]quit

g .h
n
[S1]pim
[S1-pim]static-rp 10.0.14.1 2000
ni
r
lea
[S1-pim]static-rp 10.0.25.5 2001

: //
t t p
Add S1's Loopback 0 to the multicast group 225.0.1.1 to simulate multicast users of

:h
group 225.0.1.1.
[S1]interface LoopBack 0
e s
r c
[S1-LoopBack0]igmp static-group 225.0.1.1

ou
[S1-LoopBack0]quit

e s
R
routing table. in
g
Run the display pim routing-table command on S1, R2, and R5 to check the PIM

a rn
e
[R5]display pim routing-table

L
VPN-Instance: public net

e
r
Total 1 (*, G) entry; 0 (S, G) entry

o
M(*, 225.0.1.1)
RP: 10.0.25.5 (local)
Protocol: pim-sm, Flag: WC
UpTime: 00:03:13
Upstream interface: Register
Upstream neighbor: NULL
RPF prime neighbor: NULL
Downstream interface(s) information:

HC Series HUAWEI TECHNOLOGIES 385


HCNP-IERS Chapter 4 Multicast Protocols

Total number of downstreams: 1


1: GigabitEthernet0/0/0
Protocol: pim-sm, UpTime: 00:03:13, Expires: 00:03:17

[R2]display pim routing-table


VPN-Instance: public net
Total 1 (*, G) entry; 0 (S, G) entry

(*, 225.0.1.1)
e n
RP: 10.0.25.5
/
Protocol: pim-sm, Flag: WC
o m
i.c
UpTime: 00:03:41
Upstream interface: GigabitEthernet0/0/0
Upstream neighbor: 10.0.25.5
w e
RPF prime neighbor: 10.0.25.5
u a
Downstream interface(s) information:

g .h
n
Total number of downstreams: 1
1: GigabitEthernet0/0/1
ni
r
lea
Protocol: pim-sm, UpTime: 00:03:41, Expires: 00:02:48

[S1]display pim routing-table


: //
VPN-Instance: public net

t t p
:h
Total 2 (*, G) entries; 0 (S, G) entry

e s
c
(*, 225.0.0.1)

r
ou
RP: 10.0.14.1
Protocol: pim-sm, Flag: WC
UpTime: 00:17:09
es
R
Upstream interface: Vlanif1

n g
Upstream neighbor: 10.0.24.4

i
n
RPF prime neighbor: 10.0.24.4

ar
Downstream interface(s) information:

e
L
Total number of downstreams: 1

e 1: LoopBack0

or Protocol: static, UpTime: 00:17:09, Expires: -

M
(*, 225.0.1.1)
RP: 10.0.25.5
Protocol: pim-sm, Flag: WC
UpTime: 00:03:58
Upstream interface: Vlanif1
Upstream neighbor: 10.0.24.2
RPF prime neighbor: 10.0.24.2
Downstream interface(s) information:

HC Series HUAWEI TECHNOLOGIES 386


HCNP-IERS Chapter 4 Multicast Protocols

Total number of downstreams: 1


1: LoopBack0
Protocol: static, UpTime: 00:03:58, Expires: -

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
e n
/
o m
i.c
Additional Exercises: Analysis and Verification

PIM SM is applicable to the scenarios where users are dispersed.


w e
u a
. h
For which networks you will configure PIM SM? What are the characteristics of these
networks?
in g
r n
Device Configurations
l e a
[R1]display current-configuration
: / /
tp
[V200R007C00SPC600]
#

ht
sysname R1

s :
#
board add 0/1 1SA
r c e
board add 0/2 1SA
o u
board add 0/3 1SA
es
board add 0/4 1SA
R
#

i n g
drop illegal-mac alarm
#

a rn
#
L e
multicast routing-enable

r e
acl number 2000

o
rule 5 permit source 225.0.0.0 0.0.0.255

Macl number 2001


rule 5 permit source 225.0.1.0 0.0.0.255
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
pim sm
#

HC Series HUAWEI TECHNOLOGIES 387


HCNP-IERS Chapter 4 Multicast Protocols

interface Serial2/0/0
link-protocol ppp
#
interface Serial3/0/0
link-protocol ppp
ip address 10.0.14.1 255.255.255.0
pim sm
#
interface Serial4/0/0
e n
link-protocol ppp
/
#
o m
i.c
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/1
w e
#
u a
interface GigabitEthernet0/0/2

g .h
n
ip address 10.0.13.1 255.255.255.0
pim sm
ni
r
lea
#
interface GigabitEthernet0/0/3
description VirtualPort
: //
#

t t p
:h
interface Cellular0/0/0

s
#
interface Cellular0/0/1

r c e
ou
#
interface NULL0
#
es
interface LoopBack0
R
n g
ip address 10.0.1.1 255.255.255.0

i
pim sm
n
#

e ar
L
ospf 1 router-id 10.0.1.1

e
area 0.0.0.0

or network 10.0.1.1 0.0.0.0

M network 10.0.12.1 0.0.0.0


network 10.0.13.1 0.0.0.0
network 10.0.14.1 0.0.0.0
#
pim
static-rp 10.0.14.1 2000
static-rp 10.0.25.5 2001
#
return

HC Series HUAWEI TECHNOLOGIES 388


HCNP-IERS Chapter 4 Multicast Protocols

[R2]display current-configuration
[V200R007C00SPC600]
#
sysname R2
#
board add 0/1 1SA
board add 0/2 1SA
board add 0/3 1SA
e n
board add 0/4 2FE
/
#
o m
i.c
drop illegal-mac alarm
#
multicast routing-enable
w e
#
u a
acl number 2000

g .h
n
rule 5 permit source 225.0.0.0 0.0.0.255
acl number 2001
ni
r
lea
rule 5 permit source 225.0.1.0 0.0.0.255
#
interface Ethernet4/0/0
: //
#

t t p
:h
interface Ethernet4/0/1

s
#
interface Serial1/0/0

r c e
ou
link-protocol ppp
ip address 10.0.12.2 255.255.255.0
pim sm
es
#
R
interface Serial2/0/0

i n g
link-protocol ppp
n
#

e ar
L
interface Serial3/0/0

e
link-protocol ppp
#
or
M
interface GigabitEthernet0/0/0
ip address 10.0.25.2 255.255.255.0
pim sm
#
interface GigabitEthernet0/0/1
ip address 10.0.24.2 255.255.255.0
pim sm
#
interface GigabitEthernet0/0/2

HC Series HUAWEI TECHNOLOGIES 389


HCNP-IERS Chapter 4 Multicast Protocols

#
interface GigabitEthernet0/0/3
description VirtualPort
#
interface Cellular0/0/0
#
interface Cellular0/0/1
#
interface NULL0
e n
#
/
interface LoopBack0
o m
i.c
ip address 10.0.2.2 255.255.255.0
pim sm
#
w e
ospf 1 router-id 10.0.2.2
u a
area 0.0.0.0

g .h
n
network 10.0.2.2 0.0.0.0
network 10.0.12.2 0.0.0.0
ni
r
lea
network 10.0.24.2 0.0.0.0
network 10.0.25.2 0.0.0.0
#
: //
pim

t t p
:h
static-rp 10.0.14.1 2000

s
static-rp 10.0.25.5 2001
#

r c e
ou
return

es
[R3]display current-configuration
[V200R007C00SPC600]
R
#

i n g
sysname R3
n
#

e ar
L
board add 0/1 1SA

e
board add 0/2 1SA

or
board add 0/3 1SA

M
board add 0/4 2FE
#
drop illegal-mac alarm
#
multicast routing-enable
#
acl number 2000
rule 5 permit source 225.0.0.0 0.0.0.255
acl number 2001

HC Series HUAWEI TECHNOLOGIES 390


HCNP-IERS Chapter 4 Multicast Protocols

rule 5 permit source 225.0.1.0 0.0.0.255


#
interface Ethernet4/0/0
#
interface Ethernet4/0/1
#
interface Serial1/0/0
link-protocol ppp
#
e n
interface Serial2/0/0
/
link-protocol ppp
o m
i.c
#
interface Serial3/0/0
link-protocol ppp
w e
ip address 10.0.35.3 255.255.255.0
u a
pim sm

g .h
n
#
interface GigabitEthernet0/0/0
ni
r
lea
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
: //
#

t t p
:h
interface GigabitEthernet0/0/2

s
ip address 10.0.13.3 255.255.255.0
pim sm

r c e
ou
#
interface GigabitEthernet0/0/3
description VirtualPort
es
#
R
n
interface Cellular0/0/0

i g
#
n
ar
interface Cellular0/0/1

e
L
#

e
interface NULL0
#
or
M
interface LoopBack0
ip address 10.0.3.3 255.255.255.0
pim sm
#
ospf 1 router-id 10.0.3.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.13.3 0.0.0.0
network 10.0.35.3 0.0.0.0

HC Series HUAWEI TECHNOLOGIES 391


HCNP-IERS Chapter 4 Multicast Protocols

#
pim
static-rp 10.0.14.1 2000
static-rp 10.0.25.5 2001
#
return

[R4]display current-configuration
[V200R007C00SPC600]
e n
#
/
sysname R4
o m
i.c
#
board add 0/1 2SA
board add 0/2 2FE
w e
#
u a
drop illegal-mac alarm

g .h
n
#
multicast routing-enable
ni
r
lea
#
acl number 2000
rule 5 permit source 225.0.0.0 0.0.0.255
: //
acl number 2001

t t p
:h
rule 5 permit source 225.0.1.0 0.0.0.255

s
#
interface Ethernet2/0/0

r c e
ou
#
interface Ethernet2/0/1
#
es
interface Serial1/0/0
R
link-protocol ppp

i n g
n
ip address 10.0.14.4 255.255.255.0
pim sm

e ar
L
#

e
interface Serial1/0/1

or
link-protocol ppp

M
#
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/1
ip address 10.0.24.4 255.255.255.0
pim sm
#
interface GigabitEthernet0/0/2
#

HC Series HUAWEI TECHNOLOGIES 392


HCNP-IERS Chapter 4 Multicast Protocols

interface GigabitEthernet0/0/3
description VirtualPort
#
interface Cellular0/0/0
#
interface Cellular0/0/1
#
interface NULL0
#
e n
interface LoopBack0
/
ip address 10.0.4.4 255.255.255.0
o m
i.c
pim sm
#
ospf 1 router-id 10.0.4.4
w e
area 0.0.0.0
u a
network 10.0.4.4 0.0.0.0

g .h
n
network 10.0.14.4 0.0.0.0
network 10.0.24.4 0.0.0.0
ni
r
lea
#
pim
static-rp 10.0.14.1 2000
: //
static-rp 10.0.25.5 2001

t t p
:h
#

s
return

r c e
ou
[R5]display current-configuration
[V200R007C00SPC600]
#
es
sysname R5
R
#

i n g
board add 0/1 2SA
n
ar
board add 0/2 2FE

e
L
#

e
drop illegal-mac alarm
#
or
M
multicast routing-enable
#
acl number 2000
rule 5 permit source 225.0.0.0 0.0.0.255
acl number 2001
rule 5 permit source 225.0.1.0 0.0.0.255
#
interface Ethernet2/0/0
#

HC Series HUAWEI TECHNOLOGIES 393


HCNP-IERS Chapter 4 Multicast Protocols

interface Ethernet2/0/1
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.35.5 255.255.255.0
pim sm
#
interface Serial1/0/1
link-protocol ppp
e n
#
/
interface GigabitEthernet0/0/0
o m
i.c
ip address 10.0.25.5 255.255.255.0
pim sm
#
w e
interface GigabitEthernet0/0/1
u a
#

g .h
n
interface GigabitEthernet0/0/2
#
ni
r
lea
interface GigabitEthernet0/0/3
description VirtualPort
#
: //
interface Cellular0/0/0

t t p
:h
#

s
interface Cellular0/0/1
#

r c e
ou
interface NULL0
#
interface LoopBack0
es
R
ip address 10.0.5.5 255.255.255.0
pim sm

i n g
#
n
ar
ospf 1 router-id 10.0.5.5

e
L
area 0.0.0.0

e
network 10.0.5.5 0.0.0.0

or network 10.0.25.5 0.0.0.0

M
#
network 10.0.35.5 0.0.0.0

pim
static-rp 10.0.14.1 2000
static-rp 10.0.25.5 2001
#
return

[S1]display current-configuration

HC Series HUAWEI TECHNOLOGIES 394


HCNP-IERS Chapter 4 Multicast Protocols

!Software Version V200R008C00SPC500


#
sysname S1
#
multicast routing-enable
#
diffserv domain default
#
acl number 2000
e n
rule 5 permit source 225.0.0.0 0.0.0.255
/
acl number 2001
o m
i.c
rule 5 permit source 225.0.1.0 0.0.0.255
#
interface Vlanif1
w e
ip address 10.0.24.1 255.255.255.0
u a
pim sm

g .h
n
#
interface LoopBack0
ni
r
lea
ip address 10.0.11.11 255.255.255.0
pim sm
igmp enable
: //
igmp static-group 225.0.0.1

t t p
:h
igmp static-group 225.0.1.1

s
#
ospf 1

r c e
ou
area 0.0.0.0
network 10.0.11.11 0.0.0.0
network 10.0.24.1 0.0.0.0
es
#
R
pim

i n g
n
static-rp 10.0.14.1 2000

ar
static-rp 10.0.25.5 2001

e
L
#
return
e
or
M

HC Series HUAWEI TECHNOLOGIES 395


HCNP-IERS Chapter 5 Route Control

Chapter 5 Route Control

Lab 5-1 Route Import and Control

Learning Objectives

The objectives of this lab are to learn and understand:


e n
/
 How to import OSPF and RIP routes to each other
o m
 How to configure route filtering based on IP prefix list
e i.c
 How to filter routes using a route-policy
aw
u
Topology
g .h
ni n
r
//lea
p :
t t
s :h
r c e
s ou
Re
i n g
n
e ar Figure 6-1 Route import and control

e L
or
Scenario

MYou are a network administrator of a company. The company's network has OSPF
areas and RIP 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.

HC Series HUAWEI TECHNOLOGIES 396


HCNP-IERS Chapter 5 Route Control

Tasks

Step 1 Set basic parameters and configure IP addresses.

Configure IP addresses and masks for physical interfaces and loopback interfaces of
all routers. Each Loopback0 uses the 32-bit mask.
<R1>system-view

e n
/
Enter system view, return user view with Ctrl+Z.

m
[R1]interface Serial 1/0/0
[R1-Serial1/0/0]ip address 10.0.12.1 255.255.255.0
o
[R1-Serial1/0/0]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.0.15.1 255.255.255.0
e i.c
[R1-GigabitEthernet0/0/0]interface Serial 3/0/0
aw
u
.h
[R1-Serial3/0/0]ip address 10.0.14.1 255.255.255.0

g
[R1-Serial3/0/0]interface LoopBack 0
[R1-LoopBack0]ip address 10.0.1.1 255.255.255.255

ni n
r
lea
<R2>system-view

//
Enter system view, return user view with Ctrl+Z.
[R2]interface Serial 1/0/0
p :
t t
[R2-Serial1/0/0]ip address 10.0.12.2 255.255.255.0

:h
[R2-Serial1/0/0]interface Serial 2/0/0

e s
[R2-Serial2/0/0]ip address 10.0.23.2 255.255.255.0

r c
[R2-Serial2/0/0]interface LoopBack 0

ou
[R2-LoopBack0]ip add 10.0.2.2 255.255.255.255

es
R
<R3>system-view

g
Enter system view, return user view with Ctrl+Z.

i n
[R3]interface Serial 2/0/0

n
ar
[R3-Serial2/0/0]ip address 10.0.23.3 255.255.255.0

e
[R3-Serial2/0/0]interface Serial 3/0/0

L
[R3-Serial3/0/0]ip address 10.0.35.3 255.255.255.0

e
or
[R3-Serial3/0/0]interface LoopBack 0
[R3-LoopBack0]ip address 10.0.3.3 255.255.255.255

M
<R4>system-view
Enter system view, return user view with Ctrl+Z.
[R4]interface Serial 1/0/0
[R4-Serial1/0/0]ip address 10.0.14.4 255.255.255.0
[R4-Serial1/0/0]interface LoopBack 0
[R4-LoopBack0]ip address 10.0.4.4 255.255.255.255

HC Series HUAWEI TECHNOLOGIES 397


HCNP-IERS Chapter 5 Route Control

<R5>system-view
Enter system view, return user view with Ctrl+Z.
[R5]interface Serial 1/0/0
[R5-Serial1/0/0]ip address 10.0.35.5 255.255.255.0
[R5-Serial1/0/0]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]ip address 10.0.15.5 255.255.255.0
[R5-GigabitEthernet0/0/0]interface LoopBack 0
[R5-LoopBack0]ip address 10.0.5.5 255.255.255.255

e n
/
After the configurations are complete, test link connectivity.
o m
[R1]ping -c 1 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
e i.c
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=38 ms
aw
u
--- 10.0.12.2 ping statistics ---
g .h
1 packet(s) transmitted

ni n
r
1 packet(s) received

lea
0.00% packet loss

//
round-trip min/avg/max = 38/38/38 ms

p :
[R1]ping -c 1 10.0.15.5
t t
:h
PING 10.0.15.5: 56 data bytes, press CTRL_C to break

e s
Reply from 10.0.15.5: bytes=56 Sequence=1 ttl=255 time=12 ms

r c
ou
--- 10.0.15.5 ping statistics ---
1 packet(s) transmitted

es
R
1 packet(s) received

g
0.00% packet loss

i n
round-trip min/avg/max = 12/12/12 ms

n
e ar
[R1]ping -c 1 10.0.14.4

L
PING 10.0.14.4: 56 data bytes, press CTRL_C to break

e
or
Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=33 ms

M--- 10.0.14.4 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 33/33/33 ms

[R2]ping -c 1 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break

HC Series HUAWEI TECHNOLOGIES 398


HCNP-IERS Chapter 5 Route Control

Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=34 ms

--- 10.0.23.3 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/34/34 ms

[R3]ping -c 1 10.0.35.5
e n
PING 10.0.35.5: 56 data bytes, press CTRL_C to break
/
Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=39 ms
o m
--- 10.0.35.5 ping statistics ---
e i.c
1 packet(s) transmitted

aw
1 packet(s) received
u
0.00% packet loss

g .h
n
round-trip min/avg/max = 39/39/39 ms

ni
r
Step 2 Configure an IGP protocol.
//lea
p :
t
Run OSPF on R1, R2, R4, and R5. All devices belong to area 0.
t
: h to R1's S1/0/0, S3/0/0, G0/0/0, and
Run OSPF on the network segments connected
e s
Loopback0.
r c
[R1]ospf 1
o u
[R1-ospf-1]area 0
es
R
[R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0

i n g
[R1-ospf-1-area-0.0.0.0]network 10.0.15.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 10.0.14.1 0.0.0.0

a rn
[R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0

L e
r e on the network segment connected to R2's S1/0/0.
Run OSPF
o
M[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0

Run OSPF on the network segment connected to R4's S1/0/0 and Loopback0.
[R4]ospf 1

HC Series HUAWEI TECHNOLOGIES 399


HCNP-IERS Chapter 5 Route Control

[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.0.14.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0

Run OSPF on the network segment connected to R5's G0/0/0.


[R5]ospf 1
[R5-ospf-1]area 0

e n
/
[R5-ospf-1-area-0.0.0.0]network 10.0.15.5 0.0.0.0

m
Check whether the routers can learn the routes from the network segments co
connected to Loopback0 of other routers. e i.
aw
hu
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib

g .
n
----------------------------------------------------------------------------
Routing Tables: Public
ni
Destinations : 17 Routes : 17
ar
l e
Destination/Mask Proto Pre Cost
: //
Flags NextHop Interface

t tp
10.0.1.1/32 Direct 0 0

: h D 127.0.0.1 InLoopBack0
10.0.4.4/32 OSPF 10
s
1562

e
D 10.0.14.4 Serial3/0/0
10.0.12.0/24 Direct 0

r c 0 D 10.0.12.1 Serial1/0/0

u
10.0.12.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.12.2/32
s o
Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.255/32
10.0.14.0/24 Re
Direct 0
Direct 0
0
0
D
D
127.0.0.1
10.0.14.1
InLoopBack0
Serial3/0/0

i
10.0.14.1/32
n g
Direct 0 0 D 127.0.0.1 InLoopBack0

rn
10.0.14.4/32 Direct 0 0 D 10.0.14.4 Serial3/0/0

e a
10.0.14.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e L
10.0.15.0/24 Direct 0 0 D 10.0.15.1 GigabitEthernet0/0/0

r
10.0.15.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

o 10.0.15.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

M 127.0.0.0/8
127.0.0.1/32
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public

HC Series HUAWEI TECHNOLOGIES 400


HCNP-IERS Chapter 5 Route Control

Destinations : 17 Routes : 17

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 OSPF 10 1562 D 10.0.12.1 Serial1/0/0


10.0.2.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.4.4/32 OSPF 10 3124 D 10.0.12.1 Serial1/0/0
10.0.12.0/24 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.1/32 Direct 0 0 D 10.0.12.1 Serial1/0/0
e n
10.0.12.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
/
10.0.12.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
o m
i.c
10.0.14.0/24 OSPF 10 3124 D 10.0.12.1 Serial1/0/0
10.0.15.0/24
10.0.23.0/24
OSPF
Direct 0
10 1563
0
D
D
10.0.12.1
10.0.23.2
Serial1/0/0
Serial2/0/0
w e
10.0.23.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
u a
10.0.23.3/32 Direct 0 0 D 10.0.23.3
.h
Serial2/0/0

g
n
10.0.23.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1
niInLoopBack0

r
lea
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D
: //
127.0.0.1 InLoopBack0

t t p
:h
[R4]display ip routing-table

s
Route Flags: R - relay, D - download to fib

c e
----------------------------------------------------------------------------

r
ou
Routing Tables: Public
Destinations : 12 Routes : 12

es
Destination/Mask Proto
R Pre Cost Flags NextHop Interface

i n g
n
10.0.1.1/32 OSPF 10 1562 D 10.0.14.1 Serial1/0/0

ar
10.0.4.4/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Le
10.0.12.0/24 OSPF 10 3124 D 10.0.14.1 Serial1/0/0

re
10.0.14.0/24 Direct 0 0 D 10.0.14.4 Serial1/0/0

o 10.0.14.1/32 Direct 0 0 D 10.0.14.1 Serial1/0/0

M 10.0.14.4/32
10.0.14.255/32
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
10.0.15.0/24 OSPF 10 1563 D 10.0.14.1 Serial1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

[R5]display ip routing-table

HC Series HUAWEI TECHNOLOGIES 401


HCNP-IERS Chapter 5 Route Control

Route Flags: R - relay, D - download to fib


----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.1.1/32 OSPF 10 1 D 10.0.15.1 GigabitEthernet0/0/0


10.0.4.4/32 OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
e n
10.0.5.5/32 Direct 0 0 D 127.0.0.1 InLoopBack0
/
10.0.12.0/24 OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
o m
i.c
10.0.14.0/24 OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
10.0.15.0/24
10.0.15.5/32
Direct 0
Direct 0
0
0
D
D
10.0.15.5
127.0.0.1 InLoopBack0
w e
GigabitEthernet0/0/0

10.0.15.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0


u a
10.0.35.0/24 Direct 0 0 D 10.0.35.5
.h
Serial1/0/0

g
n
10.0.35.3/32 Direct 0 0 D 10.0.35.3 Serial1/0/0
10.0.35.5/32 Direct 0 0 D 127.0.0.1
niInLoopBack0

r
lea
10.0.35.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D
: //
127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0

t t
D
p
127.0.0.1 InLoopBack0

:h
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e s
Configure RIP on R2, R3, and R5. c
u r
s o connected to R2's S2/0/0 and Loopback0.
Run RIP on the network segments
Re
g
[R2]rip

i n
[R2-rip-1]version 2

rn
[R2-rip-1]network 10.0.0.0

e a
Run RIP L
r e on the network segments connected to R3's S2/0/0, S3/0/0, and Loopback0.

o
[R3]rip

M[R3-rip-1]version 2
[R3-rip-1]network 10.0.0.0

Run RIP on the network segments connected to R5's S1/0/0 and Loopback0.
[R5]rip
[R5-rip-1]version 2
[R5-rip-1]network 10.0.0.0

HC Series HUAWEI TECHNOLOGIES 402


HCNP-IERS Chapter 5 Route Control

Check whether the routers learn Loopback0 addresses of other devices.


[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 20 Routes : 20

e n
/
m
Destination/Mask Proto Pre Cost Flags NextHop Interface

o
10.0.1.1/32
10.0.2.2/32
OSPF
Direct 0
10 1562
0
D
D
10.0.12.1
127.0.0.1
Serial1/0/0
InLoopBack0
e i.c
10.0.3.3/32 RIP 100 1 D 10.0.23.3 Serial2/0/0
aw
u
.h
10.0.4.4/32 OSPF 10 3124 D 10.0.12.1 Serial1/0/0

g
10.0.5.5/32 RIP 100 2 D 10.0.23.3 Serial2/0/0
10.0.12.0/24 Direct 0 0 D 10.0.12.2

ni n
Serial1/0/0

r
10.0.12.1/32 Direct 0 0 D 10.0.12.1 Serial1/0/0

lea
10.0.12.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0

://
10.0.12.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

tp
10.0.14.0/24 OSPF 10 3124 D 10.0.12.1 Serial1/0/0
10.0.15.0/24 OSPF 10 1563
t D 10.0.12.1 Serial1/0/0

:h
10.0.23.0/24 Direct 0 0 D 10.0.23.2 Serial2/0/0

es
10.0.23.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.23.3/32 Direct 0
r
0
c D 10.0.23.3 Serial2/0/0

ou
10.0.23.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.35.0/24 RIP

es
100 1 D 10.0.23.3 Serial2/0/0

R
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

g
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

n i n
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

ar
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

L e
[R3]display ip routing-table

e
or
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

M
Routing Tables: Public
Destinations : 17 Routes : 17

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.2.2/32 RIP 100 1 D 10.0.23.2 Serial2/0/0


10.0.3.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.5.5/32 RIP 100 1 D 10.0.35.5 Serial3/0/0

HC Series HUAWEI TECHNOLOGIES 403


HCNP-IERS Chapter 5 Route Control

10.0.12.0/24 RIP 100 1 D 10.0.23.2 Serial2/0/0


10.0.15.0/24 RIP 100 1 D 10.0.35.5 Serial3/0/0
10.0.23.0/24 Direct 0 0 D 10.0.23.3 Serial2/0/0
10.0.23.2/32 Direct 0 0 D 10.0.23.2 Serial2/0/0
10.0.23.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.23.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.35.0/24 Direct 0 0 D 10.0.35.3 Serial3/0/0
10.0.35.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.35.5/32 Direct 0 0 D 10.0.35.5 Serial3/0/0
e n
10.0.35.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
/
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
o m
i.c
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0
255.255.255.255/32 Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
w e
u a
[R5]display ip routing-table

g .h
n
Route Flags: R - relay, D - download to fib

ni
----------------------------------------------------------------------------

r
lea
Routing Tables: Public
Destinations : 19 Routes : 19

: //
Destination/Mask Proto Pre Cost

t t p
Flags NextHop Interface

:h
es
10.0.1.1/32 OSPF 10 1 D 10.0.15.1 GigabitEthernet0/0/0

c
10.0.2.2/32 RIP 100 2 D 10.0.35.3 Serial1/0/0

r
ou
10.0.3.3/32 RIP 100 1 D 10.0.35.3 Serial1/0/0
10.0.4.4/32 OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
10.0.5.5/32 Direct 0
es 0 D 127.0.0.1 InLoopBack0
10.0.12.0/24 OSPF
R 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
10.0.14.0/24

i n g
OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0

n
10.0.15.0/24 Direct 0 0 D 10.0.15.5 GigabitEthernet0/0/0

ar
10.0.15.5/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Le
10.0.15.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

re
10.0.23.0/24 RIP 100 1 D 10.0.35.3 Serial1/0/0

o 10.0.35.0/24 Direct 0 0 D 10.0.35.5 Serial1/0/0

M 10.0.35.3/32
10.0.35.5/32
Direct 0
Direct 0
0
0
D
D
10.0.35.3
127.0.0.1
Serial1/0/0
InLoopBack0
10.0.35.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 404


HCNP-IERS Chapter 5 Route Control

Step 3 Configure a prefix list to filter routes.

Create static routes 1.1.1.1/32, 1.1.1.0/24, 1.1.1.0/25, 1.1.0.0/16, and 1.0.0.0/8


pointing to NULL 0 on R1. Run the import-route static command to import routes
to OSPF.
[R1]ip route-static 1.1.1.1 255.255.255.255 NULL 0
[R1]ip route-static 1.1.1.0 255.255.255.0 NULL 0

e n
[R1]ip route-static 1.1.1.0 255.255.255.128 NULL 0
/
[R1]ip route-static 1.1.0.0 255.255.0.0 NULL 0

o m
i.c
[R1]ip route-static 1.0.0.0 255.0.0.0 NULL 0

e
[R1]ospf 1

w
[R1-ospf-1]import-route static

u a
Check whether R4 receives the static routes added to R1.
g .h
[R4]display ip routing-table
ni n
r
lea
Route Flags: R - relay, D - download to fib

//
----------------------------------------------------------------------------
Routing Tables: Public

p :
Destinations : 17 Routes : 17
t t
:h
es
Destination/Mask Proto Pre Cost Flags NextHop Interface

r c
ou
1.0.0.0/8 O_ASE 150 1 D 10.0.14.1 Serial1/0/0

s
1.1.0.0/16 O_ASE 150 1 D 10.0.14.1 Serial1/0/0
1.1.1.0/24
1.1.1.0/25
O_ASE
O_ASE
Re150
150
1
1
D
D
10.0.14.1
10.0.14.1
Serial1/0/0
Serial1/0/0
1.1.1.1/32

i n g
O_ASE 150 1 D 10.0.14.1 Serial1/0/0

n
10.0.1.1/32 OSPF 10 1562 D 10.0.14.1 Serial1/0/0

ar
10.0.4.4/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Le
10.0.12.0/24 OSPF 10 3124 D 10.0.14.1 Serial1/0/0

re
10.0.14.0/24 Direct 0 0 D 10.0.14.4 Serial1/0/0

o 10.0.14.1/32 Direct 0 0 D 10.0.14.1 Serial1/0/0

M 10.0.14.4/32
10.0.14.255/32
Direct 0
Direct 0
0
0
D
D
127.0.0.1
127.0.0.1
InLoopBack0
InLoopBack0
10.0.15.0/24 OSPF 10 1563 D 10.0.14.1 Serial1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 405


HCNP-IERS Chapter 5 Route Control

Configure the prefix list pref_r1 on R1 to match the route 1.1.1.0/24.


[R1]ip ip-prefix pref_r1 index 10 permit 1.1.1.0 24 greater-equal 24 less-equal 24

Create the routing policy policy_r1 and invoke the prefix list pref_r1 to control static
route import on R1.

n
[R1]route-policy policy_r1 permit node 10
[R1-route-policy]if-match ip-prefix pref_r1
/ e
[R1-route-policy]ospf

o m
i.c
[R1-ospf-1]import-route static route-policy policy_r1

w e
Check the routing table on R4.
u a
[R4]display ip routing-table

g .h
n
Route Flags: R - relay, D - download to fib

ni
----------------------------------------------------------------------------

r
lea
Routing Tables: Public
Destinations : 13 Routes : 13

: //
Destination/Mask Proto Pre Cost

t t p
Flags NextHop Interface

:h
es
1.1.1.0/24 O_ASE 150 1 D 10.0.14.1 Serial1/0/0

c
10.0.1.1/32 OSPF 10 1562 D 10.0.14.1 Serial1/0/0

r
ou
10.0.4.4/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.12.0/24 OSPF 10 3124 D 10.0.14.1 Serial1/0/0
10.0.14.0/24 Direct 0
es 0 D 10.0.14.4 Serial1/0/0
10.0.14.1/32
R
Direct 0 0 D 10.0.14.1 Serial1/0/0
10.0.14.4/32

i n g
Direct 0 0 D 127.0.0.1 InLoopBack0

n
10.0.14.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

ar
10.0.15.0/24 OSPF 10 1563 D 10.0.14.1 Serial1/0/0

Le
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

re
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

o
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

M
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Step 4 Use the route policy to filter routes, avoiding loops.

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

HC Series HUAWEI TECHNOLOGIES 406


HCNP-IERS Chapter 5 Route Control

[R4-LoopBack1]ip address 10.1.4.4 255.255.255.0


[R4-LoopBack1]ospf 1
[R4-ospf-1]import-route direct

Import OSPF routes on R2 to RIP, and import RIP routes on R5 to OSPF.


[R2]rip
[R2-rip-1]import-route ospf
e n
/
[R5]ospf
o m
i.c
[R5-ospf-1]import-route rip

w e
Test the connectivity between R1 and 10.1.4.4.
u a
[R1]ping 10.1.4.4
g .h
PING 10.1.4.4: 56 data bytes, press CTRL_C to break

ni n
Request time out
r
lea
Request time out
Request time out
: //
Request time out
Request time out
t t p
s :h
--- 10.1.4.4 ping statistics ---
5 packet(s) transmitted
r c e
ou
0 packet(s) received
100.00% packet loss
es
R
i n g
The connection is abnormal. Check the routing table on R1.
n
ar
[R1]display ip routing-table

e
e L
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

or
Routing Tables: Public

M Destinations : 28 Routes : 28

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.0.0.0/8 Static 60 0 D 0.0.0.0 NULL0


1.1.0.0/16 Static 60 0 D 0.0.0.0 NULL0
1.1.1.0/24 Static 60 0 D 0.0.0.0 NULL0
1.1.1.0/25 Static 60 0 D 0.0.0.0 NULL0
1.1.1.1/32 Static 60 0 D 0.0.0.0 NULL0

HC Series HUAWEI TECHNOLOGIES 407


HCNP-IERS Chapter 5 Route Control

10.0.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0


10.0.2.2/32 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
10.0.3.3/32 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
10.0.4.4/32 OSPF 10 1562 D 10.0.14.4 Serial3/0/0
10.0.5.5/32 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial1/0/0
10.0.12.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
e n
10.0.14.0/24 Direct 0 0 D 10.0.14.1 Serial3/0/0
/
10.0.14.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
o m
i.c
10.0.14.4/32 Direct 0 0 D 10.0.14.4 Serial3/0/0
10.0.14.255/32
10.0.15.0/24
Direct 0
Direct 0
0
0
D
D
127.0.0.1
10.0.15.1
InLoopBack0

w e
GigabitEthernet0/0/0
10.0.15.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
u a
10.0.15.255/32 Direct 0 0 D 127.0.0.1
.h
InLoopBack0

g
n
10.0.23.0/24 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
10.0.35.0/24 O_ASE 150 1 D 10.0.15.5
ni
GigabitEthernet0/0/0

r
lea
10.1.4.0/24 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D
: //
127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D

t t p
127.0.0.1 InLoopBack0

:h
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

e s
r c on R1 is R5.
The next hop of the route 10.1.4.0/24

o uthe routing tables on R2, R3, and R5.


e s
Check the 10.1.4.0/24 route in
R
g
[R2]display ip routing-table 10.1.4.0

i n
Route Flags: R - relay, D - download to fib

rn
----------------------------------------------------------------------------

a
Routing Table : Public
e
L
Summary Count : 1

e
r
Destination/Mask Proto Pre Cost Flags NextHop Interface

o
M 10.1.4.0/24 O_ASE 150 1 D 10.0.12.1 Serial1/0/0

[R3]display ip routing-table 10.1.4.0


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface

HC Series HUAWEI TECHNOLOGIES 408


HCNP-IERS Chapter 5 Route Control

10.1.4.0/24 RIP 100 1 D 10.0.23.2 Serial2/0/0

[R5]display ip routing-table 10.1.4.0


Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface

e n
10.1.4.0/24 RIP 100 2 D 10.0.35.3 Serial1/0/0
/
o m
Run the tracert command on R1 to check the path to 10.1.4.4.
e i.c
[R1]tracert 10.1.4.4
aw
u
.h
traceroute to 10.1.4.4(10.1.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break

g
1 10.0.15.5 61 ms 2 ms 2 ms
2 10.0.35.3 29 ms 28 ms 29 ms

ni n
r
3 10.0.23.2 31 ms 36 ms 36 ms

lea
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
p :
7 10.0.23.2 60 ms 66 ms 66 ms
t t
:h
8 10.0.12.1 63 ms 66 ms 66 ms
9 10.0.15.5 65 ms 67 ms 67 ms
e s
r c
A loop is detected.
s ou
e
R import is configured, R5 can learn the 10.1.4.0/24 route in
The reason is: After route
both the RIP and n
i g domains.
OSPF

a
The RIP routesrnhave higher priority than OSPF external routes, so R5 uses the routes
learned L
e
from the RIP domain.
re
R1ocan learn this route from both R5 and R4. The two routes are OSPF external routes.
MTherefore, 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]acl number 2001
[R5-acl-basic-2001]rule 0 permit source 10.1.4.0 0.0.0.255

HC Series HUAWEI TECHNOLOGIES 409


HCNP-IERS Chapter 5 Route Control

[R5-acl-basic-2001]route-policy add_tag permit node 10


[R5-route-policy]if-match acl 2001
[R5-route-policy]apply tag 100
[R5-route-policy]route-policy add_tag permit node 20
[R5-route-policy]ospf
[R5-ospf-1]import-route rip route-policy add_tag

Check OSPF routing information on R1.


e n
/
m
[R1]display ospf routing

o
OSPF Process 1 with Router ID 10.0.12.1
Routing Tables
e i.c
aw
u
.h
Routing for Network

g
Destination Cost Type NextHop AdvRouter Area
10.0.1.1/32 0 Stub 10.0.1.1 10.0.12.1

ni n 0.0.0.0

r
10.0.12.0/24 1562 Stub 10.0.12.1 10.0.12.1 0.0.0.0

lea
10.0.14.0/24 1562 Stub 10.0.14.1 10.0.12.1 0.0.0.0

://
10.0.15.0/24 1 Transit 10.0.15.1 10.0.12.1 0.0.0.0

tp
10.0.4.4/32 1562 Stub 10.0.14.4 10.0.14.4 0.0.0.0

t
:h
Routing for ASEs

es
Destination Cost Type Tag NextHop AdvRouter
1.1.1.0/24 1 Type2
r c 1 10.0.15.5 10.0.35.5

ou
10.0.2.2/32 1 Type2 1 10.0.15.5 10.0.35.5
10.0.3.3/32 1

esType2 1 10.0.15.5 10.0.35.5

R
10.0.5.5/32 1 Type2 1 10.0.15.5 10.0.35.5

g
10.0.14.1/32 1 Type2 1 10.0.15.5 10.0.35.5
10.0.23.0/24

n i n
1 Type2 1 10.0.15.5 10.0.35.5

ar
10.0.35.0/24 1 Type2 1 10.0.15.5 10.0.35.5

e
10.1.4.0/24 1 Type2 100 10.0.15.5 10.0.35.5

e L
or
Total Nets: 13
Intra Area: 5 Inter Area: 0 ASE: 8 NSSA: 0

M
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 RIP
routes to OSPF.

HC Series HUAWEI TECHNOLOGIES 410


HCNP-IERS Chapter 5 Route Control

Configure the route policy route_delete on R5 to control RIP route import to OSPF.
[R5]route-policy route_delete deny node 10
[R5-route-policy]if-match acl 2001
[R5-route-policy]route-policy route_delete permit node 20
[R5-route-policy]ospf 1
[R5-ospf-1]import-route rip route-policy route_delete

e n
Check the routing table on R1.
/
[R1]display ip routing-table
o m
i.c
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------

w e
a
Routing Tables: Public
Destinations : 28 Routes : 28
u
g .h
Destination/Mask Proto Pre Cost Flags NextHop

ni n
Interface

r
lea
1.0.0.0/8 Static 60 0 D 0.0.0.0 NULL0

//
1.1.0.0/16 Static 60 0 D 0.0.0.0 NULL0
1.1.1.0/24 Static 60 0 D
:
0.0.0.0
p
NULL0
1.1.1.0/25 Static 60 0
t t
D 0.0.0.0 NULL0

:h
1.1.1.1/32 Static 60 0 D 0.0.0.0 NULL0

es
10.0.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.2.2/32 O_ASE 150 1
r c D 10.0.15.5 GigabitEthernet0/0/0

ou
10.0.3.3/32 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
10.0.4.4/32 OSPF

es
10 1562 D 10.0.14.4 Serial3/0/0

R
10.0.5.5/32 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0

g
10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial1/0/0
10.0.12.1/32

n i nDirect 0 0 D 127.0.0.1 InLoopBack0

ar
10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial1/0/0
10.0.12.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

L e
10.0.14.0/24 Direct 0 0 D 10.0.14.1 Serial3/0/0

e
or
10.0.14.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.14.4/32 Direct 0 0 D 10.0.14.4 Serial3/0/0

M 10.0.14.255/32
10.0.15.0/24
Direct 0
Direct 0
0
0
D
D
127.0.0.1
10.0.15.1
InLoopBack0
GigabitEthernet0/0/0
10.0.15.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.15.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.23.0/24 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
10.0.35.0/24 O_ASE 150 1 D 10.0.15.5 GigabitEthernet0/0/0
10.1.4.0/24 O_ASE 150 1 D 10.0.14.4 Serial3/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

HC Series HUAWEI TECHNOLOGIES 411


HCNP-IERS Chapter 5 Route Control

127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0


255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

The routing information is correct.

Test the connectivity between R1 and 10.1.4.4.


[R1]ping 10.1.4.4
PING 10.1.4.4: 56 data bytes, press CTRL_C to break
e n
Reply from 10.1.4.4: bytes=56 Sequence=1 ttl=255 time=33 ms /
Reply from 10.1.4.4: bytes=56 Sequence=2 ttl=255 time=29 ms
o m
i.c
Reply from 10.1.4.4: bytes=56 Sequence=3 ttl=255 time=29 ms
Reply from 10.1.4.4: bytes=56 Sequence=4 ttl=255 time=29 ms

w e
a
Reply from 10.1.4.4: bytes=56 Sequence=5 ttl=255 time=29 ms

u
--- 10.1.4.4 ping statistics ---

g .h
5 packet(s) transmitted

ni n
r
5 packet(s) received

lea
0.00% packet loss

//
round-trip min/avg/max = 29/29/33 ms

p :
t t
:h
Test the path from R1 to 10.1.4.4.
[R1]tracert 10.1.4.4
e s
traceroute to
r c
10.1.4.4(10.1.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break

ou
1 10.0.14.4 61 ms 29 ms 29 ms

e s
R is the next hop of the 10.1.4.0/24 route on R1.
i n g
The loop is removed. R4

Step 5 Use the


rn route-policy to change route priorities, avoiding
loops. ea
e L
or the IP routing table of R5. Observe the next hop of the route 10.1.4.0/24.
Check

M[R5]display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------------
Routing Tables: Public
Destinations : 22 Routes : 22

Destination/Mask Proto Pre Cost Flags NextHop Interface

HC Series HUAWEI TECHNOLOGIES 412


HCNP-IERS Chapter 5 Route Control

1.1.1.0/24 RIP 100 2 D 10.0.35.3 Serial1/0/0


10.0.1.1/32 OSPF 10 1 D 10.0.15.1 GigabitEthernet0/0/0
10.0.2.2/32 RIP 100 2 D 10.0.35.3 Serial1/0/0
10.0.3.3/32 RIP 100 1 D 10.0.35.3 Serial1/0/0
10.0.4.4/32 OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
10.0.5.5/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.12.0/24 OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
10.0.14.0/24 OSPF 10 1563 D 10.0.15.1 GigabitEthernet0/0/0
10.0.14.1/32 RIP 100 2 D 10.0.35.3 Serial1/0/0
e n
10.0.15.0/24 Direct 0 0 D 10.0.15.5 GigabitEthernet0/0/0
/
10.0.15.5/32 Direct 0 0 D 127.0.0.1 InLoopBack0
o m
i.c
10.0.15.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.0.23.0/24
10.0.35.0/24
RIP
Direct 0
100 1
0
D
D
10.0.35.3
10.0.35.5
Serial1/0/0
Serial1/0/0
w e
10.0.35.3/32 Direct 0 0 D 10.0.35.3 Serial1/0/0
u a
10.0.35.5/32 Direct 0 0 D 127.0.0.1
.h
InLoopBack0

g
n
10.0.35.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.4.0/24 RIP 100 2 D 10.0.35.3
niSerial1/0/0

r
lea
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D
: //
127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D

t t p
127.0.0.1 InLoopBack0

s :h
Test the path from R5 to 10.1.4.4.
r c e
[R5]tracert 10.1.4.4

s ou
traceroute to
1 10.0.35.3 62 ms
Re
10.1.4.4(10.1.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break
24 ms 24 ms
2 10.0.23.2 43 ms

i n g
44 ms 44 ms

n
3 10.0.12.1 33 ms 33 ms 33 ms

e ar
4 10.0.14.4 74 ms 55 ms 55 ms

e L
or
Although route filtering can fix the loop problem, R5 still learns the 10.1.4.0/24 route
Mfrom the RIP 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.

Delete the policy route_delete on R5.


[R5]undo route-policy route_delete

HC Series HUAWEI TECHNOLOGIES 413


HCNP-IERS Chapter 5 Route Control

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.
[R5]route-policy route_pref permit node 10
[R5-route-policy]if-match acl 2001
[R5-route-policy]apply preference 180

e n
/
Use the route-policy route_pref to control the RIP routes imported into OSPF.
o m
[R5]rip
i . c
[R5-rip-1]preference route-policy route_pref

w e
Check the IP routing tables of R5 and R1. Observe the next hopshof
a
u the 10.1.4.0/24
g .
routes.
ni n
[R5]display ip routing-table 10.1.4.0
ar
Route Flags: R - relay, D - download to fib
l e
: //
----------------------------------------------------------------------------

tp
Routing Table : Public
Summary Count : 1
ht
Destination/Mask Proto Pre
s
Cost
: Flags NextHop Interface

10.1.4.0/24 O_ASE 150


r c1
e D 10.0.15.1 GigabitEthernet0/0/0

o u
e s
[R1]display ip routing-table 10.1.4.0

R
Route Flags: R - relay, D - download to fib

n g
----------------------------------------------------------------------------

i
rn
Routing Table : Public

a
Summary Count : 1

L e
Destination/Mask Proto Pre Cost Flags NextHop Interface

r e
o
10.1.4.0/24 O_ASE 150 1 D 10.0.14.4 Serial3/0/0

M
Test the connectivity between R1 and 10.1.4.4.
[R1]ping 10.1.4.4
PING 10.1.4.4: 56 data bytes, press CTRL_C to break
Reply from 10.1.4.4: bytes=56 Sequence=1 ttl=255 time=39 ms
Reply from 10.1.4.4: bytes=56 Sequence=2 ttl=255 time=35 ms
Reply from 10.1.4.4: bytes=56 Sequence=3 ttl=255 time=35 ms
Reply from 10.1.4.4: bytes=56 Sequence=4 ttl=255 time=35 ms

HC Series HUAWEI TECHNOLOGIES 414


HCNP-IERS Chapter 5 Route Control

Reply from 10.1.4.4: bytes=56 Sequence=5 ttl=255 time=35 ms

--- 10.1.4.4 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 35/35/39 ms

e n
Test the path from R1 to 10.1.4.4.
/
[R1]tracert 10.1.4.4
o m
traceroute to
1 10.0.14.4 61 ms 25 ms 25 ms
e i.c
10.1.4.4(10.1.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break

aw
u
Test the path from R5 to 10.1.4.4.
g .h
[R5]tracert 10.1.4.4

ni n
traceroute to
r
10.1.4.4(10.1.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break

lea
1 10.0.15.1 61 ms 2 ms 2 ms
2 10.0.14.4 41 ms 28 ms 27 ms
: //
t t p
The loop problem is fixed.
s :h
r c e
R4 is the next hop of the route 10.1.4.0/24 on R1. R1 is the next hop of the route

o u route problem is also fixed.


10.1.4.0/24 on R5. The sub-optimal

e s
----End
R
i n g
rn
Additional Exercises: Analysis and Verification

e aan ACL to achieve the same effect as that in step 3? What is the
L between using an ACL and a prefix list?
Can you use
e
r
difference
o
MIn 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]
#

HC Series HUAWEI TECHNOLOGIES 415


HCNP-IERS Chapter 5 Route Control

sysname R1
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
#
interface Serial3/0/0
link-protocol ppp
ip address 10.0.14.1 255.255.255.0
e n
#
/
interface GigabitEthernet0/0/0
o m
i.c
ip address 10.0.15.1 255.255.255.0
#
interface LoopBack0
w e
ip address 10.0.1.1 255.255.255.255
u a
#

g .h
n
ospf 1
import-route static route-policy policy_r1
ni
r
lea
area 0.0.0.0
network 10.0.12.1 0.0.0.0
network 10.0.15.1 0.0.0.0
: //
network 10.0.14.1 0.0.0.0

t t p
:h
network 10.0.1.1 0.0.0.0

s
#

c
route-policy policy_r1 permit node 10

r e
ou
if-match ip-prefix pref_r1
#

es
ip ip-prefix pref_r1 index 10 permit 1.1.1.0 24 greater-equal 24 less-equal 24
#
R
n g
ip route-static 1.0.0.0 255.0.0.0 NULL0

i
n
ip route-static 1.1.0.0 255.255.0.0 NULL0

ar
ip route-static 1.1.1.0 255.255.255.0 NULL0

e
L
ip route-static 1.1.1.0 255.255.255.128 NULL0

e
ip route-static 1.1.1.1 255.255.255.255 NULL0
#
or
M
return

<R2>display current-configuration
[V200R007C00SPC600]
#
sysname R2
#
interface Serial1/0/0
link-protocol ppp

HC Series HUAWEI TECHNOLOGIES 416


HCNP-IERS Chapter 5 Route Control

ip address 10.0.12.2 255.255.255.0


#
interface Serial2/0/0
link-protocol ppp
ip address 10.0.23.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
e n
ospf 1
/
area 0.0.0.0
o m
i.c
network 10.0.12.2 0.0.0.0
#
rip 1
w e
version 2
u a
network 10.0.0.0

g .h
n
import-route ospf 1
#
ni
r
lea
return

<R3>display current-configuration
: //
[V200R007C00SPC600]

t t p
:h
#

s
sysname R3
#

r c e
ou
interface Serial2/0/0
link-protocol ppp

es
ip address 10.0.23.3 255.255.255.0
#
R
interface Serial3/0/0

i n g
link-protocol ppp
n
ar
ip address 10.0.35.3 255.255.255.0

e
L
#

e
interface LoopBack0

or
ip address 10.0.3.3 255.255.255.255

M
#
rip 1
version 2
network 10.0.0.0
#
return

<R4>display current-configuration
[V200R007C00SPC600]

HC Series HUAWEI TECHNOLOGIES 417


HCNP-IERS Chapter 5 Route Control

#
sysname R4
#
interface Serial1/0/0
link-protocol ppp
ip address 10.0.14.4 255.255.255.0
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
e n
#
/
interface LoopBack1
o m
i.c
ip address 10.1.4.4 255.255.255.0
#
ospf 1
w e
import-route direct
u a
area 0.0.0.0

g .h
n
network 10.0.14.4 0.0.0.0
network 10.0.4.4 0.0.0.0
ni
r
lea
#
return

: //
<R5>display current-configuration

t t p
:h
[V200R007C00SPC600]

s
#
sysname R5

r c e
ou
#
interface Serial1/0/0
link-protocol ppp
es
R
ip address 10.0.35.5 255.255.255.0
#

i n g
n
interface GigabitEthernet0/0/0

ar
ip address 10.0.15.5 255.255.255.0

e
L
#

e
interface LoopBack0

or
ip address 10.0.5.5 255.255.255.255

M
#
ospf 1
import-route rip 1 route-policy route_delete
area 0.0.0.0
network 10.0.15.5 0.0.0.0
#
rip 1
version 2
network 10.0.0.0

HC Series HUAWEI TECHNOLOGIES 418


HCNP-IERS Chapter 5 Route Control

preference route-policy route_pref


#
route-policy add_tag permit node 10
if-match acl 2001
apply tag 100
#
route-policy add_tag permit node 20
#
route-policy route_pref permit node 10
e n
if-match acl 2001
/
apply preference 180
o m
i.c
#
return

w e
u a
g .h
ni n
r
//lea
p :
t t
s :h
r c e
s ou
Re
i n g
n
e ar
e L
or
M

HC Series HUAWEI TECHNOLOGIES 419


HCNP-IERS Chapter 6 VLAN Features and Configurations

Chapter 6 VLAN Features and Configurations

Lab 6-1 VLAN Configurations

Learning Objectives

The objectives of this lab are to learn and understand:


e n
/
 How to configure VLANs
o m
 How to configure Eth-Trunk
e i.c
Topology aw
u
g .h
ni n
r
//lea
p :
t t
s :h
r c e
sou
Re
i n g
n
e ar Figure 7-1 VLAN configuration

e L
or
Scenario

MYou are a network administrator of a company. The company's network is an


Ethernet that has two switches. In the preceding figure, the routers simulate the
computers, and R3 is a server. To optimize the network, you need to improve the link
speed and reliability between S1 and S2. Two VLANs are required to isolate
broadcast storms. R2 and R3 are on the same VLAN. Ensure that R1 can access R3.

HC Series HUAWEI TECHNOLOGIES 420


HCNP-IERS Chapter 6 VLAN Features and Configurations

Tasks

Step 1 Set basic parameters and configure IP addresses.

Configure IP addresses and masks for all devices.


<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
e n
[R1]interface GigabitEthernet 0/0/1
/
[R1-GigabitEthernet0/0/1]ip address 10.0.10.1 24
o m
i.c
[R1-GigabitEthernet0/0/1]quit

<Huawei>system-view
w e
Enter system view, return user view with Ctrl+Z.
u a
[Huawei]sysname R2

g .h
n
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.0.10.2 24
ni
r
lea
[R2-GigabitEthernet0/0/1]quit

<Huawei>system-view
: //
t
Enter system view, return user view with Ctrl+Z.
t p
:h
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/2

e s
c
[R3-GigabitEthernet0/0/2]ip address 10.0.10.3 24

r
ou
[R3-GigabitEthernet0/0/2]quit

es
Set names for switches. R
i
<Huawei>system-view
n g
n
ar
Enter system view, return user view with Ctrl+Z.

e
[Huawei]sysname S1

e L
or
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.

M
[Huawei]sysname S2

Step 2 Configure an Eth-Trunk.

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.

HC Series HUAWEI TECHNOLOGIES 421


HCNP-IERS Chapter 6 VLAN Features and Configurations

Create an Eth-Trunk.
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]

[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]

e n
Set the working mode of the Eth-Trunk to LACP.
/
[S1-Eth-Trunk1]mode lacp
o m
i.c
[S1-Eth-Trunk1]quit

w e
a
[S2-Eth-Trunk1]mode lacp
[S2-Eth-Trunk1]quit
u
g .h
Add G0/0/9 and G0/0/10 of S1 and S2 to an Eth-Trunk.
ni n
r
lea
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]eth-trunk 1
: //
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
t t p
[S1-GigabitEthernet0/0/10]eth-trunk 1

s :h
[S1-GigabitEthernet0/0/10]quit

r c e
ou
[S2]interface GigabitEthernet 0/0/9

es
[S2-GigabitEthernet0/0/9]eth-trunk 1

R
[S2-GigabitEthernet0/0/9]quit

i n g
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]eth-trunk 1

n
ar
[S2-GigabitEthernet0/0/10]quit

L e
r e display eth-trunk command to check configurations.
Run the
o
M[S1]display eth-trunk
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: LACP
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: d0d0-4ba6-aab0
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------

HC Series HUAWEI TECHNOLOGIES 422


HCNP-IERS Chapter 6 VLAN Features and Configurations

ActorPortName Status PortType PortPri PortNo PortKey PortState Weight


GigabitEthernet0/0/9 Selected 1GE 32768 1 305 10111100 1
GigabitEthernet0/0/10 Selected 1GE 32768 2 305 10111100 1

Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/9 32768 d0d0-4ba6-ac20 32768 1 305 10111100
GigabitEthernet0/0/10 32768 d0d0-4ba6-ac20 32768 2 305 10111100
e n
/
o m
The command output shows that the Eth-Trunk working mode is LACP, and the
i . c
threshold of active interfaces is 8. G0/0/9 and G0/0/10 are active.
w e
a
hu
Change the threshold of active interfaces.
[S1]interface Eth-Trunk 1
g .
[S1-Eth-Trunk1]max active-linknumber 1

ni n
[S1-Eth-Trunk1]quit

ar
l e
[S2]interface Eth-Trunk 1

: //
tp
[S2-Eth-Trunk1]max active-linknumber 1
[S2-Eth-Trunk1]quit

ht
s :
Check the Eth-Trunk configurations.e
r c
[S1]display eth-trunk 1
o u
e s
Eth-Trunk1's state information is:
Local:
R
LAG ID: 1

i n g WorkingMode: LACP

rn
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP

e a
System Priority: 32768 System ID: d0d0-4ba6-aab0

L
Least Active-linknumber: 1 Max Active-linknumber: 1

r e
Operate status: up Number Of Up Port In Trunk: 1

o
----------------------------------------------------------------------------

MActorPortName
GigabitEthernet0/0/9
Status PortType PortPri PortNo PortKey PortState Weight
Selected 1GE 32768 1 305 10111100 1
GigabitEthernet0/0/10 Unselect 1GE 32768 2 305 10100000 1

Partner:
----------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/9 32768 d0d0-4ba6-ac20 32768 1 305 10111100
GigabitEthernet0/0/10 32768 d0d0-4ba6-ac20 32768 2 305 10100000

HC Series HUAWEI TECHNOLOGIES 423


HCNP-IERS Chapter 6 VLAN Features and Configurations

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.

Shut down G0/0/9 of S1 to verify link backup.


[S1]interface GigabitEthernet 0/0/9

n
[S1-GigabitEthernet0/0/9]shutdown
[S1-GigabitEthernet0/0/9]quit
/ e
o m
Check the Eth-Trunk information.
e i.c
[S1]display eth-trunk 1

aw
Eth-Trunk1's state information is:
u
Local:

g .h
n
LAG ID: 1 WorkingMode: LACP
Preempt Delay: Disabled
n
Hash arithmetic: According to SIP-XOR-DIP
i
r
lea
System Priority: 32768 System ID: d0d0-4ba6-aab0
Least Active-linknumber: 1 Max Active-linknumber: 1
Operate status: up Number Of Up Port In Trunk: 1
: //
t p
--------------------------------------------------------------------------------

t
:h
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight

es
GigabitEthernet0/0/9 Unselect 1GE 32768 1 305 10100010 1

c
GigabitEthernet0/0/10 Selected 1GE 32768 2 305 10111100 1

r
Partner:
s ou
ActorPortName SysPrie
--------------------------------------------------------------------------------

R SystemID PortPri PortNo PortKey PortState


GigabitEthernet0/0/9

i n g 0 0000-0000-0000 0 0 0 10100011

n
GigabitEthernet0/0/10 32768 d0d0-4ba6-ac20 32768 2 305 10111100

e ar
L
The command output shows that the status of G0/0/9 in the Eth-Trunk changes to
e
o r
Unselect, and the status of G0/0/10 changes from Unselect to Selected and G0/0/10
Mresumes data forwarding. Link backup is successful.
Device Configurations
[S1]display current-configuration
!Software Version V200R008C00SPC500
#
sysname SW1
#

HC Series HUAWEI TECHNOLOGIES 424


HCNP-IERS Chapter 6 VLAN Features and Configurations

diffserv domain default


#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
e n
domain default_admin
/
local-user admin password
o m
i.c
irreversible-cipher %^%#tK;J&jw0HG8<9-"zX!kHwzXRNjuXn96[vN47F$*L~pXcROEP3!>c)NV+:`i;%^%#
local-user admin service-type http
#
w e
interface Vlanif1
u a
#

g .h
n
interface MEth0/0/1
#
ni
r
lea
interface Eth-Trunk1
mode lacp
max active-linknumber 1
: //
#

t t p
:h
interface GigabitEthernet0/0/1

s
#
interface GigabitEthernet0/0/2

r c e
ou
#
interface GigabitEthernet0/0/3
#
es
R
interface GigabitEthernet0/0/4
#

i n g
n
interface GigabitEthernet0/0/5
#

e ar
L
interface GigabitEthernet0/0/6
#
e
or
interface GigabitEthernet0/0/7

M
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
shutdown
eth-trunk 1
#
interface GigabitEthernet0/0/10
eth-trunk 1

HC Series HUAWEI TECHNOLOGIES 425


HCNP-IERS Chapter 6 VLAN Features and Configurations

#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
e n
interface GigabitEthernet0/0/15
/
#
o m
i.c
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
w e
#
u a
interface GigabitEthernet0/0/18

g .h
n
#
interface GigabitEthernet0/0/19
ni
r
lea
#
interface GigabitEthernet0/0/20
#
: //
interface GigabitEthernet0/0/21

t t p
:h
#

s
interface GigabitEthernet0/0/22
#

r c e
ou
interface GigabitEthernet0/0/23
#

es
interface GigabitEthernet0/0/24
#
R
n g
interface GigabitEthernet0/0/25

i
#
n
ar
interface GigabitEthernet0/0/26

e
L
#

e
interface GigabitEthernet0/0/27
#
or
M
interface GigabitEthernet0/0/28
#
interface XGigabitEthernet0/0/1
#
interface XGigabitEthernet0/0/2
#
interface XGigabitEthernet0/0/3
#
interface XGigabitEthernet0/0/4

HC Series HUAWEI TECHNOLOGIES 426


HCNP-IERS Chapter 6 VLAN Features and Configurations

#
interface NULL0
#
user-interface con 0
authentication-mode password
set authentication password cipher
$1a$fcjGHMtb0U$^GKZ+`,g@DfG$:T/P,R~iJ&')|!O":$b4)0*~&c-$
idle-timeout 0 0
user-interface vty 0 4
e n
user-interface vty 16 20
/
#
o m
i.c
return

[S2]display current-configuration
w e
!Software Version V200R008C00SPC500
u a
#

g .h
n
sysname SW2
#
ni
r
lea
diffserv domain default
#
drop-profile default
: //
#

t t p
:h
aaa

s
authentication-scheme default
authorization-scheme default

r c e
ou
accounting-scheme default
domain default
domain default_admin
es
local-user admin password
R
n g
irreversible-cipher %^%#gI/bO8qF$HkpAPUgNd'GiYR4TC!>EK#oG("Wl4_#$G*OKo-'7*R[h3+49<Z2%^%#

i
n
local-user admin service-type http
#

e ar
L
interface Vlanif1
#
e
or
interface MEth0/0/1

M
#
interface Eth-Trunk1
mode lacp
max active-linknumber 1
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/02
#

HC Series HUAWEI TECHNOLOGIES 427


HCNP-IERS Chapter 6 VLAN Features and Configurations

interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
e n
#
/
interface GigabitEthernet0/0/8
o m
i.c
#
interface GigabitEthernet0/0/9
eth-trunk 1
w e
#
u a
interface GigabitEthernet0/0/10

g .h
n
eth-trunk 1
#
ni
r
lea
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
: //
#

t t p
:h
interface GigabitEthernet0/0/13

s
#
interface GigabitEthernet0/0/14

r c e
ou
#
interface GigabitEthernet0/0/15
#
es
R
interface GigabitEthernet0/0/16
#

i n g
n
interface GigabitEthernet0/0/17
#

e ar
L
interface GigabitEthernet0/0/18
#
e
or
interface GigabitEthernet0/0/19

M
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#

HC Series HUAWEI TECHNOLOGIES 428


HCNP-IERS Chapter 6 VLAN Features and Configurations

interface GigabitEthernet0/0/24
#
interface GigabitEthernet0/0/25
#
interface GigabitEthernet0/0/26
#
interface GigabitEthernet0/0/27
#
interface GigabitEthernet0/0/28
e n
#
/
interface XGigabitEthernet0/0/1
o m
i.c
#
interface XGigabitEthernet0/0/2
#
w e
interface XGigabitEthernet0/0/3
u a
#

g .h
n
interface XGigabitEthernet0/0/4
#
ni
r
lea
interface NULL0
#
user-interface con 0
: //
authentication-mode password

t t p
:h
set authentication password cipher

s
$1a$5"l`L7$/5T$,KFQ9dEy~'IggWOa7V(C+9fQOd*M;U6q,.Sl1y'H$
idle-timeout 0 0

r c e
ou
user-interface vty 0 4
user-interface vty 16 20
#
es
return
R
i n g
Lab 6-2 MUX
rn VLAN
e a
L Objectives
Learning
e
orobjectives of this lab are to learn and understand:
The
M How to configure MUX VLAN

HC Series HUAWEI TECHNOLOGIES 429


HCNP-IERS Chapter 6 VLAN Features and Configurations

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
// lea
Figure 7-2 MUX VLAN configuration

p :
Scenario t t
: h The company's network is an
You are a network administrator of a scompany.
Ethernet that has two switches. Inr c e
the preceding figure, routers simulate the
computers. To optimize the o u you need to isolate the broadcast domains. R1
e s and R3 and R4 are on another VLAN. The company
network,

R
and R2 are on the same VLAN,
requires that all PCsgcan access R5, and R3 and R4 cannot communicate with R1 and
n
R2 or access eachi other. In the future network plan, S2's G0/0/24 will be connected
a rn Therefore, plan the voice VLAN and related configurations.
e
to voice devices.
L
r e
o
Tasks
MStep 1 Set basic parameters and configure IP addresses.
Configure IP addresses and masks for all devices.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]interface g0/0/1

HC Series HUAWEI TECHNOLOGIES 430


HCNP-IERS Chapter 6 VLAN Features and Configurations

[R1-GigabitEthernet0/0/1]ip address 10.0.10.1 24


[R1-GigabitEthernet0/0/1]quit

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.0.10.2 24
[R2-GigabitEthernet0/0/1]quit
e n
/
<Huawei>system-view
o m
i.c
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]interface g0/0/1
w e
[R3-GigabitEthernet0/0/1]ip address 10.0.10.3 24
u a
[R3-GigabitEthernet0/0/1]quit

g .h
<Huawei>system-view
ni n
r
lea
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]interface Ethernet2/0/0
: //
[R4-Ethernet2/0/0]ip address 10.0.10.4 24

t t p
:h
[R4-GigabitEthernet2/0/0]quit

e s
c
<Huawei>system-view

r
ou
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R5
[R5]interface Ethernet2/0/0
es
R
[R5-Ethernet2/0/0]ip address 10.0.10.5 24

n g
[R1-GigabitEthernet0/0/1]quit

i
n
ar
<Huawei>system-view

e
L
Enter system view, return user view with Ctrl+Z.

e
[Huawei]sysname S1

or
[S1]

M
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname S2
[S2]

Test the connectivity between R1 and R2, R3, R4, as well as R5.

HC Series HUAWEI TECHNOLOGIES 431


HCNP-IERS Chapter 6 VLAN Features and Configurations

[R1]ping -c 1 10.0.10.2
PING 10.0.10.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.10.2: bytes=56 Sequence=1 ttl=255 time=14 ms

--- 10.0.10.2 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 14/14/14 ms
e n
/
[R1]ping -c 1 10.0.10.3
o m
i.c
PING 10.0.10.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.10.3: bytes=56 Sequence=1 ttl=255 time=5 ms

w e
--- 10.0.10.3 ping statistics ---
u a
1 packet(s) transmitted

g .h
n
1 packet(s) received
0.00% packet loss
ni
r
lea
round-trip min/avg/max = 5/5/5 ms

[R1]ping -c 1 10.0.10.4
: //
t p
PING 10.0.10.4: 56 data bytes, press CTRL_C to break

t
:h
Reply from 10.0.10.4: bytes=56 Sequence=1 ttl=255 time=15 ms

e s
c
--- 10.0.10.4 ping statistics ---

r
ou
1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
es
R
round-trip min/avg/max = 15/15/15 ms

i n g
n
[R1]ping -c 1 10.0.10.5

ar
PING 10.0.10.5: 56 data bytes, press CTRL_C to break

e
L
Reply from 10.0.10.5: bytes=56 Sequence=1 ttl=255 time=6 ms

e
or
--- 10.0.10.5 ping statistics ---

M 1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 6/6/6 ms

Step 2 Configure MUX VLAN.

HC Series HUAWEI TECHNOLOGIES 432


HCNP-IERS Chapter 6 VLAN Features and Configurations

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.
e n
Set the interface types between PCs and switches. Allow all PCs to communicate with /
o m
R4. Prevent R3 and R4 from communicating with other VLANs or accessing each
i . c
other.
e
wVLANs.
a
hu
Configure VLAN 100 as the principle VLAN and configure subordinate
[S1]vlan 10
g .
[S1-vlan10]quit

ni n
[S1]vlan 20

ar
e
[S1-vlan20]quit
[S1]vlan 100
// l
:
tp
[S1-vlan100]mux-vlan
[S1-vlan100]subordinate group 10

ht
:
[S1-vlan100]subordinate separate 20
[S1-vlan100]quit
e s
r c
[S2]vlan 10
o u
[S2-vlan10]quit

e s
[S2]vlan 20
R
[S2-vlan20]quit
[S2]vlan 100
i n g
rn
[S2-vlan100]mux-vlan

a
L e
[S2-vlan100]subordinate group 10
[S2-vlan100]subordinate separate 20

r e
[S2-vlan100]quit

o
MAdd G0/0/5 between R5 and S2 to VLAN 100 and enable MUX VLAN.
[S2]interface GigabitEthernet 0/0/5
[S2-GigabitEthernet0/0/5]port link-type access
[S2-GigabitEthernet0/0/5]port default vlan 100
[S2-GigabitEthernet0/0/5]port mux-vlan enable vlan 100
[S2-GigabitEthernet0/0/5]quit

HC Series HUAWEI TECHNOLOGIES 433


HCNP-IERS Chapter 6 VLAN Features and Configurations

Add G0/0/1 between R1 and S1 and G0/0/2 between R2 and S1 to VLAN 10, and
enable MUX VLAN.
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]port link-type access
[S1-GigabitEthernet0/0/1]port default vlan 10
[S1-GigabitEthernet0/0/1]port mux-vlan enable vlan 10
[S1-GigabitEthernet0/0/1]quit
[S1]interface GigabitEthernet 0/0/2
e n
[S1-GigabitEthernet0/0/2]port link-type access /
[S1-GigabitEthernet0/0/2]port default vlan 10
o m
i.c
[S1-GigabitEthernet0/0/2]port mux-vlan enable vlan 10
[S1-GigabitEthernet0/0/2]quit

w e
a
Add G0/0/3 between R3 and S1 and G0/0/4 between R4 and S2h touVLAN 20, and
g .
enable MUX VLAN.
ni n
[S1]interface GigabitEthernet 0/0/3
ar
[S1-GigabitEthernet0/0/3]port link-type access
l e
:
[S1-GigabitEthernet0/0/3]port default vlan 20
//
tp
[S1-GigabitEthernet0/0/3]port mux-vlan enable vlan 20

t
[S1-GigabitEthernet0/0/3]quit

: h
e s
c
[S2]interface GigabitEthernet 0/0/4

ur
[S2-GigabitEthernet0/0/4]port link-type access

o
[S2-GigabitEthernet0/0/4]port default vlan 20

s
Re
[S2-GigabitEthernet0/0/4]port mux-vlan enable vlan 20
[S2-GigabitEthernet0/0/4]quit

i n g
a rnmux-vlan command to display MUX VLAN information.
Run the display
L e
e
[S1]display mux-vlan

o r
Principal Subordinate Type Interface

M
----------------------------------------------------------------------------
100 - principal
100 20 separate GigabitEthernet0/0/3
100 10 group GigabitEthernet0/0/1 GigabitEthernet0/0/2

[S2]display mux-vlan
Principal Subordinate Type Interface
----------------------------------------------------------------------------
100 - principal GigabitEthernet0/0/5

HC Series HUAWEI TECHNOLOGIES 434


HCNP-IERS Chapter 6 VLAN Features and Configurations

100 20 separate GigabitEthernet0/0/4


100 10 group
----------------------------------------------------------------------------

Ping R2, R3, R4, and R5 from R1.


[R1]ping -c 1 10.0.10.2
PING 10.0.10.2: 56 data bytes, press CTRL_C to break

e n
Reply from 10.0.10.2: bytes=56 Sequence=1 ttl=255 time=3 ms
/
o m
i.c
--- 10.0.10.2 ping statistics ---
1 packet(s) transmitted
1 packet(s) received
w e
0.00% packet loss
u a
round-trip min/avg/max = 3/3/3 ms

g .h
[R1]ping -c 1 10.0.10.3
ni n
r
lea
PING 10.0.10.3: 56 data bytes, press CTRL_C to break
Request time out

: //
--- 10.0.10.3 ping statistics ---

t t p
:h
1 packet(s) transmitted

s
0 packet(s) received
100.00% packet loss

r c e
[R1]ping -c 1 10.0.10.4

sou
Request time out
Re
PING 10.0.10.4: 56 data bytes, press CTRL_C to break

i n g
n
--- 10.0.10.4 ping statistics ---

ar
1 packet(s) transmitted

e
L
0 packet(s) received

e
100.00% packet loss

or
M
[R1]ping -c 1 10.0.10.5
PING 10.0.10.5: 56 data bytes, press CTRL_C to break
Reply from 10.0.10.5: bytes=56 Sequence=1 ttl=255 time=3 ms

--- 10.0.10.5 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms

HC Series HUAWEI TECHNOLOGIES 435


HCNP-IERS Chapter 6 VLAN Features and Configurations

Ping R2, R4, and R5 from R3.


[R3]ping -c 1 10.0.10.2
PING 10.0.10.2: 56 data bytes, press CTRL_C to break
Request time out

--- 10.0.10.2 ping statistics ---

e n
/
1 packet(s) transmitted

m
0 packet(s) received
100.00% packet loss
o
[R3]ping -c 1 10.0.10.4
e i.c
PING 10.0.10.4: 56 data bytes, press CTRL_C to break
aw
u
.h
Request time out

--- 10.0.10.4 ping statistics ---


i n g
1 packet(s) transmitted
r n
lea
0 packet(s) received

//
100.00% packet loss

p :
[R3]ping -c 1 10.0.10.5
t t
:h
PING 10.0.10.5: 56 data bytes, press CTRL_C to break

e s
Reply from 10.0.10.5: bytes=56 Sequence=1 ttl=255 time=3 ms

r c
ou
--- 10.0.10.5 ping statistics ---
1 packet(s) transmitted

es
R
1 packet(s) received

g
0.00% packet loss

i n
round-trip min/avg/max = 3/3/3 ms

n
e ar
L
The ping command output shows that R1 and R2 in VLAN 10 of MUX VLAN can
e with R5, and also access each other. R3 and R4 in VLAN 20 can only
o r
communicate
communicate with R5.
M
----End

Additional Exercises: Analysis and Verification

Can the users belonging to different MUX VLANs communicate with each other?

HC Series HUAWEI TECHNOLOGIES 436


HCNP-IERS Chapter 6 VLAN Features and Configurations

Device Configurations
[S1]display current-configuration
!Software Version V200R008C00SPC500
#
sysname S1
#
vlan batch 10 20 100
#

e n
diffserv domain default
/
#

o m
i.c
drop-profile default

e
#

w
vlan 100
mux-vlan
u a
.h
subordinate separate 20
subordinate group 10
#
i n g
aaa
r n
lea
authentication-scheme default
authorization-scheme default
: //
accounting-scheme default

t t p
:h
domain default
domain default_admin
local-user admin password
e s
r c
irreversible-cipher %^%#tK;J&jw0HG8<9-"zX!kHwzXRNjuXn96[vN47F$*L~pXcROEP3!>c)NV+:`i;%^%#

ou
local-user admin service-type http
#
es
interface Vlanif1
R
#
interface MEth0/0/1
i n g
n
ar
#

e
interface GigabitEthernet0/0/1

L
e
port link-type access

or
port default vlan 10
port mux-vlan enable vlan 10

M
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
port mux-vlan enable vlan 10
#
interface GigabitEthernet0/0/3
port link-type access

HC Series HUAWEI TECHNOLOGIES 437


HCNP-IERS Chapter 6 VLAN Features and Configurations

port default vlan 20


port mux-vlan enable vlan 20
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
e n
interface GigabitEthernet0/0/7
/
#
o m
i.c
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
w e
#
u a
interface GigabitEthernet0/0/10

g .h
n
#
interface GigabitEthernet0/0/11
ni
r
lea
#
interface GigabitEthernet0/0/12
#
: //
interface GigabitEthernet0/0/13

t t p
:h
#

s
interface GigabitEthernet0/0/14
#

r c e
ou
interface GigabitEthernet0/0/15
#

es
interface GigabitEthernet0/0/16
#
R
n g
interface GigabitEthernet0/0/17

i
#
n
ar
interface GigabitEthernet0/0/18

e
L
#

e
interface GigabitEthernet0/0/19
#
or
M
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24

HC Series HUAWEI TECHNOLOGIES 438


HCNP-IERS Chapter 6 VLAN Features and Configurations

#
interface GigabitEthernet0/0/25
#
interface GigabitEthernet0/0/26
#
interface GigabitEthernet0/0/27
#
interface GigabitEthernet0/0/28
#
e n
interface XGigabitEthernet0/0/1
/
#
o m
i.c
interface XGigabitEthernet0/0/2
#
interface XGigabitEthernet0/0/3
w e
#
u a
interface XGigabitEthernet0/0/4

g .h
n
#
interface NULL0
ni
r
lea
#
user-interface con 0
authentication-mode password
: //
set authentication password cipher

t t p
:h
$1a$fcjGHMtb0U$^GKZ+`,g@DfG$:T/P,R~iJ&')|!O":$b4)0*~&c-$

s
idle-timeout 0 0
user-interface vty 0 4

r c e
ou
user-interface vty 16 20
#
return
es
R
n g
[S2]display current-configuration

i
n
!Software Version V200R008C00SPC500
#

e ar
L
sysname S2
#
e
or
vlan batch 10 20 100

M
#
diffserv domain default
#
drop-profile default
#
vlan 100
mux-vlan
subordinate separate 20
subordinate group 10

HC Series HUAWEI TECHNOLOGIES 439


HCNP-IERS Chapter 6 VLAN Features and Configurations

#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password
irreversible-cipher %^%#gI/bO8qF$HkpAPUgNd'GiYR4TC!>EK#oG("Wl4_#$G*OKo-'7*R[h3+49<Z2%^%#
e n
local-user admin service-type http
/
#
o m
i.c
interface Vlanif1
#
interface MEth0/0/1
w e
#
u a
interface GigabitEthernet0/0/1

g .h
n
#
interface GigabitEthernet0/0/2
ni
r
lea
#
interface GigabitEthernet0/0/3
#
: //
interface GigabitEthernet0/0/4

t t p
:h
port link-type access

s
port default vlan 20
port mux-vlan enable vlan 20

r c e
ou
#
interface GigabitEthernet0/0/5
port link-type access
es
port default vlan 100
R
n g
port mux-vlan enable vlan 100

i
#
n
ar
interface GigabitEthernet0/0/6

e
L
#

e
interface GigabitEthernet0/0/7
#
or
M
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12

HC Series HUAWEI TECHNOLOGIES 440


HCNP-IERS Chapter 6 VLAN Features and Configurations

#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
e n
interface GigabitEthernet0/0/17
/
#
o m
i.c
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
w e
#
u a
interface GigabitEthernet0/0/20

g .h
n
#
interface GigabitEthernet0/0/21
ni
r
lea
#
interface GigabitEthernet0/0/22
#
: //
interface GigabitEthernet0/0/23

t t p
:h
#

s
interface GigabitEthernet0/0/24
#

r c e
ou
interface GigabitEthernet0/0/25
#

es
interface GigabitEthernet0/0/26
#
R
n g
interface GigabitEthernet0/0/27

i
#
n
ar
interface GigabitEthernet0/0/28

e
L
#

e
interface XGigabitEthernet0/0/1
#
or
M
interface XGigabitEthernet0/0/2
#
interface XGigabitEthernet0/0/3
#
interface XGigabitEthernet0/0/4
#
interface NULL0
#
user-interface con 0

HC Series HUAWEI TECHNOLOGIES 441


HCNP-IERS Chapter 6 VLAN Features and Configurations

authentication-mode password
set authentication password cipher
$1a$5"l`L7$/5T$,KFQ9dEy~'IggWOa7V(C+9fQOd*M;U6q,.Sl1y'H$
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#

Lab 6-3 Inter-VLAN Communication


e n
/
o m
i.c
Learning Objectives

The objectives of this lab are to learn and understand:


w e
a
How to configure multi-armed route (connect switchesuto independent

. h
physical interfaces of a router)
i n g
How to configure router-on-a-stick (connectn

belonging to the same physical interface a


r switches to subinterfaces

/ l e on a router)

: /communication
tp
 Method of implementing inter-VLAN

h
How to configure VLAN aggregationt
s :
r c e
o u
e s
R
i n g
a rn
e Le
o r
M

HC Series HUAWEI TECHNOLOGIES 442


HCNP-IERS Chapter 6 VLAN Features and Configurations

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
//lea
p :
t t
:h
Figure 7-3 Inter-VLAN communication

e s
Scenario
r c
o u of a company. The company's network is an
sand one router. In the preceding figure, R1 and R2
You are a network administrator
e
Ethernet with two switches
R departments, and are added to two VLANs respectively. R1
i n g
represent PCs of different

ris,nthe switches are connected to different physical interfaces of the


and R2 need to communicate with each other. The company used the multi-armed
a
econserve interfaces, the company decided to use the router-on-a-stick
method. That
L
e
router. To
r
o
method.
MThen, 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.

HC Series HUAWEI TECHNOLOGIES 443


HCNP-IERS Chapter 6 VLAN Features and Configurations

Tasks

Step 1 Set basic parameters and configure IP addresses.

Configure IP addresses and masks for all devices.


<huawei>system-view
Enter system view, return user view with Ctrl+Z.
[huawei]sysname R1
e n
[R1]interface GigabitEthernet 0/0/1
/
[R1-GigabitEthernet0/0/1]ip address 10.0.2.2 24
o m
i.c
[R1-GigabitEthernet0/0/1]quit

<huawei>system-view
w e
Enter system view, return user view with Ctrl+Z.
u a
[huawei]sysname R2

g .h
n
[R2]interface GigabitEthernet 0/0/2
[R2-GigabitEthernet0/0/2]ip address 10.0.3.2 24
ni
r
lea
[R2-GigabitEthernet0/0/2]quit

<Huawei>system-view
: //
t
Enter system view, return user view with Ctrl+Z.
t p
:h
[Huawei]sysname S1

e s
c
<Huawei>system-view

r
ou
Enter system view, return user view with Ctrl+Z.

s
[Huawei]sysname S2

<huawei>system-view
Re
n g
Enter system view, return user view with Ctrl+Z.
i
n
[huawei]sysname R4

ar
[R4]interface GigabitEthernet 0/0/1

e
e L
[R4-GigabitEthernet0/0/1]ip address 10.0.2.1 24
[R4-GigabitEthernet0/0/1]quit

or
[R4]interface Ethernet2/0/0

M
[R4-Ethernet2/0/0]ip address 10.0.3.1 24
[R4-Ethernet2/0/0]quit

Ping R4's G0/0/1 from R1's G0/0/1.


[R1]ping -c 1 10.0.2.1
PING 10.0.2.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.1: bytes=56 Sequence=1 ttl=255 time=4 ms

HC Series HUAWEI TECHNOLOGIES 444


HCNP-IERS Chapter 6 VLAN Features and Configurations

--- 10.0.2.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 4/4/4 ms

Ping R4 from R2.


e n
/
m
[R2]ping -c 1 10.0.3.1
PING 10.0.3.1: 56 data bytes, press CTRL_C to break
o
Reply from 10.0.3.1: bytes=56 Sequence=1 ttl=255 time=3 ms

e i.c
--- 10.0.3.1 ping statistics ---
aw
u
.h
1 packet(s) transmitted

g
1 packet(s) received
0.00% packet loss

ni n
r
round-trip min/avg/max = 3/3/3 ms

//lea
Step 2 Configure multi-armed route.
p :
t t
:h
R1 and R2 belong to different VLANs.

e s
rc
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 u
G0/0/2.
s ointerfaces to implement inter-VLAN communication.
e
R4 provides multiple physical
R
i n g
This is multi-armed route.

Create VLAN 2n
a r and VLAN 3 on S1 and S2.

L e
[S1]vlan batch 2 3

e
or
Info: This operation may take a few seconds. Please wait for a moment...done.

M[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]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]port link-type access
[S1-GigabitEthernet0/0/1]port default vlan 2

HC Series HUAWEI TECHNOLOGIES 445


HCNP-IERS Chapter 6 VLAN Features and Configurations

[S1-GigabitEthernet0/0/1]quit
[S1]interface GigabitEthernet 0/0/4
[S1-GigabitEthernet0/0/4]port link-type access
[S1-GigabitEthernet0/0/4]port default vlan 2
[S1-GigabitEthernet0/0/4]quit

[S2]interface GigabitEthernet 0/0/2


[S2-GigabitEthernet0/0/2]port link-type access
[S2-GigabitEthernet0/0/2]port default vlan 3
e n
[S2-GigabitEthernet0/0/2]
/
[S2]interface GigabitEthernet 0/0/2
o m
i.c
[S2-GigabitEthernet0/0/4]port link-type access
[S2-GigabitEthernet0/0/4]port default vlan 3
[S2-GigabitEthernet0/0/4]quit
w e
u a
. h
g
Configure the gateway addresses on R1 and R2. The gateway addresses are the R4
interface addresses belonging to their respective VLANs. in
r n
[R1]ip route-static 0.0.0.0 0 10.0.2.1
l e a
: //
tp
[R2]ip route-static 0.0.0.0 0 10.0.3.1

t
hconfigurations.
s :
r c e
Run the display vlan command to check

u
[S1]display vlan 2

s o
----------------------------------------------------------------------------
U: Up; D: Down;
MP: Vlan-mapping; Re TG: Tagged;
ST: Vlan-stacking;
UT: Untagged;

i n g
#: ProtocolTransparent-vlan; *: Management-vlan;

rn
----------------------------------------------------------------------------
VID Type

e a Ports

L
----------------------------------------------------------------------------

e
r
2 common UT:GE0/0/1(U) GE0/0/4(U)

o
VID Status Property MAC-LRN Statistics Description

M----------------------------------------------------------------------------
2 enable default enable disable VLAN 0002

[S2]display vlan 3
----------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
----------------------------------------------------------------------------

HC Series HUAWEI TECHNOLOGIES 446


HCNP-IERS Chapter 6 VLAN Features and Configurations

VID Type Ports


----------------------------------------------------------------------------
3 common UT:GE0/0/2(U) GE0/0/4(U)
VID Status Property MAC-LRN Statistics Description
----------------------------------------------------------------------------
3 enable default enable disable VLAN 0003

Test the connectivity between R1 and R2.


e n
/
m
[R1]ping -c 1 10.0.3.2
PING 10.0.3.2: 56 data bytes, press CTRL_C to break
o
Reply from 10.0.3.2: bytes=56 Sequence=1 ttl=254 time=3 ms

e i.c
--- 10.0.3.2 ping statistics ---
aw
u
.h
1 packet(s) transmitted

g
1 packet(s) received
0.00% packet loss

ni n
r
round-trip min/avg/max = 3/3/3 ms

[R2]ping -c 1 10.0.2.2
//lea
PING 10.0.2.2: 56
p
data bytes, press CTRL_C to break
:
t t
Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=254 time=3 ms

s :h
e
--- 10.0.2.2 ping statistics ---
1 packet(s) transmitted
r c
ou
1 packet(s) received
0.00% packet loss

es
R
round-trip min/avg/max = 3/3/3 ms

i n g
Step 3 Configure
rn router-on-a-stick.
e atwo subinterfaces belonging to the same physical interface to
L inter-VLAN communication.
R4 provides
e
r
implement
o
MThis is router-on-a-stick.
Shut down S2's G0/0/4.
[S2]interface GigabitEthernet 0/0/4
[S2-GigabitEthernet0/0/4]shutdown
[S2-GigabitEthernet0/0/4]quit

HC Series HUAWEI TECHNOLOGIES 447


HCNP-IERS Chapter 6 VLAN Features and Configurations

Add G0/0/9 of S1 and S2 to VLAN 3.


[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]port link-type access
[S2-GigabitEthernet0/0/9]port default vlan 3
[S2-GigabitEthernet0/0/9]quit

[S1]interface GigabitEthernet 0/0/9


[S1-GigabitEthernet0/0/9]port link-type access

e n
[S1-GigabitEthernet0/0/9]port default vlan 3
/
[S1-GigabitEthernet0/0/9]quit

o m
Change the access type of S1's G0/0/4 to Trunk, allowing VLAN 2 and VLAN 3. e i.c
aw
[S1]interface GigabitEthernet 0/0/4
u
[S1-GigabitEthernet0/0/4]port default vlan 1

g .h
[S1-GigabitEthernet0/0/4]port link-type trunk

ni n
r
[S1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3

lea
[S1-GigabitEthernet0/0/4]quit

: / /
t
Create two subinterfaces on R4's G0/0/1. Assign
t p IP addresses to subinterfaces and
encapsulate VID.
: h
e s
c
[R4]inter GigabitEthernet 0/0/1.2

u r
[R4-GigabitEthernet0/0/1.2]dot1q termination vid 2

o
[R4-GigabitEthernet0/0/1.2]arp broadcast enable
s
Re
[R4-GigabitEthernet0/0/1.2]ip address 10.0.20.1 24
[R4-GigabitEthernet0/0/1.2]quit

n g
[R4]interface GigabitEthernet 0/0/1.3

i
rn
[R4-GigabitEthernet0/0/1.3]dot1q termination vid 3

a
[R4-GigabitEthernet0/0/1.3]arp broadcast enable

e
L
[R4-GigabitEthernet0/0/1.3]ip address 10.0.30.1 24

e
[R4-GigabitEthernet0/0/1.3]quit

r
o
MRun the display ip interface brief command to check subinterface information on
R4.
[R4]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing

HC Series HUAWEI TECHNOLOGIES 448


HCNP-IERS Chapter 6 VLAN Features and Configurations

(E): E-Trunk down


The number of interface that is UP in Physical is 7
The number of interface that is DOWN in Physical is 6
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 8

Interface IP Address/Mask Physical Protocol


Cellular0/0/0 unassigned down down
Cellular0/0/1 unassigned down down
e n
Ethernet2/0/0 10.0.3.1/24 down down
/
Ethernet2/0/1 unassigned down down
o m
i.c
GigabitEthernet0/0/0 unassigned up down
GigabitEthernet0/0/1
GigabitEthernet0/0/1.2
10.0.2.1/24
10.0.20.1/24
up
up
up
up
w e
GigabitEthernet0/0/1.3 10.0.30.1/24 up up
u a
GigabitEthernet0/0/2 unassigned down down

g .h
n
GigabitEthernet0/0/3 unassigned up down
NULL0 unassigned up
ni
up(s)

r
lea
Serial1/0/0 unassigned up up
Serial1/0/1 unassigned down down

: //
t t p
Change the IP addresses and gateway addresses of R1 and R2.

s :h
e
[R1]interface GigabitEthernet 0/0/1

r c
[R1-GigabitEthernet0/0/1]ip address 10.0.20.2 24

ou
[R1-GigabitEthernet0/0/1]quit

s
[R1]undo ip route-static 0.0.0.0 0 10.0.2.1

e
R
[R1]ip route-static 0.0.0.0 0 10.0.20.1

i n g
[R2]interface GigabitEthernet 0/0/2

n
ar
[R2-GigabitEthernet0/0/2]ip address 10.0.30.2 24

e
[R2-GigabitEthernet0/0/2]quit

L
[R2]undo ip route-static 0.0.0.0 0 10.0.3.1

e
or
[R2]ip route-static 0.0.0.0 0 10.0.30.1

MTest the connectivity between R1 and R2.


[R1]ping -c 1 10.0.30.2
PING 10.0.30.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.30.2: bytes=56 Sequence=1 ttl=254 time=3 ms

--- 10.0.30.2 ping statistics ---


1 packet(s) transmitted

HC Series HUAWEI TECHNOLOGIES 449


HCNP-IERS Chapter 6 VLAN Features and Configurations

1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms

The ping command output shows that the computers in VLAN 2 and VLAN 3
successfully communicate with each other.

Compared with multi-armed route, this method reduces investment on routers.


e n
/
However, in the router-on-a-stick method, all data is transmitted through the same
o m
i .
interface. When the number of VLANs increases, the load on a single link increases. c
This link potentially causes a single-point failure.
w e
a
Step 4 Configure Layer 3 switching.
. hu
In Layer 3 switching, each VLAN has a VLANIF interface, which
i n g functions as a router
to allow inter-VLAN communication. r n
l e a
Shut down S1's G0/0/4.
: //
[S1]interface GigabitEthernet 0/0/4
t tp
[S1-GigabitEthernet0/0/4]shutdown
: h
[S1-GigabitEthernet0/0/4]quit
e s
r c
o
Change the access types of S1's u G0/0/9 and S2's G0/0/9 to Trunk, allowing VLAN 2
e s
and VLAN 3.
R
n g
[S1]interface GigabitEthernet 0/0/9
i
rn
[S1-GigabitEthernet0/0/9]port default vlan 1

a
[S1-GigabitEthernet0/0/9]port link-type trunk

e
e L
[S1-GigabitEthernet0/0/9]port trunk allow-pass vlan 2 3
[S1-GigabitEthernet0/0/9]quit

o r
M[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]port default vlan 1
[S2-GigabitEthernet0/0/9]port link-type trunk
[S2-GigabitEthernet0/0/9]port trunk allow-pass vlan 2 3
[S2-GigabitEthernet0/0/9]quit

Create VLANIF2 and VLANIF3 on S1 and assign IP addresses to them.

HC Series HUAWEI TECHNOLOGIES 450


HCNP-IERS Chapter 6 VLAN Features and Configurations

[S1]interface Vlanif 2
[S1-Vlanif2]ip address 10.0.20.1 24
[S1-Vlanif2]quit
[S1]inter Vlanif 3
[S1-Vlanif3]ip address 10.0.30.1 24
[S1-Vlanif3]quit

Test the connectivity between R1 and R2.


e n
/
m
[R1]ping -c 1 10.0.30.2
PING 10.0.30.2: 56 data bytes, press CTRL_C to break
o
Reply from 10.0.30.2: bytes=56 Sequence=1 ttl=254 time=2 ms

e i.c
--- 10.0.30.2 ping statistics ---
aw
u
.h
1 packet(s) transmitted

g
1 packet(s) received
0.00% packet loss

ni n
r
round-trip min/avg/max = 2/2/2 ms

//lea
p :
The ping command output shows that the computers on VLAN 2 and VLAN 3
t t
:h
implement Layer 3 communication through two VLANIF interfaces of S1.

e s
Compared with the router-on-a-stick method, Layer 3 switching is more extensible.
c
The increasing number of VLANsr has little impact on services.
o u
On a network where most e straffic is inter-VLAN traffic, the network can fully support
R
the services.
i n g
r
Step 5 Configuren VLAN aggregation.
e a
e L
Similar to Layer 3 switching, VLAN aggregation can implement inter-VLAN

o r
communication. Different from Layer 3 switching, VLAN aggregation places all

MVLANs in the same network segment, reducing the number of required IP network
segments and implementing unified gateway configuration.

Create VLAN 10, 20, and 100 on S1 and S2.


[S1]vlan batch 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.

[S2]vlan batch 10 20 100

HC Series HUAWEI TECHNOLOGIES 451


HCNP-IERS Chapter 6 VLAN Features and Configurations

Info: This operation may take a few seconds. Please wait for a moment...done.

Allow VLAN 10 and VLAN 20 on G0/0/9 of S1 and S2.


[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]port trunk allow-pass vlan 10 20
[S1-GigabitEthernet0/0/9]quit

e n
/
[S2]interface GigabitEthernet 0/0/9

m
[S2-GigabitEthernet0/0/9]port trunk allow-pass vlan 10 20
[S2-GigabitEthernet0/0/9]quit
o
e i.c
Add S1's G0/0/1 and S2's G0/0/2 to VLAN 10 and VLAN 20 respectively.
aw
u
.h
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]port default vlan 10
[S1-GigabitEthernet0/0/1]quit
i n g
r n
lea
[S2]interface GigabitEthernet 0/0/2
[S2-GigabitEthernet0/0/1]port default vlan 20
: //
[S2-GigabitEthernet0/0/1]quit

t t p
s:h
as sub VLANs. r c e
Configure VLAN 100 as a super VLAN, and add VLAN 10 and VLAN 20 to VLAN 100

[S1]vlan 100
s ou
[S1-vlan100]aggregate-vlan
Re
[S1-Vlan100]quit
i n g
[S1-vlan100]access-vlan 10 20

n
e ar
L
Configure a VLANIF interface for VLAN 100 and enable ARP proxy.
e
or
[S1]interface Vlanif 100

M
[S1-Vlanif100]ip address 10.0.100.1 24
[S1-Vlanif100]arp-proxy inter-sub-vlan-proxy enable
[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]interface GigabitEthernet 0/0/1

HC Series HUAWEI TECHNOLOGIES 452


HCNP-IERS Chapter 6 VLAN Features and Configurations

[R1-GigabitEthernet0/0/1]ip address 10.0.100.2 24


[R1-GigabitEthernet0/0/1]quit
[R1]undo ip route-static 0.0.0.0 0 10.0.20.1
[R1]ip route-static 0.0.0.0 0 10.0.100.1

[R2]interface GigabitEthernet 0/0/2


[R2-GigabitEthernet0/0/2]ip address 10.0.100.3 24
[R2-GigabitEthernet0/0/2]quit
[R2]undo ip route-static 0.0.0.0 0 10.0.30.1
e n
[R2]ip route-static 0.0.0.0 0 10.0.100.1
/
o m
Test the connectivity between R1 and R2 and S1's VLANIF 100.
e i.c
[R1]ping -c 1 10.0.100.1
aw
u
.h
PING 10.0.100.1: 56 data bytes, press CTRL_C to break

g
Reply from 10.0.100.1: bytes=56 Sequence=1 ttl=254 time=3 ms

ni n
r
--- 10.0.100.1 ping statistics ---

lea
1 packet(s) transmitted

//
1 packet(s) received
0.00% packet loss
p :
round-trip min/avg/max = 3/3/3 ms
t t
s :h
e
[R1]ping -c 1 10.0.100.3
PING 10.0.100.3: 56
r c
data bytes, press CTRL_C to break

ou
Reply from 10.0.100.3: bytes=56 Sequence=1 ttl=254 time=2 ms

es
R
--- 10.0.100.3 ping statistics ---

g
1 packet(s) transmitted

i n
1 packet(s) received

n
ar
0.00% packet loss

e
round-trip min/avg/max = 2/2/2 ms

e L
or
[R2]pin -c 1 10.0.100.1
PING 10.0.100.1: 56 data bytes, press CTRL_C to break

M Reply from 10.0.100.1: bytes=56 Sequence=1 ttl=254 time=3 ms

--- 10.0.100.1 ping statistics ---


1 packet(s) transmitted
1 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/3 ms

HC Series HUAWEI TECHNOLOGIES 453


HCNP-IERS Chapter 6 VLAN Features and Configurations

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.

e n
----End
/
o m
Additional Exercises: Analysis and Verification
e i.c
aw of
What are the characteristics, advantages, disadvantages, and usage scenarios
multi-armed route, router-on-a-stick, inter-VLAN communication,u
. h and VLAN
aggregation?
i n g
r n
Device Configurations
l e a
[S1]display current-configuration
: //
!Software Version V200R008C00SPC500

t tp
#

: h
s
sysname S1
#

r c e
u
vlan batch 2 to 3 10 20 100
#

s o
diffserv domain default
#
Re
n
drop-profile default

i g
rn
#
vlan 100

e a
L
aggregate-vlan

e
access-vlan 10 20

r
#
o
M
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password
irreversible-cipher %^%#tK;J&jw0HG8<9-"zX!kHwzXRNjuXn96[vN47F$*L~pXcROEP3!>c)NV+:`i;%^%#
local-user admin service-type http

HC Series HUAWEI TECHNOLOGIES 454


HCNP-IERS Chapter 6 VLAN Features and Configurations

#
interface Vlanif1
#
interface Vlanif2
ip address 10.0.20.1 255.255.255.0
#
interface Vlanif3
ip address 10.0.30.1 255.255.255.0
#
e n
interface Vlanif100
/
ip address 10.0.100.1 255.255.255.0
o m
i.c
arp-proxy inter-sub-vlan-proxy enable
#
interface MEth0/0/1
w e
#
u a
interface GigabitEthernet0/0/1

g .h
n
port link-type access
port default vlan 10
ni
r
lea
#
interface GigabitEthernet0/0/2
#
: //
interface GigabitEthernet0/0/3

t t p
:h
#

s
interface GigabitEthernet0/0/4
shutdown

r c e
ou
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
es
R
interface GigabitEthernet0/0/5
#

i n g
n
interface GigabitEthernet0/0/6
#

e ar
L
interface GigabitEthernet0/0/7
#
e
or
interface GigabitEthernet0/0/8

M
#
interface GigabitEthernet0/0/9
port link-type trunk
port trunk allow-pass vlan 2 to 3 10 20
#
interface GigabitEthernet0/0/10
#
interface NULL0
#

HC Series HUAWEI TECHNOLOGIES 455


HCNP-IERS Chapter 6 VLAN Features and Configurations

user-interface con 0
authentication-mode password
set authentication password cipher
$1a$fcjGHMtb0U$^GKZ+`,g@DfG$:T/P,R~iJ&')|!O":$b4)0*~&c-$
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
return
e n
/
[S2]display current-configuration
o m
i.c
!Software Version V200R008C00SPC500
#
sysname S2
w e
#
u a
vlan batch 2 to 3 10 20 100

g .h
n
#
diffserv domain default
ni
r
lea
#
drop-profile default
#
: //
aaa

t t p
:h
authentication-scheme default

s
authorization-scheme default
accounting-scheme default

r c e
ou
domain default
domain default_admin
local-user admin password
es
R
irreversible-cipher %^%#gI/bO8qF$HkpAPUgNd'GiYR4TC!>EK#oG("Wl4_#$G*OKo-'7*R[h3+49<Z2%^%#

n g
local-user admin service-type http

i
#
n
ar
interface Vlanif1

e
L
#

e
interface MEth0/0/1
#
or
M
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4

HC Series HUAWEI TECHNOLOGIES 456


HCNP-IERS Chapter 6 VLAN Features and Configurations

shutdown
port link-type access
port default vlan 3
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
e n
#
/
interface GigabitEthernet0/0/8
o m
i.c
#
interface GigabitEthernet0/0/9
port link-type trunk
w e
port trunk allow-pass vlan 2 to 3 10 20
u a
#

g .h
n
interface GigabitEthernet0/0/10
#
ni
r
lea
user-interface con 0
authentication-mode password
set authentication password cipher
: //
t p
$1a$5"l`L7$/5T$,KFQ9dEy~'IggWOa7V(C+9fQOd*M;U6q,.Sl1y'H$

t
:h
idle-timeout 0 0

s
user-interface vty 0 4
user-interface vty 16 20

r c e
ou
#
return

es
R
[R4]display current-configuration
[V200R007C00SPC600]

i n g
#
n
sysname R4

e ar
L
#

e
board add 0/1 2SA

or
board add 0/2 2FE

M
#
drop illegal-mac alarm
#
pki realm default
enrollment self-signed
#
ssl policy default_policy type server
pki-realm default
#

HC Series HUAWEI TECHNOLOGIES 457


HCNP-IERS Chapter 6 VLAN Features and Configurations

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password
irreversible-cipher %^%#`S|f)zA5xQeP^7UA/d/LH:}m3<KxR6fH,g5a%d)'zc,T/&qu:XPCg7))ihy5%^%#
local-user admin privilege level 15
e n
local-user admin service-type terminal http
/
#
o m
i.c
firewall zone Local
priority 64
#
w e
interface Ethernet2/0/0
u a
ip address 10.0.3.1 255.255.255.0

g .h
n
#
interface Ethernet2/0/1
ni
r
lea
#
interface Serial1/0/0
link-protocol ppp
: //
#

t t p
:h
interface Serial1/0/1

s
link-protocol ppp
#

r c e
ou
interface GigabitEthernet0/0/0
#

e
interface GigabitEthernet0/0/1s
R
ip address 10.0.2.1 255.255.255.0
#

i n g
n
interface GigabitEthernet0/0/1.2

ar
dot1q termination vid 2

e
L
ip address 10.0.20.1 255.255.255.0
#
e
or
interface GigabitEthernet0/0/1.3

M
dot1q termination vid 3
ip address 10.0.30.1 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
description VirtualPort
#
interface Cellular0/0/0

HC Series HUAWEI TECHNOLOGIES 458


HCNP-IERS Chapter 6 VLAN Features and Configurations

#
interface Cellular0/0/1
#
interface NULL0
#
snmp-agent local-engineid 800007DB03D0D04B03D43B
#
http secure-server ssl-policy default_policy
http server enable
e n
http secure-server enable
/
#
o m
i.c
user-interface con 0
authentication-mode aaa
idle-timeout 0 0
w e
user-interface vty 0
u a
authentication-mode aaa

g .h
n
user privilege level 15
user-interface vty 1 4
ni
r
lea
#
wlan ac
#
: //
voice

t t p
:h
#

s
diagnose
#

r c e
ou
ops
#
autostart
es
#
R
return

i n g
n
e ar
e L
or
M

HC Series HUAWEI TECHNOLOGIES 459


HCNP-IERS Chapter 7 STP Configurations

Chapter 7 STP Configurations

Lab 7-1 STP, RSTP, and MSTP

Learning Objectives

The objectives of this lab are to learn and understand:


e n
/
Differences between STP, RSTP, and MSTP
m
How to change the bridge priority to control root bridge electionco

e i .

aw
How to change the port priority to control election of the root port and
designated port
hu

g .
How to configure RSTP and compatibility between STP and RSTP

How to configure MSTP to implement VLAN n i n


ar load balancing

l e
Topology
: //
t tp
: h
e s
r c
o u
e s
R
i n g
a rn
L e
r e
o
M

Figure 8-1 STP, RSTP, and MSTP topology

HC Series HUAWEI TECHNOLOGIES 460


HCNP-IERS Chapter 7 STP Configurations

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.

e n
Tasks /
o m
i.c
Step 1 Configure STP and verify the STP configuration.

If STP is not enabled, enable it.


w e
u a
.h
[S1]stp enable

[S2]stp enable
i n g
r n
lea
[S3]stp enable

: //
p
[S4]stp enable

t t
Configure STP.
s :h
[S1]stp mode stp
r c e
s ou
[S2]stp mode stp

Re
[S3]stp mode stp

i n g
n
ar
[S4]stp mode stp

L e
e
or
Check STP status.

M
[S1]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :32768.4c1f-cc45-aadc
Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.4c1f-cc45-aac1 / 20000
CIST RegRoot/IRPC :32768.4c1f-cc45-aadc / 0
CIST RootPortId :128.9
BPDU-Protection :Disabled

HC Series HUAWEI TECHNOLOGIES 461


HCNP-IERS Chapter 7 STP Configurations

TC or TCN received :36


TC count per hello :2
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:0m:1s
…output omit…

[S2]display stp
-------[CIST Global Info][Mode STP]-------
e n
CIST Bridge :32768.4c1f-cc45-aac1
/
Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
o m
i.c
CIST Root/ERPC :32768.4c1f-cc45-aac1 / 0
CIST RegRoot/IRPC
CIST RootPortId
:32768.4c1f-cc45-aac1 / 0
:0.0
w e
BPDU-Protection :Disabled
u a
TC or TCN received :20

g .h
n
TC count per hello :0
STP Converge Mode :Normal
ni
r
lea
Share region-configuration :Enabled
Time since last TC :0 days 0h:1m:4s
…output omit…
: //
t t p
:h
[S1]display stp brief

es
MSTID Port Role STP State Protection

c
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE

r
ou
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE
0 GigabitEthernet0/0/13 DESI FORWARDING NONE
0 GigabitEthernet0/0/14
es DESI FORWARDING NONE

R
[S2]display stp brief

i n g
MSTID Port
n Role STP State Protection
0
ar
GigabitEthernet0/0/9 DESI FORWARDING NONE

Le
0 GigabitEthernet0/0/10 DESI FORWARDING NONE

re
0 GigabitEthernet0/0/23 DESI FORWARDING NONE

o0 GigabitEthernet0/0/24 DESI FORWARDING NONE

M
S2 is the root bridge, and all ports are designated ports.

The switch MAC addresses are not fixed, so the actual lab test result may be
different.

Step 2 Control root bridge election.

HC Series HUAWEI TECHNOLOGIES 462


HCNP-IERS Chapter 7 STP Configurations

Configure S1 as the primary root bridge and S2 as the backup root bridge.
[S1]stp root primary

[S2]stp root secondary

Check the STP configuration.


[S1]display stp
e n
-------[CIST Global Info][Mode STP]------- /
CIST Bridge :0 .4c1f-cc45-aadc
o m
i.c
Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .4c1f-cc45-aadc / 0

w e
a
CIST RegRoot/IRPC :0 .4c1f-cc45-aadc / 0
CIST RootPortId :0.0
u
BPDU-Protection :Disabled

g .h
CIST Root Type :Primary root

ni n
r
TC or TCN received :67

lea
TC count per hello :0

//
STP Converge Mode :Normal
Share region-configuration :Enabled
p :
Time since last TC :0 days 0h:0m:15s
t t
:h
…output omit…

e s
[S2]display stp
r c
ou
-------[CIST Global Info][Mode STP]-------
CIST Bridge
s
:4096 .4c1f-cc45-aac1

e
R
Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

g
CIST Root/ERPC :0 .4c1f-cc45-aadc / 20000
CIST RegRoot/IRPC

n i n
:4096 .4c1f-cc45-aac1 / 0

ar
CIST RootPortId :128.9
BPDU-Protection :Disabled

L e
CIST Root Type :Secondary root

e
or
TC or TCN received :26
TC count per hello :0

M
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:0m:1s
…output omit…

S1 is the primary root bridge and S2 is the backup root bridge.

HC Series HUAWEI TECHNOLOGIES 463


HCNP-IERS Chapter 7 STP Configurations

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]undo stp root
[S1]stp priority 8192

[S2]undo stp root


[S2]stp priority 4096

e n
/
Check STP information.
o m
[S1]display stp
e i.c
w
-------[CIST Global Info][Mode STP]-------
CIST Bridge :8192 .4c1f-cc45-aadc

u a
.h
Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC
CIST RegRoot/IRPC
:4096 .4c1f-cc45-aac1 / 20000
:8192 .4c1f-cc45-aadc / 0
i n g
CIST RootPortId :128.9
r n
lea
BPDU-Protection :Disabled
TC or TCN received :79

: //
TC count per hello :1
STP Converge Mode :Normal
t t p
Share region-configuration :Enabled

s :h
Time since last TC :0 days 0h:0m:0s
…output omit…
r c e
s ou
e
[S2]display stp

R
-------[CIST Global Info][Mode STP]-------
CIST Bridge
Bridge Times
i n g
:4096 .4c1f-cc45-aac1
:Hello 2s MaxAge 20s FwDly 15s MaxHop 20

n
ar
CIST Root/ERPC :4096 .4c1f-cc45-aac1 / 0

Le
CIST RegRoot/IRPC :4096 .4c1f-cc45-aac1 / 0
CIST RootPortId :0.0

r e
BPDU-Protection :Disabled

o
TC or TCN received :88

M
TC count per hello :0
STP Converge Mode :Normal
Share region-configuration :Enabled
Time since last TC :0 days 0h:0m:9s
…output omit…

The priority of S1 is 8192, the priority of S2 is 4096, and S2 is the root bridge.

HC Series HUAWEI TECHNOLOGIES 464


HCNP-IERS Chapter 7 STP Configurations

Step 3 Control root port election.

Check port roles on S1.


[S1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/10 ALTE DISCARDING NONE
0 GigabitEthernet0/0/13 DESI FORWARDING NONE

e n
0 GigabitEthernet0/0/14 DESI FORWARDING NONE
/
o m
GigabitEthernet0/0/9 of S1 is the root port.
e i.c
The default port priority is 128. A large value indicates a low priority. w
u a
. h
S1 and S2 are connected through G0/0/9 and G0/0/10.

i n g
n
On S2, set the priority of G0/0/9 to 32 and the priority of G0/0/10 to 16.
r
[S2]interface GigabitEthernet 0/0/9
l e a
[S2-GigabitEthernet0/0/9]stp port priority 32
: //
[S2-GigabitEthernet0/0/9]quit

t tp
[S2]interface GigabitEthernet 0/0/10

: h
s
[S2-GigabitEthernet0/0/10]stp port priority 16
[S2-GigabitEthernet0/0/10]quit

r c e
o u
e s changed on S2, not S1.
Note: The port priorities are
R
i n g
Check port roles on S1.

rn
[S1]display stp brief
MSTID

e a
Port Role STP State Protection
0

e L GigabitEthernet0/0/9 ALTE DISCARDING NONE

r
0 GigabitEthernet0/0/10 ROOT DISCARDING NONE

o0 GigabitEthernet0/0/13 DESI FORWARDING NONE

M 0 GigabitEthernet0/0/14 DESI FORWARDING NONE

GigabitEthernet0/0/10 of S1 is the root port.

Step 4 Control designated port election.

Check the status of interfaces directly connected between S3 and S4.

HC Series HUAWEI TECHNOLOGIES 465


HCNP-IERS Chapter 7 STP Configurations

[S3]display stp interface Ethernet 0/0/1


----[CIST][Port1(Ethernet0/0/1)][DISCARDING]----
Port Protocol :Enabled
Port Role :Alternate Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=199999
Designated Bridge/Port :32768.5489-98ec-f00a / 128.1
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
e n
Transit Limit :147 packets/hello-time
/
Protection Type :None
o m
i.c
Port STP Mode :STP
Port Protocol Type
PortTimes
:Config=auto / Active=dot1s
:Hello 2s MaxAge 20s FwDly 15s RemHop 0
w e
TC or TCN send :17
u a
TC or TCN received :52

g .h
n
BPDU Sent :172
TCN: 0, Config: 172, RST: 0, MST: 0
ni
r
lea
BPDU Received :206
TCN: 0, Config: 206, RST: 0, MST: 0

: //
[S4]display stp interface Ethernet 0/0/24

t t p
:h
----[CIST][Port24(Ethernet0/0/24)][DISCARDING]----

s
Port Protocol :Enabled
Port Role :Designated Port

r c e
ou
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=199999
Designated Bridge/Port
es
:32768.5489-98ec-f00a / 128.1
Port Edged
R
:Config=default / Active=disabled
Point-to-point

i n g
:Config=auto / Active=true
Transit Limit
n :147 packets/hello-time

ar
Protection Type :None

Le
Port STP Mode :STP

re
Port Protocol Type :Config=auto / Active=dot1s

o
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 20

M
TC or TCN send
TC or TCN received
:37
:17
BPDU Sent :181
TCN: 0, Config: 181, RST: 0, MST: 0
BPDU Received :172
TCN: 0, Config: 172, RST: 0, MST: 0

HC Series HUAWEI TECHNOLOGIES 466


HCNP-IERS Chapter 7 STP Configurations

S3's Ethernet 0/0/1 is an alternate port. S4's Ethernet 0/0/1 is a designated port.
Change the path cost of S4's E0/0/24 to 2000000.
[S4]interface Ethernet0/0/24 0/0/24
[S4-Ethernet0/0/24]stp cost 2000000
[S4-Ethernet0/0/24]quit

Check current port roles.


e n
/
[S3]display stp interface Ethernet 0/0/1

o m
i.c
----[CIST][Port1(Ethernet0/0/1)][FORWARDING]----
Port Protocol :Enabled
Port Role :Designated Port
w e
Port Priority :128

u a
.h
Port Cost(Dot1T ) :Config=auto / Active=199999
Designated Bridge/Port
Port Edged
:32768.5489-98ec-f022 / 128.1
:Config=default / Active=disabled
i n g
Point-to-point :Config=auto / Active=true
r n
lea
Transit Limit :147 packets/hello-time
Protection Type :None

: //
Port STP Mode
Port Protocol Type
:STP

t t
:Config=auto / Active=dot1s p
PortTimes
:h
:Hello 2s MaxAge 20s FwDly 15s RemHop 20

s
TC or TCN send
TC or TCN received
:52
:52
r c e
ou
BPDU Sent :284

es
TCN: 0, Config: 284, RST: 0, MST: 0
BPDU Received :380
R
i n g
TCN: 0, Config: 380, RST: 0, MST: 0

n
ar
[S4]display stp interface Ethernet 0/0/24

L e
----[CIST][Port24(Ethernet0/0/24)][DISCARDING]----
Port Protocol :Enabled

e
or
Port Role :Alternate Port
Port Priority :128

M
Port Cost(Dot1T )
Designated Bridge/Port
:Config=2000000 / Active=2000000
:4096.4c1f-cc45-aac1 / 128.24
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :147 packets/hello-time
Protection Type :None
Port STP Mode :STP
Port Protocol Type :Config=auto / Active=dot1s

HC Series HUAWEI TECHNOLOGIES 467


HCNP-IERS Chapter 7 STP Configurations

PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0


TC or TCN send :7
TC or TCN received :162
BPDU Sent :8
TCN: 7, Config: 1, RST: 0, MST: 0
BPDU Received :1891
TCN: 0, Config: 1891, RST: 0, MST: 0

e n
S3's Ethernet 0/0/1 is a designated port. S4's Ethernet 0/0/1 is an alternate port.
/
o m
i.c
Step 5 Configure RSTP and verify the RSTP configuration.

w
Configure VLANIF 1 addresses on S1 and S2. Test the connectivity between S1 and e
S2.
u a
[S1]interface Vlanif 1
g .h
[S1-Vlanif1]ip address 10.0.1.1 24

ni n
[S1-Vlanif1]quit
r
//lea
:
[S2]interface Vlanif 1
[S2-Vlanif1]ip address 10.0.1.2 24
[S2-Vlanif1]quit
t t p
s :h
[S1]ping 10.0.1.2

r c e
PING 10.0.1.2: 56 data bytes, press CTRL_C to break

ou
Reply from 10.0.1.2: bytes=56 Sequence=1 ttl=255 time=9 ms

es
Reply from 10.0.1.2: bytes=56 Sequence=2 ttl=254 time=1 ms

R
Reply from 10.0.1.2: bytes=56 Sequence=3 ttl=254 time=1 ms

i n g
Reply from 10.0.1.2: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=5 ttl=254 time=1 ms
n
e ar
--- 10.0.1.2 ping statistics ---

L
5 packet(s) transmitted
e
or
5 packet(s) received
0.00% packet loss

M
round-trip min/avg/max = 1/2/9 ms

Check port roles on S1.


[S1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ALTE DISCARDING NONE
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE

HC Series HUAWEI TECHNOLOGIES 468


HCNP-IERS Chapter 7 STP Configurations

0 GigabitEthernet0/0/13 DESI FORWARDING NONE


0 GigabitEthernet0/0/14 DESI FORWARDING NONE

S1's GigabitEthernet0/0/10 is the root port. Ping S2 from S1 20 times to test


connectivity.

Note: After S1 performs ping, shut down S2's GigabitEthernet 0/0/10 immediately.

e n
[S1]ping -c 20 10.0.1.2
/
PING 10.0.1.2: 56 data bytes, press CTRL_C to break

o m
i.c
Reply from 10.0.1.2: bytes=56 Sequence=1 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=2 ttl=254 time=1 ms

w e
Dec 21 2011 16:20:44-05:13 S1 %%01IFNET/4/IF_STATE(l)[5]:Interface GigabitEthernet0/0/10 has
turned into DOWN state.

u a
.h
Request time out
Request time out
Request time out
i n g
Request time out
r n
lea
Request time out
Request time out

: //
Request time out
Request time out
t t p
Request time out

s :h
Request time out
Request time out
r c e
ou
Request time out
Request time out
es
Request time out
R
Request time out

i n g
Reply from 10.0.1.2: bytes=56 Sequence=18 ttl=255 time=15 ms

n
ar
Reply from 10.0.1.2: bytes=56 Sequence=19 ttl=254 time=1 ms

e
Reply from 10.0.1.2: bytes=56 Sequence=20 ttl=254 time=1 ms

L
e
or
--- 10.0.1.2 ping statistics ---
20 packet(s) transmitted

M 5 packet(s) received
75.00% packet loss
round-trip min/avg/max = 1/3/15 ms

[S2]interface GigabitEthernet 0/0/10


[S2-GigabitEthernet0/0/10]shutdown
[S2-GigabitEthernet0/0/10]quit

HC Series HUAWEI TECHNOLOGIES 469


HCNP-IERS Chapter 7 STP Configurations

Check port roles on S1.


[S1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/13 DESI FORWARDING NONE
0 GigabitEthernet0/0/14 DESI FORWARDING NONE

e n
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 m is
/
. co
30s.
e i
Enable S2's GigabitEthernet 0/0/10.
aw
[S2]interface GigabitEthernet 0/0/10
. hu
[S2-GigabitEthernet0/0/10]undo shutdown
[S2-GigabitEthernet0/0/10]quit
i n g
r n
l e a
Set the STP mode to RSTP.
: //
[S1]stp mode rstp
t tp
: h
[S2]stp mode rstp

e s
r c
[S3]stp mode rstp

o u
[S4]stp mode rstp
e s
R
i n g
rn on S1.
Check port roles

e a
L
[S1]display stp brief

e
or
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ALTE DISCARDING NONE

M 0
0
GigabitEthernet0/0/10
GigabitEthernet0/0/13
ROOT FORWARDING
DESI FORWARDING
NONE
NONE
0 GigabitEthernet0/0/14 DESI FORWARDING NONE

S1's GigabitEthernet0/0/10 is the root port. Ping S2 from S1 20 times to test


connectivity.

HC Series HUAWEI TECHNOLOGIES 470


HCNP-IERS Chapter 7 STP Configurations

Note: After S1 performs ping, shut down S2's GigabitEthernet 0/0/10 immediately.
[S1]ping -c 20 10.0.1.2
PING 10.0.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.2: bytes=56 Sequence=1 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=5 ttl=254 time=1 ms

e n
/
Dec 21 2011 16:37:10-05:13 S1 %%01IFNET/4/IF_STATE(l)[7]:Interface GigabitEthernet0/0/10 has
turned into DOWN state.

o m
i.c
Request time out
Reply from 10.0.1.2: bytes=56 Sequence=7 ttl=255 time=10 ms
Reply from 10.0.1.2: bytes=56 Sequence=8 ttl=254 time=1 ms
w e
Reply from 10.0.1.2: bytes=56 Sequence=9 ttl=254 time=1 ms
u a
.h
Reply from 10.0.1.2: bytes=56 Sequence=10 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=11 ttl=254 time=1 ms

i n g
n
Reply from 10.0.1.2: bytes=56 Sequence=12 ttl=254 time=1 ms

r
lea
Reply from 10.0.1.2: bytes=56 Sequence=13 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=14 ttl=254 time=1 ms

: //
Reply from 10.0.1.2: bytes=56 Sequence=15 ttl=254 time=1 ms

t p
Reply from 10.0.1.2: bytes=56 Sequence=16 ttl=254 time=1 ms

t
:h
Reply from 10.0.1.2: bytes=56 Sequence=17 ttl=254 time=1 ms

s
Reply from 10.0.1.2: bytes=56 Sequence=18 ttl=254 time=1 ms

r c e
Reply from 10.0.1.2: bytes=56 Sequence=19 ttl=254 time=1 ms
Reply from 10.0.1.2: bytes=56 Sequence=20 ttl=254 time=1 ms

s ou
20 packet(s) transmitted
Re
--- 10.0.1.2 ping statistics ---

n g
19 packet(s) received

i
n
5.00% packet loss

ar
round-trip min/avg/max = 1/1/10 ms

L e
e
[S2]interface GigabitEthernet 0/0/10

or
[S2-GigabitEthernet0/0/10]shutdown

M
[S2-GigabitEthernet0/0/10]quit

Check port roles on S1.


[S1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9 ROOT FORWARDING NONE
0 GigabitEthernet0/0/13 DESI FORWARDING NONE
0 GigabitEthernet0/0/14 DESI FORWARDING NONE

HC Series HUAWEI TECHNOLOGIES 471


HCNP-IERS Chapter 7 STP Configurations

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.

Enable S2's GigabitEthernet 0/0/10.


[S2]interface GigabitEthernet 0/0/10

n
[S2-GigabitEthernet0/0/10]undo shutdown
[S2-GigabitEthernet0/0/10]quit
/ e
o m
Step 6 Check compatibility between RSTP and STP.
e i.c
a
Configure STP mode on S1 to STP and retain other configurations unchanged.w
[S1]stp mode stp
. hu
i n g
Check port roles on S1. r n
l e a
//
[S1]display stp brief

:
tp
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/9
t
ALTE DISCARDING

h
NONE

:
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE
0 GigabitEthernet0/0/13
e s
DESI FORWARDING NONE
0 GigabitEthernet0/0/14
r cDESI FORWARDING NONE

o u
e
S1's GigabitEthernet0/0/10 sis the root port. Ping S2 from S1 20 times to test
R
connectivity.
i n g
Note: After S1 n
a r performs ping, shut down S2's GigabitEthernet 0/0/10 immediately.

L e
[S1]ping -c 20 10.0.1.2

e
or
PING 10.0.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.2: bytes=56 Sequence=1 ttl=254 time=1 ms

M Reply from 10.0.1.2: bytes=56 Sequence=2 ttl=254 time=1 ms


Dec 21 2011 16:20:44-05:13 S1 %%01IFNET/4/IF_STATE(l)[5]:Interface GigabitEthernet0/0/10 has
turned into DOWN state.
Request time out
Request time out
Request time out
Request time out
Request time out
Request time out

HC Series HUAWEI TECHNOLOGIES 472


HCNP-IERS Chapter 7 STP Configurations

Request time out


Request time out
Request time out
Request time out
Request time out
Request time out
Request time out
Request time out
Request time out
e n
Reply from 10.0.1.2: bytes=56 Sequence=18 ttl=255 time=15 ms
/
Reply from 10.0.1.2: bytes=56 Sequence=19 ttl=254 time=1 ms
o m
i.c
Reply from 10.0.1.2: bytes=56 Sequence=20 ttl=254 time=1 ms

--- 10.0.1.2 ping statistics ---


w e
20 packet(s) transmitted
u a
5 packet(s) received

g .h
n
75.00% packet loss
round-trip min/avg/max = 1/3/15 ms
ni
r
[S2]interface GigabitEthernet 0/0/10

//lea
[S2-GigabitEthernet0/0/10]shutdown

p :
t t
Check port roles on S1.
s :h
[S1]display stp brief
r c e
ou
MSTID Port Role STP State Protection
0

es
GigabitEthernet0/0/9 ROOT FORWARDING NONE

R
0 GigabitEthernet0/0/13 DESI FORWARDING NONE

g
0 GigabitEthernet0/0/14 DESI FORWARDING NONE

i n
a rn
S1's GigabitEthernet0/0/9 becomes the root port and enters the Forwarding state.
There are L e15 timeout packets, and network convergence time is 30s.
r eis compatible with STP, but the convergence mode is STP.
o
RSTP
MEnable S2's GigabitEthernet 0/0/10.
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo shutdown
[S2-GigabitEthernet0/0/10]quit

HC Series HUAWEI TECHNOLOGIES 473


HCNP-IERS Chapter 7 STP Configurations

Step 7 Configure MSTP and verify the MSTP configuration.

Create VLANs 2 to 20 and add related interfaces to the VLANs.


[S1]vlan batch 2 to 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]port link-type trunk
[S1-GigabitEthernet0/0/9]port trunk allow-pass vlan 1 TO 20

e n
[S1-GigabitEthernet0/0/9]quit
/
[S1]interface GigabitEthernet 0/0/10
o m
i.c
[S1-GigabitEthernet0/0/10]port link-type trunk
[S1-GigabitEthernet0/0/10]port trunk allow-pass vlan 1 TO 20
[S1-GigabitEthernet0/0/10]quit
w e
[S1]interface GigabitEthernet 0/0/13
u a
[S1-GigabitEthernet0/0/13]port link-type trunk
[S1-GigabitEthernet0/0/13]port trunk allow-pass vlan 1 TO 20
g .h
[S1-GigabitEthernet0/0/13]quit
ni n
r
lea
[S1]interface GigabitEthernet 0/0/14
[S1-GigabitEthernet0/0/14]port link-type trunk

: //
[S1-GigabitEthernet0/0/14]port trunk allow-pass vlan 1 TO 20
[S1-GigabitEthernet0/0/14]quit

t t p
[S2]vlan batch 1 to 20
s:h
c e
Info: This operation may take a few seconds. Please wait for a moment...done.

r
ou
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]port link-type trunk

es
[S2-GigabitEthernet0/0/9]port trunk allow-pass vlan 1 TO 20

R
[S2-GigabitEthernet0/0/9]quit

n g
[S2]interface GigabitEthernet 0/0/10

i
n
[S2-GigabitEthernet0/0/10]port link-type trunk

ar
[S2-GigabitEthernet0/0/10]port trunk allow-pass vlan 1 TO 20

e
L
[S2-GigabitEthernet0/0/10]quit

e
[S2]interface GigabitEthernet 0/0/23

or
[S2-GigabitEthernet0/0/23]port link-type trunk

M
[S2-GigabitEthernet0/0/23]port trunk allow-pass vlan 1 TO 20
[S2-GigabitEthernet0/0/23]quit
[S2]interface GigabitEthernet 0/0/24
[S2-GigabitEthernet0/0/24]port link-type trunk
[S2-GigabitEthernet0/0/24]port trunk allow-pass vlan 1 TO 20
[S2-GigabitEthernet0/0/24]quit

[S3]vlan batch 1 to 20
Info: This operation may take a few seconds. Please wait for a moment...done.

HC Series HUAWEI TECHNOLOGIES 474


HCNP-IERS Chapter 7 STP Configurations

[S3]interface Ethernet0/0/1
[S3-Ethernet0/0/1]port link-type trunk
[S3-Ethernet0/0/1]port trunk allow-pass vlan 1 TO 20
[S3-Ethernet0/0/1]quit
[S3]interface Ethernet0/0/13
[S3-Ethernet0/0/13]port link-type trunk
[S3-Ethernet0/0/13]port trunk allow-pass vlan 1 TO 20
[S3-Ethernet0/0/13]quit
[S3]interface Ethernet0/0/23
e n
[S3-Ethernet0/0/23]port link-type trunk
/
[S3-Ethernet0/0/23]port trunk allow-pass vlan 1 TO 20
o m
i.c
[S3-Ethernet0/0/23]quit

[S4]vlan batch 1 to 20
w e
u a
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4]interface Ethernet0/0/1

g .h
n
[S4-Ethernet0/0/1]port link-type trunk
[S4-Ethernet0/0/1]port trunk allow-pass vlan 1 TO 20
ni
r
lea
[S4-Ethernet0/0/1]quit
[S4]interface Ethernet0/0/14
[S4-Ethernet0/0/14]port link-type trunk
: //
t p
[S4-Ethernet0/0/14]port trunk allow-pass vlan 1 TO 20

t
:h
[S4-Ethernet0/0/14]quit

s
[S4]interface Ethernet0/0/24

c e
[S4-Ethernet0/0/24]port link-type trunk

r
ou
[S4-Ethernet0/0/24]port trunk allow-pass vlan 1 TO 20
[S4-Ethernet0/0/24]quit

es
R
Configure MSTP.
i n g
rn to instance 1 and VLANs 11-20 to instance 2.
Add VLANs 1-10
a
L e
[S1]stp mode mstp

r e
[S1]stp region-configuration

o
[S1-mst-region]region-name RG1

M[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 mode mstp


[S2]stp region-configuration
[S2-mst-region]region-name RG1

HC Series HUAWEI TECHNOLOGIES 475


HCNP-IERS Chapter 7 STP Configurations

[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

[S3]STP mode mstp


Info: This operation may take a few seconds. Please wait for a moment.....done.
[S3]stp region-configuration
e n
[S3-mst-region]region-name RG1
/
[S3-mst-region]instance 1 vlan 1 to 10
o m
i.c
[S3-mst-region]instance 2 vlan 11 to 20
[S3-mst-region]quit

w e
[S4]STP mode mstp
u a
.h
Info: This operation may take a few seconds. Please wait for a moment.....done.

g
n
[S4]stp region-configuration
[S4-mst-region]region-name RG1
ni
r
lea
[S4-mst-region]instance 1 vlan 1 to 10
[S4-mst-region]instance 2 vlan 11 to 20
[S4-mst-region]quit
: //
t tp
Check the mappings between MSTP instances
: h and VLANs.
e s
r c
[S1]display stp region-configuration
Oper configuration

o u
Format selector :0

es
R
Region name :RG1

g
Revision level :0
Instance
i n
VLANs Mapped
0

a rn
21 to 4094

e
1 1 to 10
2

e L 11 to 20

o r
M
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.
[S1]stp instance 1 priority 4096
[S1]stp instance 2 priority 8192

[S2]stp instance 2 priority 4096


[S2]stp instance 1 priority 8192

HC Series HUAWEI TECHNOLOGIES 476


HCNP-IERS Chapter 7 STP Configurations

Check the status of instance 1 and instance 2.


[S1]display stp instance 1
-------[MSTI 1 Global Info]-------
MSTI Bridge ID :4096.4c1f-cc45-aadc
MSTI RegRoot/IRPC :4096.4c1f-cc45-aadc / 0
MSTI RootPortId :0.0

e n
/
Master Bridge :4096.4c1f-cc45-aac1

m
Cost to Master :20000
TC received :20
o
TC count per hello :0

e i.c
[S2]display stp instance 2
aw
u
.h
-------[MSTI 2 Global Info]-------

g
MSTI Bridge ID :4096.4c1f-cc45-aac1
MSTI RegRoot/IRPC :4096.4c1f-cc45-aac1 / 0

ni n
r
MSTI RootPortId :0.0

lea
Master Bridge :4096.4c1f-cc45-aac1

//
Cost to Master :0
TC received :16
p :
TC count per hello :0
t t
s :h
c e
S1 is the root bridge of instance 1 and S2 is the root bridge of instance 2.
r
o u 1.
Check port roles in MSTP instance
e s
R
[S1]display stp instance 1 brief
MSTID
1
Port

i n g
GigabitEthernet0/0/9
Role STP State
DESI FORWARDING
Protection
NONE
1

a rn
GigabitEthernet0/0/10 DESI FORWARDING NONE
1
1 L eGigabitEthernet0/0/13
GigabitEthernet0/0/14
DESI FORWARDING
DESI FORWARDING
NONE
NONE

r e
o
[S2]display stp instance 1 brief

M MSTID
1
Port
GigabitEthernet0/0/9
Role STP State
ROOT FORWARDING
Protection
NONE
1 GigabitEthernet0/0/10 ALTE DISCARDING NONE
1 GigabitEthernet0/0/23 DESI FORWARDING NONE
1 GigabitEthernet0/0/24 DESI FORWARDING NONE

[S3]display stp instance 1 brief


MSTID Port Role STP State Protection

HC Series HUAWEI TECHNOLOGIES 477


HCNP-IERS Chapter 7 STP Configurations

1 Ethernet0/0/1 ALTE DISCARDING NONE


1 Ethernet0/0/13 ROOT FORWARDING NONE
1 Ethernet0/0/23 ALTE DISCARDING NONE

[S4]display stp instance 1 brief


MSTID Port Role STP State Protection
1 Ethernet0/0/1 DESI FORWARDING NONE
1 Ethernet0/0/14 ROOT FORWARDING NONE
1 Ethernet0/0/24 ALTE DISCARDING NONE
e n
/
o m
S1 in instance 1 is the root bridge. The users in VLAN 1-10 on S3 communicate
i . c with
the users in VLAN 1-10 on S1, S2, and S4 through Ethernet0/0/13.
w e
a
hu
Check port roles in MSTP instance 2.
[S1]display stp instance 2 brief
g .
MSTID Port Role STP State
i
Protection

n n
2 GigabitEthernet0/0/9 ROOT FORWARDING
r
NONE

a
e
2 GigabitEthernet0/0/10 ALTE DISCARDING NONE
2 GigabitEthernet0/0/13 DESI FORWARDING
// l NONE

:
[S2]display stp instance 2 brief
t tp
MSTID Port
: h
Role STP State Protection
2 GigabitEthernet0/0/9
e s
DESI FORWARDING NONE
2 GigabitEthernet0/0/10
r cDESI FORWARDING NONE
2
o
GigabitEthernet0/0/23
u DESI FORWARDING NONE
2
e s
GigabitEthernet0/0/24 DESI FORWARDING NONE

R
MSTID Port
i n g
[S3]display stp instance 2 brief
Role STP State Protection
2

a rn
Ethernet0/0/1 ALTE DISCARDING NONE
2
2
L e
Ethernet0/0/13
Ethernet0/0/23
ALTE DISCARDING
ROOT FORWARDING
NONE
NONE

r e
o
[S4]display stp instance 2 brief

M MSTID
2
Port
Ethernet0/0/1
Role STP State
DESI FORWARDING
Protection
NONE
2 Ethernet0/0/14 DESI FORWARDING NONE
2 Ethernet0/0/24 ROOT FORWARDING NONE

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.

HC Series HUAWEI TECHNOLOGIES 478


HCNP-IERS Chapter 7 STP Configurations

----End

Additional Exercises: Analysis and Verification

How can MSTP load balance data from different VLANs in multiple regions?

What’s the reason that RSTP is able to implement fast forwarding?

e n
Device Configurations /
o m
i.c
[S1]display current-configuration
#
!Software Version V200R008C00SPC500
w e
sysname S1

u a
.h
#
vlan batch 2 to 20
#
i n g
stp instance 0 priority 8192
r n
lea
stp instance 1 priority 4096

//
stp instance 2 priority 8192
#
p :
stp region-configuration
t t
:h
region-name RG1
instance 1 vlan 1 to 10
e s
instance 2 vlan 11 to 20
r c
ou
active region-configuration
#

es
interface Vlanif1
R
#
i n g
ip address 10.0.1.1 255.255.255.0

n
ar
interface GigabitEthernet0/0/9

L e
port link-type trunk
port trunk allow-pass vlan 2 to 20

e
or
#
interface GigabitEthernet0/0/10

M
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface GigabitEthernet0/0/13
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
Return

HC Series HUAWEI TECHNOLOGIES 479


HCNP-IERS Chapter 7 STP Configurations

[S2]display current-configuration
#
!Software Version V200R008C00SPC500
sysname S2
#
vlan batch 2 to 20
#
stp instance 0 priority 4096
e n
stp instance 1 priority 8192
/
stp instance 2 priority 4096
o m
i.c
#
stp region-configuration
region-name RG1
w e
instance 1 vlan 1 to 10
u a
instance 2 vlan 11 to 20

g .h
n
active region-configuration
#
ni
r
lea
interface Vlanif1
ip address 10.0.1.2 255.255.255.0
#
: //
interface GigabitEthernet0/0/9

t t p
:h
port link-type trunk

s
port trunk allow-pass vlan 2 to 20
stp instance 0 port priority 32

r c e
ou
#
interface GigabitEthernet0/0/10
port link-type trunk
es
R
port trunk allow-pass vlan 2 to 20

n g
stp instance 0 port priority 16

i
#
n
ar
interface GigabitEthernet0/0/23

e
L
port link-type trunk

e
port trunk allow-pass vlan 2 to 20
#
or
M
interface GigabitEthernet0/0/24
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
Return

[S3]display current-configuration
#
!Software Version V200R008C00SPC500

HC Series HUAWEI TECHNOLOGIES 480


HCNP-IERS Chapter 7 STP Configurations

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
e n
#
/
interface Ethernet0/0/1
o m
i.c
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
w e
interface Ethernet0/0/13
u a
port link-type trunk

g .h
n
port trunk allow-pass vlan 2 to 20
#
ni
r
lea
interface Ethernet0/0/23
port link-type trunk
port trunk allow-pass vlan 2 to 20
: //
#

t t p
:h
Return

e s
c
[S4]display current-configuration

r
ou
#
!Software Version V200R008C00SPC500
sysname S4
es
#
R
vlan batch 2 to 20

i n g
#
n
ar
stp region-configuration

e
L
region-name RG1

e
instance 1 vlan 1 to 10

or instance 2 vlan 11 to 20

M
#
active region-configuration

interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
interface Ethernet0/0/14
port link-type trunk
port trunk allow-pass vlan 2 to 20

HC Series HUAWEI TECHNOLOGIES 481


HCNP-IERS Chapter 7 STP Configurations

#
interface Ethernet0/0/23
#
interface Ethernet0/0/24
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp instance 0 cost 2000000
#
Return
e n
/
o m
Lab 7-2 Compatibility Between MST Multi-Region and STP
(Optional) e i.c
aw
u
Learning Objectives .h g
The objectives of this lab are to learn and understand:
ni n
r
amulti-region
How to configure MST multi-instance and
l e
// MSTP and STP

How to configure compatibility between


p :
t

How to configure protection for t


h MSTP edge ports, designated ports, loop,
:

and TC-BPDU
e s
r c
o u
e s
R
i n g
a rn
L e
r e
o
M

HC Series HUAWEI TECHNOLOGIES 482


HCNP-IERS Chapter 7 STP Configurations

Topology

e n
/
o m
e i.c
aw
u
g .h
ni n
r
//lea
p :
Figure 8-2 Compatibility between MSTP multi-region and STP
t t
Scenario
s :h
You are a network administratorrof
e
c a company. In the Layer 2 network structure, a
o u some VLAN paths and cause the second optimal
saddress these problems and implement load balancing.
single spanning tree may congest
e
R
path to be used. MSTP can
In addition, MSTP isgcompatible with traditional spanning tree modes.
i n
a rn
Tasks
L e
Stepr e1 Set basic parameters.
o
MBefore this lab test, shut down undesired interfaces.
<S1>system-view
Enter system view, return user view with Ctrl+Z.
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]shutdown
[S1-GigabitEthernet0/0/9]quit

<S3>system-view

HC Series HUAWEI TECHNOLOGIES 483


HCNP-IERS Chapter 7 STP Configurations

Enter system view, return user view with Ctrl+Z.


[S3]interface Ethernet 0/0/23
[S3-Ethernet0/0/23]shutdown
[S3-Ethernet0/0/23]quit

<S4>system-view
Enter system view, return user view with Ctrl+Z.
[S4]interface Ethernet 0/0/14
[S4-Ethernet0/0/14]shutdown
e n
[S4-Ethernet0/0/14]quit
/
o m
Create VLANs 3, 4, 5, 6, 7, and 8 on all switches.
e i.c
[S1]vlan batch 3 to 8
aw
u
[S2]vlan batch 3 to 8
g .h
ni n
r
[S3]vlan batch 3 to 8

[S4]vlan batch 3 to 8
//lea
p :
t t
:h
Check VLAN configurations.
[S1]display vlan
e s
* : management-vlan
r c
---------------------

s ou
e
The total number of vlans is : 7
VLAN ID Type Status
R MAC Learning Broadcast/Multicast/Unicast Property

i n g
----------------------------------------------------------------------------

n
1 common enable enable forward forward forward default

ar
3 common enable enable forward forward forward default

Le
4 common enable enable forward forward forward default

e
5 common enable enable forward forward forward default
6
o r common enable enable forward forward forward default

M
7 common enable enable forward forward forward default
8 common enable enable forward forward forward default

[S2]display vlan
* : management-vlan
---------------------
The total number of vlans is : 7
VLAN ID Type Status MAC Learning Broadcast/Multicast/Unicast Property
----------------------------------------------------------------------------

HC Series HUAWEI TECHNOLOGIES 484


HCNP-IERS Chapter 7 STP Configurations

1 common enable enable forward forward forward default


3 common enable enable forward forward forward default
4 common enable enable forward forward forward default
5 common enable enable forward forward forward default
6 common enable enable forward forward forward default
7 common enable enable forward forward forward default
8 common enable enable forward forward forward default

[S3]display vlan
e n
* : management-vlan
/
---------------------
o m
i.c
The total number of vlans is : 7
VLAN ID Type Status MAC Learning Broadcast/Multicast/Unicast Property
----------------------------------------------------------------------------
w e
1 common enable enable forward forward
u a
forward default
3 common enable enable forward forward
.h
forward default

g
n
4 common enable enable forward forward forward default
5 common enable enable forward forward
ni
forward default

r
lea
6 common enable enable forward forward forward default
7 common enable enable forward forward forward default
8 common enable enable forward
: //
forward forward default

t t p
:h
[S4]display vlan

s
* : management-vlan
---------------------

r c e
ou
The total number of vlans is : 7
VLAN ID Type Status MAC Learning Broadcast/Multicast/Unicast Property

es
----------------------------------------------------------------------------
1 common enable
R enable forward forward forward default
3 common

i n g
enable enable forward forward forward default
4 common
n enable enable forward forward forward default
5 common
ar enable enable forward forward forward default

Le
6 common enable enable forward forward forward default

re
7 common enable enable forward forward forward default
8
o common enable enable forward forward forward default

M
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]interface GigabitEthernet 0/0/13
[S1-GigabitEthernet0/0/13]port link-type trunk
[S1-GigabitEthernet0/0/13]port trunk allow-pass vlan all
[S1-GigabitEthernet0/0/13]bpdu enable

HC Series HUAWEI TECHNOLOGIES 485


HCNP-IERS Chapter 7 STP Configurations

[S1-GigabitEthernet0/0/13]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]port link-type trunk
[S1-GigabitEthernet0/0/10]port trunk allow-pass vlan all
[S1-GigabitEthernet0/0/10]bpdu enable
[S1-GigabitEthernet0/0/10]quit

[S2]interface GigabitEthernet 0/0/24


[S2-GigabitEthernet0/0/24]port link-type trunk
e n
[S2-GigabitEthernet0/0/24]port trunk allow-pass vlan all
/
[S2-GigabitEthernet0/0/24]bpdu enable
o m
i.c
[S2-GigabitEthernet0/0/24]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]port link-type trunk
w e
[S2-GigabitEthernet0/0/10]port trunk allow-pass vlan all
u a
[S2-GigabitEthernet0/0/10]bpdu enable

g .h
n
[S2-GigabitEthernet0/0/10]quit

ni
r
lea
[S3]interface Ethernet0/0/1
[S3-Ethernet0/0/1]port link-type trunk
[S3-Ethernet0/0/1]port trunk allow-pass vlan all
: //
[S3-Ethernet0/0/1]bpdu enable

t t p
:h
[S3-Ethernet0/0/1]quit

s
[S3]interface Ethernet0/0/13

c e
[S3-Ethernet0/0/13]port link-type trunk

r
ou
[S3-Ethernet0/0/13]port trunk allow-pass vlan all
[S3-Ethernet0/0/13]bpdu enable
[S3-Ethernet0/0/13]quit
es
R
n g
[S4]interface Ethernet0/0/1

i
n
[S4-Ethernet0/0/1]port link-type trunk

ar
[S4-Ethernet0/0/1]port trunk allow-pass vlan all

e
L
[S4-Ethernet0/0/1]bpdu enable

e
[S4-Ethernet0/0/1]quit

or
[S4]interface Ethernet0/0/24

M
[S4-Ethernet0/0/24]port link-type trunk
[S4-Ethernet0/0/24]port trunk allow-pass vlan all
[S4-Ethernet0/0/24]bpdu enable
[S4-Ethernet0/0/24]quit

Step 2 Configure MST multi-instance.

HC Series HUAWEI TECHNOLOGIES 486


HCNP-IERS Chapter 7 STP Configurations

Enable MSTP in the system view.


[S1]stp enable
[S1]stp mode mstp

[S2]stp enable
[S2]stp mode mstp

[S3]stp enable

e n
[S3]stp mode mstp
/
o m
i.c
[S4]stp enable
[S4]stp mode mstp

w e
a
u to 1. Map
. h
Allocate all switches to the same region RG1 and set the revision level
instance 1 to VLANs 3, 4, and 5. Create instance 2 and map itgto VLANs 6, 7, and 8.
Activate region configuration.
nin
ar
[S1]stp region-configuration

/ l e
[S1-mst-region]region-name RG1
: /
[S1-mst-region]revision-level 1

t tp
[S1-mst-region]instance 1 vlan 3 4 5

: h
s
[S1-mst-region]instance 2 vlan 6 7 8

c e
[S1-mst-region]active region-configuration

r
u
[S1-mst-region]quit

s o
R e
[S2]stp region-configuration
[S2-mst-region]region-name RG1

n g
[S2-mst-region]revision-level 1

i
rn
[S2-mst-region]instance 1 vlan 3 4 5

a
[S2-mst-region]instance 2 vlan 6 7 8

e
L
[S2-mst-region]active region-configuration

e
[S2-mst-region]quit

r
o
M
[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

HC Series HUAWEI TECHNOLOGIES 487


HCNP-IERS Chapter 7 STP Configurations

[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

Check MSTP information.


e n
/
m
[S1]display stp brief
MSTID Port Role STP State Protection
o
0
0
GigabitEthernet0/0/10
GigabitEthernet0/0/13
DESI FORWARDING
DESI FORWARDING
NONE
NONE
e i.c
1 GigabitEthernet0/0/10 DESI FORWARDING NONE
aw
u
.h
1 GigabitEthernet0/0/13 DESI FORWARDING NONE

g
2 GigabitEthernet0/0/10 DESI FORWARDING NONE
2 GigabitEthernet0/0/13 DESI FORWARDING
i
NONE

n n
r
lea
[S2]display stp brief

//
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 ROOT FORWARDING
p : NONE
0 GigabitEthernet0/0/24
t t
DESI FORWARDING NONE

:h
1 GigabitEthernet0/0/10 ROOT FORWARDING NONE

es
1 GigabitEthernet0/0/24 DESI FORWARDING NONE
2 GigabitEthernet0/0/10
r c
ROOT FORWARDING NONE

ou
2 GigabitEthernet0/0/24 DESI FORWARDING NONE

es
R
[S3]display stp brief

g
MSTID Port Role STP State Protection
0
i
Ethernet0/0/1

n n DESI FORWARDING NONE

ar
0 Ethernet0/0/13 ROOT FORWARDING NONE

e
1 Ethernet0/0/1 DESI FORWARDING NONE
1

e L
Ethernet0/0/13 ROOT FORWARDING NONE

or
2 Ethernet0/0/1 DESI FORWARDING NONE
2 Ethernet0/0/13 ROOT FORWARDING NONE

M
[S4]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 ROOT FORWARDING NONE
0 Ethernet0/0/24 ALTE DISCARDING NONE
1 Ethernet0/0/1 ROOT FORWARDING NONE
1 Ethernet0/0/24 ALTE DISCARDING NONE
2 Ethernet0/0/1 ROOT FORWARDING NONE

HC Series HUAWEI TECHNOLOGIES 488


HCNP-IERS Chapter 7 STP Configurations

2 Ethernet0/0/24 ALTE DISCARDING NONE

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.

n
[S2]stp instance 2 priority 0

/ e
[S1]stp instance 2 priority 4096

o m
[S4]stp instance 2 priority 8192
e i.c
aw
hu
After the configurations are complete, check the MSTP basic information.
.
[S1]display stp brief

i n g
n
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 DESI FORWARDING
arNONE
0 GigabitEthernet0/0/13 DESI FORWARDING
l e NONE
1 GigabitEthernet0/0/10
: //
DESI FORWARDING NONE
1 GigabitEthernet0/0/13
tp
DESI FORWARDING

t
NONE
2 GigabitEthernet0/0/10
h
ROOT FORWARDING

:
NONE

s
2 GigabitEthernet0/0/13 DESI FORWARDING NONE

r c e
u
[S2]display stp brief
MSTID Port
s o Role STP State Protection
0
0
R e
GigabitEthernet0/0/10
GigabitEthernet0/0/24
ROOT FORWARDING
DESI FORWARDING
NONE
NONE
1
n g
GigabitEthernet0/0/10

i
ROOT FORWARDING NONE

rn
1 GigabitEthernet0/0/24 DESI FORWARDING NONE
2

e a
GigabitEthernet0/0/10 DESI FORWARDING NONE

L
2 GigabitEthernet0/0/24 DESI FORWARDING NONE

r e
o
[S3]display stp brief

M MSTID
0
Port
Ethernet0/0/1
Role STP State
DESI FORWARDING
Protection
NONE
0 Ethernet0/0/13 ROOT FORWARDING NONE
1 Ethernet0/0/1 DESI FORWARDING NONE
1 Ethernet0/0/13 ROOT FORWARDING NONE
2 Ethernet0/0/1 ALTE DISCARDING NONE
2 Ethernet0/0/13 ROOT FORWARDING NONE

[S4]display stp brief

HC Series HUAWEI TECHNOLOGIES 489


HCNP-IERS Chapter 7 STP Configurations

MSTID Port Role STP State Protection


0 Ethernet0/0/1 ALTE DISCARDING NONE
0 Ethernet0/0/24 ROOT FORWARDING NONE
1 Ethernet0/0/1 ALTE DISCARDING NONE
1 Ethernet0/0/24 ROOT FORWARDING NONE
2 Ethernet0/0/1 DESI FORWARDING NONE
2 Ethernet0/0/24 ROOT FORWARDING NONE

e n
S2 becomes the root switch in instance 2, and S3's E0/0/1 becomes the alternate /
o m
.
port in instance 2. However, the status of switches in instance 1 is not changed.
i c Each
MST instance independently calculates the spanning tree.
w e
a
hu
Step 3 Configure MST multi-region.
.
Delete the MST regions and priority settings of all switches ingstep 2.
nin
[S1]undo stp region-configuration
ar
[S1]undo stp instance 2 priority

/ l e
: /
[S2]undo stp region-configuration

t tp
h
[S2]undo stp instance 2 priority

s :
[S3]undo stp region-configuration

r c e
o
[S4]undo stp region-configuration u
e s
[S4]undo stp instance 2 priority

R
i n g
Add S1 and S3 n
a r to the same MST region. The region name is RG1 and revision version
is 1.
L e
Create
r e instance 1 and map it to VLANs 3, 4, and 5.
o
MCreate instance 2 and map it to VLANs 6, 7, and 8.
[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

HC Series HUAWEI TECHNOLOGIES 490


HCNP-IERS Chapter 7 STP Configurations

[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

e n
/
Add S2 and S4 to another MST region. The region name is RG2 and revision version
o m
is 2.
i . c
Create instance 1 and map it to VLANs 3, 4, and 5.
w e
a
.
Create instance 2 and map it to VLANs 6, 7, and 8. Activate all region
hu configurations.
[S2]stp region-configuration
i n g
[S2-mst-region]region-name RG2
r n
[S2-mst-region]revision-level 2

l e a
//
[S2-mst-region]instance 1 vlan 3 4 5

:
tp
[S2-mst-region]instance 2 vlan 6 7 8
[S2-mst-region]active region-configuration

ht
:
[S2-mst-region]quit

e s
[S4]stp region-configuration
r c
[S4-mst-region]region-name RG2

o u
s
[S4-mst-region]revision-level 2

e
R
[S4-mst-region]instance 1 vlan 3 4 5

i n g
[S4-mst-region]instance 2 vlan 6 7 8
[S4-mst-region]active region-configuration

rn
[S4-mst-region]quit

a
L e
After e
o r the configurations are complete, check the MSTP basic information.

M
[S1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 DESI FORWARDING NONE
0 GigabitEthernet0/0/13 DESI FORWARDING NONE
1 GigabitEthernet0/0/10 DESI FORWARDING NONE
1 GigabitEthernet0/0/13 DESI FORWARDING NONE
2 GigabitEthernet0/0/10 DESI FORWARDING NONE
2 GigabitEthernet0/0/13 DESI FORWARDING NONE

HC Series HUAWEI TECHNOLOGIES 491


HCNP-IERS Chapter 7 STP Configurations

[S2]display stp brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE
0 GigabitEthernet0/0/24 DESI FORWARDING NONE
1 GigabitEthernet0/0/10 MAST FORWARDING NONE
1 GigabitEthernet0/0/24 DESI FORWARDING NONE
2 GigabitEthernet0/0/10 MAST FORWARDING NONE

[S3]display stp brief


e n
MSTID Port Role STP State Protection
/
0 Ethernet0/0/1 DESI FORWARDING NONE
o m
i.c
0 Ethernet0/0/13 ROOT FORWARDING NONE
1
1
Ethernet0/0/1
Ethernet0/0/13
DESI FORWARDING
ROOT FORWARDING
NONE
NONE
w e
2 Ethernet0/0/1 DESI FORWARDING NONE
u a
2 Ethernet0/0/13 ROOT FORWARDING NONE

g .h
[S4]display stp brief
ni n
r
lea
MSTID Port Role STP State Protection
0 Ethernet0/0/1 ALTE DISCARDING NONE
0 Ethernet0/0/24 ROOT FORWARDING
: // NONE
1 Ethernet0/0/1
t
ALTE DISCARDING

t p NONE

:h
1 Ethernet0/0/24 ROOT FORWARDING NONE

es
2 Ethernet0/0/1 ALTE DISCARDING NONE

c
2 Ethernet0/0/24 ROOT FORWARDING NONE

r
s ou
e
S1 is the root switch and S4's E0/0/1 is the alternate port.
R
i n g
Set the S3 priority in instance 0 to 0 so that S3 becomes the CIST root. Set the S3

rn 1 to 0 so that S4 becomes the root of instance 1.


priority in instance 1 to 0 so that S3 becomes the root of instance 1. Set the S4

a
priority in instance
e
e L
[S3]stp instance 0 priority 0

o r
[S3]stp instance 1 priority 0

M[S4]stp instance 1 priority 0

After the configurations are complete, check the MSTP basic information.
[S1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 DESI FORWARDING NONE

HC Series HUAWEI TECHNOLOGIES 492


HCNP-IERS Chapter 7 STP Configurations

0 GigabitEthernet0/0/13 ROOT FORWARDING NONE


1 GigabitEthernet0/0/10 DESI FORWARDING NONE
1 GigabitEthernet0/0/13 ROOT FORWARDING NONE
2 GigabitEthernet0/0/10 DESI FORWARDING NONE
2 GigabitEthernet0/0/13 DESI FORWARDING NONE

[S2]display stp brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE
e n
0 GigabitEthernet0/0/24 DESI FORWARDING NONE
/
1 GigabitEthernet0/0/10 MAST FORWARDING NONE
o m
i.c
1 GigabitEthernet0/0/24 ROOT FORWARDING NONE
2
2
GigabitEthernet0/0/10
GigabitEthernet0/0/24
MAST FORWARDING
DESI FORWARDING
NONE
NONE
w e
u a
[S3]display stp brief

g .h
n
MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING
ni
NONE

r
lea
0 Ethernet0/0/13 DESI FORWARDING NONE
1 Ethernet0/0/1 DESI FORWARDING NONE
1 Ethernet0/0/13 DESI FORWARDING
: // NONE
2 Ethernet0/0/1
t
DESI FORWARDING

t p NONE

:h
2 Ethernet0/0/13 ROOT FORWARDING NONE

e s
c
[S4]display stp brief

r
ou
MSTID Port Role STP State Protection
0 Ethernet0/0/1 ALTE DISCARDING NONE
0 Ethernet0/0/24
es ROOT FORWARDING NONE
1 Ethernet0/0/1
R ALTE DISCARDING NONE
1
n
Ethernet0/0/24

i g DESI FORWARDING NONE


2
n
Ethernet0/0/1 ALTE DISCARDING NONE
2

e ar
Ethernet0/0/24 ROOT FORWARDING NONE

e L
r
Delete MSTP configuration on S2 and S4, and S2 and S4 to another MST region. The
o
Mregion 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]undo stp region-configuration

[S3]undo stp instance 0 priority


[S3]undo stp instance 1 priority

HC Series HUAWEI TECHNOLOGIES 493


HCNP-IERS Chapter 7 STP Configurations

[S4]undo stp region-configuration


[S4]undo stp instance 1 priority

[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
e n
[S2-mst-region]active region-configuration
/
[S2-mst-region]quit
o m
[S4]stp region-configuration
e i.c
[S4-mst-region]region-name RG2

aw
[S4-mst-region]revision-level 2
u
[S4-mst-region]instance 1 vlan 6 7 8

g .h
n
[S4-mst-region]instance 2 vlan 3 4 5
[S4-mst-region]active region-configuration
ni
r
lea
[S4-mst-region]quit

: //
t t p
After the configurations are complete, check the MSTP basic information.

:h
[S1]display stp brief

es
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10
r c
DESI FORWARDING NONE

ou
0 GigabitEthernet0/0/13 DESI FORWARDING NONE
1 GigabitEthernet0/0/10

es DESI FORWARDING NONE

R
1 GigabitEthernet0/0/13 DESI FORWARDING NONE

g
2 GigabitEthernet0/0/10 DESI FORWARDING NONE
2
i n
GigabitEthernet0/0/13

n
DESI FORWARDING NONE

e ar
[S2]display stp brief
MSTID

e L
Port Role STP State Protection

or
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE
0 GigabitEthernet0/0/24 DESI FORWARDING NONE

M 1
1
GigabitEthernet0/0/10
GigabitEthernet0/0/24
MAST FORWARDING
DESI FORWARDING
NONE
NONE
2 GigabitEthernet0/0/10 MAST FORWARDING NONE
2 GigabitEthernet0/0/24 DESI FORWARDING NONE

[S3]display stp brief


MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING NONE

HC Series HUAWEI TECHNOLOGIES 494


HCNP-IERS Chapter 7 STP Configurations

0 Ethernet0/0/13 ROOT FORWARDING NONE


1 Ethernet0/0/1 DESI FORWARDING NONE
1 Ethernet0/0/13 ROOT FORWARDING NONE
2 Ethernet0/0/1 DESI FORWARDING NONE
2 Ethernet0/0/13 ROOT FORWARDING NONE

[S4]display stp brief


MSTID Port Role STP State Protection
0 Ethernet0/0/1 ALTE DISCARDING NONE
e n
0 Ethernet0/0/24 ROOT FORWARDING NONE
/
1 Ethernet0/0/1 ALTE DISCARDING NONE
o m
i.c
1 Ethernet0/0/24 ROOT FORWARDING NONE
2 Ethernet0/0/1 ALTE DISCARDING NONE

w e
a
All MST instances in each region, except instance 0, independentlyucalculate
. hand whether VLANs
spanning trees, no matter whether repeated VLANs are included
i n g
r n do not affect each
map the instances. The spanning tree calculations in a region
other.
l e a
: //MSTP and STP.
Step 4 Configure compatibility between
t tp
:
Add S1, S2, and S3 to the same MST region. h Configure STP on S4.
e s
Delete and reconfigure MSTP on c
r S2. The region name is RG1. Create instance 1 and
u instance 2 and map it to VLANs 6, 7, and 8.
o
map it to VLANs 3, 4, and 5. Create
s
e
Activate all region configurations.
R
n g
[S2]undo stp region-configuration

i
rn
[S2]stp region-configuration

a
[S2-mst-region]region-name RG1

e
L
[S2-mst-region]revision-level 1

e
[S2-mst-region]instance 1 vlan 3 4 5

r
o
[S2-mst-region]instance 2 vlan 6 7 8

M
[S2-mst-region]active region-configuration
[S2-mst-region]quit

Enable S2's S0/0/23 and S3's E0/0/23.

Set the access type of the direct link between S2 and S3 to Trunk to receive BPDUs.
All VLANs are allowed.

HC Series HUAWEI TECHNOLOGIES 495


HCNP-IERS Chapter 7 STP Configurations

[S2]interface GigabitEthernet 0/0/23


[S2-GigabitEthernet0/0/23]undo shutdown
[S2-GigabitEthernet0/0/23]port link-type trunk
[S2-GigabitEthernet0/0/23]port trunk all vlan all
[S2-GigabitEthernet0/0/23]bpdu enable
[S2-GigabitEthernet0/0/23]quit

[S3]interface Ethernet0/0/23
[S3-Ethernet0/0/23]undo shutdown
e n
[S3-Ethernet0/0/23]port link-type trunk
/
[S3-Ethernet0/0/23]port trunk allow-pass vlan all
o m
i.c
[S3-Ethernet0/0/23]bpdu enable
[S3-Ethernet0/0/23]quit

w e
u a
Delete MSTP and enable STP on S4.
g .h
[S4]undo stp region-configuration

ni n
r
[S4]stp mode stp

//lea
:
After the configurations are complete, check the STP basic information.
p
t t
:h
[S1]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10
e s
DESI FORWARDING NONE
0 GigabitEthernet0/0/13
r c
DESI FORWARDING NONE
1 GigabitEthernet0/0/10

s ou DESI FORWARDING NONE

e
1 GigabitEthernet0/0/13 DESI FORWARDING NONE
2
R
GigabitEthernet0/0/10 DESI FORWARDING NONE

ing
2 GigabitEthernet0/0/13 DESI FORWARDING NONE

a rn
[S2]display stp brief
MSTID Port
e Role STP State Protection

eL
0 GigabitEthernet0/0/10 ROOT FORWARDING NONE

or
0 GigabitEthernet0/0/23 DESI FORWARDING NONE

M
0 GigabitEthernet0/0/24 DESI FORWARDING NONE
1 GigabitEthernet0/0/10 ROOT FORWARDING NONE
1 GigabitEthernet0/0/23 DESI FORWARDING NONE
1 GigabitEthernet0/0/24 DESI FORWARDING NONE
2 GigabitEthernet0/0/10 ROOT FORWARDING NONE
2 GigabitEthernet0/0/23 DESI FORWARDING NONE
2 GigabitEthernet0/0/24 DESI FORWARDING NONE

[S3]display stp brief

HC Series HUAWEI TECHNOLOGIES 496


HCNP-IERS Chapter 7 STP Configurations

MSTID Port Role STP State Protection


0 Ethernet0/0/1 DESI FORWARDING NONE
0 Ethernet0/0/13 ROOT FORWARDING NONE
0 Ethernet0/0/23 ALTE DISCARDING NONE
1 Ethernet0/0/1 DESI FORWARDING NONE
1 Ethernet0/0/13 ROOT FORWARDING NONE
1 Ethernet0/0/23 ALTE DISCARDING NONE
2 Ethernet0/0/1 DESI FORWARDING NONE
2 Ethernet0/0/13 ROOT FORWARDING NONE
e n
2 Ethernet0/0/23 ALTE DISCARDING NONE
/
o m
i.c
[S4]display stp brief
MSTID
0
Port
Ethernet0/0/1
Role STP State
ROOT FORWARDING
Protection
NONE
w e
0 Ethernet0/0/24 ALTE DISCARDING NONE
u a
g .h
i n
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 rofnCIST.
l e a
Set the S4's priority to 4096 so that S4 becomes/the
: / root of CIST.
[S4]stp priority 4096
t tp
: h
e s
Check STP basic information.
r c
[S1]display stp brief
o u
MSTID Port
e s Role STP State Protection
0
R
GigabitEthernet0/0/10 ROOT FORWARDING NONE
0
n g
GigabitEthernet0/0/13

i
DESI FORWARDING NONE

rn
1 GigabitEthernet0/0/10 DESI FORWARDING NONE
1

e a
GigabitEthernet0/0/13 DESI FORWARDING NONE

L
2 GigabitEthernet0/0/10 DESI FORWARDING NONE
2

r e GigabitEthernet0/0/13 DESI FORWARDING NONE

o
M[S2]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 DESI FORWARDING NONE
0 GigabitEthernet0/0/23 DESI FORWARDING NONE
0 GigabitEthernet0/0/24 ROOT FORWARDING NONE
1 GigabitEthernet0/0/10 ROOT FORWARDING NONE
1 GigabitEthernet0/0/23 DESI FORWARDING NONE
1 GigabitEthernet0/0/24 MAST FORWARDING NONE
2 GigabitEthernet0/0/10 ROOT FORWARDING NONE

HC Series HUAWEI TECHNOLOGIES 497


HCNP-IERS Chapter 7 STP Configurations

2 GigabitEthernet0/0/23 DESI FORWARDING NONE


2 GigabitEthernet0/0/24 MAST FORWARDING NONE

[S3]display stp brief


MSTID Port Role STP State Protection
0 Ethernet0/0/1 ALTE DISCARDING NONE
0 Ethernet0/0/13 ALTE DISCARDING NONE
0 Ethernet0/0/23 ROOT FORWARDING NONE
1 Ethernet0/0/1 ALTE DISCARDING NONE
e n
1 Ethernet0/0/13 ROOT FORWARDING NONE
/
1 Ethernet0/0/23 ALTE DISCARDING NONE
o m
i.c
2 Ethernet0/0/1 ALTE DISCARDING NONE
2
2
Ethernet0/0/13
Ethernet0/0/23
ROOT FORWARDING
ALTE DISCARDING
NONE
NONE
w e
u a
[S4]display stp brief

g .h
n
MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING
ni
NONE

r
lea
0 Ethernet0/0/24 DESI FORWARDING NONE

: //
t t p
S4 becomes the root of CIST, and all ports on S4 are designated ports.

Step 5 Configure designated port : hprotection.


e s
r c for E0/0/1 and E0/0/24 of S4.
Configure designated port protection

o u
s
[S4]interface Ethernet0/0/1

e
R
[S4-Ethernet0/0/1]stp root-protection

g
[S4-Ethernet0/0/1]quit

i n
[S4]interface Ethernet0/0/24

rn
[S4-Ethernet0/0/24]stp root-protection

a
e
[S4-Ethernet0/0/24]quit

L
eSTP basic information on S4.
o r
Check
M[S4]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING ROOT
0 Ethernet0/0/24 DESI DISCARDING ROOT

Set the priority of instance 0 on S2 to 0 to simulate CIST root preemption.


[S2]stp instance 0 priority 0

HC Series HUAWEI TECHNOLOGIES 498


HCNP-IERS Chapter 7 STP Configurations

Check STP information on S2 and S4.


[S2]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/10 DESI FORWARDING NONE
0 GigabitEthernet0/0/23 DESI FORWARDING NONE
0 GigabitEthernet0/0/24 DESI LEARNING NONE

e n
/
1 GigabitEthernet0/0/10 ROOT FORWARDING NONE

m
1 GigabitEthernet0/0/23 DESI LEARNING NONE
1 GigabitEthernet0/0/24 DESI LEARNING NONE
o
2
2
GigabitEthernet0/0/10
GigabitEthernet0/0/23
ROOT FORWARDING
DESI LEARNING
NONE
NONE
e i.c
2 GigabitEthernet0/0/24 DESI LEARNING NONE
aw
u
[S4]display stp brief
g .h
MSTID Port Role STP State
i
Protection

n n
r
0 Ethernet0/0/1 DESI DISCARDING ROOT

lea
0 Ethernet0/0/24 DESI DISCARDING ROOT

: //
The S4's ports enter the Discarding state, andpdo not forward packets. This indicates
t t
that the S4's port status does not change
: hand S4 is still the root switch.
e s0 on S2.
c
Delete the priority setting of instance
r
o u
[S2]undo stp instance 0 priority

e s
Ron S2 and S4.
Check STP information
i n g
rn
[S2]display stp brief

a
e
MSTID Port Role STP State Protection
0

e L GigabitEthernet0/0/10 DESI FORWARDING NONE

o
0
0r GigabitEthernet0/0/23
GigabitEthernet0/0/24
DESI FORWARDING
ROOT FORWARDING
NONE
NONE

M 1
1
GigabitEthernet0/0/10
GigabitEthernet0/0/23
ROOT FORWARDING
DESI FORWARDING
NONE
NONE
1 GigabitEthernet0/0/24 MAST FORWARDING NONE
2 GigabitEthernet0/0/10 ROOT FORWARDING NONE
2 GigabitEthernet0/0/23 DESI FORWARDING NONE
2 GigabitEthernet0/0/24 MAST FORWARDING NONE

[S4]display stp brief

HC Series HUAWEI TECHNOLOGIES 499


HCNP-IERS Chapter 7 STP Configurations

MSTID Port Role STP State Protection


0 Ethernet0/0/1 DESI FORWARDING ROOT
0 Ethernet0/0/24 DESI FORWARDING ROOT

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).

Step 6 Configure edge port protection.


e n
/
Enable S2's G0/0/9.
o m
[S2]interface GigabitEthernet 0/0/9
e i.c
w
[S2-GigabitEthernet0/0/9]undo shutdown
[S2-GigabitEthernet0/0/9]quit
u a
g .h
ni n
Configure S1's G0/0/9 as an edge port. Enable edge port protection globally.
r
lea
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]undo shutdown
: //
[S1-GigabitEthernet0/0/9]stp edged-port enable
[S1-GigabitEthernet0/0/9]quit
t t p
[S1]stp bpdu-protection

s :h
c e
Check STP information on S1. ur
s o
Re
[S1]display stp interface GigabitEthernet 0/0/9 brief
MSTID Port Role STP State Protection
0
n g
GigabitEthernet0/0/9

i
DESI FORWARDING BPDU

rn
e
Enable S1's a
G0/0/9 so that the edge port can receive BPDUs. Simulate an attack on

e L
the switch.
or
M
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]undo shutdown
[S1-GigabitEthernet0/0/9]quit

Observe S1.
Dec 21 2011 08:39:51-05:13 S1 %%01IFNET/4/IF_STATE(l)[3]:Interface GigabitEthernet0/0/9 has
turned into UP state.
Dec 21 2011 08:39:51-05:13 S1 %%01MSTP/4/BPDU_PROTECTION(l)[4]:This edged-port

HC Series HUAWEI TECHNOLOGIES 500


HCNP-IERS Chapter 7 STP Configurations

GigabitEthernet0/0/9 that enabled BPDU-Protection will be shutdown, because it received BPDU


packet!
Dec 21 2011 08:39:52-05:13 S1 %%01IFNET/4/IF_STATE(l)[5]:Interface GigabitEthernet0/0/9 has
turned into DOWN state.

After edge port protection is configured, the edge port is shut down once it receives
a BPDU.

e n
Step 7 Configure loop prevention. /
o m
Configure loop prevention on S3's E0/0/23.
e i.c
w
[S3]interface Ethernet0/0/23
[S3-Ethernet0/0/23]stp loop-protection
u a
.h
[S3-Ethernet0/0/23]quit

i n g
Check STP information on S3's E0/0/23.
r n
[S3]display stp interface Ethernet 0/0/23 brief

//lea
MSTID Port Role STP State

p :Protection
0 Ethernet0/0/23
t t
ROOT FORWARDING LOOP

:h
1 Ethernet0/0/23 ALTE DISCARDING LOOP

es
2 Ethernet0/0/23 ALTE DISCARDING LOOP

r c
Step 8 Configure TC BPDU o u protection.
e s
R on S1.
Enable TC BPDU protection

i n
[S1]stp tc-protection g
----Endar
n
L e
r e Exercises: Analysis and Verification
o
Additional
MIf 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?

HC Series HUAWEI TECHNOLOGIES 501


HCNP-IERS Chapter 7 STP Configurations

Device Configurations
<S1>display current-configuration
#
!Software Version V200R008C00SPC500
sysname S1
#
vlan batch 3 to 8
#

e n
stp bpdu-protection
/
stp tc-protection

o m
i.c
#

e
stp region-configuration

w
region-name RG1
revision-level 1
u a
.h
instance 1 vlan 3 to 5
instance 2 vlan 6 to 8
active region-configuration
i n g
#
r n
lea
interface GigabitEthernet0/0/9
shutdown
: //
stp edged-port enable

t t p
:h
#
interface GigabitEthernet0/0/10
port link-type trunk
e s
port trunk allow-pass vlan 2 to 4094
r c
ou
#

e
interface GigabitEthernet0/0/13
s
port link-type trunk
R
#
i n g
port trunk allow-pass vlan 2 to 4094

n
ar
return

e
<S2>display current-configuration

L
e
#

or
!Software Version V200R008C00SPC500
sysname S2

M
#
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

HC Series HUAWEI TECHNOLOGIES 502


HCNP-IERS Chapter 7 STP Configurations

active region-configuration
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/23
e n
port link-type trunk
/
port trunk allow-pass vlan 2 to 4094
o m
i.c
#
interface GigabitEthernet0/0/24
port link-type trunk
w e
port trunk allow-pass vlan 2 to 4094
u a
#

g .h
n
return
<S3>display current-configuration
ni
r
lea
#
!Software Version V200R008C00SPC500
sysname S3
: //
#

t t p
:h
vlan batch 3 to 8

s
#
stp region-configuration

r c e
ou
region-name RG1
revision-level 1
instance 1 vlan 3 to 5
es
instance 2 vlan 6 to 8
R
n g
active region-configuration

i
#
n
ar
interface Ethernet0/0/1

e
L
port link-type trunk

e
port trunk allow-pass vlan 2 to 4094
#
or
M
interface Ethernet0/0/13
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/23
port link-type trunk
port trunk allow-pass vlan 2 to 4094
stp loop-protection
#

HC Series HUAWEI TECHNOLOGIES 503


HCNP-IERS Chapter 7 STP Configurations

return
<S4>display current-configuration
#
!Software Version V200R008C00SPC500
sysname S4
#
vlan batch 3 to 8 30
#
stp mode stp
e n
stp instance 0 priority 4096
/
#
o m
i.c
interface Vlanif30
ip address 100.100.100.8 255.255.255.0
#
w e
interface Ethernet0/0/1
u a
port link-type trunk

g .h
n
port trunk allow-pass vlan 2 to 4094
stp root-protection
ni
r
lea
undo ntdp enable
undo ndp enable
#
: //
interface Ethernet0/0/14

t t p
:h
shutdown

s
undo ntdp enable
undo ndp enable

r c e
ou
bpdu disable
#
interface Ethernet0/0/23
es
port link-type access
R
port default vlan 30

i n g
undo ntdp enable
n
undo ndp enable

e ar
L
bpdu disable
#
e
or
interface Ethernet0/0/24

M
port link-type trunk
port trunk allow-pass vlan 2 to 4094
stp root-protection
undo ntdp enable
undo ndp enable
#
Return

HC Series HUAWEI TECHNOLOGIES 504


The privilege of HCNA/HCNP/HCIE:
With any Huawei Career Certification, you have the privilege on http://learning.huawei.com/en to enjoy:
n
 1、e-Learning Courses: Logon http://learning.huawei.com/en and enter Huawei Training/e-Learning
/e

o m
If you have the HCNA/HCNP certificate:You can access Huawei Career Certification and Basic Technology e-Learning
courses.
e i .c
If you have the HCIE certificate: You can access all the e-Learning courses which marked for HCIE Certification Users.

aw

Methods to get the HCIE e-Learning privilege : Please associate HCIE certificate information with your Huawei account, and

hu

email the account to Learning@huawei.com to apply for HCIE e-Learning privilege.


g .
 2、 Training Material Download
i n

arn
Content: Huawei product training material and Huawei career certification training material.

//le
Method:Logon http://learning.huawei.com/en and enter Huawei Training/Classroom Training ,then you can download
training material in the specific training introduction page.
p :
 3、 Priority to participate in Huawei Online Open Class (LVC)
t t

s :h
The Huawei career certification training and product training covering all ICT technical domains like R&S, UC&C, Security,

4、Learning Tools: rc e
Storage and so on, which are conducted by Huawei professional instructors.

u

s o
eNSP :Simulate single Router&Switch device and large network.

R e
WLAN Planner :Network planning tools for WLAN AP products.

n g
In addition, Huawei has built up Huawei Technical Forum which allows candidates to discuss technical issues with Huawei experts ,

ni
share exam experiences with others or be acquainted with Huawei Products.

a r
 Statement:
L e
r e
This material is for personal use only, and can not be used by any individual or organization for any commercial purposes.
o
M
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential 1

Вам также может понравиться