You are on page 1of 94

Configure OSPF on

NE Series Routers

www.huawei.com

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


Foreword
 Open Shortest Path First (OSPF) is a link state-based
interior gateway protocol (IGP) developed by the Internet
Engineering Task Force (IETF).

 As a link state-based protocol featuring fast convergence,


loop-free routing, and high scalability, OSPF has become an
excellent IGP that is widely used.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page1
Objectives
 Upon completion of this course, you will be able to:
 Describe the meanings and functions of OSPF configuration
parameters

 Configure OSPF on a network that consists of NE series


routers

 Analyze and handle common faults that occur during OSPF


configuration on NE series routers

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page2
Contents
1. OSPF Overview

2. Basic OSPF Concepts

3. OSPF Route Calculation

4. OSPF Configuration on NE Series Routers

5. Hands-on Practice of OSPF

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page3
Contents
1. OSPF Overview

2. Basic OSPF Concepts

3. OSPF Route Calculation

4. OSPF Configuration on NE Series Routers

5. Hands-on Practice of OSPF

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page4
Basic Characteristics of OSPF
 Supporting Classless Inter-Domain Routing (CIDR)

 Free of routing loops

 Fast convergence

 Sending and receiving protocol data by using IP


multicast

 Supporting equal-cost routes

 Supporting protocol packet authentication

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page5
Route Calculation Using the Link State
Algorithm

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page6
Self-Test Question About OSPF Overview

1.Which of the following statements about OSPF are true? ( )

A.OSPF uses a link state routing algorithm.

B.OSPF uses a distance vector routing algorithm.

C.OSPF is an Interior Gateway Protocol (IGP).

D.OSPF is an Exterior Gateway Protocol (EGP)

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page7
Contents
1. OSPF Overview

2. Basic OSPF Concepts

3. OSPF Route Calculation

4. OSPF Configuration on NE Series Routers

5. Hands-on Practice of OSPF

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page8
AS (Autonomous System)
 In OSPF, an AS refers to a group of routers that exchange
routing information by running the same routing protocol.

OSPF

 In this example, all the routers run OSPF and belong to the
same AS.
Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page9
Router ID
 A router ID is a 32-bit integer that uniquely identifies an
OSPF router in an AS. The format of a router ID is the same
as that of an IP address.
[~HUAWEI]router id 1.1.1.1
[~HUAWEI]commit
[~HUAWEI]display router id
RouterID:1.1.1.1

 In this example, run the router id 1.1.1.1 command to


configure the router ID of the router as 1.1.1.1. After the
router ID is configured, run the display router id command.
The command output information shows that the router ID of
the router is 1.1.1.1
Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page10
Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page11
Cost
 An OSPF cost is a 16-bit unsigned integer ranging from 1 to
65535.
1. By default, the cost of an interface is calculated as 108/BW(bps)

2. The cost of an OSPF interface can be configured manually

[~HUAWEI-Ethernet0/0]ospf cost 100


[~HUAWEI-Ethernet0/0]commit

3. Bandwidth reference values are configurable. When configuring


bandwidth reference values, ensure that the bandwidth reference values
of all the routers running the OSPF process are the same.
[~HUAWEI]ospf
[~HUAWEI-ospf-1]bandwidth-reference 1000
[~HUAWEI-ospf-1]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page12
OSPF Area (1/2)

Area 1
Area 4
Area 0 is Backbone area ,
for ABR at least one Area 0
interface belongs to Area
0.

Area 2
Area 3

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page13
OSPF Area (2/2)

Area 1
Area 4
Area 0

Area 2
Area 3
[~HUAWEI]ospf
[~HUAWEI-ospf-1]area 2
[~HUAWEI-ospf-1-area-0.0.0.2]network 12.1.1.0 0.0.0.3
[~HUAWEI-ospf-1-area-0.0.0.2]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page14
OSPF Router Roles
BR

ASBR

Area 0 Import ISIS route

Area 1
Area 2

ABR ABR

IR

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page15
Self-Test Questions About OSPF Basic
Concepts
1. In the OSPF routing domain, ( ) uniquely identifies an
OSPF router.

A. Area ID

B. AS ID

C. Router ID

D. Cost

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page16
Self-Test Questions About OSPF Basic
Concepts
2.Which of the following statements about the backbone area
are true in an OSPF network? ( )

A. The area ID of the backbone area is 0.0.0.0.

B. All non-backbone areas must connect to the backbone area.

C. No non-backbone area can directly connect to another one.

D. At least one backbone area is required in areas to which


the ABR belongs.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page17
Self-Test Questions About OSPF Basic
Concepts
3. In the OSPF routing domain, the router importing external
routes is called ( ).

A. ABR

B. BR

C. ASBR

D. IR

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page18
Contents
1. OSPF Overview

2. Basic OSPF Concepts

3. OSPF Route Calculation

4. OSPF Configuration on NE Series Routers

5. Hands-on Practice of OSPF

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page19
Contents
3. OSPF Route Calculation

3.1 OSPF Packets

3.2 Establishment of Neighbor Relationship and


Adjacency

3.3 Establishment of An Adjacency and LSDB


Synchronization

3.4 OSPF Route Calculation

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page20
OSPF Packet Types

Type Packet name Packet function


Discover /maintain neighbor
1 Hello
relationships
2 Database DescriptionSummarize database contents
3 Link State Request Database download
4 Link State Update Database update

5 Link State Ack Flooding acknowledgement

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page21
OSPF Packet Header Authentication-
Interface Authentication
Configure simple password
"huawei"

Area 1
Loopback0 E0/0 E0/0 Loopback0
1.1.1.1/32 2.2.2.2/32
RTA RTB

[~RTA-Ethernet0/0]ospf authentication-mode simple


plain huawei
[~RTA-Ethernet0/0]commit
[~RTB-Ethernet0/0]ospf authentication-mode simple
plain huawei
[~RTB-Ethernet0/0]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page22
OSPF Packet Header Authentication-
Area Authentication
Configure simple password
"huawei"

Area 1
Loopback0 E0/0 E0/0 Loopback0
1.1.1.1/32 2.2.2.2/32
RTA RTB

[~RTA-ospf-1-area-0.0.0.1]authentication-mode
simple plain huawei
[~RTA-ospf-1-area-0.0.0.1]commit
[~RTB-ospf-1-area-0.0.0.1]authentication-mode
simple plain huawei
[~RTB-ospf-1-area-0.0.0.1]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page23
Contents
3. OSPF Route Calculation

3.1 OSPF Packets

3.2 Establishment of Neighbor Relationship and


Adjacency

3.3 Establishment of An Adjacency and LSDB


Synchronization

3.4 OSPF Route Calculation

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page24
What Is Neighbor? What Is Adjacency?

I have 3
neighbors

RTA
10.1.1.1
10.1.1.2

Ethernet
10.1.1.3 10.1.1.4

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page25
What Are the OSPF Network Types?-P2P
and Broadcast

PPP 10.1.1.1 10.1.1.2


10.1.1.1 20.1.1.1
Ethernet
10.1.1.3 10.1.1.4
Point to Point Network

Broadcast Network

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page26
What Are the OSPF Network Types?-
NBMA

VPI/VCI=0/102 VPI/VCI=0/103

10.1.1.1
Full meshed
ATM network

ATM

Non-Broadcast Multiple Access(


(NBMA)

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page27
What Are the OSPF Network Types?-
P2MP

DLCI = 102 DLCI = 103

10.1.1.1
Non-full meshed frame
relay network

FR

Point-to-MultiPoint

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page28
Default Network Types Corresponding to
Common Link Layer Protocols

Network type Common data link layer protocols

Point-to-point PPP, LAPB, HDLC

Broadcast Ethernet

NBMA Frame Relay, ATM

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page29
DR and BDR

I have 3 neighbors, but only


2 adjacencies

RTA
10.1.1.1 10.1.1.2

Ethernet
10.1.1.3 10.1.1.4

BDR DR

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page30
DR Election and BDR Election
 Instead of being manually specified, the DR and BDR are
elected among all the routers on the local network segment.
The DR priority of a router interface determines the eligibility
of the interface in the DR election and BDR election.

Router with highest DR


Priority may not be DR/BDR

10.1.1.3
120

90 10.1.1.2
Ethernet 100
10.1.1.1

BDR DR Red numbers indicate


DR Priority of interface

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page31
DR Election and BDR Election
 DR election and BDR election takes time and affects the speed of OSPF
route convergence. During the actual OSPF application, the broadcast
network and NBMA network types are often changed to the P2P type to
prevent the election of the DR or BDR. The following command is used to
change the network type of an OSPF network interface:
[~RTB-Ethernet0/0] ospf network-type p2p
[~RTB-Ethernet0/0] commit
 The following figure describes whether adjacencies are established with
neighbors for different network types:
Network Type Establish Adjacency with Neighbor or not
Point-to-Point Neighbors always become adjacent
Point-to-MultiPoint Neighbors always become adjacent
DR is always adjacent to all the other routers including BDR;
Broadcast BDR is always adjacent to all the other routers including DR;
NBMA Routers whose interface state is DROther is adjacent to only
DR and BDR.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page32
Establishment of Neighbor Relationship (1/3)
 Neighbor relationship establishment on a
broadcast network:
Router id
Router id 2.2.2.2
1.1.1.1

RTA RTB

Down Down
1 Hello (one-way)
Init

2 Hello (two-way)
Two-way

3 Hello (two-way)
Two-way

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page33
Establishment of Neighbor Relationship (2/3)

 The difference between the 1-way and 2-way states is as


follows: If a Hello packet carrying the router's router ID has
recently been seen from the neighbor, it indicates the 2-way
state. Otherwise, it indicates the 1-way state.
<HUAWEI>display ospf peer

OSPF Process 1 with Router ID 4.4.4.4


Neighbors

Area 0.0.0.1 interface 10.1.1.4(Ethernet0/0)'s neighbor(s)


RouterID: 1.1.1.1 Address: 10.1.1.1
State: 2 Way Mode: None Priority: 1
DR: 10.1.1.2 BDR: 10.1.1.3
Dead timer expires in 37s
Retrans timer interval: 5
Neighbor is up for 00h00m49s
Authentication Sequence: [ 0 ]

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page34
Establishment of Neighbor Relationship (3/3)
 Neighbor relationship establishment on a P2P network:
Router id
Router id 2.2.2.2
1.1.1.1

RTA RTB

Down Down
1 Hello
Init

2 Hello
Init
 No DR or BDR needs to be elected on a P2P link, P2MP
link, or virtual link.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page35
Contents
3. OSPF Route Calculation

3.1 OSPF Packets

3.2 Establishment of Neighbor Relationship and


Adjacency

3.3 Establishment of An Adjacency and LSDB


Synchronization

3.4 OSPF Route Calculation

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page36
Adjacency Establishment Process
(1/2)
Router id Router id Master
1.1.1.1 2.2.2.2
Adjacency relationship
RTA RTB

1 DD, Seq=552A, I, M, MS
ExStart

2 DD, Seq=5528, I, M, MS
ExStart  Exchange ExStart

3 DD, Seq=5528
Exchange ExStart  Exchange

4 DD, Seq=5529, MS
Exchange Exchange

5 DD, Seq=5529
Exchange Exchange  Full
Exchange  Loading

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page37
Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page38
Adjacency Establishment Process
(2/2)
Router id Router id
1.1.1.1 2.2.2.2
Adjacency relationship
RTA RTB

7 LS Request
Loading Full

8 LS Update
Loading  Full Full

9 LS Ack
Full Full

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page39
Check Neighbor State of OSPF
Router
<RTA>display ospf peer

OSPF Process 1 with Router ID 1.1.1.1


Neighbors
Area 0.0.0.0 interface 10.1.1.1(Ethernet0/0)'s neighbor(s)
RouterID: 2.2.2.2 Address: 10.1.1.2
State: Full Mode: Nbr is Master Priority: 1
DR: 10.1.1.1 BDR: 10.1.1.2
Dead timer expires in 37s
Retrans timer interval: 5
Neighbor is up for 00h05m52s
Authentication Sequence: [ 0 ]

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page40
LSDB Synchronization
 Synchronized LSDBs are the basis for proper OSPF route
calculation. When an adjacency is established, an OSPF router
completes the LSDB synchronization with the adjacent router.

 After an adjacency is established and LSDB synchronization is


completed, LSAs are updated in the following ways:
 Periodic update: Every 30 minutes, an OSPF router floods the LSAs
in the LSDB of the current area to the adjacent routers in the
corresponding areas.

 Triggered update: When a network topology change occurs, the


router generates new LSAs and floods them so that the topology
information about the network remains correct and consistent.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page41
Contents
3. OSPF Route Calculation

3.1 OSPF Packets

3.2 Establishment of Neighbor Relationship and


Adjacency

3.3 Establishment of An Adjacency and LSDB


Synchronization

3.4 OSPF Route Calculation

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page42
What Is An LSA?
LSA Type LSA Name LSA Description
Generated by each router. Describing the collected states of the
1 Router-LSA router’s interfaces, flooded only within the area where this LSA is
generated.

2 Generated by DR, available in broadcast and NBMA network.


Network -LSA Describing the set of routers attached to the network. flooded only
within the area where this LSA is generated.

Network -Generated by ABR. Describing routes to networks that are outside


3 area but inside the AS, flooded within the area where this LSA is
Summary-LSA generated.

ASBR
- Generated by ABR. Describing routes to ASBRs, flooded within the
4
Summary-LSA area where this LSA is generated.

AS-external- Generated by ASBR. Describing routes to destinations external to


5 As, flooded within the whole AS.
LSA

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page43
Intra-Area Route Calculation

Area 1

Router-LSA Network-LSA

DR

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page44
Inter-Area Route Calculation

Area 1
Area 0
N1

ABR

Router-LSA Network-Summary-LSA

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page45
External Route Calculation (1/2)

Area 1
Area 0

ABR ASBR Connected to


another AS by
BGP
-external-LSA
ASBR AS-external-LSA

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page46
External Route Calculation (2/2)

Des N1, type=1, cost=100


Cost=1
RTC
RTA

RTB

Cost=1 Des N1, type=2, cost=20

Destination Type Cost Next hop


N1 1 101 RTA √
N1 2 20 RTB

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page47
Route Calculation in Special Areas-Stub
Area (1/3)

StubArea Flood AS- externalLSA

Area 0
Flood AS-external LSA
Area 1
RTB
Area 2

RTAConnected to another AS by BGP

Flood a default route by Network


SummaryLSA ,will not flood AS
external LSA .

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page48
Route Calculation in Special Areas-Stub
Area (2/3)

Area 1 Area 0
RTA RTB RTC RTD
10.1.1.0/30 10.2.1.0/30 10.3.1.0/30
.1 .2 .1 .2 .1 .2

Stub Area
Loopback0
10.4.1.1/24
Configure a static to
10.4.1.0/24 on RTC and
import it to OSPF

[~RTA-ospf-1-area-0.0.0.1] stub
[~RTA-ospf-1-area-0.0.0.1] commit
[~RTB-ospf-1-area-0.0.0.1] stub
[~RTB-ospf-1-area-0.0.0.1] commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page49
Route Calculation in Special Areas-Stub
Area (3/3)
<RTA>display ospf lsdb

OSPF Process 1 with Router ID 1.1.1.1


Link State Database

Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 165 36 80000004 1
Router 1.1.1.1 1.1.1.1 165 36 80000003 1
Network 10.1.1.2 2.2.2.2 166 32 80000001 0
Sum-Net 0.0.0.0 2.2.2.2 228 28 80000001 1
Sum-Net 10.2.1.0 2.2.2.2 228 28 80000001 1

RTB only advertise a default Inter-area routes are still


route not advertise an AS- advertised to STUB area.
External-LSA.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page50
Route Calculation in Special Areas-Total
Stub Area (1/2)

Area 1 Area 0
RTA RTB RTC RTD
10.1.1.0/30 10.2.1.0/30 10.3.1.0/30
.1 .2 .1 .2 .1 .2

Stub Area
Loopback0
10.4.1.1/24
Configure a static to
10.4.1.0/24 on RTC and
import it to OSPF

[~RTA-ospf-1-area-0.0.0.1] stub
[~RTA-ospf-1-area-0.0.0.1] commit
[~RTB-ospf-1-area-0.0.0.1] stub no-summary
[~RTB-ospf-1-area-0.0.0.1] commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page51
Route Calculation in Special Areas-Total
Stub Area (2/2)

<RTA>display ospf lsdb

OSPF Process 1 with Router ID 1.1.1.1


Link State Database

Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 10 36 80000008 1
Router 1.1.1.1 1.1.1.1 10 36 80000008 1
Network 10.1.1.1 1.1.1.1 14 32 80000001 0
Sum-Net 0.0.0.0 2.2.2.2 550 28 80000001 1

Only advertise a default route


Not advertise any inter area routing information
Not advertise any AS external LSA

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page52
Route Calculation in Special Areas- Not
So Stubby Area (NSSA)
Transform type 7
LSA into type 5 Configure the static
LSA route to10.4.1.0/24
Area 1
Area 0
NSSA
RTA RTC RTD
10.1.1.0/24 10.2.1.0/24 10.3.1.0/24
.1 .2 .1 .2 .1 .2
RTB
Loopback0
10.4.1.1/24

Flood type 5 LSA Flood type 7 LSA

[~RTB-ospf-1-area-0.0.0.1] nssa
[~RTB-ospf-1-area-0.0.0.1] commit
[~RTC-ospf-1-area-0.0.0.1] nssa
[~RTC-ospf-1-area-0.0.0.1] commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page53
OSPF Route Aggregation-Route
Aggregation on ABR

RouterC Area 0 RouterA

19.1.1.0/24
RouterB 19.1.2.0/24
19.1.0.0/16 19.1.3.0/24
ABR ABR
….

Area 19

[~RouterA-ospf-1-area-0.0.0.19]abr-summary
19.1.0.0 255.255.0.0
[~RouterA-ospf-1-area-0.0.0.19]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page54
OSPF Route Aggregation-Route
Aggregation on ASBR

RouterC Area 0 RouterA Import route

19.1.1.0/24
RouterB 19.1.2.0/24
19.1.0.0/16 19.1.3.0/24
ABR ABR
….
19.1.0.0/1
ASBR Area 19
6

[~RouterB-ospf-1]asbr-summary 19.1.0.0
255.255.0.0
[~RouterB-ospf-1]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page55
Self-Test Questions About OSPF Route
Calculation
1. Which of the following OSPF protocol packets contains
detailed information about the router link state? ( )

A. LSR

B. LSU

C. Router LSA

D. AS-External LSA

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page56
Self-Test Questions About OSPF Route
Calculation
2. Which of the following two routers can establish adjacency
relationships? ( )

A. Two routers in a point-to-point link

B. A DR router and a DR-other router in a broadcast network

C. A DR router and a BDR router in a broadcast network

D. Two DR-other routers in an NBMA network

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page57
Self-Test Questions About OSPF Route
Calculation
3. ( ) indicates a stable neighbor relationship and ( )
indicates a stable adjacency relationship after neighbor and
adjacency relationships are established and the LSDB is
synchronized.

A. Exchange

B. Full

C. 2-Way

D. Init

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page58
Self-Test Questions About OSPF Route
Calculation
4. OSPF calculates routes in an area based on ( ), calculates
routes between different areas based on ( ), and calculates
routes outside an area based on ( ).

A. Type 1 LSA

B. Type 2 LSA

C. Type 3 LSA

D. Type 4 LSA

E. Type 5 LSA

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page59
Contents
1. OSPF Overview

2. Basic OSPF Concepts

3. OSPF Route Calculation

4. OSPF Configuration on NE Series Routers

5. Hands-on Practice of OSPF

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page60
Typical Scenario of OSPF Application on
MAN

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page61
Configuration Example-Topology
Description
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

 In the topology, there are four routers. Two routers function


as CRs, and the other two routers function as ARs. Each
AR is connected to the two CRs by using dual uplinks.
Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page62
OSPF Basic Configuration Procedure

Step Operation View Command


1 Configure a router [~HUAWEI] router id router
ID. id
2 Create an OSPF [~HUAWEI] ospf process id
process.
3 Configure an OSPF [~HUAWEI-ospf-1] area area id
area.
4 Advertise the [~HUAWEI -ospf-1- network ip-
network segments area-1] address
contained in the wildcard-mask
area.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page63
OSPF Basic Configuration-Configuration on
CR1
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0
The configurations
Area1 Area2 of CR2 is similar to
CR1.

[~CR1]router
AR1 id 1.1.1.1 AR2
[~CR1]ospf
LO: 3.3.3.3/32 LO: 4.4.4.4/32
[~CR1-ospf-1]area 1
[~CR1-ospf-1-area-0.0.0.1]network 20.1.1.0 0.0.0.3
[~CR1-ospf-1-area-0.0.0.1]quit
[~CR1-ospf-1]area 2
[~CR1-ospf-1-area-0.0.0.2]network 30.1.1.0 0.0.0.3
[~CR1-ospf-1]area 0
[~CR1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.3
[~CR1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[~CR1-ospf-1-area-0.0.0.0]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page64
OSPF Basic Configuration-Configuration
on AR1
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0
The configurations
Area1 Area2 of AR2 is similar to
AR1.

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

[~AR1]router id 3.3.3.3
[~AR1]ospf
[~AR1-ospf-1]area 1
[~AR1-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[~AR1-ospf-1-area-0.0.0.1]network 20.1.1.0 0.0.0.3
[~AR1-ospf-1-area-0.0.0.1]network 21.1.1.0 0.0.0.3
[~AR1-ospf-1-area-0.0.0.1]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page65
Basic Configuration-Check the Information
About OSPF Neighbor State
<AR1>display ospf peer
OSPF Process 1 with Router ID 3.3.3.3
Neighbors
Area 0.0.0.1 interface 20.1.1.1(Ethernet0/0/0)'s neighbors
Router ID: 1.1.1.1 Address: 20.1.1.2
State: Full Mode:Nbr is Slave Priority: 1
DR: 20.1.1.1 BDR: 20.1.1.2 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 5
Neighbor is up for 00:19:45
Authentication Sequence: [ 0 ]
Neighbors
Area 0.0.0.1 interface 21.1.1.1(Ethernet0/0/1)'s neighbors
Router ID: 2.2.2.2 Address: 21.1.1.2
State: Full Mode:Nbr is Slave Priority: 1
DR: 21.1.1.1 BDR: 21.1.1.2 MTU: 0
Dead timer due in 33 sec
Retrans timer interval: 5
Neighbor is up for 00:06:21
Authentication Sequence: [ 0 ]

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page66
Basic Configuration-Check IP Routing
Table
<AR1>display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------
Routing Tables: _public_
Destinations : 13 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 1 D 20.1.1.2 Ethernet0/0/0
2.2.2.2/32 OSPF 10 1 D 21.1.1.2 Ethernet0/0/1
3.3.3.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0
4.4.4.4/32 OSPF 10 2 D 21.1.1.2 Ethernet0/0/1
OSPF 10 2 D 20.1.1.2 Ethernet0/0/0
10.1.1.0/30 OSPF 10 2 D 20.1.1.2 Ethernet0/0/0
OSPF 10 2 D 21.1.1.2 Ethernet0/0/1
20.1.1.0/30 Direct 0 0 D 20.1.1.1 Ethernet0/0/0
20.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
21.1.1.0/30 Direct 0 0 D 21.1.1.1 Ethernet0/0/1
21.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
30.1.1.0/30 OSPF 10 2 D 20.1.1.2 Ethernet0/0/0
31.1.1.0/30 OSPF 10 2 D 21.1.1.2 Ethernet0/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

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page67
OSPF Route Redistribution Configuration

 Configuring Tasks: On AR1, configure static routes and


redistribute the static routes into OSPF.
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page68
OSPF Route Redistribution Configuration-
Configuration of AR1
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

[~AR1]ip route-static 100.1.1.0 24 NULL 0


[~AR1]ip route-static 100.1.2.0 24 NULL 0
[~AR1]ip route-static 100.1.3.0 24 NULL 0
[~AR1]ospf
[~AR1-ospf-1]import-route static
[~AR1-ospf-1]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page69
OSPF Route Redistribution Configuration-
IP Routing Table of AR1

<AR1>display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------
Routing Tables: _public_
Destinations : 16 Routes : 18
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 1 D 20.1.1.2 Ethernet0/0/0
……
31.1.1.0/30 OSPF 10 2 D 21.1.1.2 Ethernet0/0/1
100.1.1.0/24 Static 60 0 D 0.0.0.0 NULL0
100.1.2.0/24 Static 60 0 D 0.0.0.0 NULL0
100.1.3.0/24 Static 60 0 D 0.0.0.0 NULL0
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

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page70
OSPF Route Redistribution Configuration-
IP Routing Table of AR2

<AR2>display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------
Routing Tables: _public_
Destinations : 16 Routes : 21
Destination/Mask Proto Pre Cost Flags NextHop Interface

……
31.1.1.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
100.1.1.0/24 O_ASE 150 1 D 30.1.1.1 Ethernet0/0/1
O_ASE 150 1 D 31.1.1.1 Ethernet0/0/0
100.1.2.0/24 O_ASE 150 1 D 30.1.1.1 Ethernet0/0/1
O_ASE 150 1 D 31.1.1.1 Ethernet0/0/0
100.1.3.0/24 O_ASE 150 1 D 30.1.1.1 Ethernet0/0/1
O_ASE 150 1 D 31.1.1.1 Ethernet0/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

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page71
OSPF Route Aggregation Configuration
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

[~AR1-ospf-1]asbr-summary 100.1.0.0 255.255.0.0


[~AR1-ospf-1]commit

 Summarize the static routes configured in the previous


configuration task into a summary route.
Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page72
OSPF Route Aggregation Configuration-
IP Routing Table of AR2

<AR2> display ip routing-table


Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------
Routing Tables: _public_
Destinations : 14 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
……
31.1.1.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
100.1.0.0/16 O_ASE 150 2 D 30.1.1.1 Ethernet0/0/1
O_ASE 150 2 D 31.1.1.1 Ethernet0/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

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page73
OSPF Special Area Configuration-NSSA
Area Configuration (1/7)
 Configuring Tasks: On the MAN, it is required that AR2 redistribute the
static routes to user networks, instead of receiving any external route
redistributed by CRs. Therefore, area 2 is configured as an NSSA.

LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page74
OSPF Special Area Configuration-NSSA
Area Configuration (2/7)
 NSSA Configuration on CR2:
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

[~CR2]ospf
[~CR2-ospf-1]area 2
[~CR2-ospf-1-area-0.0.0.2]nssa
[~CR2-ospf-1-area-0.0.0.2]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page75
OSPF Special Area Configuration-NSSA
Area Configuration (3/7)
 NSSA Configuration on AR2:
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

[~AR2]ospf
[~AR2-ospf-1]area 2
[~AR2-ospf-1-area-0.0.0.2]nssa
[~AR2-ospf-1-area-0.0.0.2]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page76
OSPF Special Area Configuration-NSSA
Area Configuration (4/7)
 IP routing table information on AR2:

<AR2>display ip routing-table
Route Flags: R - relay, D - download to fib
----------------------------------------------------------------------
Routing Tables: _public_
Destinations : 15 Routes : 18
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_NSSA 150 1 D 31.1.1.1 Ethernet0/0/0
O_NSSA 150 1 D 30.1.1.1 Ethernet0/0/1
1.1.1.1/32 OSPF 10 1 D 30.1.1.1 Ethernet0/0/1
……
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
200.1.1.0/24 Static 60 0 D 0.0.0.0 NULL0

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page77
OSPF Special Area Configuration-NSSA
Area Configuration (5/7)
 On AR2, redistribute the static routes to user networks:
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

[~AR2]ip route-static 200.1.1.0 24 NULL 0


[~AR2]ospf
[~AR2-ospf-1]import-route static
[~AR2-ospf-1]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page78
OSPF Special Area Configuration-NSSA
Area Configuration (6/7)
 IP routing table of CR2:

<CR2>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

……
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
200.1.1.0/24 O_NSSA 150 1 D 31.1.1.2 Ethernet0/0/0

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page79
OSPF Special Area Configuration-NSSA
Area Configuration (7/7)
 IP routing table of AR2:

<AR1>display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------
Routing Tables: _public_
Destinations : 17 Routes : 18

Destination/Mask Proto Pre Cost Flags NextHop Interface

……
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
200.1.1.0/24 O_ASE 150 1 D 21.1.1.2 Ethernet0/0/1
O_ASE 150 1 D 20.1.1.2 Ethernet0/0/0

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page80
OSPF Network Security Configuration
(1/2)
 Configure OSPF interface authentication on NE series routers by
using the interconnection between AR1 and CR1:
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

[~CR1-Ethernet0/0/0]ospf
Area1 authentication-mode
Area2 md5 100
cipher huawei
[~CR1-Ethernet0/0/0]commit

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

[~AR1-Ethernet0/0/0]ospf authentication-mode md5 100


cipher huawei
[~AR1-Ethernet0/0/0]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page81
OSPF Network Security Configuration
(2/2)
 OSPF neighbor information on CR1:
<CR1>display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors

Area 0.0.0.0 interface 10.1.1.1(Ethernet0/0/1)'s neighbors


……
Authentication Sequence: [ 0 ]

Neighbors

Area 0.0.0.1 interface 20.1.1.2(Ethernet0/0/0)'s neighbors


Router ID: 3.3.3.3 Address: 20.1.1.1
State: Full Mode:Nbr is Master Priority: 1
DR: 20.1.1.1 BDR: 20.1.1.2 MTU: 0
Dead timer due in 33 sec
Retrans timer interval: 5
Neighbor is up for 00:00:06
Authentication Sequence: [ 3799]

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page82
Modification of OSPF Interface Costs (1/3)

 Configure OSPF interface authentication on AR1 and CR1:


LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32
[~AR1]interface Ethernet0/0/0
[~AR1-Ethernet0/0/0]ospf cost 100
[~AR1-Ethernet0/0/0]quit
[~AR1]interface Ethernet 0/0/1
[~AR1-Ethernet0/0/1]ospf cost 200
[~AR1-Ethernet0/0/1]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page83
Modification of OSPF Interface Costs (2/3)
 IP Routing table information on AR1 (before the cost modification):
<AR1>display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------
Routing Tables: _public_
Destinations : 17 Routes : 20
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 1 D 20.1.1.2 Ethernet0/0/0
2.2.2.2/32 OSPF 10 1 D 21.1.1.2 Ethernet0/0/1
3.3.3.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0
4.4.4.4/32 OSPF 10 2 D 21.1.1.2 Ethernet0/0/1
OSPF 10 2 D 20.1.1.2 Ethernet0/0/0
10.1.1.0/30 OSPF 10 2 D 20.1.1.2 Ethernet0/0/0
OSPF 10 2 D 21.1.1.2 Ethernet0/0/1
……
30.1.1.0/30 OSPF 10 2 D 20.1.1.2 Ethernet0/0/0
31.1.1.0/30 OSPF 10 2 D 21.1.1.2 Ethernet0/0/1
……
200.1.1.0/24 O_ASE 150 1 D 21.1.1.2 Ethernet0/0/1
O_ASE 150 1 D 20.1.1.2 Ethernet0/0/0

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page84
Modification of OSPF Interface Costs (3/3)

 IP Routing table information on AR1 (after the cost modification):


<AR1>display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------
Routing Tables: _public_
Destinations : 17 Routes : 17

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 OSPF 10 100 D 20.1.1.2 Ethernet0/0/0


2.2.2.2/32 OSPF 10 101 D 20.1.1.2 Ethernet0/0/0
3.3.3.3/32 Direct 0 0 D 127.0.0.1 InLoopBack0
4.4.4.4/32 OSPF 10 101 D 20.1.1.2 Ethernet0/0/0
10.1.1.0/30 OSPF 10 101 D 20.1.1.2 Ethernet0/0/0
……
30.1.1.0/30 OSPF 10 101 D 20.1.1.2 Ethernet0/0/0
31.1.1.0/30 OSPF 10 102 D 20.1.1.2 Ethernet0/0/0
……

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page85
OSPF Fast Convergence Configuration
(1/3)
 Configuration of CR1:

LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32

CR1 CR2
Area0

Area1 Area2

[~CR1]interface
AR1 Ethernet0/0/0 AR2
[~CR1-Ethernet0/0/0]ospf
LO: 3.3.3.3/32 network-type p2p
LO: 4.4.4.4/32
[~CR1]interface Ethernet0/0/0
[~CR1-Ethernet0/0/0]ospf timer hello 3
[~CR1-Ethernet0/0/0]commit

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page86
OSPF Fast Convergence Configuration
(2/3)
 Configuration of AR1:

LO: 1.1.1.1/32
[~AR1]interface Ethernet0/0/0
10.1.1.0/30 LO: 2.2.2.2/32
[~AR1-Ethernet0/0/0]ospf network-type p2p
CR1
[~AR1]interface Ethernet0/0/0 CR2
Area0
[~AR1-Ethernet0/0/0]ospf timer hello 3
[~AR1-Ethernet0/0/0]commit
Area1 Area2

AR1 AR2
LO: 3.3.3.3/32 LO: 4.4.4.4/32

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page87
OSPF Fast Convergence Configuration
(3/3)
 OSPF neighbor information on AR1:
<AR1>display ospf peer
OSPF Process 1 with Router ID 3.3.3.3
Neighbors
Area 0.0.0.1 interface 20.1.1.1(Ethernet0/0/0)'s neighbors
Router ID: 1.1.1.1 Address: 20.1.1.2
State: Full Mode:Nbr is Slave Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 8 sec
Retrans timer interval: 4
Neighbor is up for 00:01:17
Authentication Sequence: [ 15488]
Neighbors
Area 0.0.0.1 interface 21.1.1.1(Ethernet0/0/1)'s neighbors
Router ID: 2.2.2.2 Address: 21.1.1.2
State: Full Mode:Nbr is Slave Priority: 1
DR: 21.1.1.1 BDR: 21.1.1.2 MTU: 0
Dead timer due in 35 sec
Retrans timer interval: 4
Neighbor is up for 04:18:16
Authentication Sequence: [ 0 ]

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page88
Contents
1. OSPF Overview

2. Basic OSPF Concepts

3. OSPF Route Calculation

4. OSPF Configuration on NE Series Routers

5. Hands-on Practice of OSPF

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page89
Hands-on Practice-Topology Description
LO: 1.1.1.1/32 10.1.1.0/30 LO: 2.2.2.2/32
CR CR2
1 Area0

Area1 Area2

AR AR2
1 LO: 3.3.3.3/32 LO: 4.4.4.4/32
Loopback1: 100.1.1.1/32 Loopback1: 200.1.1.1/32
Loopback2: 100.1.1.2/32 Loopback2: 200.1.1.2/32
Loopback3: 100.1.1.3/32 Loopback3: 200.1.1.3/32
 Configure OSPF for the preceding topology, where the user
networks connected to the ARs are simulated by using
Loopback1, Loopback2, and Loopback3.
Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page90
Hands-on Tasks
Task Description

1 Configure OSPF basic functions according to the area planning in the


topology, and complete the interconnection among the network segments.
2 Import the routes to user network segments into OSPF as external routes,
instead of directly redistributing these routes into OSPF. In addition,
summarize the routes to contiguous network segments before the import.
3 Configure area 2 as an OSPF special area. It is required that no external
route on CRs be imported into area 2. The routes to the user network
segments connected to area 2, however, can be imported into area 2.
4 Set the link costs properly so that active/standby backup is implemented on
the uplinks of ARs and inter-area traffic does not traverse the backbone link.

5 Configure OSPF packet authentication on different links to enhance network


security.
6 Set proper OSPF network types and timers to accelerate OSPF route
convergence.

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page91
Summary
 The contents of this course are as follows:
 OSPF overview and basic concepts

 Basic procedure of OSPF route calculation

 OSPF configuration on NE router

Copyright © 2017 Huawei Technologies Co., Ltd. All rights reserved. Page92
Thank you
www.huawei.com

You might also like