01-05 OSPF Configuration
01-05 OSPF Configuration
5 OSPF Configuration
Definition
The Open Shortest Path First (OSPF) protocol is a link-state Interior Gateway
Protocol (IGP) developed by the Internet Engineering Task Force (IETF).
OSPF Version 2, as defined in RFC 2328, is designed for IPv4. OSPF Version 3, as
defined in RFC 2740, is designed for IPv6. Unless otherwise stated, OSPF stated in
this document refers to OSPF Version 2.
Purpose
Before the introduction of OSPF, the Routing Information Protocol (RIP) was the
most widely used IGP.
RIP is distance-vector routing protocol and has the problems of slow convergence,
routing loops, and poor scalability. Therefore, OSPF now becomes the most widely
accepted and used IGP.
OSPF is a link-state routing protocol resolving the problems faced by RIP and
featuring:
● Multicast packet transmission, reducing the load on the switches not running
OSPF
● Classless Interdomain Routing (CIDR)
● Load balancing among equal-cost routes
● Packet authentication
Packet Types
Database Description (DD) Contains brief information about the local link-
packet state database (LSDB) and synchronizes the
LSDBs on two devices.
Link State Request (LSR) Requests the required LSAs from neighbors.
packet LSR packets are sent only after DD packets are
exchanged successfully.
LSA Types
Router-LSA (Type 1) Describes the link status and link cost of a router. It
is generated by every router and advertised in the
area to which the router belongs.
Network-LSA (Type 2) Describes the link status of all routers on the local
network segment. Network-LSAs are generated by a
designated router (DR) and advertised in the area to
which the DR belongs.
Router Types
Figure 5-1 lists common router types used in OSPF.
Area1 Area4
Area0
Area Border Router (ABR) An ABR belongs to two or more than two areas,
one of which must be the backbone area.
An ABR is used to connect the backbone area and
non-backbone areas. It can be physically or logically
connected to the backbone area.
Route Types
Inter-area and intra-area routes in an AS describe the AS's network structure. AS
external routes describe the routes to destinations outside an AS. OSPF classifies
the imported AS external routes into Type 1 and Type 2 external routes.
Type 2 external route Type 2 external routes have low reliability, and
therefore OSPF considers that the cost of the route
from an ASBR to the destination of a Type 2
external route is much greater than the cost of any
internal route to the ASBR.
Cost of a Type 2 external route = Cost of the route
from the ASBR to the destination of the Type 2
external route
Area Types
Common area OSPF areas are common areas by default. Common areas
include standard areas and backbone areas.
● A standard area is the most common area and transmits
intra-area routes, inter-area routes, and external routes.
● A backbone area connects all the other OSPF areas. It is
usually named Area 0.
Stub area A stub area does not advertise AS external routes but
advertises only intra-area and inter-area routes.
Compared with a non-stub area, a router in a stub area
maintains fewer routing entries and transmits less routing
information.
To ensure the reachability of AS external routes, the ABR in
a stub area advertises Type 3 default routes to the entire
stub area. All AS external routes must be advertised by the
ABR.
Totally stub area A totally stub area does not advertise AS external routes or
inter-area routes but advertises only intra-area routes.
Compared with a non-stub area, a router in a totally stub
area maintains fewer routing entries and transmits less
routing information.
To ensure the reachability of AS external and inter-area
routes, the ABR in a totally stub area advertises Type 3
default routes to the entire totally stub area. All AS
external and inter-area routes must be advertised by the
ABR.
DR and BDR
On broadcast or NBMA networks, any two routers need to exchange routing
information. As shown in Figure 5-2, n routers are deployed on the network. n x
(n - 1)/2 adjacencies must be established. Any route change on a router is
transmitted to other routers, which wastes bandwidth resources. OSPF resolves
this problem by defining a DR and a BDR. After a DR is elected, all routers send
routing information only to the DR. Then the DR broadcasts LSAs. routers other
than the DR and BDR are called DR others. The DR others establish only
adjacencies with the DR and BDR and not with each other. This process reduces
If the original DR fails, routers must reelect a DR and the routers except the new
DR must synchronize routing information to the new DR. This process is lengthy,
which may cause incorrect route calculations. A BDR is used to shorten the
process. The BDR is a backup for a DR. A BDR is elected together with a DR. The
BDR establishes adjacencies with all routers on the network segment and
exchanges routing information with them. If the DR fails, the BDR immediately
becomes a new DR. The routers need to reelect a new BDR, and this process does
not affect route calculations.
The DR priority of a router interface determines its qualification for DR and BDR
elections. The router interfaces with their DR priorities greater than 0 are eligible.
Each router adds the elected DR to a Hello packet and sends it to other routers on
the network segment. When both router interfaces on the same network segment
declare that they are DRs, the router interface with a higher DR priority is elected
as a DR. If the two router interfaces have the same DR priority, the router
interface with a larger router ID is elected as a DR.
Stub Area
Stub areas are specific areas where ABRs do not flood the received AS external
routes. In stub areas, Routers maintain fewer routing entries and less routing
information.
Configuring a stub area is optional. Not every area can be configured as a stub
area. A stub area is usually a non-backbone area with only one ABR and is located
at the AS border.
To ensure the reachability of the routes to destinations outside an AS, the ABR in
the stub area generates a default route and advertises the route to the non-ABRs
in the same stub area.
Note the following points when configuring a stub area:
● The backbone area cannot be configured as a stub area.
● Before configuring an area as a stub area, you must configure stub area
attributes on all routers in the area.
● There should be no ASBR in a stub area, meaning that AS external routes
cannot be transmitted in the stub area.
NSSA
NSSAs are a special type of OSPF areas. There are many similarities between an
NSSA and a stub area. Both of them do not advertise the external routes received
from the other OSPF areas. The difference is that a stub area cannot import AS
external routes, whereas an NSSA can import AS external routes and advertise the
imported routes to the entire AS.
After an area is configured as an NSSA, an ABR in the NSSA generates a default
route and advertises the route to the other routers in the NSSA. This is to ensure
the reachability of the routes to the destinations outside an AS.
Note the following points when configuring an NSSA:
● The backbone area cannot be configured as an NSSA.
● Before configuring an area as an NSSA, you must configure NSSA attributes
on all routers in the area.
● Virtual connections cannot cross an NSSA.
Table 5-8 provides guidelines for advertising default routes in different areas.
Stub area A stub area does not allow AS external routes (Type 5
LSAs) to be transmitted within the area.
All routers within the stub area must learn AS external
routes from the ABR. The ABR automatically generates a
default Summary LSA (Type 3 LSA) and advertises it to the
entire stub area. Then all routes to destinations outside an
AS can be learned from the ABR.
Totally stub area A totally stub area does not allow AS external routes (Type
5 LSAs) or inter-area routes (Type 3 LSAs) to be
transmitted within the area.
All routers within the totally stub area must learn AS
external routes and other areas' routes from the ABR. The
ABR automatically generates a default Summary LSA (Type
3 LSA) and advertises it to the entire totally stub area.
Then, all routes to destinations outside an AS and to
destinations in other areas can be learned from the ABR.
Totally NSSA A totally NSSA does not allow AS external routes (Type 5
LSAs) or inter-area routes (Type 3 LSAs) to be transmitted
within the area.
All routers within the totally NSSA must learn AS external
routes from the ABR. The ABR automatically generates a
default Summary LSA and advertises it to the entire totally
NSSA. Then all external routes received from other areas
and inter-area routes can be advertised within the totally
NSSA.
● Importing routes
OSPF can import routes learned by other routing protocols. You can configure
routing policies to filter the imported routes to allow OSPF to import only the
routes that match specific conditions.
● Advertising imported routes
OSPF advertises the imported routes to its neighbors.
You can configure filtering rules to filter the routes to be advertised. The
filtering rules can be configured only on ASBRs.
● Learning routes
Filtering rules can be configured to allow OSPF to filter the received intra-
area, inter-area, and AS external routes.
After receiving routes, an OSPF device adds only the routes that match the
filtering rules to the local routing table, but can still advertise all routes from
the OSPF routing table.
● Learning inter-area LSAs
You can configure an ABR to filter the incoming Summary LSAs. This
configuration takes effect only on ABRs because only ABRs can advertise
Summary LSAs.
Table 5-9 Differences between inter-area LSA learning and route learning
Filters incoming Filters the routes that are calculated based on LSAs,
LSAs. but does not filter LSAs. This means that all incoming
LSAs are learned.
OSPF Multi-Process
OSPF supports multi-process. Multiple OSPF processes can run on the same router,
and they are independent of each other. Route exchanges between different OSPF
processes are similar to route exchanges between different routing protocols.
A typical application of OSPF multi-process is that OSPF runs between PEs and
CEs in a VPN, whereas OSPF is used as an IGP on the backbone of the VPN. Two
OSPF processes on the same PE are independent of each other.
When OSPF calculates external routes, routing loops may occur because RFC 2328
and RFC 1583 define different route selection rules. To prevent routing loops, both
communication ends must use the same route selection rules.
● After RFC 1583 compatibility is enabled, OSPF uses the route selection rules
defined in RFC 1583.
● When RFC 1583 compatibility is disabled, OSPF uses the route selection rules
defined in RFC 2328.
OSPF calculates external routes based on Type 5 LSAs. If the router enabled with
RFC 1583 compatibility receives a Type 5 LSA:
● The router selects a route to the ASBR that originates the LSA, or to the
forwarding address (FA) described in the LSA.
● The router selects external routes to the same destination.
By default, OSPF uses the route selection rules defined in RFC 1583.
1. Adjacency establishment
The adjacency establishment process is as follows:
a. The local and remote routers use OSPF interfaces to exchange Hello
packets to establish a neighbor relationship.
b. The local and remote routers negotiate a master/slave relationship and
exchange DD packets.
c. The local and remote routers exchange LSAs to synchronize their LSDBs.
2. Route calculation
OSPF uses the shortest path first (SPF) algorithm to calculate routes, resulting
in fast route convergence.
Adjacency Establishment
Adjacencies can be established in either of the following situations:
On a broadcast network, the DR and BDR establish adjacencies with each router
on the same network segment, but DR others establish only neighbor
relationships.
▪ I field: The value 1 indicates that the packet is the first DD packet,
which is used to negotiate a master/slave relationship and does not
carry LSA summaries.
▪ M field: The value 1 indicates that the packet is not the last DD
packet.
On an NBMA network, all routers establish adjacencies only with the DR and BDR.
Route Calculation
OSPF uses an LSA to describe the network topology. A Type 1 LSA describes the
attributes of a link between routers. A router transforms its LSDB into a weighted,
directed graph, which reflects the topology of the entire AS. All routers in the
same area have the same graph. Figure 5-5 shows a weighted, directed graph.
Based on the graph, each router uses an SPF algorithm to calculate an SPT with
itself as the root. The SPT shows routes to nodes in the AS. Figure 5-6 shows an
SPT.
When a router's LSDB changes, the router recalculates a shortest path. Frequent
SPF calculations consume a large amount of resources and affect router efficiency.
Changing the interval between SPF calculations can prevent resource consumption
caused by frequent LSDB changes. The default interval between SPF calculations is
5 seconds.
5.2.3 OSPF TE
OSPF Traffic Engineering (TE) is a new feature developed on the basis of OSPF to
support MPLS TE and establish and maintain the Label Switch Path (LSP) of TE. In
the MPLS TE architecture described in "Principles" in the Configuration Guide -
MPLS - MPLS TE Configuration, OSPF functions as the information advertising
component, responsible for collecting and advertising MPLS TE information.
In addition to the network topology, TE also needs to know network constraints,
such as the bandwidth, TE metric, administrative group, and affinity attribute.
Current OSPF functions, however, cannot meet these requirements. Therefore,
OSPF needs to be extended by introducing a new type of LSAs to advertise
network constraints. Based on the network constraints, the Constrained Shortest
Path First (CSPF) algorithm can calculate the path that satisfies certain
constraints.
Area 3 RouterE
RouterC ASBR
cost=6 cost=1 cost=8
RouterA RouterB
ASBR cost=1
cost=2
Area 0
Area 2
RouterD
TE-LSA
OSPF uses a new type of LSAs, namely, Type 10 opaque LSAs, to collect and
advertise TE information. This type of LSAs contains the link status information
required by TE, including the maximum link bandwidth, maximum reservable
bandwidth, current reserved bandwidth, and link color. Type 10 opaque LSAs
synchronize link status information among devices in an area through the OSPF
flooding mechanism. By so doing, a uniform TEDB is formed for route calculation.
OSPF DS-TE
DiffSer Aware Traffic Engineering (DS-TE) controls and forwards flows differently
based on Class of Service (CoS). DS-TE combines the advantages of MPLS TE and
Differentiated Services (DiffServ) and controls flow paths precisely. By so doing,
DS-TE effectively uses network resources and reserves required resources for
different service flows. For details, see "Principles" in the Configuration Guide -
MPLS - MPLS TE Configuration.
To support DS-TE in MPLS, OSPF supports the local overbooking multiplier TLV
and bandwidth constraint (BC) TLV in the TE-LSA, which are used to advertise and
collect the reservable bandwidths of class types (CTs) with different priorities on
the link (A CT refers to a collection of bandwidths of an LSP or a group of LSPs
with the same CoS.)
OSPF SRLG
OSPF supports the applications of the Shared Risk Link Group (SRLG) in MPLS by
obtaining information about the SRLG that floods TE information to devices in an
area. For details, see "Principles" in the Configuration Guide - MPLS - MPLS TE
Configuration.
Definition
Bidirectional Forwarding Detection (BFD) is a mechanism to detect
communication faults between forwarding engines.
In BFD for OSPF, a BFD session is associated with OSPF. The BFD session quickly
detects a link fault and then notifies OSPF of the fault. This speeds up OSPF's
response to the change of the network topology.
Purpose
The link fault or the topology change may cause devices to re-calculate routes.
Therefore, the convergence of routing protocols must be as quick as possible to
improve the network performance.
Table 5-10 Comparison before and after BFD for OSPF is enabled
Not associated An OSPF Dead timer expires. By default, At the second level
with BFD the timeout period of the timer is 40s.
Principle
GE1/0/0 GE2/0/0
10.1.1.2/24 10.2.2.1/24 Area0
RouterC
4. RouterA processes the event that a neighbor relationship becomes Down and
re-calculates routes. After calculation, the outbound interface is GE1 /0/0
passes through RouterC and then reaches RouterB.
NOTE
Definition
GTSM is short for Generalized TTL Security Mechanism, a mechanism that protects
the services over the IP layer by checking whether the TTL value in the IP packet
header is within a pre-defined range.
Purpose
On the network, an attacker may simulate valid OSPF packets and keeps sending
them to a device. After receiving these packets, the device identifies the
destination of the packets. The forwarding plane of the device then directly sends
the packets to the control plane for processing without checking the validity of the
packets. As a result, the device is busy processing these "valid" packets, resulting
in high CPU usage.
In applications, the GTSM is mainly used to protect the TCP/IP-based control plane
from CPU-utilization based attacks, for example, attacks that cause CPU overload.
Principle
Devices enabled with GTSM check the TTL values in all the received packets
according to the configured policies. The packets that fail to pass the policies are
discarded or sent to the control plane. This prevents devices from possible CPU-
utilization based attacks. A GTSM policy involves the following items:
● Source address of the IP packet sent to the device
● VPN instance to which the packet belongs
● Protocol number of the IP packet (89 for OSPF, and 6 for BGP)
● Source interface number and destination interface number of protocols above
TCP/UDP
● Valid TTL range
The method of implementing GTSM is as follows:
● For the directly connected OSPF neighbors, the TTL value of the unicast
protocol packets to be sent is set to 255.
● For multi-hop neighbors, a reasonable TTL range is defined.
The applicability of GTSM is as follows:
● GTSM takes effect only for unicast packets. The TTL value of multicast packets
cannot exceed 255; therefore, GTSM is not required for multicast packets.
● GTSM does not support tunnel-based neighbors.
Definition
Generally, Routers periodically send Hello packets through OSPF interfaces. That
is, a Router sends Hello packets at the Hello interval set by a Hello timer. Because
Hello packets are sent at a fixed interval, the speed at which OSPF neighbor
relationship is established is lowered.
Enabling Smart-discover can speed up the establishment of OSPF neighbor
relationships in specific scenarios.
Smart-discover is not ● Hello packets are sent only when the Hello
configured timer expires.
● The gap between the sending of two Hello
packets is the Hello interval.
● Neighbors keep waiting to receive Hello
packets within the Hello interval.
Principle
In the following scenarios, the interface enabled with Smart-discover can send
Hello packets to neighbors without having to wait for the Hello timer to expire:
● The neighbor status becomes 2-way for the first time.
● The neighbor status changes from 2-way or a higher state to Init.
Definition
As an extension of OSPF, OSPF VPN multi-instance enables Provider Edges (PEs)
and Customer Edges (CEs) in VPNs to run OSPF for interworking and use OSPF to
learn and advertise routes.
Purpose
As a widely used IGP, in most cases, OSPF runs in VPNs. If OSPF runs between PEs
and CEs, and PEs advertise VPN routes to CEs using OSPF, CEs do not need to
support other routing protocols for interworking with PEs. This simplifies
management and configuration of CEs.
Area0 Area0
OSPF 100 VPN1
OSPF 100 VPN1 MPLS VPN
Backbone
Area1 PE1 PE2 Area1
OSPF 200 VPN2 OSPF 200 VPN1
CE2 CE4
Area1 Area2
Site2 Site4
VPN2 VPN1
In the extended application of OSPF VPN, the MPLS VPN backbone network serves
as Area 0. OSPF requires that Area 0 be contiguous. Therefore, Area 0 of all VPN
sites must be connected to the MPLS VPN backbone network. If a VPN site has
OSPF Area 0, the PEs that CEs access must be connected to the backbone area of
this VPN site through Area 0. If no physical link is available to directly connect PEs
to the backbone area, a virtual link can be used to implement logical connection
between the PEs and the backbone area, as shown in Figure 5-10.
OSPF Domain ID
If inter-area routes are advertised between local and remote OSPF areas, these
areas are considered to be in the same OSPF domain.
Before advertising the remote routes sent by BGP to CEs, PEs need to determine
the type of OSPF routes (Type 3, Type 5 or Type 7) to be advertised to CEs
according to domain IDs.
● If local domain IDs are the same as or compatible with remote domain IDs in
BGP routes, PEs advertise Type 3 routes.
● Otherwise, PEs advertise Type 5 or Type 7 routes.
Both the local and remote domain IDs The same Inter-area route
are null.
The remote domain ID is different Not the If the local area is a non-
from the local primary domain ID or same NSSA, external routes are
any of the local secondary domain IDs. generated.
If the local area is an
NSSA, NSSA routes are
generated.
VPN
backbone
CE1
PE2
As shown in Figure 5-11, on PE1, OSPF imports a BGP route whose destination
address is 10.1.1.1/32, and then generates and advertises a Type 5 or Type 7 LSA
to CE1. Then, CE1 learns an OSPF route with the destination address and next hop
being 10.1.1.1/32 and PE1 respectively, and advertises the route to PE2. In this
manner, PE2 learns an OSPF route with the destination address and next hop
being 10.1.1.1/32 and CE1 respectively.
Similarly, CE1 also learns an OSPF route with the destination address and next hop
being 10.1.1.1/32 and PE2 respectively. PE1 learns an OSPF route with the
destination address and next hop being 10.1.1.1/32 and CE1 respectively.
As a result, CE1 has two equal-cost routes with next hops being PE1 and PE2
respectively, and the next hops of the routes from PE1 and PE2 to 10.1.1.1/32 are
CE1. Thus, a routing loop occurs.
In addition, the preference of an OSPF route is higher than that of a BGP route.
Therefore, on PE1 and PE2, BGP routes to 10.1.1.1/32 are replaced by the OSPF
route. That is, the OSPF route with the destination address and next hop being
10.1.1.1/32 and CE1 respectively is active in the routing tables of PE1 and PE2.
The BGP route then becomes inactive, and thus the LSA generated when this route
is imported by OSPF is deleted. This causes the OSPF route to be withdrawn. As a
result, there is no OSPF route in the routing table, and the BGP route becomes
active again. This cycle causes route flapping.
OSPF VPN provides a solution to this problem, as shown in Table 5-13.
VPN Route Tag The VPN route tag is carried in When a PE detects that
Type 5 or Type 7 LSAs generated the VPN route tag in the
by PEs according to the received incoming LSA is the
BGP private route. same as that in the local
Not transmitted in BGP extended LSA, the PE ignores this
community attributes, the VPN LSA. Consequently,
route tag is valid only on the PEs routing loops are
that receive BGP routes and avoided.
generate OSPF LSAs.
NOTICE
Disabling routing loop prevention may cause routing loops. Exercise caution when
performing this operation.
During BGP or OSPF route exchanges, routing loop prevention prevents OSPF
routing loops in VPN sites.
In the inter-AS VPN Option A scenario, if OSPF is running between ASBRs to
transmit VPN routes, the remote ASBR may be unable to learn the OSPF routes
sent by the local ASBR due to the routing loop prevention mechanism.
As shown in Figure 5-12, inter-AS VPN Option A is deployed. OSPF is running
between PE1 and CE1. CE1 sends VPN routes to CE2.
VPN1
CE1 VPN1
CE3
BGP/MPLS backbone BGP/MPLS backbone
AS: 100 AS: 200
PE1
PE3
ASBR1 ASBR2
MP-IBGP MP-IBGP
OSPF
PE2
PE4
CE2 CE4
VPN2 VPN2
1. PE1 learns routes to CE1 using the OSPF process in a VPN instance, and
imports these routes into MP-BGP, and sends the MP-BGP routes to ASBR1.
2. After having received the MP-BGP routes, ASBR1 imports the routes into the
OSPF process in a VPN instance and generates Type 3, Type 5, or Type 7 LSAs
in which the DN bit is set to 1.
3. ASBR2 learns these LSAs using OSPF and checks the DN bit of each LSA. After
learning that the DN bit in each LSA is set to 1, ASBR2 does not add the
routing information carried in these LSAs to its routing table.
Due to the routing loop prevention mechanism, ASBR2 cannot learn the OSPF
routes sent from ASBR1, causing CE1 to be unable to communicate with CE3.
● A device does not set the DN bit to 1 in the LSAs when importing BGP routes
into OSPF. For example, ASBR1 does not set the DN bit to 1 when importing
MP-BGP routes into OSPF. After ASBR2 receives these routes and checks that
the DN bit in the LSAs carrying these routes is 0, ASBR2 adds the routes to its
routing table.
● A device does not check the DN bit after having received LSAs. For example,
ASBR1 sets the DN bit to 1 in LSAs when importing MP-BGP routes into OSPF.
ASBR2, however, does not check the DN bit after having received these LSAs.
The preceding methods can be used more flexibly based on specific types of LSAs.
For Type 3 LSAs, you can configure a sender to determine whether to set the DN
bit to 1 or configure a receiver to determine whether to check the DN bit in the
Type 3 LSAs based on the router ID of the device that generates the Type 3 LSAs.
In the inter-AS VPN Option A scenario shown in Figure 5-13, the four ASBRs are
fully meshed and run OSPF. ASBR2 may receive the Type 3, Type 5, or Type 7 LSAs
generated on ASBR4. If ASBR2 is not configured to check the DN bit in the LSAs,
ASBR2 will accept the Type 3 LSAs, and routing loops will occur, as described in
Figure 5-13. ASBR2 will deny the Type 5 or Type 7 LSAs, because the VPN route
tags carried in the LSAs are the same as the default VPN route tag of the OSPF
process on ASBR2.
To address the routing loop problem caused by Type 3 LSAs, configure ASBR2 not
to check the DN bit in the Type 3 LSAs that are generated by devices with the
router ID 10.1.1.1 and the router ID 10.3.3.3. After the configuration is complete, if
ASBR2 receives Type 3 LSAs sent by ASBR4 with the router ID 10.4.4.4, ASBR2 will
check the DN bit and deny these Type 3 LSAs because the DN bit is set to 1.
Figure 5-13 Networking diagram for full-mesh ASBRs in the inter-AS VPN Option
A scenario
OSPF Router ID OSPF Router ID
10.1.1.1 10.2.2.2
ASBR1 ASBR2
ASBR3 ASBR4
OSPF Router ID OSPF Router ID
10.3.3.3 10.4.4.4
OSPF Multi-VPN-Instance
OSPF multi-VPN-instance is short for OSPF multi-instance.
Multi-VPN-Instance CE
OSPF multi-instance generally runs on PEs. The devices that run OSPF multi-
instance within the LANs of users and are configured with the vpn-instance-
capability simple command are called Multi-VPN-Instance CEs (MCEs), that is,
multi-instance CEs.
Compared with OSPF multi-instance running on PEs, MCEs have the following
characteristics:
● MCEs do not need to support OSPF-BGP synchronization.
● MCEs establish different OSPF instances for different services. Different virtual
CEs transmit different services. This solves the security issue of the LAN at a
low cost.
● MCEs implement different OSPF multi-instances on a CE. The key to
implementing MCEs is to disable loop detection and calculate routes directly.
That is, MCEs also use the received LSAs with the DN-bit set to 1 for route
calculation.
Definition
As defined in OSPF, stub areas cannot import external routes. This prevents a large
number of external routes from consuming bandwidth and storage resources of
the Routers in stub areas. To import external routes and to prevent external routes
from consuming resources, NSSAs are used, because stub areas cannot meet
requirements.
NSSAs are a new type of OSPF areas.
There are many similarities between NSSAs and stub areas. The difference
between NSSAs and stub areas is that NSSAs can import AS external routes into
the entire OSPF AS and advertise the imported routes in the OSPF AS, but do not
learn external routes from other areas on the OSPF network.
N-bit
All Routers in an area must be configured with the same area type. In OSPF, the
N-bit is carried in a Hello packet and is used to identify the area type supported
by the Router. OSPF neighbor relationships cannot be established between Routers
configured with different area types.
Some manufacturers do not comply with the standard and set the N-bit in both
OSPF Hello and DD packets. To allow Huawei devices to interwork with these
manufacturers' devices, set the N-bit in OSPF DD packets on Huawei devices.
Type 7 LSA
● Type 7 LSAs are a new type of LSAs that can only be used in NSSAs and
describe the imported external routes.
● Type 7 LSAs are generated by ASBRs in an NSSA and flooded only in the NSSA
where the ASBRs reside.
● When the ABRs in the NSSA receive these Type 7 LSAs, they translate some of
the Type 7 LSAs into Type 5 LSAs to advertise AS external routes to the other
areas on the OSPF network.
OSPF NSR synchronizes the protocol data on the master MPU/SRU to the slave
MPU/SRU in real time. When the master MPU/SRU becomes faulty or needs to be
upgraded, the slave MPU/SRU rapidly takes over services from the master
MPU/SRU without being sensed by the neighbor. OSPF NSR synchronizes the real-
time data between the master and slave MPUs/SRUs in the following manners:
● OSPF backs up configuration data and dynamic data, including information
about interfaces, neighbors, and LSDBs.
● OSPF does not back up routes, shortest path trees (SPTs), and Traffic
Engineering DataBases (TEDBs). All these can be restored through the source
data by using the database backup process.
● When the master-slave switchover occurs, the new master MPU/SRU restores
the operation data and takes over services from the former master MPU/SRU
without being sensed by the neighbor.
NOTE
OSPF IP FRR complies with RFC 5286, that is, Basic Specification for IP Fast
Reroute Loop-Free Alternates, which protects traffic when links or nodes become
faulty.
Background
With the development of networks, Voice over IP (VoIP) and online video services
require high-quality real-time transmission. Nevertheless, if an OSPF fault occurs,
multiple processes, including fault detection, LSP update, LSP flooding, route
calculation, and FIB entry delivery, must be performed to switch traffic to a new
link. As a result, the fault recovery time is much greater than 50 ms, the time for
users to sense traffic interruption, which cannot meet the requirement for real-
time services.
Implementation Principle
OSPF IP FRR pre-computes a backup link by using the Loop-Free Alternate (LFA)
algorithm, and then adds the backup link and the primary link to the forwarding
table. In the case of failures, OSPF IP FRR can fast switch traffic to the backup link
before routes on the control plane converge. This prevents traffic interruption and
thus protects traffic and improves reliability of an OSPF network. The Router
supports IPv4 OSPF IP FRR.
In the LFA algorithm, considering a neighbor that can provide a backup link as the
root node, the neighbor computes the shortest path from itself to the destination
of the primary link by using the SPF algorithm. The neighbor then computes a
loop-free backup link with the smallest cost by using the inequality defined in RFC
5286.
OSPF IP FRR can filter backup routes that need to be added to the IP routing
table. Only the backup routes that are filtered through the filtering policy are
added to the IP routing table. In this manner, users can flexibly manage the
addition of OSPF backup routes to the IP routing table.
Application Environment
OSPF IP FRR is classified into link protection and link-node dual protection.
Distance_opt(X,Y) indicates the shortest path between node X and node Y.
Link protection: indicates that the object to be protected is the traffic passing
through an OSPF IP FRR-enabled link. The link cost must satisfy the inequality
Distance_opt(N, D) < Distance_opt(N, S) + Distance_opt(S, D). S indicates the
source node of traffic; N indicates the node on the backup link; D indicates the
destination node of traffic.
As shown in Figure 5-15, traffic is transmitted from RouterS to RouterD. The link
cost satisfies the link protection inequality. When the primary link fails, RouterS
switches the traffic to the backup link RouterS -> RouterN so that the traffic can
be further transmitted along downstream paths. This ensures that traffic
interruption is less than 50 ms.
t=
t=s
s
co
1
0
RouterN
Link-node dual protection: Figure 5-16 shows link-node dual protection of OSPF IP
FRR. Node protection takes precedence over link protection.
Link-node dual protection must satisfy the following situations:
The link cost must satisfy the inequality Distance_opt(N, D) < Distance_opt(N, S)
+ Distance_opt(S, D).
The interface cost of the router must satisfy the inequality Distance_opt(N, D) <
Distance_opt(N, E) + Distance_opt(E, D).
S indicates the source node of traffic; E indicates the faulty node; N indicates the
node on the backup link; D indicates the destination node of traffic.
RouterE
RouterS RouterD
co
st= 5
10 ost=
c
RouterN
Definition
When a new device is deployed in the network or a device is restarted, network
traffic may be lost during BGP convergence. This is because IGP convergence is
faster than BGP convergence.
This problem can be solved through the synchronization between OSPF and BGP.
Purpose
If a backup link exists, during traffic switchback, BGP traffic is lost because BGP
route convergence is slower than OSPF route convergence.
As shown in Figure 5-17, RouterA, RouterB, RouterC, and RouterD run OSPF and
establish IBGP connections. RouterC functions as the backup of RouterB. When the
network is stable, BGP and OSPF routes converge completely on the device.
Normally, traffic from RouterA to 10.3.1.0/30 passes through RouterB. When
RouterB becomes faulty, traffic is switched to RouterC. After RouterB recovers,
traffic is switched back to RouterB. During this process, packet loss occurs.
This is because when traffic is switched back to RouterB, IGP route convergence is
faster than BGP route convergence. Consequently, convergence of OSPF routes is
already complete when BGP route convergence is still going on. As a result,
RouterB does not know the route to 10.3.1.0/30.
Therefore, when packets from RouterA to 10.3.1.0/30 arrive at RouterB, they are
discarded because RouterB does not have the route to 10.3.1.0/30.
Principle
The device enabled with OSPF-BGP synchronization remains as a stub router
within the set synchronization period. That is, the link metric in the LSA advertised
by the device is the maximum value 65535. Therefore, the device instructs other
OSPF devices not to use it for data forwarding.
As shown in Figure 5-17, OSPF-BGP synchronization is enabled on RouterB. In this
situation, before BGP route convergence is complete, RouterA continues to use the
backup link RouterC rather than forward traffic to RouterB until BGP route
convergence on RouterB is complete.
Local MT
After IGP Shortcut is configured on a TE tunnel, the outbound interface of the
route calculated by an IGP may not be the actual physical interface but a TE
tunnel interface.
According to the unicast route to the multicast source address, a router sends a
Join message through a TE tunnel interface. In this situation, routers spanned by
the TE tunnel cannot detect the Join message, so they do not create any multicast
forwarding entry.
As shown in Figure 5-18, RouterB spanned by the TE tunnel does not create any
multicast forwarding entry.
Client Server
Join Packets
Multicast Packets
RouterB
GE1/1/0 GE2/1/0 GE2/2/0 GE3/1/0
RouterA RouterC
Tunnel1/0/0
5.2.15 OSPF GR
Routers generally operate with separation of the control plane and forwarding
plane. When the network topology remains stable, a restart of the control plane
does not affect the forwarding plane, and the forwarding plane can still forward
data properly. This separation ensures non-stop service forwarding.
In graceful restart (GR) mode, the forwarding plane continues to direct data
forwarding after a restart occurs. The actions on the control plane, such as re-
establishment of neighbor relationships and route calculation, do not affect the
forwarding plane. Network reliability is improved because service interruption
caused by route flapping is prevented.
Classification of OSPF GR
● Totally GR: indicates that when a neighbor of a router does not support GR,
the router exits from GR.
● Partly GR: indicates that when a neighbor does not support GR, only the
interface associated with this neighbor exits from GR, whereas the other
interfaces perform GR normally.
● Planned GR: indicates that a router restarts or performs the master/slave
switchover using a command. The Restarter sends a Grace-LSA before restart
or master/slave switchover.
● Unplanned GR: indicates that a router restarts or performs the master/slave
switchover because of faults. A router performs the master/slave switchover,
without sending a Grace-LSA, and then enters GR after the slave board goes
Up. The process of unplanned GR is the same as that of planned GR.
GR Process
● A router starts GR.
In planned GR mode, after master/slave switchover is triggered through a
command, the Restarter sends a Grace-LSA to all neighbors to notify them of
the start, period, and cause of GR, and then performs the master/slave
switchover.
In unplanned GR, the Restarter does not send the Grace-LSA.
In unplanned GR mode, the Restarter sends a Grace-LSA immediately after
the slave board goes Up, informing neighbors of the start, period, and cause
of GR. The Restarter then sends a Grace-LSA to each neighbor five times
consecutively. This ensures that neighbors receive the Grace-LSA. This
operation is proposed by manufacturers but not defined by the OSPF protocol.
The Restarter sends a Grace-LSA to notify neighbors that it enters GR. During
GR, neighbors keep neighbor relationships with the Restarter so that other
routers cannot detect the switchover of the Restarter.
● The GR process runs, as shown in Figure 5-19.
RouterA RouterB
Restarter Helper
Before the active/ Grace-LSA
Enter Helper
standby switchover
Switchover Return LSAck
LSAck
Finish switchover packet for the
received LSA
Grace-LSA Updates the GR
Enter GR period for the
Grace-LSAs received
Grace-LSAs
Send Hello packets, negotiate,
exchange
Full DD packets, and synchronize LSDB
Exit GR successfully, Exit the Helper
Flush Grace-LSA successfully and
calculate routes,
and generate LSA generate Router-
LSA
Purpose
As shown in Figure 5-20, the primary link adopts the path
PE1→P1→P2→P3→PE2, and the backup link adopts the path
PE1→P1→P4→P3→PE2.
When the primary link is faulty, traffic is switched to the backup link. After the
primary link recovers, traffic is switched back to the primary link. During this
process, traffic is interrupted for a long period of time.
PE1 P1 P3 PE2
Primary link
Backup link
P4
Principle
The principle of LDP-IGP synchronization is to delay route switchback by
suppressing the establishment of IGP neighbor relationships until LDP convergence
is complete. That is, before an LSP on the primary link is established, the backup
link continues to forward traffic. Then the link is deleted after the LSP is
established.
Synchronization of LDP and IGP involves three timers:
● Hold-down
● Hold-max-cost
● Delay
After the primary link recovers, a router responds as follows:
1. Starts the hold-down timer. The IGP interface does not establish IGP
neighbors but waits for establishment of an LDP session. The Hold-down
timer specifies the period that the IGP interface waits.
2. Starts the hold-max-cost timer after the hold-down timer expires. The hold-
max-cost timer specifies the interval for advertising the maximum link metric
of the interface in the Link State Advertisement (LSA) to the primary link.
3. Starts the Delay timer to allow time for establishment of an LSP after an LDP
session is re-established for the faulty link.
4. After the Delay timer expires, LDP notifies IGP that synchronization is
complete regardless of the status of IGP.
Definition
OSPF requires that routers in the same area have the same Link-State Database
(LSDB).
With the continuous increase in routes on the network, some routers fail to carry
the additional routing information because of limited system resources. This
situation is called OSPF database overflow.
Purpose
You can configure stub areas or NSSAs to solve the problem of the continuous
increase in routing information that causes the exhaustion of system resources of
routers. However, configuring stub areas or NSSAs cannot solve the problem when
the unexpected increase in dynamic routes causes database overflow. Setting the
maximum number of external LSAs in the LSDB can dynamically limit the LSDB
capacity, to avoid the problems caused by database overflow.
Principle
To prevent database overflow, you can set the maximum number of non-default
external routes on a router.
All routers on the OSPF network must be set with the same upper limit. If the
number of external routes on a router reaches the upper limit, the router enters
the Overflow state and starts an overflow timer. The router automatically exits
from the overflow state after the timer expires. By default, it is 5 seconds.
Entering overflow state A router deletes all non-default external routes that
are generated.
Definition
In the scenario where there are multiple concurrent links, you can deploy OSPF
mesh-group to classify links into a mesh group. Then, OSPF floods LSAs to only a
link selected from the mesh group. Using OSPF mesh-group prevents unnecessary
burden on the system caused by repetitive flooding.
The mesh-group feature is disabled by default.
Purpose
After receiving or generating an LSA, an OSPF process floods the LSA. When there
are multiple concurrent links, OSPF floods the LSA to each link and sends Update
messages.
In this scenario, if there are 2000 concurrent links, OSPF floods each LSA 2000
times. Only one flooding, however, is valid. The other 1999 times are useless
repetition.
To prevent burden on the system caused by repetitive flooding, you can enable
mesh-group to classify multiple concurrent links between a router and its
neighbor into a group and then select a primary link to use for flooding.
Principles
As shown in Figure 5-21, RouterA and RouterB, which are connected through
three links, establish an OSPF neighbor relationship. After receiving a new LSA
from interface 4, RouterA floods the LSA to RouterB through interfaces 1, 2, and 3.
This flooding causes a heavy load on the concurrent links. For the neighbor with
concurrent links, only a primary link is selected to flood the LSA.
1 LSA
LSA 4 2 LSA
When multiple concurrent links exist between a device enabled with OSPF mesh-
group and its neighbor, the device selects to flood the received LSAs, as shown in
Figure 5-22.
1 LSA
LSA 4 2 LSA
3 LSA
RouterA RouterB
As defined in OSPF, LSAs can be flooded to a link only when the neighbor status is
not lower than Exchange. In this case, when the status of the interface on the
primary link is lower than Exchange, OSPF reselects a primary link from the
concurrent links and then floods the LSA. After receiving the LSA flooded by
RouterA from link 1, RouterB no longer floods the LSA to RouterA through
interfaces 2 and 3.
In Figure 5-23, a mesh group of RouterA resides in Area 0, which contains the
links of interface 1 and interface 2. More than one neighbor of interface 3 resides
on the broadcast link. Therefore, interface 3 cannot be defined as part of the mesh
group.
4 2
RouterB
RouterA
3
Area0
NOTE
After a router is enabled with mesh-group, if the Router IDs of the router and its directly
connected neighbor are the same, LSDBs cannot be synchronized and routes cannot be
calculated correctly. In this case, you need to reconfigure the Router ID of the neighbor.
Background
If the status of an interface carrying OSPF services alternates between Up and
Down, OSPF neighbor relationship flapping occurs on the interface. During the
flapping, OSPF frequently sends Hello packets to reestablish the neighbor
relationship, synchronizes LSDBs, and recalculates routes. In this process, a large
number of packets are exchanged, adversely affecting neighbor relationship
stability, OSPF services, and other OSPF-dependent services, such as LDP and BGP.
OSPF neighbor relationship flapping suppression can address this problem by
delaying OSPF neighbor relationship reestablishment or preventing service traffic
from passing through flapping links.
Related Concepts
Flapping_event: reported when the status of a neighbor relationship on an
interface last changes from Full to a non-Full state. The flapping_event triggers
flapping detection.
Implementation
Flapping detection
OSPF interfaces start a flapping counter. If the interval between two
flapping_events is shorter than the detect-interval, a valid flapping_event is
recorded, and the flapping_count increases by 1. When the flapping_count exceeds
the threshold, the system determines that flapping occurs, and therefore triggers
flapping suppression, and sets the flapping_count to 0. If the interval between two
valid flapping_events is longer than the resume-interval before the flapping_count
reaches the threshold again, the system sets the flapping_count to 0 again.
Interfaces start the suppression timer when the status of a neighbor relationship
last changes to ExStart or Down.
The detect-interval, threshold, and resume-interval are configurable.
Flapping suppression
Flapping suppression works in either Hold-down or Hold-max-cost mode.
● Hold-down mode: In the case of frequent flooding and topology changes
during neighbor relationship establishment, interfaces prevent neighbor
relationships from being reestablished during the suppression period, which
minimizes LSDB synchronization attempts and packet exchanges.
● Hold-max-cost mode: If the traffic forwarding path changes frequently,
interfaces use 65535 as the cost of the flapping link during the suppression
period, which prevents traffic from passing through the flapping link.
Flapping suppression can also work first in Hold-down mode and then in Hold-
max-cost mode.
By default, the Hold-max-cost mode takes effect. The mode and suppression
period can be changed manually.
NOTE
When an interface enters the flapping suppression state, all neighbor relationships on the
interface enter the state accordingly.
Exiting from flapping suppression
Interfaces exit from flapping suppression in the following scenarios:
● The suppression timer expires.
● The corresponding OSPF process is reset.
● A command is run to exit from flapping suppression.
Typical Scenarios
Basic scenario
In Figure 5-24, the traffic forwarding path is Router A -> Router B -> Router C ->
Router E before a link failure occurs. After the link between Router B and Router C
fails, the forwarding path switches to Router A -> Router B -> Router D -> Router
Router C
cost=10 cost=10
Router D
NOTE
cost=65535
Router B Router C
Broadcast scenario
In Figure 5-26, four devices are deployed on the same broadcast network using
switches, and the devices are broadcast network neighbors. If Router C flaps due
to a link failure, and Router A and Router B were deployed at different time
(Router A was deployed earlier for example) or the flapping suppression
parameters on Router A and Router B are different, Router A first detects the
flapping and suppresses Router C. Consequently, the Hello packets sent by Router
A do not carry Router C's router ID. However, Router B has not detected the
flapping yet and still considers Router C a valid node. As a result, the DR
candidates identified by Router A are Router B and Router D, whereas the DR
candidates identified by Router B are Router A, Router C, and Router D. Different
DR candidates result in a different DR election result, which may lead to route
calculation errors. To prevent this problem in scenarios where an interface has
multiple neighbors, such as on a broadcast, P2MP, or NBMA network, all
neighbors on the interface are suppressed when the status of a neighbor
relationship last changes to ExStart or Down. Specifically, if Router C flaps, Router
A, Router B, and Router D on the broadcast network are all suppressed. After the
network stabilizes and the suppression timer expires, Router A, Router B, and
Router D are restored to normal status.
Router A Router B
Router C Router D
Multi-area scenario
In Figure 5-27, Router A, Router B, Router C, Router E, and Router F are
connected in area 1, and Router B, Router D, and Router E are connected in
NOTE
By default, the Hold-max-cost mode takes effect. The mode can be changed to Hold-down
manually.
cost=10 cost=10
Area 1
Router B Router E
Area Device B Device E
Area 0
0 cost=10 cost=10
cost=10 cost=10
Router D
Table 5-18 Principles for selecting the suppression modes that take effect in
different situations
LDP-IGP LDP-IGP LDP-IGP Exited from LDP-
Synchronization/ Synchronization Synchronization IGP
OSPF Neighbor Hold-down Mode Hold-max-cost Synchronization
Relationship Mode Suppression
Flapping
Suppression
Mode
For example, the link between PE1 and P1 frequently flaps in Figure 5-28, and
both LDP-IGP synchronization and OSPF neighbor relationship flapping
suppression are configured. In this case, the suppression mode is selected based on
the preceding principles. No matter which mode (Hold-down or Hold-max-cost) is
selected, the forwarding path is PE1 -> P4 -> P3 -> PE2.
Figure 5-28 Scenario with both LDP-IGP synchronization and OSPF neighbor
relationship flapping suppression configured
P1 P2
cost=10
cost=10 cost=10
P4 P3
5.3.1 OSPF GR
NOTE
In practical application, in order to realize that business forwarding is not affected by
motherboard failure, it is usually possible to configure OSPF GR in the hardware
environment of dual motherboard to make sense.
All the models support the GR Helper, and only AR3200 series support the GR Restarter.
In Figure 5-29, RouterA, RouterB, RouterC, and RouterD run OSPF for
interworking, and RouterA and RouterB are enabled with GR. When RouterA
restarts, RouterB helps RouterA perform GR, without notifying other neighbors of
RouterA. OSPF GR ensures non-interrupted network traffic.
es
B do ter RouterC
r ou
o ute tify R ter A
R no u
Set up neighbor t Ro s
no that tart
relationship C res
RouterA and negotiate RouterB
GR
● RouterA and RouterE are the neighbors of RouterC, and their valid TTL range
of packets is [255 - hops + 1, 255].
● The valid TTL ranges of the packets sent from RouterB, RouterD, and RouterF
to RouterC are respectively [254, 255], [253, 255], and [252, 255].
Area0
RouterA RouterB
POS1/0/0 POS1/0/0
192.168.0.1/24 192.168.0.2/24
POS2/0/0 POS2/0/0
192.168.1.1/24 192.168.2.1/24
POS1/0/0 POS1/0/0
192.168.1.2/24 192.168.2.2/24
RouterC RouterD
GE2/0/0 GE2/0/0
172.16.1.1/24 172.17.1.1/24
GE2/0/0 GE2/0/0
172.16.1.2/24 172.17.1.2/24
RouterE RouterF
Area1 PC Area2
Improving the Stability of an You can improve the 5.18 Improving the
OSPF Network stability of the OSPF Stability of an OSPF
network to reduce Network
route flapping on the
OSPF network and
enable the device to
work in a normal state
for a long time.
Licensing Requirements
OSPF is a basic feature of a router and is not under license control.
Feature Limitations
None
OSPF Disabled
Interval for sending Hello By default, the interval for sending Hello packets
packets is 10 seconds on P2P and broadcast interfaces;
the interval is 30 seconds on P2MP and NBMA
interfaces.
Dead interval for OSPF By default, the dead interval for OSPF neighbors
neighbors is 40 seconds on P2P and broadcast interfaces;
the interval is 120 seconds on P2MP and NBMA
interfaces.
Applicable Environment
When OSPF is configured on multiple routers in the same area, most
configuration data, such as the timer, filter, and aggregation, must be planned
The OSPF-relevant commands that are configured in the interface view take effect
regardless of whether OSPF is enabled. After OSPF is disabled, the OSPF-relevant
commands also exist on interfaces.
Pre-configuration Tasks
Before configuring basic OSPF functions, complete the following task:
Context
To run OSPF, the router needs to have a router ID. A router ID of the router is a
32-bit unsigned integer, which uniquely identifies the router in an AS. To ensure
the stability of OSPF, you need to manually configure a router ID for each device
during network planning.
Procedure
Step 1 Run system-view
NOTE
The router ID of each OSPF process must be unique on the OSPF network; otherwise,
the OSPF neighbor relationship cannot be set up and routing information is incorrect.
Configuring a unique router ID for each OSPF process on each OSPF device is
recommended to ensure stability.
● The parameter vpn-instance vpn-instance-name specifies the name of a VPN
instance.
If a VPN instance is specified, the OSPF process belongs to the specified VPN
instance. Otherwise, the OSPF process belongs to the public network
instances.
----End
Context
More and more devices are deployed with the increasing expansion of the network
scale. As a result, each device has to maintain a large LSDB, which becomes a
heavy burden. OSPF solves this problem by dividing an AS into areas. An area is
regarded as a logical device group. Each group is identified by an area ID. The
borders of an area are devices, rather than links. A network segment (or a link)
belongs to only one area; that is, each OSPF interface must belong to an area.
Procedure
Step 1 Run system-view
The system view is displayed.
Context
After creating an OSPF process, you need to configure the network segments
included in an area. A network segment belongs to only one area. That is, you
need to specify an area for each interface that runs OSPF. In this document,
network segment refers to the network segment to which the IP address of the
OSPF interface belongs.
OSPF checks the network mask carried in a received Hello packets. If the network
mask carried in a received Hello packet is different from the network mask of the
local device, the Hello packet is discarded. As a result, an OSPF neighbor
relationship is not established.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run area area-idnetwork ip-address wildcard-maskinterface interface-type
interface-numberospf enable [ process-id ] area area-id
The OSPF area view is displayed.
OSPF can be enabled in an OSPF area or on a specific interface.
● Enable OSPF in an OSPF area.
1. Run
Network segments belonging to an area are configured.
OSPF can properly run on an interface only when the following conditions are
met:
– The IP address mask length of the interface is equal to or greater than
the mask length specified in the network command.
– The primary IP address of the interface must be within the network
segment specified by the network command.
By default, OSPF advertises the IP address of the loopback interface as a 32-
bit host route, which is irrelevant to the mask length configured on the
loopback interface. To advertise routes to the network segment of the
loopback interface, configure the network type as NBMA or broadcast in the
interface view. For details, see Configuring Network Types of OSPF
Interfaces.
● Enable OSPF on an interface.
1. Run the following command in the system view:interface interface-type
interface-number
The interface view is displayed.
2. Run ospf enable [ process-id ] area area-id
OSPF is enabled on the interface.
An area ID can be input in the format of a decimal integer or an IPv4 address,
but displayed in the format of IPv4 address.
----End
Context
After OSPF areas are defined, OSPF route updates between non-backbone areas
are transmitted through a backbone area. Therefore, OSPF requires that all non-
backbone areas maintain connectivity with the backbone area and that the
backbone areas in different OSPF areas maintain connectivity with each other. In
real world situations, this requirement may not be met because of certain
restrictions. To resolve this problem, you can configure OSPF virtual links.
Procedure
Step 1 Run system-view
NOTICE
If plain is selected, the password is saved in the configuration file in plain text.
This brings security risks. It is recommended that you select cipher to save the
password in cipher text.
MD5 authentication and HMAC-MD5 authentication have potential security risks.
HMAC-SHA256 authentication mode is recommended.
----End
Follow-up Procedure
After virtual links are created, different default MTUs may be used on devices
provided by different vendors. To ensure consistency, the MTU is set to 0 by
default when the interface sends DD packets. For details, see Configuring an
Interface to Fill in the DD Packet with the Actual MTU.
Context
When multiple neighboring routers are configured or a large number of LSA
update packets are flooded, the neighboring router may receive a large number of
LSA update packets in a short period. This keeps the neighboring router busy
processing a burst of LSA update packets and causes the neighboring router to
discard Hello packets that are used to maintain the OSPF neighbor relationships.
As a result, the neighbor relationships are interrupted. After the neighbor
relationships are reestablished, more packets will be exchanged. This increases the
frequency of neighbor relationship interruption. To resolve this problem, you can
restrict the flooding of LSA update packets to maintain neighbor relationships.
Perform the following steps on the router running OSPF.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run flooding-control [ number transmit-number | timer-interval transmit-
interval ] *
The flooding of LSA update packets is restricted.
By default, the number of LSA update packets to be flooded each time is 50, and
the interval at which LSA update packets are flooded is 30s.
After the flooding-control command is run, the flooding of LSA update packets is
immediately restricted.
If the flooding-control command is not run, the function of restricting the
flooding of LSA update packets automatically takes effect when the number of
neighboring routers exceeds 256.
----End
Prerequisites
All configurations of basic OSPF functions are complete.
Procedure
● Run the display ospf [ process-id ] peer command in any view to check
information about OSPF neighbors.
● Run the display ospf [ process-id ] interface command in any view to check
information about OSPF interfaces.
● Run the display ospf [ process-id ] routing command in any view to check
information about the OSPF routing table.
● Run the display ospf [ process-id ] lsdb command to check information in
the OSPF LSDB.
----End
Pre-configuration Tasks
Before configuring session parameters for OSPF neighbor or adjacency
relationships, complete the following tasks:
Configuration Procedure
Perform one or more of the following configuration tasks (excluding the task of
Verifying the OSPF Session Parameter Configuration) as required.
Context
After an OSPF router sends one of the following packets, if it does not receive the
LSAck packet within a specified time, it retransmits the packet. After the number
of packet retransmissions reaches the set limit, the OSPF router tears down the
adjacency relationship with its neighbor.
● DD packets
● LSU packets
● LSR packets
Procedure
Step 1 Run system-view
----End
Context
After virtual links are created, different default MTUs may be used on devices
provided by different vendors. To ensure consistency, the MTU is set to 0 by
default when the interface sends DD packets.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The OSPF interface view is displayed.
Step 3 Run ospf mtu-enable
The interface is configured to fill in DD packets with the actual MTU and check
whether the MTU in DD packets from the neighbor exceeds the MTU of the local
end.
By default, the MTU in DD packets sent by an interface is 0.
NOTICE
Setting the MTU in a DD packet will lead to the re-establishment of the neighbor
relationship.
----End
Prerequisites
All configurations of session parameters of the OSPF neighbor or adjacency
relationship are complete.
Procedure
● Run the display ospf [ process-id ] peer command to check information
about OSPF neighbors.
● Run the display ospf [ process-id ] brief command to check brief information
about the specified OSPF process.
● Run the display ospf [ process-id ] retrans-queue [ interface-type interface-
number ] [ neighbor-id ] [ low-level-of-retrans-times-range min-time ]
[ high-level-of-retrans-times-range max-time ] command to check the
OSPF retransmission list.
----End
Applicable Environment
In Table 5-21, OSPF classifies networks into four types based on the type of link
layer protocols.
NOTE
Differentiated OSPF configurations that are applicable only to NBMA networks and P2MP
networks are provided in this section. The OSPF configurations not provided here are
applicable to the four types of networks.
Pre-configuration Tasks
Before configuring OSPF attributes in different types of networks, complete the
following tasks:
Configuration Procedure
Configuring network types of OSPF interfaces is the prerequisite for configuring
P2MP or NBMA network attributes
The network types of the interfaces on both ends of a link must be the same;
otherwise, the OSPF neighbor relationship cannot be established.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The OSPF interface view is displayed.
Step 3 Run ospf network-type { broadcast | nbma | p2mp | p2p [ peer-ip-ignore ] }
The network type of the OSPF interface is configured.
By default, the network type of an interface depends on the physical interface.
The network type of an Ethernet interface is broadcast; the network type of a
serial or POS interface (encapsulated with PPP or HDLC) is P2P; the network type
of an ATM and FR interface is NBMA.
When the network type is configured for an interface, the original network type of
the interface is replaced.
The network type can be configured to suit networking requirements.
● If the network type of an interface is broadcast and a router does not support
multicast addresses, change the network type of the interface to NBMA.
● If the network type of an interface is NBMA and the network is fully meshed
or any two routers are directly connected, change the network type of the
interface to broadcast and do not configure neighboring router information
on the interface.
● If the network type of an interface is NBMA and the network is not fully
meshed, change the network type of the interface to P2MP. After that, two
indirectly connected routers can communicate through one router that can
directly reach both the two routers. After the network type of the interface is
changed to P2MP, configuring neighboring router information on the interface
is unnecessary.
● If only two routers run OSPF on the same network segment, changing the
network type of the interface to P2P is recommended.
NOTE
OSPF cannot be configured on a null interface.
----End
Procedure
Step 1 Disable OSPF from checking the network mask.
1. Run system-view
The system view is displayed.
2. Run interface interface-type interface-number
The interface view is displayed.
----End
Procedure
Step 1 (Optional) Set the network type to NBMA.
An NBMA network must be fully meshed. Any two routers on the NBMA network
must be directly reachable. In most cases, however, this requirement cannot be
met. To resolve this problem, run specific commands to forcibly change the
network type to NBMA. For details, see Configuring Network Types for OSPF
Interfaces.
1. Run system-view
The system view is displayed.
2. Run interface interface-type interface-number
The interface view is displayed.
3. Run ospf network-type nbma
The network type of the OSPF interface is set to NBMA.
Step 2 (Optional) Set the interval at which Hello packets for polling are sent on the
NBMA network.
On the NBMA network, after the neighbor relationship becomes invalid, the router
sends Hello packets at an interval defined in the polling mechanism.
The interval at which Hello packets for polling are sent by an NBMA interface
is set.
If the network type of an interface is NBMA, the interface cannot broadcast Hello
packets to discover neighboring routers. Therefore, the IP address of a neighboring
router must be configured on the interface and whether the neighboring router
can participate in DR election must be determined on the interface.
1. Run quit
----End
Prerequisites
The configurations for OSPF attributes on the NBMA network and P2MP network
are complete.
Procedure
● Run either of the following commands to check LSDB information.
– display ospf [ process-id ] lsdb [ brief ]
– display ospf [ process-id ] lsdb [ { router | network | summary | asbr |
ase | nssa | opaque-link | opaque-area | opaque-as } [ link-state-id ] ]
[ originate-router [ advertising-router-id ] | self-originate ] [ age { min-
value min-age-value | max-value max-age-value } * ]
● Run the display ospf [ process-id ] peer [ [ interface-type interface-number ]
neighbor-id | brief | last-nbr-down ] command to view neighbor information.
● Run the display ospf [ process-id ] nexthop command to check next hop
information.
● Run either of the following commands to check routing table information.
– display ospf [ process-id ] routing [ ip-address [ mask | mask-length ] ]
[ interface interface-type interface-number ] [ nexthop nexthop-
address ]
– display ospf [ process-id ] routing router-id [ router-id ]
Applicable Environment
The number of LSAs can be reduced by partitioning an AS into different areas. To
reduce the number of entries in the routing table and the number of LSAs to be
transmitted in a non-backbone area, configure the non-backbone area on the
border of the AS as a stub area.
Configuring a stub area is optional.
Note the following points when configuring a stub area:
● The backbone area (Area 0) cannot be configured as a stub area.
● If an area needs to be configured as a stub area, all the routers in this area
must be configured with stub attributes using the stub command.
● An ASBR cannot exist in a stub area. External routes are not transmitted in
the stub area.
● Virtual links cannot exist in the stub area.
Pre-configuration Tasks
Before configuring OSPF stub areas, complete the following tasks:
● Configuring IP addresses for interfaces to ensure that neighboring nodes are
reachable at the network layer
● 5.7 Configuring Basic OSPF Functions
Configuration Procedure
Mandatory
procedure
Optional
procedure
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run area area-id
The OSPF area view is displayed.
● Stub attributes must be configured on all routers in a stub area using the stub
command.
● Configuring or deleting stub attributes will update routing information in the area. Stub
attributes can be deleted or reconfigured only after the routing update is complete.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run area area-id
The OSPF area view is displayed.
● The parameter no-summary is used to forbid the ABR to send Type 3 LSAs to
the stub area.
● The parameter default-route-advertise is used to enable the ABR to
generate default Type 3 LSAs and advertise them to the stub area.
● The parameter backbone-peer-ignore is used to prevent the ABR from
checking the neighbor status when the ABR generates default Type 3 LSAs
and advertises them to the stub area. Specifically, the ABR generates default
Type 3 LSAs and advertises them to the stub area as long as an interface that
is Up exist in the backbone area.
NOTE
● Stub attributes must be configured on all routers in a stub area using the stub
command.
● Configuring or deleting stub attributes will update routing information in the area. Stub
attributes can be deleted or reconfigured only after the routing update is complete.
NOTE
● Stub attributes must be configured on all routers in a stub area using the stub
command.
● Configuring or deleting stub attributes will update routing information in the area. Stub
attributes can be deleted or reconfigured only after the routing update is complete.
----End
Procedure
Run either of the following commands to check LSDB information.
● display ospf [ process-id ] lsdb [ brief ]
● display ospf [ process-id ] lsdb [ { router | network | summary | asbr | ase |
nssa | opaque-link | opaque-area | opaque-as } [ link-state-id ] ]
[ originate-router [ advertising-router-id ] | self-originate ] [ age { min-
value min-age-value | max-value max-age-value } * ]
Run either of the following commands to check routing table information.
Applicable Environment
To both import external routes and prevent resource consumption caused by
external routes, you can configure an NSSA.
The NSSA is a special type of OSPF area. Neither an NSSA nor a stub area
transmits routes learned from other areas in the AS where it resides. A stub area
does not allow AS external routes to be imported, whereas an NSSA allows AS
external routes to be imported and advertised in the entire AS.
Type 7 LSAs are used to carry imported AS external routing information in the
NSSA. Type 7 LSAs are generated by the ASBRs of NSSAs and flooded only in the
NSSAs where ASBRs reside. The ABR in an NSSA selectively translates received
Type 7 LSAs into Type 5 LSAs to advertise AS external routing information to the
other areas over the OSPF network.
Pre-configuration Tasks
Before configuring an NSSA, complete the following tasks:
● Configuring IP addresses for interfaces to ensure that neighboring routers are
reachable at the network layer
● 5.7 Configuring Basic OSPF Functions
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run area area-id
The OSPF area view is displayed.
Step 4 Run nssa [ { default-route-advertise [ backbone-peer-ignore ] | suppress-
default-route } | flush-waiting-timer interval-value | no-import-route | no-
summary | set-n-bit | suppress-forwarding-address | translator-always |
translator-interval interval-value | zero-address-forwarding | translator-strict ]*
NOTE
● NSSA attributes must be configured on all devices in the NSSA using the nssa
command.
● Configuring or deleting NSSA attributes may update the routing information in the area
and disconnect neighbor relationships. NSSA attributes can be reconfigured or deleted
only after the routing update is complete.
– When the LS age field value (aging time) in the header of an LSA reaches 3600s,
the LSA is deleted.
– If an ASBR also functions as an ABR, flush-waiting-timer does not take effect.
This prevents Type 5 LSAs in the non-NSSAs from being deleted.
● If an ASBR also functions as an ABR, the no-import-route parameter can be
configured to prevent external routes imported using the import-route
command from being advertised to the NSSA.
● The no-summary parameter is configured on an ABR to reduce the number
of LSAs that are transmitted to the NSSA. This implementation prevents the
ABR from transmitting Type 3 LSAs to the NSSA.
NOTE
After the nssa default-route-advertise backbone-peer-ignore no-summary
command is run, the ABR generates default Type 7 and Type 3 LSAs as long as an
interface that is Up exist in the backbone area. The default Type 3 LSAs preferentially
take effect.
● After the set-n-bit parameter is configured, the N-bit is set in the database
description (DD) packets during the synchronization between the router and
neighboring routers.
● If multiple ABRs are deployed in the NSSA, the system automatically selects
an ABR (generally the router with the largest router ID) as a translator to
convert Type 7 LSAs into Type 5 LSAs. You can configure the translator-
always parameter on an ABR to specify the ABR as an all-the-time translator.
To specify two ABRs for load balancing, configure the translator-always
parameter on the chosen ABRs to specify the ABRs as all-the-time translators.
You can use this command to pre-configure a fixed translator to prevent LSA
flooding caused by translator role changes.
● The translator-interval parameter is used to ensure uninterrupted services
when translator roles change. The value of interval-value must be greater
than the flooding period.
The cost of the default route on which Type 3 LSAs are transmitted to the NSSA by
the ABR is set.
To ensure the reachability of AS external routes, the ABR in the NSSA generates a
default route and advertises this route to the other routers in the NSSA. The cost
of the default route to an NSSA is set and the selection of the default route is
adjusted.
Type 7 LSAs can be used to carry default route information to guide traffic to
other ASs.
Multiple ABRs may be deployed in an NSSA. To prevent routing loops, ABRs do not
calculate the default routes advertised by each other.
By default, the cost of the default route to the NSSA by the ABR is 1.
----End
Applicable Environment
On complex networks, you can adjust OSPF parameters to flexibly optimize load
balancing requirements.
Pre-configuration Tasks
Before adjusting OSPF route selection, complete the following tasks:
● Configuring IP addresses for interfaces to ensure that neighboring nodes are
reachable at the network layer
● 5.7 Configuring Basic OSPF Functions
Configuration Procedure
Perform one or more configuration tasks (excluding the task of Verifying the OSPF
Route Selection Adjustment Configuration) as required.
Context
OSPF can automatically calculate the link cost for an interface according to the
interface bandwidth. You can also set the link cost for the interface using
commands.
If you do not set the cost of an OSPF interface using the ospf cost cost command,
OSPF automatically calculates the cost of the interface according to the interface
bandwidth. The calculation formula is as follows: Cost of the interface =
Bandwidth reference value/Interface bandwidth. The integer of the calculated
result is the cost of the interface. If the calculated result is smaller than 1, the cost
value is 1. Changing the bandwidth reference value can change the cost of an
interface.
Procedure
● Setting the link cost for an OSPF interface
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The OSPF interface view is displayed.
c. Run ospf cost cost
The cost of the OSPF interface is set.
● Setting the bandwidth reference value
a. Run system-view
The system view is displayed.
b. Run ospf [ process-id ]
The OSPF process view is displayed.
NOTE
Ensure that the bandwidth reference values of routers in an OSPF process are the
same.
----End
Context
If the destinations and costs of the multiple routes discovered by one routing
protocol are the same, load balancing can be implemented among the routes.
As shown in Figure 5-32, three routes between RouterA and RouterB that run
OSPF have the same costs. The three routes are equal-cost routes for load
balancing.
IP
Network
co
5 st=
st= 10
co
cost=10 IP cost=5
Network
RouterA
RouterB
co
st =8 =7
st
IP co
Network
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run maximum load-balancing number
The maximum number of equal-cost routes is set.
NOTE
----End
Context
RFC 2328 and RFC 1583 define the route selection rule differently. After OSPF is
enabled on the router, specify a route selection rule based on the router
configuration. The router complies with the route selection rule defined in RFC
1583 by default. If the neighboring router complies with the route selection rule
defined in RFC 2328, configure the local router to comply with that defined in RFC
2328. This allows all routers in the OSPF area to comply with the same route
selection rule.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
The router is configured to comply with the route selection rule defined in RFC
2328, not RFC 1583.
By default, the router complies with route selection rule defined in RFC 1583.
----End
Prerequisites
All configurations of adjusting OSPF route selection are complete.
Procedure
● Run the display ospf [ process-id ] interface command to check information
about OSPF interfaces.
● Run the display ospf [ process-id ] routing command to check information
about the OSPF routing table.
----End
Pre-configuration Tasks
Before controlling OSPF routing information, complete the following tasks:
Configuration Procedure
Perform one or more configuration tasks (excluding the task of Verifying the OSPF
Routing Information Control Configuration) as required.
Context
To access a router running a non-OSPF protocol, an OSPF-capable router needs to
import routes of the non-OSPF protocol into the OSPF network.
OSPF can ensure loop-free intra-area and inter-area routes; however, OSPF cannot
protect external routes against loops. Therefore, when configuring OSPF to import
external routes, avoid the loops caused by manual configurations.
Procedure
● Configuring OSPF to import the routes discovered by other protocols
a. Run system-view
The default values of parameters (the metric of routes, tag, and type) are
set for importing routes.
The default values of parameters (the cost, number of routes, tag, and
type) are set for imported routes.
When OSPF imports external routes, you can set default values for some
additional parameters, such as the cost, number of routes to be imported,
route tag, and route type. The route tag is used to identify the protocol-
related information. For example, it can be used to differentiate AS
numbers carried in BGP routes imported by OSPF.
By default, the cost of the external routes imported by OSPF is 1; the type
of the imported external routes is Type 2; the default tag value of the
imported routes is 1.
NOTE
You can run one of the following commands to set the cost of the imported
route. The following commands are listed in descending order of priority.
● Run the apply cost command to set the cost of a route.
● Run the import-route command to set the cost of the imported route.
● Run the default command to set the default cost of the imported route.
----End
Context
Multiple routers often reside on the area border and AS border of an OSPF
network for next-hop backup or traffic load balancing. A default route can be
configured to reduce routing entries and improve resource usage on the OSPF
network.
The default route is generally applied to the following scenarios:
1. An ABR in an area advertises Type 3 LSAs carrying the default route within
the area. routers in the area use the received default route to forward inter-
area packets.
2. An ASBR in an AS advertises Type 5 or Type 7 LSAs carrying the default route
within the AS. routers in the AS use the received default route to forward AS
external packets.
When no exactly matched route is discovered, the router can forward packets
through the default route.
The preference of the default route in Type 3 LSAs is higher than that of the route
in Type 5 or Type 7 LSAs.
The advertising mode of the default route is determined by the type of the area to
which the default route is imported, as shown in Table 5-22.
Procedure
● Configuring OSPF to advertise the default route to the OSPF area
a. Run system-view
● An ASE LSA that describes the default route is generated and then advertised
only when there are active default routes of other OSPF processes in the
routing table of the local device.
● Before advertising a default route, OSPF compares the preferences of default
routes. Therefore, if a static default route is configured on an OSPF router, to
add the default route advertised by OSPF to the current routing table, ensure
that the preference of the configured static default route is lower than that of
the default route advertised by OSPF.
----End
Context
Route summarization on a large-scale OSPF network efficiently reduces routing
entries. This function minimizes consumption of system resources while
maintaining system performance. In addition, if a specific link frequently
alternates between Up and Down states, the links uninvolved in the route
summarization will not be affected. This prevents route flapping and improves
network stability.
When an ABR sends routing information to other areas, it originates Type 3 LSAs
for each network segment. If any contiguous segments exist in this area, run the
abr-summary command to summarize these segments into one. An ABR then
sends just one summarized LSA to other areas, and no LSAs that belong to the
summarized network segment specified by this command. Therefore, the routing
table size is reduced, and router performance is improved.
Carry out the following steps on the router running OSPF.
Procedure
● Configuring ABR route aggregation
a. Run system-view
The system view is displayed.
b. Run ospf [ process-id ]
The OSPF process view is displayed.
c. Run area area-id
The OSPF area view is displayed.
d. Run abr-summary ip-address mask [ [ cost { cost | inherit-minimum } |
[ advertise [ generate-null0-route ] | not-advertise | generate-null0-
route [ advertise ] ] ] * ]
ABR route aggregation is configured.
● Configuring ASBR route aggregation
a. Run system-view
The system view is displayed.
b. Run ospf [ process-id ]
The OSPF process view is displayed.
c. (Optional) Run asbr-summary type nssa-trans-type-reference [ cost
nssa-trans-cost-reference ]
OSPF is configured to refer to Type 5 LSAs that have been translated
from Type 7 LSAs when it sets types and costs for summary routes on
ASBRs.
By default, when OSPF sets types and costs for summary routes on
ASBRs, OSPF does not refer to Type 5 LSAs that have been translated
from Type 7 LSAs.
d. Run asbr-summary ip-address mask [ not-advertise | tag tag | cost cost
| distribute-delay interval ] *
ASBR route aggregation is configured.
NOTE
After route summarization is configured, the routing table on the local OSPF
router remains unchanged. The routing table on another OSPF router, however,
contains just one summarized route, and no specific routes. This summarized
route will not be removed unless all specific routes are interrupted.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run filter-policy { acl-number | acl-name acl-name | ip-prefix ip-prefix-name |
route-policy route-policy-name [ secondary ] } import
OSPF is configured to filter the received routes.
● The parameter acl-number specifies the number of a basic ACL.
● The parameter acl-name acl-name specifies the name of an ACL.
● The parameter ip-prefix ip-prefix-name specifies the name of an IP prefix list.
OSPF is a link-state dynamic routing protocol, with routing information carried in
the LSA. Therefore, the filter-policy import command cannot be used to filter the
advertised or received LSAs.
The filter-policy import command is used to filter the routes calculated by OSPF.
Only the routes that pass the filtering criteria are added to the routing table.
Routes that do not pass the filtering criteria cannot be added to the OSPF routing
table but can be advertised.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run filter-policy { acl-number | acl-name acl-name | ip-prefix ip-prefix-name |
route-policy route-policy-name } export [ protocol [ process-id ] ]
OSPF is configured to filter the routes imported through the import-route
command. Only the routes that pass the filtering criteria are advertised.
● The parameter acl-number specifies the number of a basic ACL.
● The parameter acl-name acl-name specifies the name of an ACL.
● The parameter ip-prefix ip-prefix-name specifies the name of an IP prefix list.
● The parameter route-policy route-policy-name specifies the name of the
route policy.
You can specify the parameter protocol [ process-id ] to filter the routes of a
certain routing protocol or a certain OSPF process. If protocol [ process-id ] is not
specified, OSPF filters all the imported routes.
NOTE
----End
Context
When multiple links exist between two routers, you can configure the local router
to filter the LSAs to be sent. This prevents transmission of unnecessary LSAs and
saves bandwidth resources.
Perform the following steps on the router running OSPF.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run ospf filter-lsa-out { all | { summary [ acl { acl-number | acl-name } ] | ase
[ acl { acl-number | acl-name } ] | nssa [ acl { acl-number | acl-name } ] } * }
The LSAs to be sent are filtered.
By default, the LSAs to be sent are not filtered.
----End
Context
After filtering conditions are set for the incoming or outgoing Type 3 LSAs
(Summary LSAs) in an area, only the Type 3 LSAs that meet the filtering
conditions can be received or advertised.
This function is applicable only to the ABR.
Procedure
Step 1 Run system-view
The system view is displayed.
----End
Context
When concurrent links exist between two routers, you can enable the mesh-group
function to reduce the load on the links.
The neighboring router ID identifies each mesh group. Several concurrent links are
added to a mesh group. Flooding is implemented once in the group. You can add
interfaces that meet the following conditions to the same mesh group.
● The interfaces belong to the same area and OSPF process.
● The interfaces begin to exchange DD packets.
● The interfaces are connected to the same neighboring router.
Perform the following steps on the router running OSPF.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run mesh-group enable
The mesh-group function is enabled.
By default, the mesh-group function is disabled.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run lsdb-overflow-limit number
The maximum number of external LSAs in the LSDB is set.
----End
Prerequisites
The configurations of controlling OSPF routing information are complete.
Procedure
● Run either of the following commands to check routing table information.
– display ospf [ process-id ] routing [ ip-address [ mask | mask-length ] ]
[ interface interface-type interface-number ] [ nexthop nexthop-
address ]
– display ospf [ process-id ] routing router-id [ router-id ]
● Run the display ospf [ process-id ] interface [ all | interface-type interface-
number ] [ verbose ] command to check OSPF interface information.
● Run the display ospf [ process-id ] asbr-summary [ ip-address mask ]
command to check OSPF ASBR summarization information.
----End
Context
With the development of networks, Voice over IP (VoIP) and on-line video services
require high-quality real-time transmission. Nevertheless, if an OSPF fault occurs,
traffic can be switched to a new link only after the following processes: fault
detection at the millisecond level, notifying the fault to the routing control plane
at the millisecond level, generating and flooding new topology information at the
tens of milliseconds level, triggering SPF calculation at the tens of milliseconds
level, and notifying and installing a new route at the hundreds-of-milliseconds
level. As a result, it takes much more than 50 ms to recovery the link from the
fault, which cannot meet the requirement for real-time services on the network.
OSPF IP FRR can work with BFD to implement protection switchover within 50 ms.
With OSPF IP FRR that calculates a backup link in advance, devices can fast switch
traffic to the backup link without interrupting traffic when the primary link
becomes faulty. This protects traffic and thus greatly improves the reliability of
OSPF networks.
OSPF IP FRR is applicable to the services that are sensitive to packet delay and
packet loss.
NOTE
AR100&AR120&AR150&AR160&AR200 series do not support OSPF IP FRR.
Pre-configuration Tasks
Before configuring OSPF IP FRR, complete the following tasks:
Configuration Procedure
Mandatory
procedure
Optional
procedure
Context
Enabling OSPF IP FRR to generate a loop-free backup link. When this route
becomes faulty, OSPF can fast switch the traffic to a backup link.
FRR calculation consumes a large number of CPU resources. When there are
import features such as routing protocol, you need to delay FRR calculation.
After FRR calculation is delayed, devices process important services such as route
calculation first.
Procedure
Step 1 Run system-view
NOTE
OSPF can generate a loop-free backup link only when the OSPF IP FRR traffic protection
inequality is met.
The Loop-Free Alternates (LFA) algorithm is used to calculate the nexthop and
outbound interface for a backup link.
The nexthop and outbound interface of an OSPF loop-free backup link can be
obtained using either of the following methods:
● For a static backup link, after IP FRR is enabled using the ip frr command in
the system view or ip frr command in VPN instance view, configure a nexthop
and an outbound interface for the static backup link.
● For a dynamic backup link, after OSPF IP FRR is enabled using the loop-free-
alternate command, enable the device to use the LFA algorithm to calculate
the nexthop and outbound interface for the dynamic backup link.
By default, static backup links take preference over dynamic backup links during
route selection. However, static backup links are less flexible than dynamic backup
links. If a link failure occurs, static backup links cannot update automatically, but
dynamic backup links can. Therefore, to ensure automatic link updates, run the
frr-priority static low command to enable dynamic backup links to take
preference over static backup links so that the LFA algorithm is used to calculate
the nexthop and outbound interface.
After OSPF IP FRR filtering policies are configured, only the OSPF backup routes
that match the filtering conditions can be delivered to the forwarding table. To
protect the traffic over a specific OSPF route, you can configure a filtering policy
that matches the OSPF route to ensure that the route can be added to the
forwarding table. When this route becomes faulty, OSPF can fast switch the traffic
to a backup link.
----End
Context
During the configuration of OSPF IP FRR, the lower layer needs to fast respond to
the link change so that traffic can be rapidly switched to the backup link in the
case of a link failure. Bind BFD to the link status so that link faults can be
detected rapidly. This ensures that traffic is rapidly switched to the backup link in
the case of link failures.
Procedure
● Bind IP FRR and BFD in an OSPF process.
a. Run system-view
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The view of an OSPF interface enabled with FRR is displayed.
Step 3 Run ospf frr block
FRR is blocked on the OSPF interface.
----End
Procedure
● Run the display ospf [ process-id ] routing command to check the
information about the primary link and backup link of a route after
configuring OSPF IP FRR.
----End
Applicable Environment
NOTE
BFD for routing protocols can only be configured on GRE tunnel interfaces.
OSPF enables the router to periodically send Hello packets to a neighboring router
for fault detection. Detecting a fault takes more than 1s. As technologies develop,
voice, video, and other VoD services are widely used. These services are quite
sensitive to packet loss and delays. When traffic is transmitted at gigabit rates,
long-time fault detection will cause packet loss. This prolonged detection period
cannot meet high reliability requirements of the carrier-class network.
BFD for OSPF is introduced to resolve this problem. After BFD for OSPF is
configured in a specified process or on a specified interface, the link status can be
rapidly detected and fault detection can be completed in milliseconds. This speeds
up OSPF convergence when the link status changes.
NOTE
If the change of bound peer IP address causes a route to switch to another link, the BFD
session is negotiated again only when the original link fails.
Pre-configuration Tasks
Before configuring BFD for OSPF, complete the following tasks:
● Configuring IP addresses for interfaces to ensure that neighboring nodes are
reachable at the network layer
● 5.7 Configuring Basic OSPF Functions
Configuration Procedure
Mandatory procedure
Optional procedure
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bfd
BFD is configured globally, and the global BFD view is displayed.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF view is displayed.
Step 3 Run bfd all-interfaces enable
BFD for OSPF is enabled to establish the BFD session.
If all the interfaces in a certain process are configured with BFD and their
neighbor relationships are in the Full state, OSPF establishes BFD sessions on all
the interfaces in the process.
Run the bfd all-interfaces { min-rx-interval receive-interval | min-tx-interval
transmit-interval | detect-multiplier multiplier-value | frr-binding } * command to
set parameters for BFD sessions.
● The parameter min-rx-interval receive-interval specifies the expected
minimum interval for receiving BFD packets from the neighbor.
● The parameter min-tx-interval transmit-interval specifies the minimum
interval for sending BFD packets to the neighbor.
● The parameter detect-multiplier multiplier-value specifies the local detection
multiplier.
● The parameter frr-binding indicates that the status of the BFD session is
bound to OSPF IP FRR.
NOTE
You can skip this step. The default interval at which BFD packets are transmitted
and the default detection multiplier are recommended.
The parameters are configured based on the network status and network
reliability requirements. A short interval at which BFD packets are transmitted can
be configured if high network reliability is required. A long interval at which BFD
packets are transmitted can be configured if high network reliability is not
required.
NOTE
● Actual interval at which BFD packets are transmitted on the local router = Max { configured
interval transmit-interval at which BFD packets are transmitted on the local router,
configured interval receive-interval at which BFD packets are received on the peer router }
● Actual interval at which BFD packets are received on the local router = Max { configured
interval transmit-interval at which BFD packets are transmitted on the peer router,
configured interval receive-interval at which BFD packets are received on the local router }
● Actual time for detecting BFD packets = Actual interval at which BFD packets are received on
the local router x Configured detection multiplier multiplier-value on the peer router
For example:
● On the local router, the configured interval at which BFD packets are transmitted is 200 ms;
the configured interval at which BFD packets are received is 300 ms; the detection multiplier
is 4.
● On the peer router, the configured interval at which BFD packets are transmitted is 100 ms;
the interval at which BFD packets are received is 600 ms; the detection multiplier is 5.
Then:
● On the local router, the actual interval at which BFD packets are transmitted is 600 ms
calculated by using the formula max {200 ms, 600 ms}; the interval at which BFD packets
are received is 300 ms calculated by using the formula max {100 ms, 300 ms}; the detection
period is 1500 ms calculated by multiplying 300 ms by 5.
● On the peer router, the actual interval at which BFD packets are transmitted is 300 ms
calculated by using the formula max {100 ms, 300 ms}, the actual interval at which BFD
packets are received is 600 ms calculated by using the formula max {200 ms, 600 ms}, and
the detection period is 2400 ms calculated by multiplying 600 ms by 4.
----End
Context
After the bfd all-interfaces enable command is run in an OSPF process, BFD
sessions can be established on all the OSPF interfaces whose neighbor
relationships are Full.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The view of the interface enabled with BFD for OSPF is displayed.
Step 3 Run ospf bfd block
The interface is prevented from dynamically establishing a BFD session.
----End
Context
After BFD for OSPF is configured on a specified interface and the interface
becomes faulty, the router rapidly detects the fault and instructs OSPF to
recalculate routes. This speeds up OSPF convergence. When the OSPF neighbor
relationship goes Down, the BFD session between OSPF neighbors is dynamically
deleted.
Before configuring BFD for OSPF, enable BFD globally.
Perform the following steps on the router:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The view of the interface enabled with BFD for OSPF is displayed.
Step 3 Run ospf bfd enable
BFD is enabled on the interface to establish the BFD session.
If all the interfaces in a certain process are configured with BFD and their
neighbor relationships are in the Full state, OSPF creates BFD sessions with default
parameter values on specified interfaces in the process.
NOTE
The priority of BFD for OSPF configured on an interface is higher than that of BFD for OSPF
configured for a process.
NOTE
● Actual interval at which BFD packets are transmitted on the local router = Max { configured
interval transmit-interval at which BFD packets are transmitted on the local router,
configured interval receive-interval at which BFD packets are received on the peer router }
● Actual interval at which BFD packets are received on the local router = Max { configured
interval transmit-interval at which BFD packets are transmitted on the peer router,
configured interval receive-interval at which BFD packets are received on the local router }
● Actual time for detecting BFD packets = Actual interval at which BFD packets are received on
the local router x Configured detection multiplier multiplier-value on the peer router
For example:
● On the local router, the configured interval at which BFD packets are transmitted is 200 ms;
the interval at which BFD packets are received is set to 300 ms; the detection multiplier is 4.
● On the peer router, the configured interval at which BFD packets are transmitted is 100 ms;
the interval at which BFD packets are received is 600 ms; the detection multiplier is 5.
Then:
● On the local router, the actual interval at which BFD packets are transmitted is 600 ms
calculated by using the formula max {200 ms, 600 ms}; the interval at which BFD packets
are received is 300 ms calculated by using the formula max {100 ms, 300 ms}; the detection
period is 1500 ms calculated by multiplying 300 ms by 5.
● On the peer router, the actual interval at which BFD packets are transmitted is 300 ms
calculated by using the formula max {100 ms, 300 ms}, the actual interval at which BFD
packets are received is 600 ms calculated by using the formula max {200 ms, 600 ms}, and
the detection period is 2400 ms calculated by multiplying 600 ms by 4.
----End
Prerequisites
All configurations of BFD for OSPF are complete.
Procedure
● Run either of the following commands to check the BFD session:
– display ospf [process-id ] bfd session interface-type interface-number
[ router-id ]
– display ospf [process-id ] bfd session { router-id | all }
----End
Pre-configuration Tasks
By adjusting OSPF timers, you can implement OSPF fast network convergence.
Configuration Procedure
Perform one or more configuration tasks (excluding the task of Verifying the OSPF
Fast Convergence Configuration) as required.
Context
With the integration of network services, different services such as data, voice, and
video run on the same network infrastructure, and have different requirements for
the network. For Video on Demand (VoD) services, the route convergence speed
of the multicast source server is the most critical factor that affects multicast
services. It is required that the routes to the multicast source should converge
rapidly when network faults occur. On the BGP or MPLS VPN bearer network
where OSPF is used to implement the IP connectivity of the backbone network,
end-to-end routes between PEs need to be converged rapidly.
You can set priorities for specific routes by setting the convergence priority of
OSPF routes so that these routes converge preferentially. This shortens the
interruption of key services and improves the reliability of the entire network.
Procedure
Step 1 Run system-view
After the convergence priority of OSPF routes is set, OSPF can calculate and flood
LSAs, and synchronize LSDBs according to the priorities. This speeds up route
convergence. When an LSA meets multiple priorities, the highest priority takes
effect. OSPF calculates LSAs in the sequence of intra-area routes, inter-area routes,
and AS external routes. This command makes OSPF calculate route priorities.
Convergence priorities are critical, high, medium, and low. During LSA flooding,
LSAs are placed into the corresponding critical, high, medium, and low queues
according to priorities to speed up the processing of high-priority LSAs.
NOTE
----End
Context
Hello packets are commonly used packets, which are periodically sent on OSPF
interfaces to establish and maintain neighbor relationships. The intervals set on
the interfaces connecting two OSPF neighbors need to be the same. Otherwise,
the OSPF neighbor relationship cannot be established.
Procedure
Step 1 Run system-view
The interval for sending Hello packets is set on the OSPF interface.
By default, the interval for sending Hello packets on a P2P or broadcast interface
is 10s; the interval for sending Hello packets on a P2MP or NBMA interface is 30s;
the dead time for the OSPF neighbors on the same interface is four times the
interval for sending Hello packets.
----End
Procedure
Step 1 Run system-view
The dead time after which the neighbor relationship between two routers is set.
NOTE
Setting the dead interval of an OSPF neighbor to longer than 20s is recommended. If the
dead interval of an OSPF neighbor is shorter than 20s, the session may be closed.
Both the Hello timer and the Dead timer are restored to their respective default values
upon a change to the network type.
----End
Context
Before Smart-discover is configured, when the neighbor status of the router
changes or the DR/BDR on the multi-access network (broadcast or NBMA
network) changes, the router does not send Hello packets to its neighbor until the
Hello timer expires. This slows down the establishment of neighbor relationships
between devices. After Smart-discover is configured, when the neighbor
relationship status of the router changes or the DR/BDR on the multi-access
network (broadcast or NBMA network) changes, the router can send Hello
packets to its neighbor immediately without waiting for the expiration of the Hello
timer. This speeds up the establishment of neighbor relationships and thus
implements fast convergence of OSPF networks.
Procedure
Step 1 Run system-view
----End
Context
In OSPF, the interval for updating LSAs is defined as 5s. This aims to prevent
network connections or frequent route flapping from consuming excessive
network bandwidth or device resources.
On a stable network where routes need to be fast converged, you can cancel the
interval for updating LSAs by setting the interval to 0 seconds. In this manner,
changes to the topology or the routes can be immediately advertised on the
network through LSAs, thereby speeding up route convergence on the network.
Procedure
Step 1 Run system-view
----End
Context
In OSPF, the interval for receiving LSAs is 1s. This aims to prevent network
connections or frequent route flapping from consuming excessive network
bandwidth or device resources.
On a stable network where routes need to be fast converged, you can cancel the
interval for receiving LSAs by setting the interval to 0 seconds. In this manner,
changes to the topology or the routes can be immediately advertised on the
network through LSAs, thereby speeding up route convergence on the network.
Procedure
Step 1 Run system-view
On a stable network where routes need to be fast converged, you can set the
interval for receiving LSAs to 0 seconds so that changes to the topology or the
routes can be detected immediately.
By default, if the device receives an LSA, it delays route calculation for 10s.
----End
Context
When the OSPF LSDB changes, the shortest path needs to be recalculated. If a
network changes frequently and the shortest path is calculated continually, many
system resources are consumed and thus system performance is degraded. By
configuring an intelligent timer and setting a correct interval for the SPF
calculation, you can prevent excessive system memory and bandwidth resources
from being occupied.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF process view is displayed.
Step 3 Run spf-schedule-interval { interval1 | intelligent-timer max-interval start-
interval hold-interval | millisecond interval2 }
The interval for the SPF calculation is set.
● The parameter interval1 specifies the interval for the SPF calculation, in
milliseconds.
● The parameter intelligent-timer indicates that the interval for the SPF
calculation is set through an intelligent timer.
● The parameter max-interval specifies the maximum interval for the SPF
calculation, in milliseconds.
● The parameter start-interval specifies the initial interval for the SPF
calculation, in milliseconds.
● The parameter hold-interval specifies the hold interval for the SPF calculation,
in milliseconds.
● The parameter millisecond interval2 specifies the interval for the SPF
calculation, in milliseconds.
By default, an intelligent timer is enabled; the maximum interval for the SPF
calculation is 10000 ms, the initial interval is 500 ms, and the hold interval is 1000
ms.
After an intelligent timer is enabled, the interval for the SPF calculation is as
follows:
1. The initial interval for the SPF calculation is specified by the parameter start-
interval.
2. The interval for the SPF calculation for the nth (n ≥ 2) time is equal to hold-
interval x 2(n-2).
3. When the interval specified by hold-interval x 2(n-2) reaches the maximum
interval specified by max-interval, OSPF performs the SPF calculation at the
maximum interval for three consecutive times. Then, OSPF goes back to step
Step 3.1 and performs the SPF calculation at the initial interval specified by
start-interval.
----End
Prerequisites
All configurations of OSPF fast convergence are complete.
Procedure
● Run the display ospf [ process-id ] brief command to check brief information
about the specified OSPF process.
----End
Applicable Environment
To avoid traffic interruption and route flapping caused by the active/standby
switchover, you can enable OSPF GR.
After the OSPF process is restarted through GR, the Restarter and the Helper
reestablish the neighbor relationship, exchange routing information, synchronize
the LSDB, and update the routing table and forwarding table. These operations
ensure the fast convergence of OSPF and the stability of the network topology.
NOTE
In practical application, in order to realize that business forwarding is not affected by
motherboard failure, it is usually possible to configure OSPF GR in the hardware
environment of dual motherboard to make sense.
All the models support the GR Helper, and only AR3200 series support the GR Restarter.
Pre-configuration Tasks
Before configuring OSPF GR, complete the following tasks:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF view is displayed.
Step 3 Run opaque-capability enable
The opaque-LSA capability is enabled.
The opaque-LSA capability of OSPF needs to be enabled first because OSPF
supports GR through Type 9 LSAs.
Step 4 Run graceful-restart
The OSPF GR feature is enabled.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf [ process-id ]
The OSPF view is displayed.
----End
Procedure
Step 1 Run system-view
● If ACL parameters are configured, the local router can enter the Helper mode
only after neighbors pass the filtering policies of ip-prefix or acl.
● If ignore-external-lsa is configured, the Helper does not check the LSAs
outside the AS (AS-external LSA). By default, the Helper checks the LSAs
outside the AS.
● If planned-only is configured, the Helper supports only planned GR. By
default, the Helper supports both planned GR and unplanned GR.
● If never is configured, the router will not enter the Helper mode.
----End
Prerequisites
All configurations of OSPF GR are complete.
Procedure
● Run the display ospf [ process-id ] graceful-restart [ verbose ] command to
check information about OSPF GR.
----End
Applicable Environment
By configuring timers, you can reduce the number of unnecessary packets on
networks and reduce the load on the device to improve network performance.
Pre-configuration Tasks
Before improving the security of an OSPF network, complete the following task:
Configuration Procedure
Perform one or more configuration tasks (excluding the task of Verifying the OSPF
Network Stability Optimization Configuration) as required.
Context
Routing protocols may share and select routing information because the router
may run multiple dynamic routing protocols at the same time. The system sets a
priority for each routing protocol. When multiple routing protocols are used to
select routes, the route selected by the routing protocol with a higher priority
takes effect.
Procedure
Step 1 Run system-view
By default, the preference of OSPF routes is 10. When the parameter ase is
specified, the default preference of AS external routes is 150.
----End
Procedure
Step 1 Run system-view
----End
Context
After sending an LSA packet to the neighboring router, the router waits for a
response. If no response is received within the set interval, the router retransmits
the LSA packet to the neighboring router.
Procedure
Step 1 Run system-view
NOTE
The interval for retransmitting LSAs between adjacent routers cannot be set too small.
Generally, the interval needs to be larger than the round trip time of a packet transmitted
between two routers. Otherwise, certain LSAs are retransmitted unnecessarily.
----End
Context
After a stub router is configured, the route on the stub router will not be
preferentially selected. After the route cost is set to the maximum value 65535,
traffic generally bypasses the router. This ensures an uninterrupted route on the
router during upgrades and other maintenance operations.
Procedure
Step 1 Run system-view
NOTE
There is no relationship between the stub router configured through this command and the
router in a stub area.
----End
Context
You can prohibit an OSPF interface from sending and receiving OSPF packets to
prevent local OSPF routing information from being obtained by devices on other
networks. This restriction also prevents the local device from receiving the routing
update information advertised by other devices on the same network.
After an OSPF interface is prohibited from sending and receiving OSPF packets,
the interface can still advertise its direct routes, but not Hello packets. Therefore,
no neighbor relationship can be set up between the device and its neighbor. The
OSPF network becomes more adaptive and network resources are saved.
Procedure
Step 1 Run system-view
You can prohibit an interface from sending and receiving OSPF packets in different
OSPF processes, but the silent-interface command is valid only for the OSPF
interface in the local process.
----End
Prerequisites
All configurations of improving the stability of an OSPF network are complete.
Procedure
● Run the display ospf [ process-id ] brief command to check brief information
about the specified OSPF process.
● Run the display ip routing-table command to check information about the
IP routing table.
----End
Applicable Environment
In a network demanding high security, you can configure OSPF authentication and
adopt the GTSM mechanism to improve the security of the OSPF network.
The GTSM mechanism defends against attacks by checking the TTL value. If an
attacker keeps sending packets to a router by simulating real OSPF unicast
packets, the router finds that itself is the destination of the packets after the
interface board receives these packets. The router directly sends the packets to the
control plane for OSPF processing without checking the validity of the packets.
The router busies itself with processing these "valid" packets. As a result, the
system is busy, and the CPU is highly occupied.
The GTSM mechanism protects a router by checking whether the TTL value in the
IP packet header is in a pre-defined range to enhance the system security.
NOTE
GTSM supports only unicast addresses; therefore, in OSPF, GTSM takes effect on the virtual
link and the sham link.
Pre-configuration Tasks
Before improving the security of an OSPF network, complete the following tasks:
Configuration Procedure
Perform one or more configuration tasks (excluding the task of Verifying the OSPF
Network Security Optimization Configuration) as required.
Context
To apply GTSM functions, enable GTSM on the two ends of the OSPF connection.
The valid TTL range of the detected packets is [255 -hops + 1, 255].
GTSM checks the TTL value of only the packets that match the GTSM policy. For
the packets that do not match the GTSM policy, you can set them as "pass" or
"drop". If the GTSM default action performed on the packet is set as "drop", you
need to configure all the router connections for GTSM. If the packets sent from a
router do not match the GTSM policy, they are dropped. The connection thus
cannot be established. This ensures security but reduces the ease of use.
You can enable the log function to record information about dropped packets. This
information facilitates fault location.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ospf valid-ttl-hops hops [ nonstandard-multicast ] [ vpn-instance vpn-
instance-name ]
OSPF GTSM functions are configured.
NOTE
By default, the packets that do not match the GTSM policy can pass the filtering
criteria.
NOTE
If the default action is configured but the GTSM policy is not configured, GTSM does not
take effect.
The log function is enabled on the specified board in the system view. The
information about the packets dropped by GTSM is recorded in the log.
----End
Context
In area authentication, all the routers in an area must use the same area
authentication mode and password. For example, the authentication mode of all
devices in Area 0 is simple authentication and the password is abc.
NOTICE
If plain is selected during the configuration of the area authentication mode, the
password is saved in the configuration file in plain text. This saving mode brings
security risks. It is recommended that you select cipher to save the password in
cipher text.
Simple, MD5 authentication, and HMAC-MD5 cipher text authentication have
potential security risks. HMAC-SHA256 cipher text authentication is
recommended.
Procedure
Step 1 Run system-view
Step 4 Run any of the following commands to configure the authentication mode of the
OSPF area as required:
● Run authentication-mode simple [ plain plain-text | [ cipher ] cipher-text ]
Simple authentication is configured for the OSPF area.
– plain indicates the plain text password.
– cipher indicates the cipher text password. For Message Digest 5 (MD5) or
Hashed Message Authentication Code-MD5 (HMAC-MD5)
authentication, the authentication mode is in cipher text by default.
● Run authentication-mode { md5 | hmac-md5 | hmac-sha256 } [ key-id
{ plain plain-text | [ cipher ] cipher-text } ]
The specified authentication mode is configured for the OSPF area.
– md5 indicates the MD5 cipher text authentication mode.
– hmac-md5 indicates the HMAC-MD5 cipher text authentication mode.
– hmac-sha256 indicates the HMAC-SHA256 cipher text authentication
mode.
– key-id specifies the authentication key ID of the cipher authentication.
● Run authentication-mode keychain keychain-name
Keychain authentication is configured for the OSPF area.
NOTE
----End
Context
The interface authentication mode is used among neighbor routers to set the
authentication mode and password. Its priority is higher than that of the area
authentication mode.
NOTICE
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The OSPF interface view is displayed.
Step 3 Run any of the following commands to configure the interface authentication
mode as required:
● Run ospf authentication-mode simple [ plain plain-text | [ cipher ] cipher-
text ]
Simple authentication is configured for the OSPF interface.
– simple indicates simple authentication.
– plain indicates the plain text password. For simple authentication, the
authentication mode is in plain text by default.
– cipher indicates the cipher text password. For MD5 or HMAC-MD5
authentication, the authentication mode is in cipher text by default.
● Run ospf authentication-mode { md5 | hmac-md5 | hmac-sha256 } [ key-id
{ plain plain-text | [ cipher ] cipher-text } ]
The specified authentication mode is configured for the OSPF interface.
– md5 indicates the MD5 cipher text authentication mode.
– hmac-md5 indicates the HMAC-MD5 cipher text authentication mode.
– hmac-sha256 indicates the HMAC-SHA256 cipher text authentication
mode.
● Run ospf authentication-mode null
The OSPF interface is not authenticated.
● Run ospf authentication-mode keychain keychain-name
Keychain authentication is configured for the OSPF area.
NOTE
----End
Prerequisites
The configurations for improving security of an OSPF network are complete.
Procedure
● Run the display gtsm statistics { slot-id | all } command to check the GTSM
statistics.
● Run the display ospf [ process-id ] request-queue [ interface-type interface-
number ] [ neighbor-id ] command to check the OSPF request queue.
● Run the display ospf [ process-id ] retrans-queue [ interface-type interface-
number ] [ neighbor-id ] command to check the OSPF retransmission queue.
● Run the display ospf [ process-id ] error [ lsa ] command to check the OSPF
error information.
----End
Applicable Environment
OSPF supports the network management function. You can bind OSPF MIB to a
certain OSPF process. In addition, OSPF also supports the trap function and the
log function.
Pre-configuration Tasks
Before configuring the network management function of OSPF, complete the
following tasks:
Configuration Procedure
Perform one or more configuration tasks (excluding the task of Verifying the OSPF
Network Management Function Configuration) as required.
Context
When multiple OSPF processes are enabled, you can configure OSPF MIB to select
the process to be processed, that is, configure OSPF MIB to select the process to
which it is bound.
Procedure
Step 1 Run system-view
----End
Procedure
Step 1 Run system-view
To enable the traps of one or more events, you can specify type-name.
----End
Procedure
Step 1 Run system-view
----End
Prerequisites
The configurations for the network management function of OSPF are complete.
Procedure
● Run the display ospf [ process-id ] brief command to view information about
the binding of OSPF MIBs and OSPF processes.
● Run the display snmp-agent trap feature-name ospf all command to view
all trap messages of the OSPF module.
----End
Usage Scenario
If an interface carrying OSPF services alternates between Up and Down, OSPF
neighbor relationship flapping occurs on the interface. During the flapping, OSPF
frequently sends Hello packets to reestablish the neighbor relationship,
synchronizes LSDBs, and recalculates routes. In this process, a large number of
packets are exchanged, adversely affecting neighbor relationship stability, OSPF
services, and other OSPF-dependent services, such as LDP and BGP. OSPF neighbor
relationship flapping suppression can address this problem by delaying OSPF
neighbor relationship reestablishment or preventing service traffic from passing
through flapping links.
NOTE
The following steps are optional, choose them as required.
Pre-configuration Tasks
Before configuring OSPF neighbor relationship flapping suppression, complete the
following tasks:
Procedure
Step 1 Run system-view
Flapping suppression can also work first in Hold-down mode and then in Hold-
max-cost mode.
To set duration for the Hold-max-cost mode or disable this mode, run the ospf
suppress-flapping peer hold-max-cost disable command.
NOTE
The value of resume-interval must be greater than that of detecting-interval.
Interfaces are forced to exit from OSPF neighbor relationship flapping suppression.
NOTE
----End
Suppress flapping peer in the command output indicates the current suppression
mode (Hold-down), time when the flapping suppression started, and the
remaining time of the flapping suppression.
Context
If the local device clock is faster than usual and the aging timer expires
abnormally, the local device incorrectly clears all Router LSAs from the peer
device, which causes route flapping and service interruptions. To resolve this issue,
master/slave board switching triggered by abnormal OSPF LSA aging is
automatically enabled. Master/slave board switching is triggered to restore
network connections and service traffic when the following condition is met:
Procedure
Step 1 Run system-view
----End
Context
NOTICE
OSPF information cannot be restored after you clear it. So, confirm the action
before you use the command.
To clear OSPF information, run the following reset commands in the user view.
Procedure
● Run the reset ospf [ process-id ] counters [ neighbor [ interface-type
interface-number ] [ router-id ] ] command to reset OSPF counters.
– counters indicates OSPF counters.
– neighbor indicates neighbor information on the specified interface.
● Run the reset ospf [ process-id ] redistribution command in the user view to
re-import routes by OSPF.
● Run the reset gtsm statistics all command in the user view to clear the
GTSM statistics on the board.
----End
Context
NOTICE
Running the reset ospf command will tear down the OSPF adjacency relationship
between the routers. So, confirm the action before you use the command.
To reset OSPF connections, run the following reset commands in the user view.
Procedure
● Run the reset ospf [ process-id ] process [ flush-waiting-timer time |
graceful-restart ] command in the user view to restart the OSPF process.
----End
Networking Requirements
As shown in Figure 5-35, all routers run OSPF, and the entire AS is divided into
three areas. Router A and Router B serve as ABRs to forward routes between
areas.
After the configuration, each router should learn the routes from the AS to all
network segments.
Area0
RouterA GE1/0/0 RouterB
192.168.0.1/24 GE1/0/0
192.168.0.2/24
GE2/0/0 GE2/0/0
192.168.1.1/24 192.168.2.1/24
GE1/0/0 GE1/0/0
192.168.1.2/24 192.168.2.2/24
RouterC RouterD
GE2/0/0 GE2/0/0
172.16.1.1/24 172.17.1.1/24
GE2/0/0 GE2/0/0
172.16.1.2/24 172.17.1.2/24
RouterE RouterF
Area1 Area2
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure an IP address for each interface.
# Configure RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.0.1 255.255.255.0
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 192.168.1.1 255.255.255.0
[RouterA-GigabitEthernet2/0/0] quit
The configurations of RouterB, RouterC, RouterD, RouterE, and RouterF are similar
to the configuration of RouterA, and are not mentioned here.
# Configure Router A.
[RouterA] router id 1.1.1.1
[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
[RouterA-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.1] quit
[RouterA-ospf-1] quit
# Configure Router B.
[RouterB] router id 2.2.2.2
[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] quit
[RouterB-ospf-1] area 2
[RouterB-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.2] quit
[RouterB-ospf-1] quit
# Configure Router C.
[RouterC] router id 3.3.3.3
[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
[RouterC-ospf-1] quit
# Configure Router D.
# Configure Router E.
[RouterE] router id 5.5.5.5
[RouterE] ospf
[RouterE-ospf-1] area 1
[RouterE-ospf-1-area-0.0.0.1] network 172.16.1.0 0.0.0.255
[RouterE-ospf-1-area-0.0.0.1] quit
[RouterE-ospf-1] quit
# Configure Router F.
[RouterF] router id 6.6.6.6
[RouterF] ospf
[RouterF-ospf-1] area 2
[RouterF-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255
[RouterF-ospf-1-area-0.0.0.2] quit
[RouterF-ospf-1] quit
# View the routing table of Router D and test connectivity by using the ping
command.
[RouterD] display ospf routing
OSPF Process 1 with Router ID 4.4.4.4
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 4 Inter-area 192.168.2.1 2.2.2.2 0.0.0.2
172.17.1.0/24 1 Transit 172.17.1.1 4.4.4.4 0.0.0.2
192.168.0.0/24 2 Inter-area 192.168.2.1 2.2.2.2 0.0.0.2
192.168.1.0/24 3 Inter-area 192.168.2.1 2.2.2.2 0.0.0.2
192.168.2.0/24 1 Transit 192.168.2.2 4.4.4.4 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=3 ttl=253 time=62 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) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/59/94 ms
----End
Configuration Files
● Configuration file of Router A
#
sysname RouterA
#
router id 1.1.1.1
#
interface GigabitEthernet1/0/0
ip address 192.168.0.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
#
interface GigabitEthernet2/0/0
ip address 172.16.1.2 255.255.255.0
#
ospf 1
area 0.0.0.1
network 172.16.1.0 0.0.0.255
#
return
Networking Requirements
As shown in Figure 5-36, Area 2 does not connect to the backbone area directly.
Area 1 serves as a transit area to connect Area 2 and Area 0. A virtual link is
configured between Router A and Router B.
Area1
RouterA GE1/0/0 GE1/0/0 RouterB
192.168.1.1/24 192.168.1.2/24
GE2/0/0 GE2/0/0
10.1.1.1/8 Virtual Link 172.16.1.1/16
GE2/0/0 GE2/0/0
10.1.1.2/8 172.16.1.2/16
Area0 Area2
RouterC RouterD
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure an IP address for each interface.
# Configure Router A.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.1.1 24
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 10.1.1.1 8
[RouterA-GigabitEthernet2/0/0] quit
# Configure Router B.
[RouterB] ospf 1 router-id 2.2.2.2
[RouterB-ospf-1] area 1
[RouterB-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.1] quit
[RouterB-ospf-1] area 2
[RouterB-ospf-1-area-0.0.0.2] network 172.16.0.0 0.0.255.255
[RouterB-ospf-1-area-0.0.0.2] quit
# Configure Router C.
[RouterC] ospf 1 router-id 3.3.3.3
[RouterC-ospf-1] area 0
[RouterC-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255
[RouterC-ospf-1-area-0.0.0.0] quit
# Configure Router D.
[RouterD] ospf 1 router-id 4.4.4.4
[RouterD-ospf-1] area 2
[RouterD-ospf-1-area-0.0.0.2] network 172.16.0.0 0.0.255.255
[RouterD-ospf-1-area-0.0.0.2] quit
NOTE
The routing table of Router A does not contain routes in Area 2 because Area 2 is not
directly connected to Area 0.
[RouterA] display ospf routing
OSPF Process 1 with Router ID 1.1.1.1
Routing Tables
# Configure Router B.
[RouterB] ospf 1
[RouterB-ospf-1] area 1
[RouterB-ospf-1-area-0.0.0.1] vlink-peer 1.1.1.1
[RouterB-ospf-1-area-0.0.0.1] quit
[RouterB-ospf-1] quit
----End
Configuration Files
● Configuration file of Router A
#
sysname RouterA
#
interface GigabitEthernet1/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 10.1.1.1 255.0.0.0
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 10.0.0.0 0.255.255.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
vlink-peer 2.2.2.2
#
return
Networking Requirements
As shown in Figure 5-37, Router A has the highest priority (100) in the network
and is elected as the DR. Router C has the second highest priority, and is elected
as the BDR. The priority of Router B is 0, and Router B cannot be elected as the
DR or BDR. The priority of Router D is not configured and its default value is 1.
GE1/0/0 GE1/0/0
192.168.1.1/24 192.168.1.2/24
GE1/0/0 GE1/0/0
192.168.1.3/24 192.168.1.4/24
RouterC RouterD
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the router ID on each router, enable OSPF, and specify the network
segment.
2. Check the DR/BDR status of each router with the default priority.
3. Configure the DR priority of the interface and check the DR/BDR status.
Procedure
Step 1 Configure an IP address for each interface.
# Configure IP addresses for all interfaces of RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.1.1 255.255.255.0
[RouterA-GigabitEthernet1/0/0] quit
# Configure Router B.
[RouterB] router id 2.2.2.2
[RouterB] ospf
[RouterB-ospf-1] area 0
[RouterB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0] quit
[RouterB-ospf-1] quit
# Configure Router C.
[RouterC] router id 3.3.3.3
[RouterC] ospf
[RouterC-ospf-1] area 0
[RouterC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[RouterC-ospf-1-area-0.0.0.0] quit
[RouterC-ospf-1] quit
# Configure Router D.
[RouterD] router id 4.4.4.4
[RouterD] ospf
[RouterD-ospf-1] area 0
[RouterD-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[RouterD-ospf-1-area-0.0.0.0] quit
[RouterD-ospf-1] quit
# View the neighbor information of Router A. You can see the priority of DR and
the neighbor status. The Router D is the DR, and Router C is the BDR.
NOTE
When the priority is the same, the router with a higher router ID is elected as the DR. If a
new router is added after the DR/BDR election is complete, the new router cannot become
the DR even if it has the highest priority.
# Configure Router B.
[RouterB] interface gigabitethernet 1/0/0
[RouterB-GigabitEthernet1/0/0] ospf dr-priority 0
[RouterB-GigabitEthernet1/0/0] quit
# Configure Router C.
[RouterC] interface gigabitethernet 1/0/0
[RouterC-GigabitEthernet1/0/0] ospf dr-priority 2
[RouterC-GigabitEthernet1/0/0] quit
In the user view of each router, run the reset ospf 1 process command to restart
the OSPF process.
If all neighbors are in the Full state, it indicates that Router A establishes the
neighbor relationship with its neighbor. If the neighbor stays "2-Way", it indicates
both of them are not the DR or BDR. They need not exchange LSAs.
If the status of the OSPF interface is DROther, it indicates that it is neither DR nor
BDR.
----End
Configuration Files
● Configuration file of Router A
#
sysname RouterA
#
router id 1.1.1.1
#
interface GigabitEthernet1/0/0
ip address 192.168.1.1 255.255.255.0
ospf dr-priority 100
#
ospf 1
area 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return
#
return
Networking Requirements
As shown in Figure 5-38, all routers run OSPF, and the entire AS is divided into
three areas. Router A and Router B serve as ABRs to forward routes between
areas. Router D serves as an ASBR to import external routes (static routes).
Area0
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure an IP address for each interface.
# Configure Router A.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.0.1 24
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 192.168.1.1 24
[RouterA-GigabitEthernet2/0/0] quit
# Configure Router B.
[RouterB] router id 2.2.2.2
[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] quit
[RouterB-ospf-1] area 2
[RouterB-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.2] quit
[RouterB-ospf-1] quit
# Configure Router C.
[RouterC] router id 3.3.3.3
[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
[RouterC-ospf-1] quit
# Configure Router D.
[RouterD] router id 4.4.4.4
[RouterD] ospf
[RouterD-ospf-1] area 2
[RouterD-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
[RouterD-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255
[RouterD-ospf-1-area-0.0.0.2] quit
[RouterD-ospf-1] quit
# Configure Router E.
[RouterE] router id 5.5.5.5
[RouterE] ospf
[RouterE-ospf-1] area 1
# Configure Router F.
[RouterF] router id 6.6.6.6
[RouterF] ospf
[RouterF-ospf-1] area 2
[RouterF-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255
[RouterF-ospf-1-area-0.0.0.2] quit
[RouterF-ospf-1] quit
NOTE
When Router C is in a common area, there are AS external routes in the routing table.
[RouterC] display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 1 Transit 172.16.1.1 3.3.3.3 0.0.0.1
172.17.1.0/24 4 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.0.0/24 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.1.0/24 1 Transit 192.168.1.2 3.3.3.3 0.0.0.1
192.168.2.0/24 3 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
Routing for ASEs
Destination Cost Type Tag NextHop AdvRouter
200.0.0.0/8 4 Type1 1 192.168.1.1 4.4.4.4
Total Nets: 6
Intra Area: 2 Inter Area: 3 ASE: 1 NSSA: 0
# Configure Router C.
[RouterC] ospf
[RouterC-ospf-1] area 1
[RouterC-ospf-1-area-0.0.0.1] stub
[RouterC-ospf-1-area-0.0.0.1] quit
[RouterC-ospf-1] quit
# Configure Router E.
[RouterE] ospf
[RouterE-ospf-1] area 1
[RouterE-ospf-1-area-0.0.0.1] stub
[RouterE-ospf-1-area-0.0.0.1] quit
[RouterE-ospf-1] quit
NOTE
After the area where Router C resides is configured as a stub area, AS external routes are
invisible. Instead, there is a default route.
[RouterC] display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
0.0.0.0/0 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
172.16.1.0/24 1 Transit 172.16.1.1 3.3.3.3 0.0.0.1
172.17.1.0/24 4 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.0.0/24 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
192.168.1.0/24 1 Transit 192.168.1.2 3.3.3.3 0.0.0.1
192.168.2.0/24 3 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
Total Nets: 6
Intra Area: 2 Inter Area: 4 ASE: 0 NSSA: 0
Step 5 Stop Router A from advertising Type 3 LSAs to the stub area.
[RouterA] ospf
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.0.0.1] stub no-summary
[RouterA-ospf-1-area-0.0.0.1] quit
[RouterA-ospf-1] quit
NOTE
After the advertisement of summary LSAs to a stub area is disabled, the routing entries of
the stub router are further reduced, and only the default route to a destination outside the
AS is reserved.
----End
Configuration Files
● Configuration file of Router A
#
sysname RouterA
#
router id 1.1.1.1
#
interface GigabitEthernet1/0/0
ip address 192.168.0.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.1.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
stub no-summary
#
return
● Configuration file of Router B
#
sysname RouterB
#
router id 2.2.2.2
#
interface GigabitEthernet1/0/0
ip address 192.168.0.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.2.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.2
network 192.168.2.0 0.0.0.255
#
return
● Configuration file of Router C
#
sysname RouterC
#
router id 3.3.3.3
#
interface GigabitEthernet1/0/0
ip address 192.168.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.16.1.1 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
stub
#
return
● Configuration file of Router D
#
sysname RouterD
#
router id 4.4.4.4
#
interface GigabitEthernet1/0/0
ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.17.1.1 255.255.255.0
#
ospf 1
import-route static type 1
area 0.0.0.2
network 192.168.2.0 0.0.0.255
network 172.17.1.0 0.0.0.255
#
ip route-static 200.0.0.0 255.0.0.0 NULL0
#
return
Networking Requirements
Stub areas and NSSAs are described as follows:
Stub area
● Does not transmit external routes from other areas.
● Does not transmit AS external routes imported by ASBRs.
Type 5 LSAs are not transmitted in stub areas.
NSSA
● Does not transmit external routes from other areas.
● Transmits AS external routes imported by ASBRs.
Type 7 LSAs generated by ASBRs in an NSSA are transmitted only within the
NSSA. After receiving the Type 7 LSAs, ABRs in the NSSA translate them into
Type 5 LSAs to advertise external routes to other areas on the OSPF network.
Configuring an area as an NSSA prevents a large number of external routes from
consuming the bandwidth and storage resources of the router.
In Figure 5-39, OSPF runs on all routers, and the entire AS is partitioned into two
areas. Router A and Router B function as ABRs to forward inter-area routes; Router
C and Router D function as ASBRs and import external static routes 10.0.0.0/8 and
20.0.0.0/8. To import AS external routes but reduce the number of LSAs to be
advertised to area 1 without affecting route reachability, configure area 1 as an
NSSA and configure Router A as an LSA translator in the NSSA.
RouterA
GE2/0/0 GE1/0/0
192.168.3.1/24 192.168.0.1/24
GE1/0/0
192.168.3.2/24 GE3/0/0 GE1/0/0
192.168.1.1/24 192.168.0.2/24
RouterD RouterC
ASBR ASBR
GE1/0/0
192.168.1.2/24 GE2/0/0
GE2/0/0 192.168.2.2/24
192.168.4.1/24
GE3/0/0 GE2/0/0
Area1
NSSA 192.168.4.2/24 192.168.2.1/24 Area0
RouterB
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable OSPF and configure basic OSPF functions on each router
2. Configure Area 1 as an NSSA.
3. Configure Router D to import the static route 10.0.0.0/8.
4. Configure Router C to import the static route 20.0.0.0/8.
5. Configure Router A as an LSA translator in the NSSA.
6. Disable Type 3 LSA advertisement to the NSSA to reduce the routing table
size.
Data Preparation
To complete the configuration, you need the following data:
● Router ID 1.1.1.1 of Router A; OSPF process ID 1; network segment
192.168.0.0/24 of area 0; network segments 192.168.1.0/24 and
192.168.3.0/24 of Area 1
● Router ID 2.2.2.2 of Router B; OSPF process ID 1; network segment
192.168.2.0/24 of area 0; network segments 192.168.1.0/24 and
192.168.4.0/24 of Area 1
● Router ID 3.3.3.3 of Router C; OSPF process ID 1; network segments
192.168.0.0/24 and 192.168.2.0/24 of area 0
● Router ID 4.4.4.4 of Router D; OSPF process ID 1; network segments
192.168.3.0/24 and 192.168.4.0/24 of Area 1
Procedure
Step 1 Configure an IP address for each interface.
Assign an IP address to each interface according to Figure 5-39. For configuration
details, see "Configuration Files" in this section.
Step 2 Configure basic OSPF functions.
Configuring Basic OSPF Functions shows how to configure basic OSPF functions.
For details about the configuration, see Configuration Files in this section.
Step 3 Configure Router C to import the static route 20.0.0.0/8.
<Huawei> system-view
[Huawei] sysname RouterC
[RouterC] ip route-static 20.0.0.0 8 null 0
[RouterC] ospf 1
[RouterC-ospf-1] import-route static
[RouterC-ospf-1] quit
Total Nets: 7
Intra Area: 2 Inter Area: 4 ASE: 1 NSSA: 0
Total Nets: 7
Intra Area: 2 Inter Area: 4 ASE: 1 NSSA: 0
After an NSSA is configured, the OSPF routing table of Router D contains the AS
external static route 20.0.0.0/8 imported by Router C.
Step 5 Configure Area 1 as an NSSA.
# Configure Router A.
[RouterA] ospf 1
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.0.0.1] nssa
# Configure Router B.
[RouterB] ospf 1
[RouterB-ospf-1] area 1
[RouterB-ospf-1-area-0.0.0.1] nssa
# Configure Router D.
[RouterD] ospf 1
[RouterD-ospf-1] area 1
[RouterD-ospf-1-area-0.0.0.1] nssa
NOTE
NSSA attributes must be configured on all routers in the NSSA using the nssa command.
Total Nets: 7
Intra Area: 2 Inter Area: 4 ASE: 1 NSSA: 0
After an NSSA is configured, the OSPF routing table of Router C still contains the
AS external static route 10.0.0.0/8 imported by Router D, indicating that the NSSA
can transmit AS external routes imported by ASBRs.
The AdvRouter field shows that the router ID of the advertiser is 2.2.2.2. Router B
functions as the LSA translator in the NSSA because OSPF selects the ABR with the
largest router ID as an LSA translator by default.
Total Nets: 8
Intra Area: 4 Inter Area: 2 ASE: 0 NSSA: 2
After an NSSA is configured, the OSPF routing table of Router D does not contain
the AS external static route 20.0.0.0/8 imported by Router C, indicating that the
NSSA cannot transmit external routes from other areas.
Step 6 Configure Router A as an LSA translator in the NSSA.
[RouterA] ospf 1
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.0.0.1] nssa default-route-advertise translator-always
Total Nets: 7
Intra Area: 2 Inter Area: 4 ASE: 1 NSSA: 0
The AdvRouter field shows that the router ID of the advertiser has become
1.1.1.1, indicating that Router A functions an LSA translator in the NSSA.
Step 7 Disable Type 3 LSA advertisement to the NSSA.
# Display the OSPF routing table of Router D.
[RouterD] display ospf routing
Routing Tables
Total Nets: 8
Intra Area: 4 Inter Area: 2 ASE: 0 NSSA: 2
# Disable Type 3 LSA advertisement to the NSSA to reduce the routing table size.
[RouterA] ospf
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.0.0.1] nssa default-route-advertise no-summary
NOTE
Total Nets: 6
Intra Area: 4 Inter Area: 2 ASE: 0 NSSA: 0
The command output shows that ABRs no longer transmit Type 3 LSAs to the
NSSA and that the routing table size is reduced.
----End
Configuration Files
● Router A configuration file
#
sysname RouterA
#
router id 1.1.1.1
#
interface GigabitEthernet1/0/0
ip address 192.168.0.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.3.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 192.168.1.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
network 192.168.3.0 0.0.0.255
nssa default-route-advertise translator-always
nssa default-route-advertise no-summary
#
return
● Router B configuration file
#
sysname RouterB
#
router id 2.2.2.2
#
interface GigabitEthernet1/0/0
ip address 192.168.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 192.168.4.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 192.168.2.0 0.0.0.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
network 192.168.4.0 0.0.0.255
nssa
#
return
● Router C configuration file
#
sysname RouterC
#
router id 3.3.3.3
#
interface GigabitEthernet1/0/0
ip address 192.168.0.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.2.2 255.255.255.0
#
ospf 1
import-route static
area 0.0.0.0
network 192.168.0.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
ip route-static 20.0.0.0 255.0.0.0 NULL0
#
return
● Router D configuration file
#
sysname RouterD
#
router id 4.4.4.4
#
interface GigabitEthernet1/0/0
ip address 192.168.3.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.4.1 255.255.255.0
#
ospf 1
import-route static
area 0.0.0.1
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
nssa
#
ip route-static 10.0.0.0 255.0.0.0 NULL0
#
return
t=
Router-id
st
s
Co
Router-id 10.3.3.3
=
9
10.2.2.2
GE1/0/1 GE1/0/2
10.2.1.2/24 10.5.1.2/24
RouterB
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic OSPF functions on each router.
2. Set the cost to ensure that the link from Router A to Router C is preferred.
3. Enable OSPF IP FRR on Router A to protect the traffic forwarded by Router A.
Procedure
Step 1 Configure an IP address and the cost for each interface.
# Configure IP addresses for all interfaces of RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/1
[RouterA-GigabitEthernet1/0/1] ip address 10.2.1.1 255.255.255.0
[RouterA-GigabitEthernet1/0/1] ospf cost 9
[RouterA-GigabitEthernet1/0/1] quit
[RouterA] interface gigabitethernet 1/0/2
[RouterA-GigabitEthernet1/0/2] ip address 10.3.1.1 255.255.255.0
[RouterA-GigabitEthernet1/0/2] ospf cost 4
# Configure Router B.
[RouterB] router id 10.2.2.2
[RouterB] ospf
[RouterB-ospf-1] area 1
[RouterB-ospf-1-area-0.0.0.1] network 10.5.1.2 0.0.0.255
[RouterB-ospf-1-area-0.0.0.1] network 10.2.1.2 0.0.0.255
[RouterB-ospf-1-area-0.0.0.1] quit
[RouterB-ospf-1] quit
# Configure Router C.
[RouterC] router id 10.3.3.3
[RouterC] ospf
[RouterC-ospf-1] area 1
[RouterC-ospf-1-area-0.0.0.1] network 10.3.1.3 0.0.0.255
[RouterC-ospf-1-area-0.0.0.1] network 10.4.1.3 0.0.0.255
[RouterC-ospf-1-area-0.0.0.1] network 10.5.1.1 0.0.0.255
[RouterC-ospf-1-area-0.0.0.1] quit
[RouterC-ospf-1] quit
# Configure Router D.
[RouterD] router id 10.4.4.4
[RouterD] ospf
[RouterD-ospf-1] area 1
[RouterD-ospf-1-area-0.0.0.1] network 10.4.1.4 0.0.0.255
[RouterD-ospf-1-area-0.0.0.1] quit
[RouterD-ospf-1] quit
----End
Configuration Files
● Configuration file of Router A
#
sysname RouterA
#
router id 10.1.1.1
#
interface GigabitEthernet1/0/1
ip address 10.2.1.1 255.255.255.0
ospf cost 9
#
interface GigabitEthernet1/0/2
ip address 10.3.1.1 255.255.255.0
ospf cost 4
#
ospf 1
frr
loop-free-alternate
area 0.0.0.1
network 10.2.1.1 0.0.0.255
network 10.3.1.1 0.0.0.255
#
return
interface GigabitEthernet1/0/1
ip address 10.3.1.3 255.255.255.0
ospf cost 4
#
interface GigabitEthernet1/0/2
ip address 10.4.1.3 255.255.255.0
ospf cost 55
#
interface GigabitEthernet1/0/3
ip address 10.5.1.1 255.255.255.0
ospf cost 5
#
ospf 1
area 0.0.0.1
network 10.3.1.3 0.0.0.255
network 10.4.1.3 0.0.0.255
network 10.5.1.1 0.0.0.255
#
return
Networking Requirements
As shown in Figure 5-41, it is required as follows:
● Run OSPF between Router A, Router B, and Router C.
● Enable BFD of the OSPF process on Router A, Router B, and Router C.
● Traffic is transmitted on the active link Router A -> Router B. The link Router
A -> Router C -> Router B acts as the standby link.
● BFD of the interface is configured on the link between Router A and Router B.
When a fault occurs on the link, BFD can quickly detect the fault and notify
OSPF of the fault; therefore, the traffic is transmitted on the standby link.
GE1/0/0 GE2/0/0
10.1.1.2/24 10.2.2.1/24 Area0
RouterC
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable the basic OSPF functions on each router.
2. Enable global BFD.
3. Enable the detection mechanism on Router A and Router B.
Procedure
Step 1 Assign an IP address to each router interface.
# Configure IP addresses for all interfaces of RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 10.1.1.1 255.255.255.0
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 10.3.3.1 255.255.255.0
[RouterA-GigabitEthernet2/0/0] quit
# Configure Router B.
[RouterB] router id 10.2.2.2
[RouterB] ospf
[RouterB-ospf-1] area 0
[RouterB-ospf-1-area-0.0.0.0] network 10.2.2.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0] network 10.3.3.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0] quit
[RouterB-ospf-1] quit
# Configure Router C.
[RouterC] router id 10.3.3.3
[RouterC] ospf
[RouterC-ospf-1] area 0
[RouterC-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[RouterC-ospf-1-area-0.0.0.0] network 10.2.2.0 0.0.0.255
[RouterC-ospf-1-area-0.0.0.0] quit
[RouterC-ospf-1] quit
# After the preceding configurations are complete, run the display ospf peer
command. You can view that the neighboring relationship is set up between
Router A, Router B, and Router C. Take the display of Router A as an example:
<RouterA> display ospf peer
OSPF Process 1 with Router ID 10.1.1.1
Neighbors
Area 0.0.0.0 interface 10.1.1.1(GigabitEthernet1/0/0)'s neighbors
Router ID: 10.3.3.3 Address: 10.1.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: 10.1.1.1 BDR: 10.1.1.2 MTU: 0
Dead timer due in 38 sec
Retrans timer interval: 5
Neighbor is up for 00:00:15
Authentication Sequence: [ 0 ]
Neighbors
Area 0.0.0.0 interface 10.3.3.1(GigabitEthernet2/0/0)'s neighbors
Router ID: 10.2.2.2 Address: 10.3.3.2
State: Full Mode:Nbr is Master Priority: 1
DR: 10.3.3.1 BDR: 10.3.3.2 MTU: 0
Dead timer due in 25 sec
Retrans timer interval: 5
Neighbor is up for 00:00:59
Authentication Sequence: [ 0 ]
# Display the information in the OSPF routing table on Router A. You can view the
routing entries to Router B and Router C. The next hop address of the route to
172.16.1.0/24 is 10.3.3.2 and traffic is transmitted on the active link Router A ->
Router B.
<RouterA> display ospf routing
OSPF Process 1 with Router ID 10.1.1.1
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 2 Transit 10.3.3.2 10.2.2.2 0.0.0.0
10.3.3.0/24 1 Transit 10.3.3.1 10.1.1.1 0.0.0.0
10.2.2.0/24 2 Transit 10.3.3.2 10.2.2.2 0.0.0.0
10.2.2.0/24 2 Transit 10.1.1.2 10.2.2.2 0.0.0.0
10.1.1.0/24 1 Transit 10.1.1.1 10.1.1.1 0.0.0.0
Total Nets: 5
Intra Area: 5 Inter Area: 0 ASE: 0 NSSA: 0
[RouterA-ospf-1] quit
# After the preceding configurations are complete, run the display ospf bfd
session all command on Router A or Router B. You can view that the status of the
BFD session is Up.
Take the display of Router A as an example:
[RouterA] display ospf bfd session all
OSPF Process 1 with Router ID 10.1.1.1
Area 0.0.0.0 interface 10.1.1.1(GigabitEthernet1/0/0)'s BFD Sessions
NeighborId:10.3.3.3 AreaId:0.0.0.0 Interface:GigabitEthernet1/0/0
BFDState:up rx :500 tx :500
Multiplier:4 BFD Local Dis:8195 LocalIpAdd:10.1.1.1
RemoteIpAdd:10.1.1.2 Diagnostic Info:No diagnostic information
Area 0.0.0.0 interface 10.3.3.1(GigabitEthernet2/0/0)'s BFD Sessions
NeighborId:10.2.2.2 AreaId:0.0.0.0 Interface:GigabitEthernet2/0/0
BFDState:up rx :500 tx :500
Multiplier:4 BFD Local Dis:8194 LocalIpAdd:10.3.3.1
RemoteIpAdd:10.3.3.2 Diagnostic Info:No diagnostic information
# Configure BFD on GE 2/0/0 of Router B, set the minimum interval for sending
the packets and the minimum interval for receiving the packets to 500 ms, and set
the local detection time multiple to 4.
[RouterB] interface gigabitethernet 2/0/0
[RouterB-GigabitEthernet2/0/0] ospf bfd enable
[RouterB-GigabitEthernet2/0/0] ospf bfd min-tx-interval 500 min-rx-interval 500 detect-multiplier 4
[RouterB-GigabitEthernet2/0/0] quit
# After the preceding configurations are complete, run the display ospf bfd
session all command on Router A or Router B. You can view that the status of the
BFD session is Up.
Take the display of Router B as an example:
[RouterB] display ospf bfd session all
# Display the routing table on Router A. The standby link Router A -> Router C ->
Router B takes effect after the active link fails. The next hop address of the route
to 172.16.1.0/24 becomes 10.1.1.2.
<RouterA> display ospf routing
OSPF Process 1 with Router ID 10.1.1.1
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 3 Transit 10.1.1.2 10.2.2.2 0.0.0.0
10.3.3.0/24 1 Transit 10.3.3.1 10.1.1.1 0.0.0.0
10.2.2.0/24 2 Transit 10.1.1.2 10.2.2.2 0.0.0.0
10.1.1.0/24 1 Transit 10.1.1.1 10.1.1.1 0.0.0.0
Total Nets: 4
Intra Area: 4 Inter Area: 0 ASE: 0 NSSA: 0
----End
Configuration Files
● Configuration file of Router A
#
sysname RouterA
#
router id 10.1.1.1
#
bfd
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 10.3.3.1 255.255.255.0
ospf bfd enable
ospf bfd min-tx-interval 500 min-rx-interval 500 detect-multiplier 4
#
ospf 1
bfd all-interfaces enable
area 0.0.0.0
network 10.3.3.0 0.0.0.255
network 10.1.1.0 0.0.0.255
#
return
Networking Requirements
On the network shown in Figure 5-42, routers run OSPF and GTSM is enabled on
RouterA, RouterB, and RouterC.
RouterB
Virtual Link
GE1/0/0
192.168.1.2/24
Area0 GE2/0/0
192.168.2.2/24
Virtual Link
RouterC
Area1
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure OSPF.
2. Enable GTSM on each router and specify a valid TTL range for packets.
Procedure
Step 1 Configure an IP address for each interface.
# Configure IP addresses for all interfaces of RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.1.1 255.255.255.0
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 192.168.2.1 255.255.255.0
[RouterA-GigabitEthernet2/0/0] quit
[RouterA] interface gigabitethernet 3/0/0
[RouterA-GigabitEthernet3/0/0] ip address 10.1.1.1 255.0.0.0.0
[RouterA-GigabitEthernet3/0/0] quit
# On RouterA, set the maximum valid TTL range for packets from RouterA to
other routers is 255 to 255.
[RouterA] ospf valid-ttl-hops 1
# On RouterB, set the maximum valid TTL range for packets from RouterB to
other routers is 254 to 255.
[RouterB] ospf valid-ttl-hops 2
# On RouterC, set the maximum valid TTL range for packets from RouterC to
other routers is 254 to 255.
[RouterC] ospf valid-ttl-hops 2
# On Router C, run the display gtsm statistics all command. You can view GTSM
statistics on RouterC. The default behavior is pass, no illegal packets exist, and the
number of discarded packets is 0.
<RouterC> display gtsm statistics all
GTSM Statistics Table
----------------------------------------------------------------
SlotId Protocol Total Counters Drop Counters Pass Counters
----------------------------------------------------------------
0 BGP 0 0 0
0 BGPv6 0 0 0
0 OSPF 0 0 0
0 LDP 0 0 0
1 BGP 0 0 0
1 BGPv6 0 0 0
1 OSPF 0 0 0
1 LDP 0 0 0
2 BGP 0 0 0
2 BGPv6 0 0 0
2 OSPF 0 0 0
2 LDP 0 0 0
3 BGP 0 0 0
3 BGPv6 0 0 0
3 OSPF 0 0 0
3 LDP 0 0 0
----------------------------------------------------------------
----End
Configuration files
● Configuration file of RouterA
#
sysname RouterA
#
router id 1.1.1.1
#
interface GigabitEthernet1/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 10.1.1.1 255.0.0.0
#
ospf 1
area 0.0.0.0
network 10.0.0.0 0.255.255.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
ospf valid-ttl-hops 1
#
return
● Configuration file of RouterB
#
sysname RouterB
#
router id 2.2.2.2
#
interface GigabitEthernet1/0/0
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
#
ospf valid-ttl-hops 2
#
return
● Configuration file of RouterC
#
sysname RouterC
#
router id 3.3.3.3
#
interface GigabitEthernet2/0/0
ip address 192.168.2.2 255.255.255.0
#
ospf 1
area 0.0.0.1
network 192.168.2.0 0.0.0.255
#
ospf valid-ttl-hops 2
#
return
● Configuration file of RouterD
#
sysname RouterD
#
router id 4.4.4.4
#
interface GigabitEthernet1/0/0
ip address 10.1.1.2 255.0.0.0
#
ospf 1
area 0.0.0.0
network 10.0.0.0 0.255.255.255
#
return
Procedure
Step 1 Check whether the physical status and protocol status of interfaces on both ends
are Up and stable, whether packets are lost on the interfaces, and whether the
two devices can ping each other with large packets.
If the physical status of the interfaces is not Up or unstable (interfaces flap for
example), check the physical link and link layer protocol and ensure that the
physical status and protocol status of the interfaces are Up and the interfaces
have no error packet statistics.
You can perform a ping test for a long time to check whether packets are lost on
the interfaces and ping with large packets (longer than 1500 bytes) to check
whether the two devices can ping each other with large packets.
Step 2 Check whether the two devices have the same OSPF process router ID.
Run the display ospf [ process-id ] brief command on the two devices to check
the OSPF process router ID.
If the two devices have the same OSPF process router ID, run the ospf [ process-
id ] router-id router-id command in the system view to change the OSPF process
router ID and ensure that the two devices have different OSPF process router IDs.
After changing the OSPF process router ID, you must run the reset ospf [ process-
id ] process command in the user view to make the configured router ID take
effect.
Step 3 Check whether the two devices have the same OSPF area ID.
Run the display ospf [ process-id ] brief command on the two devices to check
the OSPF area ID.
If the two devices have different OSPF area IDs, run the area area-id command in
the OSPF view to change the OSPF area ID and ensure that the two devices have
the same OSPF area ID.
Step 4 Check whether OSPF interfaces on both ends have the same network type.
Run the display ospf [ process-id ] interface command on the two devices to
check the OSPF interface network type.
The network types of the OSPF interfaces on both ends of a link must be the
same; otherwise, the two interfaces cannot establish an OSPF neighbor
relationship.
● When the network type of an OSPF interface on one end is broadcast and
that of an OSPF interface on the other end is P2P, the two interfaces can still
establish an OSPF neighbor relationship but cannot learn routing information
from each other.
● When the network type of an OSPF interface on one end is P2MP and that of
an OSPF interface on the other end is P2P, the two interfaces can still
establish an OSPF neighbor relationship but cannot learn routing information
from each other. To ensure that the two interfaces learn routing information
from each other, configure the same interval for sending hello packets and
same neighbor holddown time on the two interfaces.
If the network types of the two OSPF interfaces are different, run the ospf
network-type { broadcast | nbma | p2mp | p2p } command in the OSPF interface
view to change the OSPF interface network type and ensure that the two OSPF
interfaces have the same network type.
NOTE
If the network types of OSPF interfaces on both ends are both NBMA, you must run the
peer ip-address [ dr-priority priority ] command in the OSPF view to configure NBMA
neighbors.
Step 5 Check whether OSPF interfaces on both ends have the same IP address mask.
Run the display current-configuration interface interface-type interface-number
command on the two devices to check the IP address of the specified OSPF
interface.
The IP address masks of the OSPF interfaces on both ends of a link must be the
same; otherwise, the two interfaces cannot establish an OSPF neighbor
relationship. On a P2MP network, however, you can run the ospf p2mp-mask-
ignore command in the OSPF interface view to disable a device from checking the
network mask so that an OSPF neighbor relationship can be established.
If the two OSPF interfaces have different IP address masks, run the ip address ip-
address { mask | mask-length } command in the OSPF interface view to change
the IP address mask and ensure that the two OSPF interfaces have the same IP
address mask.
Step 6 Check whether IP addresses of OSPF interfaces on both ends belong to the
network segment specified by the network command.
Run the display current-configuration interface interface-type interface-number
command on devices on both ends to check IP addresses of OSPF interfaces on
both ends and run the display current-configuration configuration ospf
command on the two devices to check the OSPF process configuration.
OSPF can run on an interface only when the following conditions are met:
● The mask length of the IP address of the interface is longer than or equal to
that specified by the network command. OSPF uses reverse mask. For
example 0.0.0.255 indicates that the mask length is 24 bits.
If the IP address of the interface does not meet the preceding conditions, run the
ip address ip-address { mask | mask-length } command in the OSPF-enabled
interface view to change the IP address of the interface or run the network
command in the view of the area that the OSPF process belongs to change the
configured network segment so that the IP address of the interface can meet the
preceding conditions.
Step 7 Check whether the DR priorities of OSPF interfaces on both ends are both 0.
Run the display ospf [ process-id ] interface command on the two devices to
check the OSPF interface DR priority.
If the DR priorities of the two OSPF interfaces are both 0, run the ospf dr-priority
priority command in the OSPF interface view to change the DR priority and ensure
that there is at least one OSPF interface of which the DR priority is not 0.
----End
Symptom
When the link is normal, OSPF cannot find routes of a non-local area.
Procedure
Step 1 Check whether the area where the device resides is connected to the backbone
area.
Run the display ospf [ process-id ] brief command on the ABR in the area where
the device resides to check area configuration.
OSPF requires that all non-backbone areas remain connected to the backbone
area.
If no backbone area information is configured on the ABR, run the area area-id
command in the OSPF view to modify the OSPF area information. Ensure that at
least one interface on the ABR runs in the backbone area.
NOTE
If some non-backbone areas cannot be connected to the backbone area due to networking
restrictions, configure OSPF virtual links to resolve this problem.
Step 2 Check whether the area where the device resides is a totally stub area.
If you specify the parameter no-summary (run the stub no-summary command
in the OSPF area view) when configuring a non-backbone area as a stub area on
the ABR, the area is configured as a totally stub area.
A totally stub area allows only intra-area routes to be advertised within the area.
If the area where the device resides is configured as a totally stub area, perform
the following configuration based on service requirements:
● To restore the totally stub area to a common area, run the undo stub
command in the OSPF area view on all devices in the area.
● To restore a totally stub area to a stub area, run the undo stub command in
the OSPF area view on the ABR in the area and then run the stub command.
Step 3 Check whether the area where the device resides is a totally NSSA.
Run the display current-configuration configuration ospf [ process-id ]
command on the device to check the OSPF process configuration.
If you specify the parameter no-summary (run the nssa no-summary command
in the OSPF area view) when configuring a non-backbone area as an NSSA on the
ABR, the area is configured as a totally NSSA.
A totally NSSA allows only intra-area routes to be advertised within the area.
If the area where the device resides is configured as a totally NSSA, perform the
following configuration based on service requirements:
● To restore the totally NSSA to a common area, run the undo nssa command
in the OSPF area view on all devices in the area.
● To restore a totally NSSA to a stub area, run the undo nssa command in the
OSPF area view on the ABR in the area and then run the nssa command.
----End
ranging from 0 to 15. A hop count of 16 or greater is defined as infinite. That is,
the destination network or host is unreachable.
An interface does not add the cost to RIP routes to be received, but increases the
cost by 1 for the sent RIP routes. You can run the following commands to change
the cost of routes:
● After you run the rip metricin command, the AR adds an additional metric to
a received route, and then adds the route to the routing table. Then the
metric of the route changes in the routing table. This command affects route
selection on the local device and other devices.
● After you run the rip metricout command, the AR adds an additional metric
to a route when advertising the route. The metric of the route, however, does
not change in the routing table. This command does not affect route selection
on the local device, but affects route selection on other devices.
NOTE
You can run one of the following commands to set the metric of the imported routes. The
following commands are listed in descending order of priority:
● Run the apply cost command to set the route cost.
● Run the import-route (RIP) command to set the cost for imported routes.
● Run the default-cost (RIP) command to set the cost for default routes.
The link cost of an IS-IS interface can be calculated in the following modes in
descending order of priority:
● Run the isis cost command to set the link cost for a specified IS-IS interface.
● Run the circuit-cost command to set the link cost for all IS-IS interfaces.
● Run the auto-cost enable command to enable automatic calculation of the
link cost of an interface.
Before using the auto-cost enable command, run the bandwidth-reference
command to set the bandwidth reference value. By default, the bandwidth
reference value is 100 Mbit/s. The bandwidth reference value takes effect only
when the cost type is wide or wide-compatible. The cost of each interface is
calculated as follows:
– Cost of each interface = (Bandwidth reference value/Interface bandwidth)
x 10
If the cost type is narrow, narrow-compatible, or compatible, the cost of each
interface can be obtained from Table 5-23.
Table 5-23 Relationship between the IS-IS interface cost and interface
bandwidth
NOTE
A Level-1 router in the Level-1 area must communicate with a router outside the Level-1
area through the default route generated on the Level-1-2 router. Therefore, the cost of the
route from the Level-1 router to the router outside the Level-1 area is the cost of the route
from the Level-1 router to the closest Level-1-2 router.
IS-IS can be configured to specify the cost for the imported route or retain the original cost
of the imported route.
NOTE
Packets between a stub router (or totally stub router) and a router outside an AS and
packets between areas are forwarded through the default route generated on the closest
ABR. Therefore, the cost of the route from the stub router (or totally stub router) to the
router outside the AS and the cost of an inter-area route is the cost of the route from the
stub router (or totally stub router) to the closest ABR. Similarly, the cost of the route from
an NSSA router to a router in another area or AS is the cost of the route from the NSSA
router to the closest ABR or ASBR.
5.26.4 How Can I Set the cost Value When OSPF Imports
External Routes?
When OSPF imports external routes, the cost of original routes is not used. By
default, the cost of the external routes imported by OSPF is 1.
To change the default cost value of external routes imported by OSPF, run the
default { cost { cost | inherit-metric } command. In the preceding command:
● cost: specifies the cost of the imported external routes. The value is an integer
ranging from 0 to 16777214.
● inherit-metric: indicates that the cost of the imported external routes is the
cost carried in the route.
To set the preference of an OSPF route in the specified process, run the preference
[ ase ] { preference | route-policy route-policy-name } * command. The default
preference of an OSPF route is 10. When an ASE is specified, the default value is 150.
2. When the protocol preferences of the two processes are the same, the RM
module compares the cost of the two routes. The route with smaller cost
value is selected as the optimal route.
NOTE
When selecting the optimal route, the RM module first compares the protocol
preference. The RM module compares the cost of routes only when the protocol
preferences are the same.