Sunteți pe pagina 1din 70

Operation Manual - IP Routing Volume

Quidway NetEngine20 Series Routers Table of Contents



Huawei Technologies Proprietary
i
Table of Contents
Chapter 4 OSPF Configuration .................................................................................................... 4-1
4.1 Introduction ........................................................................................................................ 4-1
4.1.1 OSPF Basic Concepts ............................................................................................ 4-2
4.1.2 OSPF Areas and Route Aggregation...................................................................... 4-3
4.1.3 OSPF Network Types ............................................................................................. 4-9
4.1.4 OSPF Packet Format ............................................................................................ 4-11
4.1.5 OSPF Features Supported by the NE20............................................................... 4-20
4.1.6 Protocols and Specifications................................................................................. 4-22
4.2 Configuring OSPF Basic Functions ................................................................................. 4-22
4.2.1 Establishing the Configuration Task...................................................................... 4-22
4.2.2 Enabling OSPF and Entering OSPF View............................................................ 4-23
4.2.3 Configuring the Network Segments Included by Each Area................................. 4-24
4.3 Configuring OSPF Area Features.................................................................................... 4-24
4.3.1 Establishing the Configuration Task...................................................................... 4-24
4.3.2 Configuring OSPF Stub Areas .............................................................................. 4-25
4.3.3 Configuring OSPF NSSA Areas............................................................................ 4-26
4.3.4 Configuring OSPF Virtual Links ............................................................................ 4-27
4.4 Configuring OSPF Network Types................................................................................... 4-27
4.4.1 Establishing the Configuration Task...................................................................... 4-27
4.4.2 Configuring Network Types of OSPF Interfaces................................................... 4-28
4.4.3 Configuring Neighbors for NBMA Networks.......................................................... 4-28
4.4.4 Configuring DR Priorities of OSPF Interfaces....................................................... 4-29
4.5 Controlling OSPF Routing Information ............................................................................ 4-29
4.5.1 Establishing the Configuration Task...................................................................... 4-29
4.5.2 Configuring OSPF Route Aggregation.................................................................. 4-30
4.5.3 Configuring OSPF to Filter the Received Routes ................................................. 4-31
4.5.4 Configuring OSPF to Filter ABR Type3 LSA......................................................... 4-31
4.5.5 Configuring the Link Cost of OSPF....................................................................... 4-31
4.5.6 Configuring the Maximum Number of Equal-Cost Routes.................................... 4-32
4.5.7 Configuring the Protocol Preference of OSPF...................................................... 4-32
4.5.8 Configuring OSPF to Import External Routes....................................................... 4-33
4.6 Adjusting and Optimizing OSPF Networks...................................................................... 4-34
4.6.1 Establishing the Configuration Task...................................................................... 4-34
4.6.2 Configuring OSPF Packet Timer........................................................................... 4-35
4.6.3 Configuring the Delay of Transmitting LSAs on the Interface............................... 4-36
4.6.4 Configuring the Interval of SPF Calculation.......................................................... 4-37
4.6.5 Disabling the Interface to Transmit OSPF Packets............................................... 4-37
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Table of Contents

Huawei Technologies Proprietary
ii
4.6.6 Configuring Stub Router........................................................................................ 4-38
4.6.7 Configuring Authentication for OSPF.................................................................... 4-38
4.6.8 Configuring the MTU in DD Packets ..................................................................... 4-39
4.6.9 Configuring the Maximum Number of External LSAs in LSDB............................. 4-39
4.6.10 Configuring RFC1583 Compatible External Routing .......................................... 4-39
4.6.11 Configuring the Network Management of OSPF................................................. 4-40
4.7 Maintaining OSPF............................................................................................................ 4-41
4.7.1 Displaying OSPF................................................................................................... 4-41
4.7.2 Resetting OSPF .................................................................................................... 4-42
4.7.3 Debugging OSPF.................................................................................................. 4-42
4.8 Examples for Configuring OSPF...................................................................................... 4-42
4.8.1 Configuring OSPF Basic Functions....................................................................... 4-43
4.8.2 Example for Configuring OSPF Stub Areas.......................................................... 4-48
4.8.3 Configuring OSPF NSSA Areas............................................................................ 4-53
4.8.4 Configuring DR Election of OSPF......................................................................... 4-57
4.8.5 Example for Configuring OSPF Virtual Links........................................................ 4-63
4.9 Troubleshooting............................................................................................................... 4-66
4.9.1 OSPF Neighbors Cannot be Established.............................................................. 4-66
4.9.2 Incorrect OSPF Routing Information..................................................................... 4-67

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-1
Note:
Chapter 4 OSPF Configuration
4.1 Introduction
Open Shortest Path First (OSPF) is a link state-based interior gateway protocol (IGP)
developed by the IETF. At present, OSPF version 2 (defined in RFC2328) is used for
IPv4.

Hereinafter the term OSPF, mentioned in this document, refers to OSPFv2, unless
otherwise stated.

SPF features:
ations: It supports networks in various sizes and can support up to
transmits the update packets as soon as the network
ree: It calculates routes with the shortest path tree algorithm according to
rtition: It allows the network of AS to be divided into different areas for
multiple equal-cost routes to the same
rchy: There are four possible types of paths used to route traffic to
ket authentication to
supports multicast address to
O
Wide applic
hundreds of routers.
Fast convergence: It
topology changes. This synchronizes the change in the Autonomous System
(AS).
Loop-f
the collected link states. This ensures that the algorithm itself generates no loop
routes.
Area pa
the convenience of management. This further abstracts the routing information
transmitted between the areas. This abstraction, in turn, reduces the
consumption of network bandwidth.
Equal-cost multi-route: It supports
destination.
Routing hiera
the destination. They are listed here in decreasing order of preference,
intra-area, inter-area, type 1 external or type 2 external.
Authentication: It supports the interface-based pac
guarantee the security of the packet interaction.
Multicast transmission: On some type of links, it
receive and send packets. This reduces the interference with other devices.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-2
riginates a Link
he LSAs from other routers, and all these LSAs
e
algorithm to calculate
II. Router ID
To run the OSPF protocol, a router must have a router ID. A 32-bit unsigned integer,
If no router ID is specified by any
III. OSPF
es of packets. They are as follows:
local router and is used to

of two routers.
ate Acknowledgment (LSAck) packet: It acknowledges the received
IV. LS s
OSPF encapsulates the descriptions of the routing information in the LSAs and
advertises them.
4.1.1 OSPF Basic Concepts
I. Process of OSPF Route Calculation
The process of calculating OSPF routes is as follows:
Based on the surrounding network topology, each OSPF router o
State Advertisement (LSA). Then it transmits this LSA to other OSPF routers
through the update packets.
Each OSPF router collects t
compose the Link State Database (LSDB). LSA describes the network topology
around a router; while LSDB describes the network topology of the whole AS.
OSPF routers can easily transform the LSDB to a weighted directed map. Th
weighted directed map actually reflects the topology architecture of the whole
network. Apparently, all the routers get the same maps.
According to the directed map, each router uses the SPF
the shortest path tree with itself as the root. The tree shows the routes to each
node in the AS.
router ID identifies a router uniquely in an AS.
The router ID can be configured manually.
command, the system automatically assigns a router ID from the IP addresses on the
current interfaces. The largest IP address in Loopback addresses is taken as the
router ID. If no Loopback interface is configured, the largest IP address configured on
the interface is selected as the router ID.
Packets
OSPF uses five typ
Hello packet: It is periodically sent to the peer of a
discover and maintain OSPF neighbor relationship.
Database Description (DD) packet: It describes the summary information of the
local LSDB. It is used to synchronize the databases
Link State Request (LSR) packet: It requests for the needed LSAs from the
peers.
Link State Update (LSU) packet: It transmits the required LSAs to the peers.
Link St
LSAs.
A Type
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-3
re the types of commonly used LSAs:
Router LSA (Type 1): originated by each router. It describes the link state and
(Type 2): originated by the DR. It describes the link state of the
a single area only.

V. Nei
After utside through OSPF interfaces.
packets checks some parameters defined in the
both of them are consistent, the neighbor relationship
4.1.2 OSP
I.
a massive network run OSPF, and the routers increase
with the unceasing expansion of the network scale. This may lead to a large LSDB,
ory, complicates the operating of SPF
algorithm and aggravates the burden of CPU.
ion also brings about an increase in the probability for structural
changes in the topology. So the network usually confronts with turbulence. A great
g AS into different areas. Areas are
The following a
cost of the router, and is flooded throughout a single area only.
Network LSA
local network segment, and is flooded throughout
Network Summary LSA (Type 3): originated by the ABR. It describes the routes
of a certain network segment, and is flooded to other areas.
ASBR Summary LSA (Type 4): originated by the ABR. It describ es the routes to
ASBR, and is flooded to related areas.
AS External LSA (Type 5): originated by the ASBR. It describes the AS external
routes, and is flooded to all areas except Stub areas and NSSA areas that will
be introduced later.
NSSA LSA (Type 7): originated by the ASBR. It describes the AS external
routes, and is only transmitted in NSSA areas.
ghbor and Adjacency
In OSPF, the concepts of neighbors and adjacencies are completely different.
an OSPF router starts, it sends Hello packets o
The OSPF router receiving these
packets. If the parameters of
can be established.
The neighbor relationship between the peers is not equivalent to the adjacency
relationship. The relationship depends on the network type. A true adjacency
relationship can be established only when two routers can exchange the DD packets
and the LSA successfully.
F Areas and Route Aggregation
Area Partition
Suppose that all routers in
which occupies a great amount of mem
Network expans
number of OSPF packets are transmitted on the network and the bandwidth utility of
the network is reduced accordingly. Besides, each change in topology structure
requires all the network routers to rerun the route calculation.
OSPF addresses the above puzzle by dividin
logically divided router groups, and each area is identified uniquely by an area ID. At
the border of an area resides a router rather than a link. A network segment (or a link)
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-4
can only belong to one area, namely, each interface running OSPF must specify
explicitly to which area it belongs, as shown in Figure 4-1.
Area3
Area0
Area1
Area2
Area4

Figure 4-1 OSPF area partition
After area partition, you can perform route aggregation on the border routers to
reduce the LSAs advertised to other areas. Route aggregation can also minimize the
influences caused by the topology changes.
II. Router Types
ng four categories according to their locations in
AS, as show in Figure 4-2.
e OSPF area.
2) Area Border Routers (ABR)
ng to two or more areas simultaneously, but one of the areas
connect to the backbone area physically or logically.
backbone area. Thus,
ABRs an re backbone routers.
PF
g information, it becomes an ASBR.
The OSPF routers fall into the followi
1) Internal routers
All interfaces of these routers belong to a sam
These routers can belo
must be a backbone area. An ABR is used to connect the backbone area and the
non-backbone areas. It can
3) Backbone routers
These routers have at least one interface that belongs to the
all d the routers inside Area0 a
4) AS boundary routers (ASBR)
The routers exchanging routing information with other ASs are ASBRs. ASBR is not
necessarily on the AS border. It can be an internal router or an ABR. Once an OS
router imports some external routin
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-5
Area3
Area0
Area1
Area2
Area4
ASBR
IS-IS
Internal Router
Backbone Router
ABR

Figure 4-2 OSPF router types
III. Backbone Area and Virtual Link
After area partition, not all the areas are equal. Among them, an area is having area
area. The backbone area is responsible for the routes
between areas. The routing information between the non-backbone areas must be
forwarded through backbone areas. For this, OSPF defines two rules:
ntain the connectivity with the backbone area.
ABRs are configured at
not connect directly with the backbone area. However, you
ID 0 is called the backbone
All non-backbone areas must mai
The backbone area must maintain its own connectivity
However, in practical applications, the physical connectivity cannot be ensured due
to the network topology restriction. An OSPF virtual link can be configured to solve
this problem.
Virtual link refers to a logical channel established between two ABRs through a
non-backbone area. The channel takes effect only after the
the two ends of the channel. The area providing a non-backbone area internal route
for both the ends of the virtual link is called the transit area.
In Figure 4-3, Area 2 does
can configure a virtual link on ABRs to make Area 2 maintain its connectivity with the
backbone area.
Virtual Link
ABR Area0 Area2
ABR
Transit Area
Area1

Figure 4-3 Schematic diagram 1 of the virtual link
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-6
ks, the physically
Figure 4-4.
The virtual link also provides the backup links. With the backup lin
separated areas can still maintain the logical connectivity, as shown in
VLink
Transit Area
Area1
ABR ABR
Area0

Figure 4-4 Schematic diagram 2 of the virtual link
The virtual link is similar to a point-to-point connection between two ABRs. Thus, like
the physical interfaces, the interfaces on this link can be configured with parameters
such as the interval of sending Hello packets.
OSPF packets are transmitted directly between two ABRs. The OSPF routers
between the ABRs are only responsible for packet forwarding. As the destination
addresses of the packets are not that of the OSPF routers, these packets are
transparent to them and are forwarded n IP packets.
IV
Configuring a stub area is optional. All areas do not confirm to the configuration
rs in the
Note the following items while configuring a stub area:
command.
rough the stub area.
as commo
. Stub Area
A stub area is a special area in which the ABRs do not propagate the learned AS
external routes. In these areas, the size of the routing table of the routers and the
routing traffic are significantly reduced.
requirements. Generally, a stub area is a non-backbone area with only one ABR and
it is located at the AS boundaries.
To ensure that the route to a destination outside the AS is still reachable, the ABR in
an area originates a default route and advertises it to the non-ABR route
area.
The backbone area cannot be configured to be the stub area.
If you want to configure an area to be a stub area, all the routers in this area
should be configured with the stub
ASBR cannot exist in the stub area. In other words, AS external routes are not
transmitted in the stub area.
The virtual link cannot pass th
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-7
V
area (NSSA area) and a new LSA (NSSA LSA or Type-7 LSA) are added in the
RFC1587 NSSA option.
stub area in many ways.
t imports Type-7
pe-7 LSA
As shown in Figure 4-5, the AS running OSPF includes three areas, Area 1, Area 2
e other two ASs run RIP. The Area 1 is configured as the NSSA area.
Type5 LSA and is transmitted to Area0 and Area 2.
Type-5 LSA will not reach Area 1.
. NSSA Area
A new
As NSSA area is derived from the stub area, it resembles the
NSSA does not import AS-External-LSA (namely Type-5 LSA) bu
LSA.
Ty originates from the ASBR in the NSSA area and spreads inside the
NSSA. When Type-7 LSA reaches ABR of NSSA, ABR will transform Type-7 LSA into
AS-External-LSA and spread it to the other areas.
and Area0. Th
Area 1 transmits the received RIP routes to NSSA ASBR, and then NSSA ASBR
originates Type7 LSA and transmits it within Area 1. When Type7 LSA reaches NSSA
ABR, it is transformed to
On the other hand, the RIP routes of the AS running RIP in Area 2 are transmitted in
OSPF AS by Type-5 LSA originated by ASBR in Area 2. Because Area 1 is an NSSA
area,
Similar to the stub area, an NSSA area cannot be configured with virtual links.
Area0 Area1 Area2
Type5 Type5
Type5 Type5
Type7
ASBR ASBR ABR ABR
RIP
RIP
NSSA Area

Figure 4-5 NSSA area
VI. Route
the same prefix and only advertise one
three routes are aggregated into one route 19.1.0.0/16, Router A only originates one
dvertises it to other routers in Area0.
Aggregation
ABR can aggregate the routes with
aggregated route to other areas. This is route aggregation.
After area partition, route aggregation can reduce the routing information between
the areas. Thus the size of the routing table can be reduced and the calculation
speed of the router can be improved.
For example, in Figure 4-6, there are three intra-area routes in Area 19, 19.1.1.0/24,
19.1.2.0/24 and 19.1.3.0/24. If route aggregation is configured on Router A and the

aggregated LSA and a
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-8
Area0
Area19
19.1.0.0/16
ABR ABR
19.1.1.0/24
19.1.2.0/2
19.1.3
4
.0/24
....
RouterC
RouterA
RouterB

Figure 4-6 Route aggregation
OSPF has two types of aggregation:
1) ABR aggregation
When an ABR transmits routing information to other areas, it origi
per network segment. If some continuous segments
aggregate these segments into a single segment using the abr-su
In this way, ABR only sends an aggregated LSA. Any LSA falling i
aggregation network segment of this command is not transmitted se
accordingly reduces the LSDB scale in other areas.
nates Type-3 LSA
exist in this area, you can
mmary command.
nto the specified
parately. This
Once the aggregate segment of a certain network is added to the area, all the
sses are not broadcasted separately to other areas.
aggregate segment. The routing information
of the entire aggregate network segment is broadcast.
n is configured, if the local router is ASBR, it will aggregate
V
AS internal network structure. The external route

imported AS external routes into Type 1 and Type 2.
internal routes of the IP addre
These IP address are in the range of the
2) ASBR aggregation
After the route aggregatio
the imported Type5 LSA. This LSA is within the aggregate address range. After the
NSSA area is configured, it will aggregate the imported Type7 LSA within the
aggregate address range.
If the local router is ABR, it will aggregate Type5 LSA transformed from Type7 LSA.
II. Route Types
The OSPF uses four types of routes listed below in the descending order of
precedence:
Intra area route
Inter area route
Type 1 external route
Type 2 external route
By default, the protocol precedence of the first two routes is 10, and that of the last
two routes is 150.
The first two routes describe the
describes how to select a route to the destination outside the AS. OSPF divides the
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-9
utes refer to the received IGP routes such as RIP routes and static
route. Because of their relatively high reliability, the calculated cost of the external
routes. In other words, the cost of a Type-1 external route equals the
t h the corresponding ASBR plus the cost for ASBR to reach
e r to the received EGP routes. Because of their relatively
considered greater than the cost of any path internal to
ral equal-cost Type 2 routes exist, the internal distance to the
4.1.3 OSP
I.
ast Multi-access (NBMA): If the link layer protocol is Frame Relay,
lsorily. The common practice is to change a non-fully
connected NBMA into a P2MP network. The protocol packets in this network are
cast mode (224.0.0.5).
the link layer protocol is PPP, HDLC or LAPB, OSPF
protocol packets in this network are
ast mode (224.0.0.5).
II
The
and orks.
route
you of its adjacent routers and their
The
mus
Type 1 external ro
routes is the same as that of the routes inside the AS, and is comparable with the
cost of OSPF
cos for the router to reac
the destination.
Typ 2 external routes refe
low reliability, Type-2 cost is
AS. Thus, the cost of a Type-2 external route equals the cost for ASBR to reach the
destination. When seve
ASBR is used to break the tie.
F Network Types
Four Network Types
OSPF divides networks into four types by link layer protocol:
Broadcast: If the link layer protocol is Ethernet or FDD, OSPF defaults the
network type to broadcast. The protocol packets in this network are transmitted
in multicast mode (224.0.0.5 and 224.0.0.6).
Non-Broadc
ATM or X.25, OSPF defaults the network type to NBMA. The protocol packets in
this network are transmitted in unicast mode.
Point-to-Multipoint (P2MP): No matter what the link layer protocol is, OSPF does
not default the network type to P2MP. A P2MP network must be changed from
other network types compu
transmitted in multi
Point-to-point (P2P): If
defaults network type to P2P. The
transmitted in multic
. Configuration Principles for NBMA Networks
NBMA network refers to a non-broadcast and multi-accessible network. ATM
Frame Relay networks are typical NBMA netw
You need to make some special configurations for the NBMA networks. Its adjacent
rs cannot be discovered by broadcasting Hello packets. So for this interface,
must manually configure the IP addresses
election rights.
NBMA network must be fully connected, namely, any two routers in the network
t be directly reachable. If not all the routers are directly accessible on an NBMA
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-10
netw
peer interface type to P2P.

a P2MP network is unnecessarily
An NBMA network needs to elect DR and BDR; while a P2MP network has no
etwork must be changed
hile P2MP transmits packets by multicast.
II
ssions which
s. Designated
infor
If a D lid due to some fault, it must be re-elected and synchronized. It
e
up this process, OSPF puts forward the concept of Backup Designated Router
R
In fa
adja the routers on the
the B ded and the adjacencies
n established, the process is very fast. The electing of a new BDR
takes a long time but it does not exert any influence on the route calculation.
d
ork, you can configure the interface type to P2MP. If the router has only one
on the NBMA network, you can change the
The differences between NBMA and P2MP networks are as follows:
In OSPF, an NBMA network refers to a network that is fully connected,
non-broadcast and multi-accessible; while
fully connected.
DR and BDR.
NBMA is a default network type. A P2MP n
compulsorily from other networks types. The common practice is to change a
non-fully connected NBMA network into a P2MP network.
NBMA transmits packets by unicast and neighbors need to be configured
manually; w
I. DR and BDR
In broadcast and NBMA networks, routing information is transmitted between any
two routers. If there are n routers in the network, n X (n-1)/2 adjacencies need to be
established. In this case, the route changes result in multiple transmi
are unnecessary. It also wastes the precious bandwidth resource
Router (DR) is defined in the OSPF to solve this problem. All the routers send
mation only to the DR for broadcasting the network link states to the network.
R becomes inva
tak s a long time and meanwhile the route calculation becomes incorrect. To speed
(BD ).
ct, BDR is a backup for DR. DR and BDR are elected in the mean time. The
cencies are also established between the BDR and all
segment. They also exchange the routing information. When the DR becomes invalid,
DR becomes DR instantly. Since no re-election is nee
have already bee
Adjacencies are not established between two routers other than DRs or BDRs
(called as DR Others), nor does the DR Others exchange any routing information.
Thus, it reduces the number of adjacencies between any two routers in broadcast or
NBMA networks.
In Figure 4-7, the real line represents Ethernet physical connections, and the dash
line represents the established adjacencies. Only seven adjacencies are neede
among five routers with the DR/BDR mechanism as shown below.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-11
DR BDR
DR Other DR Other DR Other

Figure 4-7 Schematic diagram of DR and BDR
IV
etwork segment.
r the DR/BDR election.
eater than 0 are the eligible
ted DR in the packet and sends
rs self-proclaimed to be
If two routers have the same
ed as the DR. A router, whose
NBMA type, it is necessary to elect DR.
A router acts as a DR on a certain network segment, in the sense of router
DR on one interface, but can be a BDR or DR
Other on the other interface.
the BDR is not necessarily the router with the second highest priority.
4.1.4 OSPF Packet Format
. Election Process for DR/BDR
DR is not designated manually. It is elected by all the routers in the n
The DR priority of an interface determines its qualification fo
In the network segment, routers with priorities gr
"candidates".
Votes are the hello packets. Each router puts the elec
it to all the other routers on the segment. Among all the route
the DR, the one with the highest priority will be elected.
priority, the one with the larger router ID will be elect
priority is 0, cannot be elected as a DR or BDR.
Note the following:
Only when an interface is of broadcast or
A p2mp or a p2p interface need not elect DR.
interface. Maybe a router is a
If a new router is added after DR and BDR election, it is impossible for the router
to become the DR even if it has the highest priority.
The DR on the network is not necessarily the router with the highest priority.
Likewise,
OSPF directly encapsulates its protocol packets into IP packets, using IP protocol 89.
Figure 4-8 shows a relatively complete OSPF packet (take LSU packets as an
example):
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-12
OSPF Packet
Header
Number of
LSAs
LSA Header IP Header LSA Data

Figure 4-8
I. OSP
OSPF has five types of packets, which all have the same packet header, as shown in
OSPF packet format
F Packet Header
Figure 4-9.
Authentication
0 7 15 31
Version Packet length Type
Router ID
Area ID
AuType Checksum

Figure 4-9 OSPF packet header format
The main fields are explained as follows:
SPF packet type. It ranges from 1 to 5, corresponding to Hello packet,


Note:
Version: OSPF version number. For OSFPv2, it is 2.
Type: O
DD packet, LSR packet, LSU packet and LSAck packet respectively.
Packet length: total length of the OSPF packet (including the packet header). Its
unit is byte.
AuType: authentication type. It can be 0, 1 and 2, corresponding to no
authentication, simple authentication and MD5 authentication respectively.
Authentication: Its value depends on AuType. When AuType is 0, it is not
defined. When AuType is 1, it is the password information. When AuType is 2,
it contains Key ID, MD5 authentication data length and the sequence number.
The MD5 authentication data is added behind the OSPF packet and is not included
h in t e Authentication field.

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-13
II l
Hello l
r. It contains the values of timers, DR, BDR and the known neighbors. Figure
shows the Hello packet format.
. He lo Packet
packet is commonly used. It is periodically sent to the neighbors of the loca
route
4-10
Authentication
7 15 31 0
Version Packet length Type=1
Router ID
Area ID
Checksum AuType
...
HelloInterval
RouterDeadInterval
Rtr Pri Options
Network Mask
Designated Router
Backup Designated Router
Neighbor

Figure 4-10 Hello packet format
The main fields are explained as follows:
Network Mask: the mask of the network to which the interface sending Hello
packets belongs.
HelloInterval: the interval of sending Hello packets. If the intervals of two
adjacent routers are different, the neighbor relationship cannot be established.
Rtr Pri: DR priority. If it is set to 0, this router cannot be DR/BDR.
RouterDeadInterval: Invalid time. If no Hello packet is received from the
neighbor during this time, the neighbor is considered as invalid. If the invalid
time of two adjacent routers is different, the neighbor relationship cannot b
III. DD Packet
their own LSDBs. It contains the header of an LSA, which can uniquely identify the
of an
Figure 4-11 shows the DD packet format.
e
established.
When two routers synchronize their databases, they use DD packets to describe
LSA. This reduces the traffic size transmitted between the routers, since the header
LSA only occupies a small portion of the overall LSA traffic. With the header,
the peer router can judge whether it already has the LSA.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-14
0 7 15 31
Version Packet length Type=2
Router ID
Area ID
Checksum AuType
Authentication
Interface MTU Options 00000 I
LSA Headers ...
M MS
DD Sequence Number

Figure 4-11 DD packet format
e
s

router ID is Master. When MS is 1, it indicates the sender is Master.
d by Master, it increases by 1 when a DD
packet is transmitted. The Slave confirms with the sequence number of the
re the reliability and completeness of the
nce number.
IV. LS
route
pack
The main fields are explained as follows:
Interface MTU: The maximum length of IP packet transmitted from this interfac
without fragmentation.
I (Initial): When multiple DD packets are transmitted continuously, if it is the first
DD packet, the I is set to 1; otherwise, the I is set to 0.
M (More): When multiple DD packets are transmitted continuously, if it is the last
DD packet, the M is set to 0; otherwise, the M is set to 1, which indicate
there are other DD packets followed.
MS (Master/Slave): When two OSPF routers exchange DD packets, the
master/slave relationship should be confirmed first. The one with a greater
DD Sequence Number: Prescribe
Master. The Master and Slave ensu
transmitted DD packets by the seque
R Packet
After two routers exchange DD packets, the one knows it lacks which LSA of the peer
r. At this time, it will send LSR packets to the peer to request LSA needed. The
LSR packet contains the summary of the requested LSA. Figure 4-12 shows the LSR
et format.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-15
0 7 15 31
Authentication
Version Type=3 Packet length
Router ID
Area ID
AuType Checksum
......
LS type
Link State ID
Advertising Router

Figure 4-12 LSR packet format
The main fields are explained as follows:
LS type: LSA type. For example, Type1 indicates Router LSA.
Link State ID: the field of the LSA header. It depends on LS type.
Advertising Router: the router ID of the router originating this LSA.
V. LSU Packet
It is used to transmit the required LSAs to
multiple LSAs (complete content
the peer router. It contains a collection of
s). Figure 4-13 shows the LSU packet format.
Authentication
31 0 7 15
Version Packet length Type=4
Router ID
Area ID
Checksum AuType
Number of LSAs
LSAs...

Figure 4-13 LSU packet format
VI. LSAck Packet
It acknowledges the received LSU packets. It contains the Header (s) of LSA(s) to be
acknowledged (an LSAck packet can acknowledge multiple LSAs). Figure 4-14
shows its packet format.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-16
Authentication
0 7 15 31
Version
Router ID
Area ID
Packet length
AuType Checksum
LSA Headers...
Type=5

Figure 4-14 LSAck packet format
VII. LSA Header Format
same packet header, as shown in Figure 4-15. All LSAs have the
0 7 15 31
LS age
Link State ID
Options LS type
Advertising Router
LS sequence number
LS checksum length

Figure 4-15 LSA header format
The main fields are explained as follows:
LS age: the time during which LSA lasts after it is originated. Its unit is second.
No matter LSA is transmitted on the links or saved in LSDB, its value increases
continuously.
Link State ID: the value is determined by the type of LSA.
r: the sequence number of LSA. Other routers determine
which LSA is the newest based on this value.
f bytes.
LS type: the type of LSA.
LS sequence numbe
length: total length of LSA (including LSA Header) in the unit o
VIII. Router LSA
Figure 4-16 shows Router LSA format.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-17
31 0 7 15
LS age
Link State ID
Options LS type=1
Advertising Router
LS sequence number
LS checksum length
0 # links E V B 0
Link ID
Link Data
Type # TOS metric
......
TOS 0 TOS metric
Link ID
......
Link Data

Figure 4-16 Router LSA format
The main fields are explained as follows:
Link State ID: indicates the router ID of the router originating this LSA at first.
V (Virtual Link): If the router originating this LSA is one end of the virtual link, this
V is set to 1.
E (External): If the router originating this LSA is ASBR, this E is set to 1.
B (Border): If the router originating this LSA is ABR, this B is set to 1.
#links: It indicates the number of links described in LSA, and includes all links
and interfaces in some area where the router resides.
IX. Network LSA

It is originated by the DR in broadcast or NBMA networks. LSA records the router IDs
rk.
Figure 4-17 shows Network LSA format.
of all the routers on this netwo
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-18
7 15 31 0
LS age
Link State ID
Options LS type=2
Advertising Router
LS sequence number
LS checksum length
Network Mask
Attached Router
......

Figure 4-17 Network LSA format
The main fields are explained as follows:
Link State ID: the interface address of the DR.
Network Mask: The address masks of the broadcast or NBMA networks.
Attached Router: the router IDs of all the routers (including DRs) connected on
X. Summary
have the same format.
0 15 31
the same network.
LSA
Originated by ABR, both the Type3 and Type4 LSAs
Figure 4-18 shows Summary LSA format.
7
LS age Options LS type=3 or 4
Link State ID
Advertising Router
LS sequence number
LS checksum length
Network Mask
metric
......
0
TOS metric TOS

Figure 4-18 Summary LSA format
The main fields are explained as follows:
Link State ID: For Type3 LSA, it is the advertised network address. For Type4
LSA, it is the router ID of ASBR.

Network Mask: For Type3 LSA, it indicates the network address mask. F r
nd is set to 0.0.0.0.
o
Type4 LSA, it makes no sense a
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-19
n address.

Metric: the route cost to the destinatio
Note:
The Type3 LSA can be used to advertise default routes. In this case, the Link State
nd Network Mask are set to 0.0.0.0. ID a

XI. AS-External
es to the destinations outside the AS.
Figure 4-19 shows AS-External LSA format.
15 31
LSA
Originated by ASBR, it describes the rout
0 7
LS age
Link State ID
Options LS type=5
Advertising Router
LS sequence number
LS checksum length
Network Mask
metric
......
0
TOS metric TOS
E
Forwarding address
External Route Tag
Forwarding address
External Route Tag
E

Figure 4-19 AS-External LSA format
The main fields are explained as follows:
Link State ID: the advertised destination address of another external AS.
Network Mask: the mask of the destination address to be advertised.
E (External Metric): the type of the external metric. For Type2 external route, it is
te, it is set to 0.
Metric: the route cost.
ith the advertised destination address are
t use this
set to 1; for Type1 external rou
Forwarding Address: The packets w
forwarded to this address.
External Route Tag: the tag added to the external route. OSPF does no
field itself, and it is used to manage external routes.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-20
X
form 0.
15 31
II. NSSA External LSA
It is originated by ASBR, and can only be transmitted in NSSA areas. It has the same
at as that of AS-External LSA, as shown in Figure 4-2
0 7
LS age
Link State ID
Options LS type=7
Advertising Router
LS sequence number
LS checksum length
Network Mask
metric
......
TOS
Forwarding address
E
External Route Tag

Figure 4-20 NSSA External LSA format
4.1.5 OSPF Features Supported by the NE20
I.
OSPF supports multi-process. Many different OSPF processes can run on a same
router. These processes are independent. The route interaction between the different
tween the different routing protocols.
An interface of a router can only belong to a certain OSPF process.

sistent (no
cation in plain text or MD5 authentication in encrypted text).
n passwords of all routers in a network segment must be
II
Multi-process
OSPF processes is similar to the interaction be
II. Authentication
OSPF supports packet authentication. Only the OSPF packets, which pass the
authentication, are received. If the packets do not pass authentication, the normal
neighbor relationship is not established.
The authentication types of all routers in one area must be con
authentication, authenti
The authenticatio
consistent.
I. OSPF Supports for IGP Shortcut and Forwarding Adjacency
OSPF supports IGP shortcut and forwarding adjacency. These features allow OSPF
to use an LSP as a possible outgoing interface to reach destination. Without this
feature, OSPF cannot take the advantage of a LSP even if it exists.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-21
rding adjacency alone is enabled, OSPF can also use the LSP as a
means of reaching destination.
abled can use
The difference between IGP shortcut and forwarding adjacency lies in:
If forwa
If IGP shortcut alone is enabled, only the router on which it is en
the LSP in its route.
Note:
For detailed configuration of this feature, refer to Quidway NetEngine20 Series
Routers Operation Manual MPLS Volume.

IV
OSPF sup orts multi-instance, which can run between PEs and CEs in VPN
erent ASs. In this way, the OSPF routes
ed in one site are transmitted to another site as external routes. This causes a
fic and some avoidable network management problems.
configure domain ID on PE to differentiate the
VPNs where different sites reside. Thus, different sites in one VPN see each other as
directly connected thorough a leased line. This leads to better network
. OSPF Support for VPN
p
networks.
In BGP MPLS VPN, many sites of one VPN can use OSPF as its internal routing
protocol. However, they are handled as diff
learn
heavy OSPF traf
In the NE20 implementation, you can
if connected directly. Thus, the PE routers exchange OSPF routing information as if
they were
management and effective OSPF usage.

Note:
For detailed configuration of this feature, refer to Quidway NetEngine20 Series
Routers Operation Manual VPN Volume.

V. OSPF Sham Links
OSPF Sham Links are unnumbered point-to-point links between two PE routers over
an MPLS VPN backbone network.
e BGP extended community attributes carry the route information over
to originate Type 3 summary link state
advertisement from PE to CE. These routes are considered as inter-area routes.
wever, if a router connects to PE routers in its own area and establishes an
intra-area route (backdoor route) to a particular destination, the VPN traffic always
In general, th
the MPLS VPN backbone between BGP peers. This information can be used by
OSPF running on PE at the other end
Ho
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-22
ather than the backbone route. This is because the OSPF
intra area routes established in the routing table have relatively higher priorities. To
ra area path with a lower cost to the PE router.
traverses the backdoor r
avoid this anomaly, an unnumbered point-to-point sham link is configured between
the PE routers. This provides an int

Note:
For related configurations of OSPF sham links, refer to Quidway NetEngine20 Series
Routers Operation Manual VPN Volume.

ocols and Specifications
The protocols and specifications related to OSPF are:RFC2328: OSPF Version 2
4.1.6 Prot
4.2 Configuring OSPF Basic Functions
4.2.1 Esta
I.
efore configuring other related OSPF functions, you must enable OSPF and specify
the interface and area ID.
nabled, you can configure OSPF commands in
interface view. With OSPF disabled, the related commands configured in interface
Before configuring OSPF, you need to complete the following tasks:
Configuring the link layer protocol
ses of the interfaces to keep the network
layers of the adjacent nodes reachable
blishing the Configuration Task
Applicable Environments
B
No matter whether OSPF is e
view remain unchanged.
II. Preconfigured Tasks
Configuring the network layer addres
III. Data Preparations
To configure OSPF, you need the following data.
No. Data
1 Router ID
2 OSPF process ID
3 Areas which each interface belongs to respectively

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-23
ures IV. Configuration Proced
No. Procedure
1 Enabling OSPF and entering OSPF view
2 Configuring the network segments included by each area
4.2.2 Enabling OSPF and Entering OSPF View
Step Action Command
1 Enter system view. system-view
2 Enable OSPF and enter
.
ospf [ process-id ] [ router-id router-id ]
enter
ospf [ process-id ] [ vpn-instance
] [ router-id router-id ]
OSPF view
3 Enable OSPF and
OSPF view of the VPN
instance.
vpn-instance-name

To ensure the stability of OSPF, you should determine the division of router IDs and
manually configure them while planning the network. When configuring router ID
manually, you should ensure the router IDs of any two routers in a single AS are
d rent. nsistent with the IP address of a
c ain in the IP
address of an interface on the router.
hen multiple OSPF processes are
enabled on a router, it is necessary to specify different process IDs. OSPF process
ID is a local conce fect on its packet exc other routers.
T refor n also exc , even with different process
ID
The NE2 PF multi-instance, and you can configure OSPF to run in VPN
in nce cified nstance.
Otherwis l instanc

iffe Generally, the router ID is configured co
ert terface of this router. A common practice is to set the router ID to be
The NE20 supports OSPF multi-processes. W
pt, with no ef hange with
he e, different routers ca hange packets
s.
0 supports OS
sta . If the VPN instance is spe
e, it belongs to the globa
, the OSPF process belongs to that i
e.
Note:
The process ID of OSPF (including OSPF multi-instance) is unique. That is, the
process IDs of OSPF multi-instance cannot be the same with the process IDs
configured previously.

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-24
4.2.3 Configuring the Network Segments Included by Each Area
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Enter OSPF area view. area area-id
4 Configure the network
segments included by the
areas.
network ip-address wildcard-mask

A network segment can only belong to one area, namely, each interface running
OSPF must specify to which area it belongs.
Most configurations should be based on the area. Wrong configuration may disable
formation transmission between the neighboring routers, and even lead to
congestion or self-loop of the routing information.
4.3 Configuring OSPF Area Features
4.3.1 Establishing th
I. Applicable Environmen
Af SPF
e nsib SAs,
you can e some non-backbone areas on the AS border as stub area.
tub areas cannot import external routes, thus leading to the concept of NSSA area.
In NSSA area, Type7 LSA transmission is allowed. Originated by ASBR in NSSA
.
ne area, and the backbone area
should maintain its own connectivity.
However, in practical applications, the physical connectivity cannot be ensured due
to the network topology restrictions. OSPF virtual link can be configured to solve this
problem.
The following deals with the configuration procedures of the features mentioned
above.
II. Preconfigured Tasks
Before configuring OSPF area features, you need to complete the following tasks:
in
e Configuration Task
ts
ter area p
xte
artition, the number of LSAs in the network d
ility is enhanced. To reduce its rou
configur
ecreases and the O
ting table size and the number of L
S
area, Type7 LSA is transformed to AS-External LSA when it reaches the ABR of
NSSA, and is further advertised to other areas
After area partition, the OSPF routes between non-backbone areas are updated with
the help of the backbone area. OSPF stipulates that all the non-backbone areas
should maintain the connectivity with the backbo
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-25
f the interfaces to keep the network
layers of the adjacent nodes reachable
Configuring OSPF basic features
III. Data Preparations
need the following data.
Configuring the network layer addresses o

To configure OSPF areas, you
No. Data
1 Type of the area
2 Interfaces included in the area
3 The default routes advertised to the area

. Configuration Procedures IV
No. Procedure
1 Configuring OSPF stub areas
2 Configuring OSPF NSSA areas
3 Configuring OSPF virtual links

4.3.2 Configuring OSPF Stub Areas
I. ring a Router as a Stub Router Configu
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Configure a router as a stub router. stub-router

Note:
When all the interfaces of a router are in one stub are
configured as a stub router.
a, this router should be
n configuring a stub router connecte BR, you need to configure the

Whe d with A
stub command in area view.

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-26
s II. Configuring OSPF Stub Area
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
area area-id
4 Configure the current area as a
stub area.
stub [ no-summary ]
e default default-cost cost
3 Enter OSPF area view.
5 Configure the cost of th
routes to the stub area.

This command in step 5 is configured on ABRs.

Note:
When co d to configure the stub
comman
nfiguring a stub router connected with ABR, you nee
d in area view.

4.3.3 Configuring OSPF NSSA Areas
Step Action Command
1 system-view Enter system view.
2 Enter OSPF view. ospf [ process-id ]
3 Enter OSPF area view. area area-id
SA area.
nssa [ default-route-advertise ]
[ no-import-route ]
[ no-summar
f the default
rea.
cost
4
Configure an area as a NS
y ]
5 Configure the cost o
routes to the NSSA a
default-cost

All the routers conn area mu nssa
comman
ected to the NSSA
d.
st be configured with the
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-27
4.3.4 Con SPF Virtual Links figuring O
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Enter OSPF area view. area area-id
nd
configure it.
vlink-peer router-id [ hello seconds]
[ retransmit seconds ] [ trans-delay
seconds ] [ dead sec ple [ plain
| cipher ] password mac-md5 }
key-id er ] password ] |
authentic
4 Create a virtual link a
onds] [ [ sim
] | [ { md5 | h
[ plain | ciph
ation-null ]

Y should configure this command at the other e
4.4 Configuring OSPF Network Types
4.4.1 Establishing the Configuration Task
I. Applicable Environments
st be fully connected, any two routers in the network are directly
irement cannot be satisfied, and you need to
ommands.
F MA networks, if there are no directly reachable en some two
routers, y interface ty the router in NBMA networks
only has one peer, you can change the interface type to P2P.
In addition, when configuring broadcast rks or NBMA networks, you can
s cify t h interf the DR/BDR election in the
network.
DR or BD
II. Preconfigured Tasks
Before configuring OSPF network types, he following tasks:
Configuring the network layer addresses of the interfaces to keep the network
III. Data Preparations
To configure OSPF network types, you need the following data.
ou nd of the virtual link.
OSPF divides networks into four types by the link layer protocol. Because an NBMA
network mu
reachable. In most cases, this requ
change the network type forcibly by c
or NB links betwe
ou can configure the pe to P2MP. If
netwo
pe he DR priorities of eac ace to affect
In general, the routers with high
R.
performance and reliability are elected as
you need to complete t

layers of the adjacent nodes reachable
Configuring OSPF basic functions
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-28
No. Data
1 Network types to be used
2 IP addresses of the neighbors (for NBMA networks)
3 DR priorities of the interfaces

IV. Configuration Procedures
No. Procedure
1 Configuring network types of OSPF interfaces
2 Configuring neighbors for NBMA networks
3 Configuring DR priorities of OSPF interfaces

4.4.2 Configuring Network Types of OSPF Interfaces
Step Action Command
1 Enter system view. system-view
2 Enter interface view. interface interface-type interface-number
OSPF interfaces. p2mp | p2p
3 Configure network types of

ospf network-type { broadcast | nbma |
}

e for the interface, the previous network type
lly.
4.4.3 Con
Wh n you configure a new network type
is removed automatica
figuring Neighbors for NBMA Networks
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3
Configure neighbors for
NBMA networks.
peer ip-address [ dr-priority priority ]

re needed for NBMA networks. Because adjacent
ro cannot be discovered by broad packets, you must manually
configure interface and their election
rights.
Some special configurations a
uters casting Hello
the IP addresses of its adjacent routers for this
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-29
4.4.4 Configuring DR Priorities of OSPF Interfaces
Step Action Command
1 Enter system view. system-view
2 Enter interf . interface interfa ber
es of y priority
ace view ce-type interface-num
3 Configure DR prioriti
OSPF interfaces.
ospf dr-priorit

When configuring broadcast networks or NBMA networks, you can specify the DR
riorities of each interface to affect the DR/BDR election in the network.
4.5 Controlling OSPF Routing Information
I. A able Enviro
A r the s section, y the advertising and receiving
of OSPF routing inform rt the route rotocols.
II. P econ
Before controlling OSPF routing information, you need to complete the following
sks:
III Preparations
owing data.
p
4.5.1 Establishing the Configuration Task
pplic nments
fte configurations in thi ou can control
ation, and impo s of other p
r figured Tasks
ta
Configuring the network layer addresses of the interfaces to keep the network
layers of the adjacent nodes reachable
Configuring OSPF basic functions
. Data
To control OSPF routing information, you need the foll
No. Data
1 Link cost
2 Filtering list if routing informatio ltered
3
of the ro lt
n needs to be fi
Name and process ID uting protocol to be imported and its defau
value

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-30
IV. Configuration Procedures
No. Procedure
1 Configuring OSPF route aggregation
2 Configuring OSPF to filter the received routes
Filter ABR Type3 LSA
col preference of OSPF
3 Configuring OSPF to
4 Configuring the link cost of OSPF
5 Configuring the maximum number of equal-cost routes
6 Configuring the proto
7 Configuring OSPF to import external routes

4.5.2 Con u
I. n n
fig ring OSPF Route Aggregation
Co figuring ABR Route Aggregatio
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
view. area -id
4 Configure ABR route abr-summary ip-address mask [ advertise
cost ]
3 Enter area area
aggregation of OSPF. | not-advertise | cost

his command only takes effect on ABRs.
on
T
II. Configuring ASBR Route Aggregati
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
ip-address mask
se ] [ tag tag ] [ cost cost ]
3 Configure ASBR route asbr-summary
aggregation of OSPF. [ not-adverti

This command only takes effect on ASBRs.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-31
d Routes 4.5.3 Configuring OSPF to Filter the Receive
Step Action Command
1 Enter system view. system-view
2 Enter OSP ospf [ process-i
ilter the umber | ip-prefix
ort
F view. d ]
3 Configure OSPF to f
received routes.
filter-policy { acl-n
ip-prefix-name } imp

A ynam
advertised and received LSAs because the routing information is hidden in the link
tate.
ou actually filter the routes calculated by
OSPF. Only the filtered routes are added into the routing table.
4.5.4 Configuring OSPF to Filter ABR Type3 LSA
d ic routing protocol based on the link state, OSPF does not filter the
s
Using the filter-policy import command, y
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view.
Enter area view.
ospf [ process-id
area area-id
]
3
4 Configure OSPF to filter ABR
Type-3 LSA.
filter { acl-number | ip-prefix ip-prefix-name
| route-policy route-policy-name } { export
port } | im

4.5.5 Configuring the Link Cost of OSPF
I. C figu PF Interfa on ring the Cost of OS ces
Step Action Command
1 Enter system view. system-view
2 Enter interface view. interface interface-type interface-number
3 Configure the cost of OSPF
ospf cost cost
interfaces.

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-32
II. Configuring Bandwidth Reference Value
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Configure bandwi
reference value.
dth ference value bandwidth-re

If no cost of the interface is configured ex erface view, OSPF calculates its
ost automatically based on the interface bandwidth. The calculation formula is the
interface cost equals the bandwidth reference value divided by interface bandwidth.
y changing the bandwidth reference value.
4.5.6 Configuring the Maximum
plicitly in int
c
You can change interface cost indirectly b
Number of Equal-Cost Routes
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Configure the maximum
number of equal-cost routes.
maximum load-balancing number

4.5.7 Co SPF nfiguring the Protocol Preference of O
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view.
Configure the protocol
ospf [ process-id ]
3
preference of OSPF.
preference [ ase ] [ route-policy
route-policy-name ] preference

Many dynamic routing protocols may run on one router, leading to sharing and
selecting routing information among different routing protocols. The system sets
preferences for each routing protocol. When different protocols discover a same
route, the route with a higher preference is selected.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-33
4.5.8 Conf rin rt Externa
I. Configu s of Other Protocols
igu g OSPF to Impo l Routes
ring OSPF to Import Route
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
Import rout
protocols.
import-route proto ss-id ] [ cost
cost ] [ type typ route-policy
me ]
4 Configure to filter the filter-policy { acl-number | ip-prefix
ort [ protocol ]
3 es of other col [ proce
e ] [ tag tag ] [
route-policy-na
imported routes. ip-prefix-name } exp

Step 4 is er a speci specifying
e protocol. If the protocol is not specified, OSPF filters all the imported routing
information.
optional. You can filt fic kind of routing information by
th

Note:
Using the import-route command, you cannot import the default routes of the
external routes.
transforms the external routes
satisfying the requirements to Type5 LSA and advertises them.
OSPF filters the imported routes, namely, OSPF only

II. nfigu rt Default Co ring OSPF to Impo Routes
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view.
type
type ] [ route-policy route-policy-name ]
ospf [ process-id ]
3 Import default routes to
OSPF processes.
default-route-advertise
[ summary ][ always ] [ cost cost ] [

You can force OSPF to import a default route with this command.

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-34
Note:
If the default route is imported to the OSPF routing domain and some OSPF router
within it is configured with static default route, you need to set the precedence of
he routing table.
static default route lower than that of the imported default route. Otherwise, the
default route may not be the one with the highest preference in t

III. Configuring the Related Parameters for OSPF to Import Routes
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Configure the default val
for parameters related to
importing routes (co
ues

st,
number of routes, tag and
type).
number | tag tag | default { cost cost | limit
type { 1 | 2 } } *

When OSPF imports external routes, you can configure the default values of some
additional parameters, such as cost, number of routes, tag and type. The route tag is
rotocol related information. For example, it is used to differentiate the
4.6 Adju
4.6.1 Establishing the Configuration Task
I. Applicable Environments
eed of the
OSPF networks and the network overload caused by protocol packets. On some low
s nks, you nee sider the delay of transmittin e interface.
B djus ion interval, in the resource consumption
d to fre nges.
In relat co
security
OSPF a gement, and you can bind OSPF MIB with a
certain p send trap messages and record logs.
to tag the p
number of ASs when OSPF receives BGP.
sting and Optimizing OSPF Networks
By changing the OSPF packet timer, you can adjust the convergence sp
peed li d to con g LSAs on th
y a ting the SPF calculat you can restra
ue quent network cha
a ively secure network, you can
of OSPF networks.
lso supports network mana
rocess,
nfigure OSPF authentication to improve the
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-35
II
plete the following
to keep the network
layers of the adjacent nodes reachable
III. Data Preparations
To adjust and optimize OSPF networks, you need the following data.
. Preconfigured Tasks
Before adjusting and optimizing OSPF networks, you need to com
tasks:
Configuring the network layer addresses of the interfaces
Configuring OSPF basic functions
No. Data
1 Value of the packet timer
2 Authentication type and password

IV. Configuration Procedures
No. Procedure
1 Configuring OSPF packet timer
2 Configuring the delay of transmitting LSU packets on the interface
nterval of SPF calculation
4 Disabling the interface to transmit OSPF packets
7
ber of LSAs in an LSDB
e cost calculation method compatible with that in RFC1583
10 Configuring the network management of OSPF
3 Configuring the i
5 Configuring Stub router
6 Configuring authentication for OSPF
Configuring the MTU in DD packets
8 Configuring the maximum num
9 Configuring th

4.6.2 Conf rin igu g OSPF Packet Timer
Step Action Command
1 Enter system view. system-view
2 Enter interface view. interface interface-type interface-number
3 Configure the interval of
sending hello packets on the
ospf timer hello seconds
interface.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-36
Step Action Command
4 Configure the interval of ospf timer poll se
sending poll packets on th
NBMA interface.
e
conds
5 Configure the dead time
during which the adjacent
relationship is invalid.
ospf timer dead seconds
6 Configure the interval of
retransmitting LSAs between ospf timer retransmit seconds
the adjacent routers.

It is necessary to keep the consistency of the hello timer between OSPF neighbors.
is inversely proportional to route convergence
speed and network load.
T e on a at least four times f sending hello
p kets.
A r a ro its neighb t
from its n emen bor in the
retransmi the LSA.

Not
Note that the value of the hello timer
he dead tim same interface is the interval o
ac
fte uter sends an LSA to or, it waits for the acknowledgement packe
eighbor. If no acknowledg
ssion interval, it will retransmit
t packet is received from its neigh
e:
Both hello an rs restore to the default values after the network type is
ng
Do no n int unnecessary
retran r than the time for a packet to be
transm t
d dead time
cha ed.
t set the LSA retransmissio erval too small. Otherwise,
smission will be caused. It must be greate
itted a round between two rou ers.

4.6.3 Configuring the Delay of Transmitting LSAs on the Interface
Step Action Command
1 Enter system view. system-view
2 Enter interface view. interface interface-type interface-number
3 Configure the delay of
transmitting LSAs on the
interface.
ospf trans-delay seconds

Considering that OSPF packet transmission on the link costs some time, you should
add some delay time to the age time of LSA before transmission.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-37

Note:
Pay much attention to this configuration on low speed links.

4.6.4 Configuring the Interval of SPF Calculation
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id
interval seconds
]
3 Configure the interval of SPF
calculation.
spf-schedule-

Wheneve PF should be recalculated. Calculating the
shortest change will consume enormous resources and affect the
peration efficiency of the router.
4.6.5 Disabling the Interface to Transmit OSPF Packets
r the LSDB of OSPF changes, S
path upon
o
Adjusting the SPF calculation interval, however, can restrain the resource
consumption due to frequent network changes.
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Disable the interface to
transmit OSPF packets.
silent-interface { all | interface-type
interface-number }

T nt OSPF ro rmation from being acquired by the routers on a certain
network, rface com le the interface to transmit
OSPF packets.
Different processes can disable the same interface to transmit OSPF packets, but
th silen y here the
specified process has been enabled, with no effect on the interface of other
rocesses.
tablished on the interface. Thereby, the capability
o preve uting info
use the silent-inte mand to disab
e t-interface command is onl valid for the OSPF interface w
p
After an OSPF interface is set to be in silent status, the interface can still advertise its
direct route. However, the hello packets of the interface will be blocked, and no
neighboring relationship can be es
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-38
for OSPF to adapt to the networking can be enhanced, which will reduce the
consumption of system resources.
4.6.6 Configuring Stub Router
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Configure Stub router. stub-router

tub router is used to control the traffic. It tells other OSPF routers not to forward The S
data by using the Stub router, but these routers can have a route to the Stub router.
In Router LSAs generated by the Stub router, you need to set the metric of all links to
infinity.

Note:
The Stub router is independent of the Stub area.

figuring Authentication for OSPF 4.6.7 Con
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
Enter OSPF area view. area area-id
tion -mode { simple | md5 |
7 Enter interface view. interface interface-type interface-number
mode of the OSPF interface
(MD5 authentication).
hmac-md5 } key-id [ plain | cipher ]
password
Configure non-authentication
mode of the OSPF interface.
ospf authentication-mode null
3
4 Configure authentica
mode of OSPF area.
authentication
hmac-md5}
5 Quit to OSPF view. quit
6 Quit to system view. quit
8 Configure authentication
mode of the OSPF interface
(simple authentication).
ospf authentication-mode simple [ plain |
cipher ] password
Configure authentication ospf authentication-mode { md5 |
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-39
the OSPF packets passing the
authentication can be received, otherwise, the neighbor relationship cannot be
stablished normally.
The authentication type of all routers in one area must be consistent, and the
network segment must be consistent.
4.6.8 Configuring the MTU in DD Packets

OSPF supports packet authentication. Only
e
authentication password of all routers in one
Step Action Command
1 Enter system view. system-view
2 Enter Ethernet interface view. rface-type interface-number
D
terface.
interface inte
3 Enable to fill the MTU in D
packets sent by the in
ospf mtu-enable

The inte ual MTU w
command is configured, the interface will f
p kets
4.6.9 Configuring the Maximum Nu
rface replaces the act ith 0 when sending DD packets. After this
ill the Interface MTU field of the DD
ac with the actual MTU.
mber of External LSAs in LSDB
Step Action Command
1 Enter system view. system-view
2 ospf [ process-id ]
3 Configure the maximum
number of external LSAs in
lsdb-overflow-limit number
Enter OSPF view.
LSDB.

4.6.10 Configuring RFC1583 Compatible External Routing
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
Configure RFC1583
outing.
rfc1583 compa 3
compatible external r
tible

When a s d le LSAs, the routing rule
defined i that in RFC1583. After this command is
ame external route is calculate
n RFC2328 is different from
according to multip
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-40
4.6.11 Configuring the Network Management of OSPF
I. Configuring OSPF MIB Binding
configure, the rule in RFC2328 can be compatible with the routing rule defined in
RFC1583
Step Action Command
1 Enter system view. system-view
2 Configure OSPF MIB binding. ospf mib-binding process-id

When multiple OSPF processes are enabled, you can configure OSPF MIB to select
e process under processing, namely, to which process the OSPF MIB is bound. th
II. Configuring OSPF TRAP
Step Action Command
1 Enter system view. system-view
2 Enable OSPF TRAP. enable ospf
| ifcfgerror |
ifstatechange |
w | lsdboverflow |
maxagelsa | nbrstatechange |
originatelsa | txretransmit | vifauthfail |
vifcfgerror | virifrxbadpkt |
snmp-agent trap
[ process-id ] [ ifauthfail
ifrxbadpkt |
lsdbapproachoverflo
virifstatechange | viriftxretransmit |
virnbrstatechange ]

OSPF can be configured to forward diversified SNMP TRAP packets and a certain
OSPF process can be specified through process ID to send SNMP TRAP packets.
PF TRAP configuration is
valid for all OSPF processes.
III. Configuring OSPF Log
If the process-id is not specified during configuration, OS
Step Action Command
1 Enter system view. system-view
2 Enter OSPF view. ospf [ process-id ]
3 Enable log information. enable log [ config | state | error ]

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-41
4.7 Ma
4.7.1 Displaying
Af cute t
the running of the OSPF configuration, a n.
Table 4-1 Displaying the running of OSP
intaining OSPF
OSPF
ter the above configurations, exe he display command in any view to display
nd to verify the effect of the configuratio
F
Action Command
View the brief information of the
OSPF routing process.
d ] brief display ospf [ process-i
View OSPF statistics. display ospf [ process-id ] cumulative
View LSDB information of OSPF.
self-originate ] } ]
display ospf [ process-id ] lsdb [ { brief |
[ { router | network | summary | asbr |
nssa | opaque-link | opaque-area |
opaque-as } link-state-id ]
[ originate-router advertising-router-id |
View OSPF neighbor information.
display ospf [ process-id ] peer
[ interface-type interface-number ]
[ neighbor-id ]
View OSPF next hop information. displa process-id ] nexthop y ospf [
View OSPF routing table.
displa ss-id ] routing
-type
nexth
y ospf [ proce
[ interface interface
interface-number ] [ nexthop
op-address ]
View OSPF virtual links. display ospf [ process-id ] vlink
View OSPF request list.
display ospf [ process-id ] request-queue
[ interface-type interface-number ]
[neighbor-id ]
View OSPF retransmission list.
display ospf [ process-id ] retrans-queue
[ interface-type interface-number ]
[ neighbor-id ]
View the information of OSPF ABR
and ASBR.
display ospf [ process-id ] abr-asbr
View OSPF interface information.
dis
interface-t
play ospf [ process-id ] interface [ all |
ype interface-number ]
View OSPF er display ospf [p rror rors. rocess-id ] e
View OSPF asbr-summary.
ummary
[ ip-address mask ]
display ospf [ process-id ] asbr-s

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-42
4.7.2 Resetting OSPF
Execute the reset command in user view
T
to reset OSPF counters or connections.
able 4-2 Resetting OSPF
Action Command
Reset OSPF counters.
reset ospf counters [ neighbor
[ interface-type interface-number ]
[ router-id ] ]

Restart OSPF processes.
reset ospf [ process-id ] process
[ graceful-restart ]
Clear the routes imported by OSPF. reset ospf redistribution

4.7.3 Debu
E mmand in us
Table 4-3 Debugging OSPF
gging OSPF
xecute the debugging co er view to debug OSPF.
Action Command
Enable the debugging of OSPF
packet.
debugging o pf [ process-id ] packet [ ack
mp |
s
| dd | hello | request | update | rcv-du
snd-dump ] [ filter { src | nbr }
{ acl-number | ip-prefix ip-prefix-name } ]
Enable the debugging of OSPF
hot-standby.
debugging ospf [ process-id ] hot-standby
Enable the debugging of OSPF
event.
debugging ospf [ process-id ] event
Enable the debugging of OSPF LSA
packet.
debugging ospf [ process-id ]
lsa-originate
Enable OSPF SPF debugging.
debugging ospf [ process-id ] spf { all |
brief | intra }
debugging ospf [ process-id ] spf
nssa } [ filter { acl acl-number | ip-prefix
ip-prefix-name } ]
{ asbr-summary | ase | net-summary |

4.8 Exam uring OS

ples for Config PF
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-43
Note:
In te this section, only the commands rela d to OSPF configuration are listed.

4.8.1 Configuring OSPF Basic Functions
I. Networking Requirements
routers run OSPF, and the whole AS is partitioned into
three areas. Ro d Router B serve as ABRs to f utes between
areas.
A er shou
segments.
II.
As shown in Figure 4-21, all
uter A an orward the ro
fter the configuration, each rout ld learn the routes from AS to all network
Networking Diagram
RouterA
POS1/0/0
RouterB
POS1/0/0
68.0.2/24
RouterD
192.168.0.1/24 192.1
2.1/24
Area0
POS2/0/0
192.168.1.1/24
POS2/0/0
192.168.
POS2/0/0
192.168.2.2/24
Eth3/0/0
172.17.1.1/24
RouterC
POS2/0/0
192.168.1.2/24
Area1
Eth3/0/0
172.16.1.1/24
Area2

Networking diagram of OSPF basic configurations
II
1) Configuring IP addresses of the interfaces (omitted)
) Configuring OSPF
# Configure Router A.
[RouterA] ospf
[RouterA-ospf-1] area 0
[RouterA-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.0] quit
[RouterA-ospf-1] area 1
Figure 4-21
I. Configuration Procedures
2
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-44
k 192.168.1.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.1] quit

quit
spf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.2] quit
3) Verifying the configuration
[RouterA] display ospf peer
OSPF Process 1 with Router ID 192.168.0.1
ace 192.168.0.1(Pos1/0/0)'s neighbors
.168.2.1 Address: 192.168.0.2 GR State: Normal
is Master Priority: 1
15:04
bors
[RouterA-ospf-1-area-0.0.0.1] networ
# Configure Router B.
[RouterB] ospf
[RouterB-ospf-1] area 0
[RouterB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0]
[RouterB-ospf-1] area 2
[RouterB-o
# Configure Router C.
[RouterC] ospf
[RouterC-ospf-1] area 1
[RouterC-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
[RouterC-ospf-1-area-0.0.0.1] network 172.16.1.0 0.0.0.255
[RouterC-ospf-1-area-0.0.0.1] quit
# Configure Router D.
[RouterD] ospf
[RouterD-ospf-1] area 2
[RouterD-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[RouterD-ospf-1-area-0.0.0.0] network 172.17.1.0 0.0.0.255
[RouterD-ospf-1-area-0.0.0.0] quit

# View OSPF neighbors of Router A.

Neighbors

Area 0.0.0.0 interf
Router ID: 192
State: Full Mode:Nbr
DR: None BDR: None MTU: 0
Dead timer due in 36 sec
Neighbor is up for 00:
Authentication Sequence: [ 0 ]

Neigh
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-45
terface 192.168.1.1(Pos2/0/0)'s neighbors
Address: 192.168.1.2 GR State: Normal
sec
routing information of Router A.
uting
Cost Type NextHop AdvRouter Area
92.168.1.2 172.16.1.1 0.0.0.1
1 0.0.0.0
1 0.0.0.1
192.168.0.2 192.168.2.1 0.0.0.0
Stub 192.168.0.1 192.168.0.1 0.0.0.0
: 0 NSSA: 0
# View LSDB of Router A.
[RouterA] display ospf lsdb

OSPF Process 1 with Router ID 192.168.0.1

Type LinkState ID AdvRouter Age Len Sequence Metric
Router 192.168.2.1 192.168.2.1 874 48 80000006 1562
48 80000005 1562
Sum-Net 192.168.1.0 192.168.0.1 630 28 80000001 1562
72.17.1.0 192.168.2.1 411 28 80000001 1563
Sum-Net 192.168.2.0 192.168.2.1 429 28 80000001 1562
Sum-Net 172.16.1.0 192.168.0.1 565 28 80000001 1563
Area: 0.0.0.1
Area 0.0.0.1 in
Router ID: 172.16.1.1
State: Full Mode:Nbr is Slave Priority: 1
DR: None BDR: None MTU: 0
Dead timer due in 39
Neighbor is up for 00:07:32
Authentication Sequence: [ 0 ]

# View the OSPF
[RouterA] display ospf ro

OSPF Process 1 with Router ID 192.168.0.1
Routing Tables

Routing for Network
Destination
172.16.1.0/24 1563 Stub 1
172.17.1.0/24 3125 Inter-area 192.168.0.2 192.168.2.
192.168.1.0/24 1562 Stub 192.168.1.1 192.168.0.
192.168.2.0/24 3124 Inter-area
192.168.0.0/24 1562

Total Nets: 5
Intra Area: 3 Inter Area: 2 ASE

Link State Data Base
Area: 0.0.0.0
Router 192.168.0.1 192.168.0.1 976
Sum-Net 1

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-46
er Age Len Sequence Metric
.168.1.2 964 48 80000003 1562
8.0.1 590 48 80000002 1562
1 526 60 80000005 1562
Sum-Net 172.17.1.0 192.168.0.1 410 28 80000001 3125
Sum-Net 192.168.2.0 192.168.0.1 428 28 80000001 3124
30 28 80000001 1562
and test connectivity using the ping command.
[RouterD] display ospf routing

OSPF Process 1 with Router ID 192.168.2.2
Routing Tables

Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 4687 Inter-area 192.168.2.1 192.168.2.1 0.0.0.2
172.17.1.0/24 1 Stub 172.17.1.1 192.168.2.2 0.0.0.2
192.168.1.0/24 4686 Inter-area 192.168.2.1 192.168.2.1 0.0.0.2
192.168.2.0/24 1562 Stub 192.168.2.2 192.168.2.2 0.0.0.2
192.168.0.0/24 3124 Inter-area 192.168.2.1 192.168.2.1 0.0.0.2
Total Nets: 5
Intra Area: 2 Inter Area: 3 ASE: 0 NSSA: 0
[RouterD] ping 172.16.1.1
PING 172.16.1.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.1: bytes=56 Sequence=1 ttl=253 time=62 ms
Reply from 172.16.1.1: bytes=56 Sequence=2 ttl=253 time=16 ms
Reply from 172.16.1.1: bytes=56 Sequence=4 ttl=253 time=94 ms
Reply from 172.16.1.1: bytes=56 Sequence=5 ttl=253 time=63 ms
--- 172.16.1.1 ping statistics ---
5 packet(s) received
0.00% packet loss
ms

Type LinkState ID AdvRout
Router 192.168.1.2 192
Router 192.168.0.1 192.16
Router 172.16.1.1 172.16.1.

Sum-Net 192.168.0.0 192.168.0.1 6


[RouterA]
# View the routing table of Router D




Reply from 172.16.1.1: bytes=56 Sequence=3 ttl=253 time=62 ms

5 packet(s) transmitted
round-trip min/avg/max = 16/59/94
[RouterD]
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-47
IV
1) Configuration file of Router A
#
sysname RouterA
#
interface Pos1/0/0
link-protocol ppp
ip address 192.168.0.1 255.255.255.0
ink-protocol ppp
pf 1

terface Pos1/0/0
pf 1
255
0.0.0.255
turn
n file of Router C
#
sysname RouterC
. Configuration Files
#
interface Pos2/0/0
l
ip address 192.168.1.1 255.255.255.0
#
os
area 0.0.0.0
network 192.168.0.0 0.0.0.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
#
return
2) Configuration file of Router B
#
sysname RouterB
#
in
link-protocol ppp
ip address 192.168.0.2 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 192.168.2.1 255.255.255.0
#
os
area 0.0.0.0
network 192.168.0.0 0.0.0.
area 0.0.0.2
network 192.168.2.0
#
re
3) Configuratio
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-48
#
interface Pos2/0/0
link-protocol ppp
ip address 192.168.1.2 255.255.255.0
#
ospf 1
area 0.0.0.1
network 192.168.1.0 0.0.0.255
network 172.16.1.0 0.0.0.255
#
return
4) Configuration file of Router D
#
sysname RouterD
#
interface Ethernet3/0/0
ip address 172.17.1.1 255.255.255.0
link-protocol ppp
ip address 192.168.2.2 255.255.255.0
#
ospf 1
area 0.0.0.2
network 192.168.2.0 0.0.0.255
network 172.17.1.0 0.0.0.255
#
return
4.8.2 Example for Configuring OSPF Stub Areas
I. Net
re 4-22, all routers run OSPF, and the whole AS is divided into three
as ABRs to forward the routes between areas.
uter D serves as ASBR to import external routes (static routes).
rements is to configure Area 1 as stub area, thus reducing the LSAs
t on the route reachability.
#
interface Ethernet3/0/0
ip address 172.16.1.1 255.255.255.0
#
interface Pos2/0/0
working Requirements
As shown in Figu
areas. Router A and Router B serve
Ro
The requi
advertised to this area with no effec
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-49
II. tworking Diagram Ne
RouterA
RouterB
RouterD
POS1/0/0
192.168.0.1/24
POS1/0/0
192.168.0.2/24
POS2/0/0
192.168.2.1/24
POS2/0/0
192.168.2.2/24
Area0
POS2/0/0
192.168.1.1/24
Eth3/0/0
172.17.1.1/24
POS2/0/0
68.1.2/24
Area1
Eth3/0/0
Area2
ASBR
RouterC
172.16.1.1/24
192.1
Stub

g OSPF stub areas
III. Configuration
ces (omitted)
Configuring OSPF (same as the previous example)
port static routes
tatic 200.0.0.0 8 null 0
uterD-ospf-1] import-route static
quit
er C.

F Process 1 with Router ID 172.16.1.1
Routing Table to ABR and ASBR
Type Destination Area Cost Nexthop RtType
0.0.0.1 1562 192.168.1.1 ABR
Inter-area 172.17.1.1 0.0.0.1 4686 192.168.1.1 ASBR
Routing Tables
Figure 4-22 Configurin
Procedures
1) Configuring IP addresses of the interfa
2)
3) Configuring Router D to im
[RouterD] ip route-s
[RouterD] ospf
[Ro
[RouterD-ospf-1]
# View ABR/ASBR information on Rout
[RouterC] display ospf abr-asbr

OSP

Intra-area 192.168.0.1

# View OSPF routing table of Router C.
[RouterC] display ospf routing

OSPF Process 1 with Router ID 172.16.1.1
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-50
1
0.1 0.0.0.1
1
0.1 0.0.0.1
0.1 0.0.0.1
er
.1
er
0

Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 1 Stub 172.16.1.1 172.16.1.1 0.0.0.
172.17.1.0/24 4687 Inter-area 192.168.1.1 192.168.
192.168.1.0/24 1562 Stub 192.168.1.2 172.16.1.1 0.0.0.
192.168.2.0/24 4686 Inter-area 192.168.1.1 192.168.
192.168.0.0/24 3124 Inter-area 192.168.1.1 192.168.

Routing for ASEs
Destination Cost Type Tag NextHop AdvRout
200.0.0.0/8 10 Type2 1 192.168.1.1 172.17.1

Routing for NSSAs
Destination Cost Type Tag NextHop AdvRout

Total Nets: 6
Intra Area: 2 Inter Area: 3 ASE: 1 NSSA:
Note:
Wh n Router C is in a common area, there are AS-ext e ernal routes in the routing
table.

4) Configuring Area 1 as a stub area
b
outerA-ospf-1-area-0.0.0.0] quit
outerC-ospf-1] stub-router
# View the routing table of Router C.
OSPF Process 1 with Router ID 172.16.1.1
# Configure Router A.
[RouterA] ospf
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.0.0.1] stu
[R
# Configure Router C.
[RouterC] ospf
[R
[RouterC-ospf-1] area 1
[RouterC-ospf-1-area-0.0.0.1] stub
[RouterC-ospf-1-area-0.0.0.1] quit
[RouterC] display ospf routing


Routing Tables
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-51
st Type NextHop AdvRouter Area
.0.1
Routing for Network
Destination Co
0.0.0.0/0 65536 Inter-area 192.168.1.1 192.168.0.1 0.0
172.16.1.0/24 1 Stub 172.16.1.1 172.16.1.1 0.0.0.1
172.17.1.0/24 68660 Inter-area 192.168.1.1 192.168.0.1 0.0.0.1
192.168.1.0/24 1562 Stub 192.168.1.2 172.16.1.1 0.0.0.1
192.168.2.0/24 68659 Inter-area 192.168.1.1 192.168.0.1 0.0.0.1
192.168.0.0/24 67097 Inter-area 192.168.1.1 192.168.0.1 0.0.0.1

Total Nets: 6
Intra Area: 2 Inter Area: 4 ASE: 0 NSSA: 0

Note:
After the area where Router C resides is configured as a stub area, the AS-external
utes are invisible. Instead, there is a default route. ro

# Configure to disable to advertise Type3 LSA to the stub area.
spf
rA-ospf-1-area-0.0.0.0] quit
View OSPF routing table of Router C.
1 with Router ID 172.16.1.1
Routing Tables
AdvRouter Area
63 Inter-area 192.168.1.1 192.168.0.1 0.0.0.1
1 Stub 172.16.1.1 172.16.1.1 0.0.0.1
192.168.1.2 172.16.1.1 0.0.0.1
0
[RouterA] o
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.0.0.1] stub no-summary
[Route
#
[RouterC] display ospf routing

OSPF Process


Routing for Network
Destination Cost Type NextHop
0.0.0.0/0 15
172.16.1.0/24
192.168.1.0/24 1562 Stub

Total Nets: 3
Intra Area: 2 Inter Area: 1 ASE: 0 NSSA:

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-52
Note:
After the advertisement of Summary LSA to the stub area is disabled, the route
entries of the stub router are further reduced, and only the default route to a
destination outside the AS is reserved.

IV. Configuration
Configuration file of Router A
interface Pos1/0/0
col ppp
interface Pos2/0/0
link-protocol ppp
ip address 192.168.1.1 255.255.255.0
stub no-summary
#
return

Note:
Files
1)
#
sysname RouterA
#
link-proto
ip address 192.168.0.1 255.255.255.0
#

#
ospf 1
area 0.0.0.0
network 192.168.0.0 0.0.0.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255

The configuration file of Router B is the same as that in the previous example, and is
omitted here.

2) Configuration file of Router C
interface Ethernet3/0/0
ip address 172.16.1.1 255.255.255.0
#
#
sysname RouterC
#
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-53
link-protocol ppp
stub-router
area 0.0.0.1
0.0.0.255
0.0.0.255
Configuration file of Router D
erface Ethernet3/0/0
.1 255.255.255.0
nk-protocol ppp
ess 192.168.2.2 255.255.255.0
.0 0.0.0.255
etwork 172.17.1.0 0.0.0.255
route-static 200.0.0.0 8 NULL0
#
4.8.3 Configuring OSPF NSSA Areas
I. Netw
hown in Figure 4-23, all routers run OSPF, and the whole AS is divided into three
r B serve as ABRs to forward the routes between areas.
uter D serves as ASBR to import external routes (static routes).
interface Pos2/0/0
ip address 192.168.1.2 255.255.255.0
#
ospf 1

network 192.168.1.0
network 172.16.1.0
stub
#
return
3)
#
sysname RouterD
#
int
ip address 172.17.1
#
interface Pos2/0/0
li
ip addr
#
ospf 1
import-route static
area 0.0.0.2
network 192.168.2
n
#
ip
return

orking Requirements
As s
areas. Router A and Route
Ro
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-54
configure Area 1 as NSSA area and configure Router C as
nal routes (static routes), and the routing information can be
II. king Diagram
The requirements is to
ASBR to import exter
transmitted correctly inside the AS.
Networ
RouterA
POS1/0/0
Area0
RouterB
RouterD
POS1/0/0
168.0.2/24
POS2/0/0
192.168.2.1/24
POS2/0/0
192.168.2.2/24
POS2/0/0
192.168.1.1/24
Eth3/0/0
172.17.1.1/24
outerC
192.168.1.2/24
172.16.1.1/24
Area2
192.168.0.1/24 192.
R
POS2/0/0
Area1
Eth3/0/0
ASBR
A
NSSA
SBR

g OSPF NSSA areas
III. Configuration Procedures
figuring IP addresses of the interfaces (omitted)
the same as the previous example)
Router D to import static routes (the same as the previous example)
area

area 1
nssa default-route-advertise no-summary
quit
# Configure Router C.
[RouterC-ospf-1] area 1
1] nssa
[RouterC-ospf-1-area-0.0.0.1] quit
Figure 4-23 Configurin
1) Con
2) Configuring OSPF (
3) Configuring
4) Configuring Area 1 as an NSSA
# Configure Router A.
[RouterA] ospf
[RouterA-ospf-1]
[RouterA-ospf-1-area-0.0.0.1]
[RouterA-ospf-1-area-0.0.0.0]
[RouterC] ospf
[RouterC-ospf-1-area-0.0.0.

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-55
Note:
It is recommended that the ABR (refers to Router A here) be configured with the
default-route-advertise no-summary parameter, thus reducing the size of the
router.
Other NSSA routers only need to be configured with the nssa command.
routing table of the NSSA

# View OSPF routing table of Router C.
[RouterC] display ospf routing

OSPF Process 1 with Router ID 172.16.1.1
Routing Tables

Routing for Network
Destination Cost Type NextHop AdvRouter Area
0.0.0.0/0 1563 Inter-area 192.168.1.1 192.168.
172.16.1.0/24 1 Stub 172.16.1.1 172.16.1.1 0.0.0.
192.168.1.0/24 1562 Stub 192.168.1.2 172.16.1.1 0.0.0.
0.1 0.0.0.1
1
1

Intra Area: 2 Inter Area: 1 ASE: 0 NSSA: 0
t
ting table of Router D.
routing
ID 172.17.1.1
ng Tables

Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 4687 Inter-area 192.168.2.1 192.168.0.2 0.0.0.2
172.17.1.0/24 1 Stub 172.17.1.1 172.17.1.1 0.0.0.2
192.168.1.0/24 4686 Inter-area 192.168.2.1 192.168.0.2 0.0.0.2
192.168.2.0/24 1562 Stub 192.168.2.2 172.17.1.1 0.0.0.2
192.168.0.0/24 3124 Inter-area 192.168.2.1 192.168.0.2 0.0.0.2
Total Nets: 3

[RouterC]
5) Configuring Router C to import static routes
[RouterC] ip route-static 100.0.0.0 8 null 0
[RouterC] ospf
[RouterC-ospf-1] import-route static
[RouterC-ospf-1] qui
# View OSPF rou
[RouterD-ospf-1]dis ospf

OSPF Process 1 with Router
Routi
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-56
Destination Cost Type Tag NextHop AdvRouter

Destination Cost Type Tag NextHop AdvRouter
1 NSSA: 0
Note:
Routing for ASEs
100.0.0.0/8 10 Type2 1 192.168.2.1
192.168.0.1

Routing for NSSAs

Total Nets: 6
Intra Area: 2 Inter Area: 3 ASE:

[RouterD]

You can see an AS external route imported by the NSSA area on Router D.

IV
1) Configuration file of Router A
#
sysname RouterA
#
ip address 192.168.0.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
0
pf 1
rea 0.0.0.1
0.0.0.255
. Configuration Files
interface Pos1/0/0
link-protocol ppp
ip address 192.168.1.1 255.255.255.
#
os
area 0.0.0.0
network 192.168.0.0 0.0.0.255
a
network 192.168.1.0
nssa default-route-advertise no-summary
#
return

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-57
Note:
The configuration files of Router B and Router D are the same as that in the previous
example, and are omitted here.

2) Configuration file of Router C
#
sysname RouterC
terface Ethernet3/0/0
172.16.1.1 255.255.255.0
interface Pos2/0/0
col ppp
#
spf 1
import-route static

etwork 172.16.1.0 0.0.0.255
0.0.0 8 NULL0
4.8.4 Configuring DR Election of OSPF
I. Networking Requirments
4-24the following figure, with the highest priority 100 in the network, Router
R. With the second highest priority, Router C is elected as BDR. The
ter B cannot be elected as DR. The priority of
onfigured and its default value is 1.
#
in
ip address
#
link-proto
ip address 192.168.1.2 255.255.255.0
o
area 0.0.0.1
network 192.168.1.0 0.0.0.255
n
nssa
#
ip route-static 100.
#
return

In Figure
A is elected as D
priority of Router B is 0, and so Rou
Router D is not c
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-58
II. g Diagram
RouterD
Eth1/0/0
1001::2/64
Eth1/0/0
Networkin
RouterB RouterA
1001::1/64
Eth1/0/0
1001::4/64
RouterC
Eth1/0/0
1001::3/64

Figure 4-24 Configuring DR election of OSPF
II
Configuring IP addresses of the interfaces (omitted)
bling OSPF
er id 1.1.1.1
A-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
# Configure Router B.
uterB] interface ethernet 1/0/0
-Ethernet1/0/0] ip address 192.168.1.2 255.255.255.0
outerB-Ethernet1/0/0] ospf dr-priority 0
[RouterB-Ethernet1/0/0] quit
[RouterB] ospf
[RouterB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[RouterC-Ethernet1/0/0] quit
[RouterC] router id 3.3.3.3
[RouterC] ospf
[RouterB-ospf-1] area 0
[RouterB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
I. Configuration Procedures
1)
2) Ena
# Configure Router A.
[RouterA] rout
[RouterA] ospf
[RouterA-ospf-1] area 0
[Router
[Ro
[RouterB
[R
[RouterB] router id 2.2.2.2
[RouterB-ospf-1] area 0
# Configure Router C.
[RouterC] interface ethernet 1/0/0
[RouterC-Ethernet1/0/0] ip address 192.168.1.3 255.255.255.0
[RouterC-Ethernet1/0/0] ospf dr-priority 2
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-59


192.168.1.1

168.1.1(Ethernet6/0/0)'s neighbors
State: Normal
R: 192.168.1.3 MTU: 0
32 sec

n Sequence: [ 0 ]
e: Normal
Nbr is Master Priority: 1
DR: 192.168.1.4 BDR: 192.168.1.3 MTU: 0
: 192.168.1.4 GR State: Normal
is Master Priority: 1
192.168.1.3 MTU: 0
00:03:53

ospf dr-priority 100
# Configure Router D.
[RouterD] interface ethernet 1/0/0
[RouterD-Ethernet1/0/0] ip address 192.168.1.4 255.255.255.0
[RouterD-Ethernet1/0/0] quit
[RouterD] router id 4.4.4.4
[RouterD] ospf
[RouterB-ospf-1] area 0
[RouterB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
# View DR/BDR states.
[RouterA] display ospf peer

OSPF Process 1 with Router ID
Neighbors
Area 0.0.0.0 interface 192.
Router ID: 192.168.1.2 Address: 192.168.1.2 GR
S ate: 2-Way Mode:Nbr is Slave Priority: 1 t
DR: 192.168.1.4 BD
Dead timer due in
Neighbor is up for 00:04:21
Authenticatio

Router ID: 192.168.1.3 Address: 192.168.1.3 GR Stat
State: Full Mode:
Dead timer due in 37 sec
Neighbor is up for 00:04:06
Authentication Sequence: [ 0 ]

Router ID: 192.168.1.4 Address
State: Full Mode:Nbr
DR: 192.168.1.4 BDR:
Dead timer due in 37 sec
Neighbor is up for
Authentication Sequence: [ 0 ]

[RouterA]
3) Configuring DR priorities on the interfaces
# Configure Router A.
[RouterA] interface ethernet 1/0/0
[RouterA-Ethernet1/0/0]
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-60
/0] quit
dr-priority 0

# Configure Router C.
ospf dr-priority 2
quit
iew DR/BDR states.
OSPF Process 1 with Router ID 192.168.1.4
0)'s neighbors
1.1 GR State: Normal
lave Priority: 100
.1.3 MTU: 0
Neighbor is up for 00:11:17
1.2 GR State: Normal
lave Priority: 0
.1.3 MTU: 0
Neighbor is up for 00:11:19
1.3 GR State: Normal
lave Priority: 2
.1.3 MTU: 0
Neighbor is up for 00:11:15
cation Sequence: [ 0 ]
[RouterA-Ethernet1/0
# Configure Router B.
[RouterB] interface ethernet 1/0/0
[RouterB-Ethernet1/0/0] ospf
[RouterB-Ethernet1/0/0] quit
[RouterC] interface ethernet 1/0/0
[RouterC-Ethernet1/0/0]
[RouterC-Ethernet1/0/0]
# V
[RouterD] display ospf peer


Neighbors

Area 0.0.0.0 interface 192.168.1.4(Ethernet6/0/
Router ID: 192.168.1.1 Address: 192.168.
State: Full Mode:Nbr is S
DR: 192.168.1.4 BDR: 192.168
Dead timer due in 31 sec

Authentication Sequence: [ 0 ]

Router ID: 192.168.1.2 Address: 192.168.
State: Full Mode:Nbr is S
DR: 192.168.1.4 BDR: 192.168
Dead timer due in 35 sec

Authentication Sequence: [ 0 ]

Router ID: 192.168.1.3 Address: 192.168.
State: Full Mode:Nbr is S
DR: 192.168.1.4 BDR: 192.168
Dead timer due in 33 sec

Authenti

[RouterD]

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-61
Note:
The DR priorities configured on the interfaces will not take effect instantly.

4) Restarting OSPF processes (omitted)
uration result
1 with Router ID 192.168.1.4
s neighbors
Address: 192.168.1.1 GR State: Normal
State: Full Mode:Nbr is Slave Priority: 100
ress: 192.168.1.2 GR State: Normal
r Priority: 0
DR: 192.168.1.1 BDR: 192.168.1.3 MTU: 0
ress: 192.168.1.3 GR State: Normal
Priority: 2
DR: 192.168.1.1 BDR: 192.168.1.3 MTU: 0
F Process 1 with Router ID 192.168.1.1
Interfaces

Area: 0.0.0.0
5) Viewing the config
# View OSPF neighbor state.
[RouterD] display ospf peer

OSPF Process
Neighbors

Area 0.0.0.0 interface 192.168.1.4(Ethernet6/0/0)'
Router ID: 192.168.1.1

DR: 192.168.1.1 BDR: 192.168.1.3 MTU: 0
Dead timer due in 35 sec
Neighbor is up for 00:07:19
Authentication Sequence: [ 0 ]

Router ID: 192.168.1.2 Add
State: 2-Way Mode:Nbr is Maste

Dead timer due in 35 sec
Neighbor is up for 00:07:19
Authentication Sequence: [ 0 ]

Router ID: 192.168.1.3 Add
State: Full Mode:Nbr is Slave

Dead timer due in 37 sec
Neighbor is up for 00:07:17
Authentication Sequence: [ 0 ]

# View the OSPF interface state.
[RouterA] display ospf interface

OSP

Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-62
Type State Cost Pri DR BDR
192.168.1.1 Broadcast DR 1 100 192.168.1.1 192.168.1.3
[RouterB] display ospf interface
192.168.1.2
Address Type State Cost Pri DR BDR
0 192.168.1.1
eighboring
ge LSAs.
they are neither DR nor BDR.
IV
55.255.0
pf 1
ysname RouterB
IP Address


OSPF Process 1 with Router ID
Interfaces

Area: 0.0.0.0
IP
192.168.1.2 Broadcast DROther 1
192.168.1.3

All neighbors are in full state. This indicates that Router A forms n
relationships with all its neighbors. If the neighbor stays 2-Way, it indicates both of
them are not DR or BDR. Thus, they need not to exchan
All other neighbors are DR Others. This indicates that
. Configuration Files
1) Configuration file of Router A
#
sysname RouterA
#
interface Ethernet6/0/0
ip address 192.168.1.1 255.2
ospf dr-priority 100
#
os
area 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return
2) Configuration file of Router B
#
s
#
interface Ethernet6/0/0
ip address 192.168.1.2 255.255.255.0
ospf dr-priority 0
#
ospf 1
area 0.0.0.0
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-63
turn
terface Ethernet6/0/0
168.1.3 255.255.255.0
rea 0.0.0.0
4) Configuration file of Router D
address 192.168.1.4 255.255.255.0
f 1
urn
4.8.5 Example for Configuring OSPF Virtual Links
I. Networking Requirements
4-25, Area 2 does not connect with the backbone area directly. Area 1
ct Area 2 and Area 0. A virtual link is configured
ween Router A and Router B.
network 192.168.1.0 0.0.0.255
#
re
3) Configuration file of Router C
#
sysname RouterC
#
in
ip address 192.
ospf dr-priority 2
#
ospf 1
a
network 192.168.1.0 0.0.0.255
#
return
#
sysname RouterD
#
interface Ethernet6/0/0
ip
#
osp
area 0.0.0.0
network 192.168.1.0 0.0.0.255
#
ret
In Figure
serves as a Transit Area to conne
bet
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-64
II. agram Networking Di
RouterA
POS1/0/0
192.168.1.1/24
RouterB
POS1/0/0
192.168.1.2/24
Eth2/0/0
172.16.1.1/16
Area0
Area2
Area1
Eth2/0/0
10.1.1.1/8
Virtual Link

III. Configuration Procedures
sses of the interfaces (omitted)
onfigure Router A.
] ospf 1 router-id 1.1.1.1
uterA-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255
ea-0.0.0.0] quit
uterA-ospf-1] area 1
0.1] network 192.168.1.0 0.0.0.255
ure Router B.


network 192.168.1.0 0.0.0.255
quit
[RouterB-ospf-1] area 2
.0 0.0.255.255
[RouterBospf-1-area-0.0.0.2] quit
outer A.
[RouterA] display ospf routing
s

Routing for Network
Destination Cost Type NextHop AdvRouter Area
10.0.0.0/8 1562 Stub 10.1.1.1 1.1.1.1 0.0.0.0
192.168.1.0/24 1562 Stub 192.168.1.1 1.1.1.1 0.0.0.1
Figure 4-25 Configuring OSPF virtual links
1) Configuring IP addre
2) Configuring OSPF
# C
[RouterA
[RouterA-ospf-1] area 0
[Ro
[RouterA-ospf-1-ar
[Ro
[RouterA-ospf-1-area-0.0.
[RouterA-ospf-1-area-0.0.0.1] quit
# Config
[RouterB] ospf 1 router-id 2.2.2.2
[RouterB-ospf-1] area 1
[RouterB-ospf-1-area-0.0.0.1]
[RouterB-ospf-1-area-0.0.0.1]
[RouterBospf-1-area-0.0.0.2] network 172.16.0
# View OSPF routing table of R

OSPF Process 1 with Router ID 1.1.1.1
Routing Table
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-65

Total Nets: 2
Intra Area: 2 Inter Area: 0 ASE: 0 NSSA: 0

Note:
Area 2 does not connect directly to Area 0. Thus, there is no Area 2
routing table of Router A.
route in the

3) Configure the virtual link
[RouterA] ospf
0.0.1] vlink-peer 2.2.2.2
-0.0.0.1] quit
-peer 1.1.1.1
.0.1] quit

ID 1.1.1.1
Tables
Type NextHop AdvRouter Area
0.0.0.0
1.1.1.1 0.0.0.0
92.168.1.1 1.1.1.1 0.0.0.1
IV. Configuration Files
# Configure Router A.
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.
[RouterA-ospf-1-area
# Configure Router B.
[RouterB] ospf 1
[RouterB-ospf-1] area 1
[RouterB-ospf-1-area-0.0.0.1] vlink
[RouterB-ospf-1-area-0.0
# View OSPF routing table of Router A.
[RouterA] display ospf routing

OSPF Process 1 with Router
Routing

Routing for Network
Destination Cost
172.16.1.1/32 1563 Inter-area 192.168.1.2 2.2.2.2
10.0.0.0/8 1562 Stub 10.1.1.1
192.168.1.0/24 1562 Stub 1

Total Nets: 3
Intra Area: 2 Inter Area: 1 ASE: 0 NSSA: 0

1) Configuration file of Router A
#
sysname RouterA
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-66
et2/0/0
interface Pos1/0/0
col ppp
ospf 1 router-id 1.1.1.1
area 0.0.0.0
5.255
network 192.168.1.0 0.0.0.255
interface Pos1/0/0
0.0.0.1
0.0.0.255
4.9 Trou
4.9.1 OS t be Established
I.
OSPF neighbors cannot be established.
#
interface Ethern
ip address 10.1.1.1 255.0.0.0
#
link-proto
ip address 192.168.1.1 255.255.255.0
#

network 10.0.0.0 0.255.25
area 0.0.0.1
vlink-peer 2.2.2.2
#
return
2) Configuration file of Router B
#
sysname RouterB
#
interface Ethernet2/0/0
ip address 172.16.1.1 255.255.0.0
#
link-protocol ppp
ip address 192.168.1.2 255.255.255.0
#
ospf 1 router-id 2.2.2.2
area
network 192.168.1.0
vlink-peer 1.1.1.1
area 0.0.0.2
network 172.16.0.0 0.0.255.255
#
return
bleshooting
PF Neighbors Canno
Fault Description
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-67
II. alysis
If both the physical connection and the lower layer protocol are normal, you can
check the OSPF parameters configured on the interface and ensure their
consistency with that of the neighboring routers. The area ID should be the same, as
ment and the mask. However, in P2P networks or the
networks with the virtual links, the network segment and the mask can be different.
network types of the interfaces of two neighboring routers should be the same.
orks, the DR priority of at least one interface should be
III. Troubleshooting
An
well as the network seg
The
For broadcast or NBMA netw
greater than 0.
Step Action
1 View OSPF neighbors using the display ospf peer command.
2 View OSPF interfaces using the display ospf interface command.
3 hysical connection and the lower layer protocol are
mand. If the local router cannot ping through the
remote router, there are some faults in the physical connection and the lower
.
4 Check OSPF timer to make sure that the dead time on one interface should
Hello interval.
ecify neighbors manually using the peer
ip-address command.
t or NBMA networks, the DR priority of at least one interface
eater than 0.
Check whether both the p
correct using the ping com
layer protocol
be at least four times the
5 For NBMA networks, you can sp
6 For broadcas
should be gr

4.9.2 Inco ormation
I.
es of other areas.
II.
s in the backbone area should be connected with each other. If one router is
d two or more areas, at least one of the areas is the backbone area. The
backbone area cannot be configured as a stub area.
The routers in the stub area cannot receive AS external routes. If one area is
configured as a stub area, all routers connected to this area should be configured
with the stub command.
rrect OSPF Routing Inf
Fault Description
OSPF cannot discover rout
Analysis
All area
configure
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 4 OSPF Configuration

Huawei Technologies Proprietary
4-68
III. Troubleshooting
No. Action
1 View OSPF neighbors using the display ospf peer command.
2 View OSPF interfaces using the display ospf interface command.
DB is complete using the display ospf lsdb
command.
configured correctly using the display
current-configuration configuration ospf command. If two or more areas
configured with the stub command, at least one of the areas is the
backbone area. However, the backbone area cannot be configured with the
3 Check whether the LS
4 Check whether the areas are
are
stub command.
5 All the routers in one stub area need to be configured with the stub
command.
6 If the virtual link is configured, you can check whether the neighbors are
normal using the display ospf vlink command.

S-ar putea să vă placă și