05-Layer 3-IP Routing Configuration Guide

HomeSupportResource CenterH3C S12500-X & S12500X-AF Switch Series Configuration Guides(R115x)-6W10205-Layer 3-IP Routing Configuration Guide
04-OSPF configuration
Title Size Download
04-OSPF configuration 815.01 KB

Contents

Configuring OSPF· 1

Overview·· 1

OSPF packets· 1

LSA types· 1

OSPF areas· 2

Router types· 4

Route types· 5

Route calculation· 5

OSPF network types· 6

DR and BDR·· 6

Protocols and standards· 7

OSPF configuration task list 7

Enabling OSPF· 9

Configuration prerequisites· 9

Configuration guidelines· 9

Enabling OSPF on a network· 9

Enabling OSPF on an interface· 10

Configuring OSPF areas· 10

Configuring a stub area· 10

Configuring an NSSA area· 11

Configuring a virtual link· 12

Configuring OSPF network types· 12

Configuration prerequisites· 12

Configuring the broadcast network type for an interface· 13

Configuring the NBMA network type for an interface· 13

Configuring the P2MP network type for an interface· 14

Configuring the P2P network type for an interface· 14

Configuring OSPF route control 14

Configuration prerequisites· 14

Configuring OSPF route summarization· 15

Configuring received OSPF route filtering· 16

Configuring Type-3 LSA filtering· 16

Configuring an OSPF cost for an interface· 17

Configuring the maximum number of ECMP routes· 17

Configuring OSPF preference· 18

Configuring OSPF route redistribution· 18

Advertising a host route· 19

Tuning and optimizing OSPF networks· 20

Configuration prerequisites· 20

Configuring OSPF timers· 20

Specifying LSA transmission delay· 21

Specifying SPF calculation interval 21

Specifying the LSA arrival interval 22

Specifying the LSA generation interval 22

Disabling interfaces from receiving and sending OSPF packets· 23

Configuring stub routers· 23

Configuring OSPF authentication· 24

Adding the interface MTU into DD packets· 24

Configuring a DSCP value for OSPF packets· 25

Configuring the maximum number of external LSAs in LSDB· 25

Configuring OSPF exit overflow interval 25

Enabling compatibility with RFC 1583· 26

Logging neighbor state changes· 26

Configuring OSPF network management 26

Configuring the LSU transmit rate· 27

Enabling OSPF ISPF· 28

Configuring prefix suppression· 28

Configuring prefix prioritization· 29

Configuring OSPF PIC·· 29

Configuring the number of OSPF logs· 30

Configuring OSPF GR·· 30

Configuring the OSPF GR restarter 30

Configuring OSPF GR helper 31

Triggering OSPF GR·· 32

Configuring OSPF NSR·· 32

Configuring BFD for OSPF· 33

Configuring bidirectional control detection· 33

Configuring single-hop echo detection· 33

Configuring OSPF FRR·· 33

Configuration prerequisites· 34

Configuration guidelines· 34

Configuration procedure· 34

Enabling the device to advertise OSPF link state information to BGP· 35

Displaying and maintaining OSPF· 36

OSPF configuration examples· 37

Basic OSPF configuration example· 37

OSPF route redistribution configuration example· 40

OSPF summary route advertisement configuration example· 41

OSPF stub area configuration example· 44

OSPF NSSA area configuration example· 47

OSPF DR election configuration example· 49

OSPF virtual link configuration example· 53

OSPF GR configuration example· 55

OSPF NSR configuration example· 57

BFD for OSPF configuration example· 59

OSPF FRR configuration example· 62

Troubleshooting OSPF configuration· 64

No OSPF neighbor relationship established· 64

Incorrect routing information· 64


Configuring OSPF

Open Shortest Path First (OSPF) is a link-state IGP developed by the OSPF working group of the IETF. OSPF version 2 is used for IPv4. OSPF refers to OSPFv2 throughout this chapter.

Overview

OSPF has the following features:

·          Wide scope—Supports various network sizes and up to several hundred routers in an OSPF routing domain.

·          Fast convergenceAdvertises routing updates instantly upon network topology changes.

·          Loop free—Computes routes with the SPF algorithm to avoid routing loops.

·          Area-based network partition—Splits an AS into multiple areas to facilitate management. This feature reduces the LSDB size on routers to save memory and CPU resources, and reduces route updates transmitted between areas to save bandwidth.

·          ECMP routing—Supports multiple equal-cost routes to a destination.

·          Routing hierarchy—Supports a 4-level routing hierarchy that prioritizes routes into intra-area, inter-area, external Type-1, and external Type-2 routes.

·          Authentication—Supports area- and interface-based packet authentication to ensure secure packet exchange.

·          Support for multicasting—Multicasts protocol packets on some types of links to avoid impacting other devices.

OSPF packets

OSPF messages are carried directly over IP. The protocol number is 89.

OSPF uses the following packet types:

·          Hello—Periodically sent to find and maintain neighbors, containing timer values, information about the DR, BDR, and known neighbors.

·          Database description (DD)—Describes the digest of each LSA in the LSDB, exchanged between two routers for data synchronization.

·          Link state request (LSR)—Requests needed LSAs from a neighbor. After exchanging the DD packets, the two routers know which LSAs of the neighbor are missing from their LSDBs. They then exchange LSR packets requesting the missing LSAs. LSR packets contain the digest of the missing LSAs.

·          Link state update (LSU)—Transmits the requested LSAs to the neighbor.

·          Link state acknowledgment (LSAck)—Acknowledges received LSU packets. It contains the headers of received LSAs (an LSAck packet can acknowledge multiple LSAs).

LSA types

OSPF advertises routing information in Link State Advertisements (LSAs). The following LSAs are commonly used:

·          Router LSA—Type-1 LSA, originated by all routers and flooded throughout a single area only. This LSA describes the collected states of the router's interfaces to an area.

·          Network LSA—Type-2 LSA, originated for broadcast and NBMA networks by the designated router, and flooded throughout a single area only. This LSA contains the list of routers connected to the network.

·          Network Summary LSA—Type-3 LSA, originated by Area Border Routers (ABRs), and flooded throughout the LSA's associated area. Each summary-LSA describes a route to a destination outside the area, yet still inside the AS (an inter-area route).

·          ASBR Summary LSA—Type-4 LSA, originated by ABRs and flooded throughout the LSA's associated area. Type 4 summary-LSAs describe routes to Autonomous System Boundary Router (ASBR).

·          AS External LSA—Type-5 LSA, originated by ASBRs, and flooded throughout the AS (except stub and NSSA areas). Each AS-external-LSA describes a route to another AS.

·          NSSA LSA—Type-7 LSA, as defined in RFC 1587, originated by ASBRs in NSSAs and flooded throughout a single NSSA. NSSA LSAs describe routes to other ASs.

·          Opaque LSA—A proposed type of LSA. Its format consists of a standard LSA header and application specific information. Opaque LSAs are used by the OSPF protocol or by some applications to distribute information into the OSPF routing domain. The opaque LSA includes Type 9, Type 10, and Type 11. The Type 9 opaque LSA is flooded into the local subnet, the Type 10 is flooded into the local area, and the Type 11 is flooded throughout the AS.

OSPF areas

In large OSPF routing domains, SPF route computations consume too many storage and CPU resources, and enormous OSPF packets generated for route synchronization occupy excessive bandwidth.

To resolve these issues, OSPF splits an AS into multiple areas. Each area is identified by an area ID. The boundaries between areas are routers rather than links. A network segment (or a link) can only reside in one area as shown in Figure 1.

You can configure route summarization on ABRs to reduce the number of LSAs advertised to other areas and minimize the effect of topology changes.

Figure 1 Area-based OSPF network partition

 

Backbone area and virtual links

Each AS has a backbone area that distributes routing information between non-backbone areas. Routing information between non-backbone areas must be forwarded by the backbone area. OSPF has the following requirements:

·          All non-backbone areas must maintain connectivity to the backbone area.

·          The backbone area must maintain connectivity within itself.

In practice, these requirements might not be met due to lack of physical links. OSPF virtual links can solve this issue.

A virtual link is established between two ABRs through a non-backbone area. It must be configured on both ABRs to take effect. The non-backbone area is called a transit area.

As shown in Figure 2, Area 2 has no direct physical link to the backbone Area 0. You can configure a virtual link between the two ABRs to connect Area 2 to the backbone area.

Figure 2 Virtual link application 1

 

Virtual links can also be used to provide redundant links. If the backbone area cannot maintain internal connectivity because of the failure of a physical link, you can configure a virtual link to replace the failed physical link, as shown in Figure 3.

Figure 3 Virtual link application 2

 

The virtual link between the two ABRs acts as a point-to-point connection. You can configure interface parameters, such as hello interval, on the virtual link as they are configured on a physical interface.

The two ABRs on the virtual link unicast OSPF packets to each other, and the OSPF routers in between convey these OSPF packets as normal IP packets.

Stub area and totally stub area

A stub area does not distribute Type-5 LSAs to reduce the routing table size and LSAs advertised within the area. The ABR of the stub area advertises a default route in a Type-3 LSA so that the routers in the area can reach external networks through the default route.

To further reduce the routing table size and advertised LSAs, you can configure the stub area as a totally stub area. The ABR of a totally stub area does no advertise inter-area routes or external routes. It advertises a default route in a Type-3 LSA so that the routers in the area can reach external networks through the default route.

NSSA area and totally NSSA area

An NSSA area does not import AS external LSAs (Type-5 LSAs) but can import Type-7 LSAs generated by the NSSA ASBR. The NSSA ABR translates Type-7 LSAs into Type-5 LSAs and advertises the Type-5 LSAs to other areas.

As shown in Figure 4, the OSPF AS contains Area 1, Area 2, and Area 0. The other two ASs run RIP. Area 1 is an NSSA area where the ASBR redistributes RIP routes in Type-7 LSAs into Area 1. Upon receiving the Type-7 LSAs, the NSSA ABR translates them to Type-5 LSAs, and advertises the Type-5 LSAs to Area 0.

The ASBR of Area 2 redistributes RIP routes in Type-5 LSAs into the OSPF routing domain. However, Area 1 does not receive Type-5 LSAs because it is an NSSA area.

Figure 4 NSSA area

 

Router types

OSPF routers are classified into the following types based on their positions in the AS:

·          Internal routerAll interfaces on an internal router belong to one OSPF area.

·          ABRBelongs to more than two areas, one of which must be the backbone area. ABR connects the backbone area to a non-backbone area. An ABR and the backbone area can be connected through a physical or logical link.

·          Backbone router—At least one interface of a backbone router must reside in the backbone area. All ABRs and internal routers in Area 0 are backbone routers.

·          ASBR—Exchanges routing information with another AS is an ASBR. An ASBR might not reside on the border of the AS. It can be an internal router or an ABR.

Figure 5 OSPF router types

 

Route types

OSPF prioritizes routes into the following route levels:

·          Intra-area route

·          Inter-area route

·          Type-1 external route

·          Type-2 external route

The intra-area and inter-area routes describe the network topology of the AS. The external routes describe routes to external ASs.

A Type-1 external route has high credibility. The cost from a router to the destination of a Type-1 external route = the cost from the router to the corresponding ASBR + the cost from the ASBR to the destination of the external route.

A Type-2 external route has low credibility. OSPF considers the cost from the ASBR to the destination of a Type-2 external route is much greater than the cost from the ASBR to an OSPF internal router. The cost from the internal router to the destination of the Type-2 external route = the cost from the ASBR to the destination of the Type-2 external route. If two Type-2 routes to the same destination have the same cost, OSPF takes the cost from the router to the ASBR into consideration to determine the best route.

Route calculation

OSPF computes routes in an area as follows:

·          Each router generates LSAs based on the network topology around itself, and sends them to other routers in update packets.

·          Each OSPF router collects LSAs from other routers to compose an LSDB. An LSA describes the network topology around a router, and the LSDB describes the entire network topology of the area.

·          Each router transforms the LSDB to a weighted directed graph that shows the topology of the area. All the routers within the area have the same graph.

·          Each router uses the SPF algorithm to compute a shortest path tree that shows the routes to the nodes in the area. The router itself is the root of the tree.

OSPF network types

OSPF classifies networks into the following types, depending on different link layer protocols:

·          Broadcast—If the link layer protocol is Ethernet or FDDI, OSPF considers the network type as broadcast by default. On a broadcast network, hello, LSU, and LSAck packets are multicast to 224.0.0.5 that identifies all OSPF routers or to 224.0.0.6 that identifies the DR; DD packets and LSR packets are unicast.

·          NBMA—If the link layer protocol is Frame Relay, ATM, or X.25, OSPF considers the network type as NBMA by default. OSPF packets are unicast on a NBMA network.

·          P2MPNo link is P2MP type by default. P2MP must be a conversion from other network types such as NBMA. On a P2MP network, OSPF packets are multicast to 224.0.0.5.

·          P2P—If the link layer protocol is PPP or HDLC, OSPF considers the network type as P2P. On a P2P network, OSPF packets are multicast to 224.0.0.5.

The following are the differences between NBMA and P2MP networks:

·          NBMA networks are fully meshed. P2MP networks are not required to be fully meshed.

·          NBMA networks require DR and BDR election. P2MP networks do not have DR or BDR.

·          On a NBMA network, OSPF packets are unicast, and neighbors are manually configured. On a P2MP network, OSPF packets are multicast by default, and you can configure OSPF to unicast protocol packets.

DR and BDR

DR and BDR mechanism

On a broadcast or NBMA network, any two routers must establish an adjacency to exchange routing information with each other. If n routers are present on the network, n(n-1)/2 adjacencies are established. Any topology change on the network results in an increase in traffic for route synchronization, consuming many system and bandwidth resources.

The DR and BDR mechanisms can solve this problem.

·          DR—Elected to advertise routing information among other routers. If the DR fails, routers on the network must elect another DR and synchronize information with the new DR. Using this mechanism alone is time-consuming and prone to route calculation errors.

·          BDR—Elected along with the DR to establish adjacencies with all other routers. If the DR fails, the BDR immediately becomes the new DR, and other routers elect a new BDR.

Routers other than the DR and BDR are called "DROthers." They do not establish adjacencies with one another, so the number of adjacencies is reduced.

The role of a router is subnet (or interface) specific. It might be a DR on one interface and a BDR or DROther on another interface.

As shown in Figure 6, solid lines are Ethernet physical links, and dashed lines represent OSPF adjacencies. With the DR and BDR, only seven adjacencies are established.

Figure 6 DR and BDR in a network

 

 

NOTE:

In OSPF, "neighbor" and "adjacency" are different concepts. After startup, OSPF sends a hello packet on each OSPF interface. A receiving router checks parameters in the packet. If the parameters match its own, the receiving router considers the sending router an OSPF neighbor. Two OSPF neighbors establish an adjacency relationship after they synchronize their LSDBs through exchange of DD packets and LSAs.

 

DR and BDR election

DR election is performed on broadcast or NBMA networks but not on P2P and P2MP networks.

Routers in a broadcast or NBMA network elect the DR and BDR by router priority and ID. Routers with a router priority value higher than 0 are candidates for DR and BDR election.

The election votes are hello packets. Each router sends the DR elected by itself in a hello packet to all the other routers. If two routers on the network declare themselves as the DR, the router with the higher router priority wins. If router priorities are the same, the router with the higher router ID wins.

If a router with a higher router priority is added to the network after DR and BDR election, the router cannot become the DR or BDR immediately as no DR election is performed for it. Therefore, the DR of a network might not be the router with the highest priority, and the BDR might not be the router with the second highest priority.

Protocols and standards

·          RFC 1765, OSPF Database Overflow

·          RFC 2328, OSPF Version 2

·          RFC 3101, OSPF Not-So-Stubby Area (NSSA) Option

·          RFC 3137, OSPF Stub Router Advertisement

·          RFC 4811, OSPF Out-of-Band LSDB Resynchronization

·          RFC 4812, OSPF Restart Signaling

·          RFC 4813, OSPF Link-Local Signaling

OSPF configuration task list

To run OSPF, you must first enable OSPF on the router. Make a proper configuration plan to avoid incorrect settings that can result in route blocking and routing loops.

To configure OSPF, perform the following tasks:

 

Tasks at a glance

(Required.) Enabling OSPF

(Optional.) Configuring OSPF areas:

·         Configuring a stub area

·         Configuring an NSSA area

·         Configuring a virtual link

(Optional.) Configuring OSPF network types:

·         Configuring the broadcast network type for an interface

·         Configuring the NBMA network type for an interface

·         Configuring the P2MP network type for an interface

·         Configuring the P2P network type for an interface

(Optional.) Configuring OSPF route control:

·         Configuring OSPF route summarization

¡  Configuring route summarization on an ABR

¡  Configuring route summarization when redistributing routes into OSPF on an ASBR

·         Configuring received OSPF route filtering

·         Configuring Type-3 LSA filtering

·         Configuring an OSPF cost for an interface

·         Configuring the maximum number of ECMP routes

·         Configuring OSPF preference

·         Configuring OSPF route redistribution

¡  Configuring OSPF to redistribute routes from another routing protocol

¡  Configuring OSPF to redistribute a default route

¡  Configuring default parameters for redistributed routes

·         Advertising a host route

(Optional.) Tuning and optimizing OSPF networks:

·         Configuring OSPF timers

·         Specifying LSA transmission delay

·         Specifying SPF calculation interval

·         Specifying the LSA arrival interval

·         Specifying the LSA generation interval

·         Disabling interfaces from receiving and sending OSPF packets

·         Configuring stub routers

·         Configuring OSPF authentication

·         Adding the interface MTU into DD packets

·         Configuring a DSCP value for OSPF packets

·         Configuring the maximum number of external LSAs in LSDB

·         Configuring OSPF exit overflow interval

·         Enabling compatibility with RFC 1583

·         Logging neighbor state changes

·         Configuring OSPF network management

·         Configuring the LSU transmit rate

·         Enabling OSPF ISPF

·         Configuring prefix suppression

·         Configuring prefix prioritization

·         Configuring OSPF PIC

·         Configuring the number of OSPF logs

(Optional.) Configuring OSPF GR

·         Configuring the OSPF GR restarter

·         Configuring OSPF GR helper

·         Triggering OSPF GR

(Optional.) Configuring OSPF NSR

(Optional.) Configuring BFD for OSPF

(Optional.) Configuring OSPF FRR

(Optional.) Enabling the device to advertise OSPF link state information to BGP

 

Enabling OSPF

Enable OSPF before you perform other OSPF configuration tasks.

Configuration prerequisites

Configure the link layer protocol and IP addresses for interfaces to ensure IP connectivity between neighboring nodes.

Configuration guidelines

To enable OSPF on an interface, you can enable OSPF on the network where the interface resides or directly enable OSPF on that interface. If you configure both, the latter takes precedence.

You can specify a global router ID, or specify a router ID when you create an OSPF process:

·          If you specify a router ID when you create an OSPF process, any two routers in an AS must have different router IDs. A common practice is to specify the IP address of an interface as the router ID.

·          If you specify no router ID when you create the OSPF process, the global router ID is used. As a best practice, specify a router ID when you create the OSPF process.

Enabling OSPF on a network

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       (Optional.) Configure a global router ID.

router id router-id

By default, no global router ID is configured.

If no global router ID is configured, the highest loopback interface IP address, if any, is used as the router ID. If no loopback interface IP address is available, the highest physical interface IP address is used, regardless of the interface status (up or down).

3.       Enable an OSPF process and enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

By default, OSPF is disabled.

4.       (Optional.) Configure a description for the OSPF process.

description description

By default, no description is configured for the OSPF process.

As a best practice, configure a description for each OSPF process.

5.       Create an OSPF area and enter OSPF area view.

area area-id

By default, no OSPF area is created.

6.       (Optional.) Configure a description for the area.

description description

By default, no description is configured for the area.

As a best practice, configure a description for each OSPF area.

7.       Specify a network to enable the interface attached to the network to run the OSPF process in the area.

network ip-address wildcard-mask

By default, no network is specified.

A network can be added to only one area.

 

Enabling OSPF on an interface

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Enable an OSPF process on the interface.

ospf process-id area area-id [ exclude-subip ]

By default, OSPF is disabled on an interface.

If the specified OSPF process and area do not exist, the command creates the OSPF process and area. Disabling an OSPF process on an interface does not delete the OSPF process or the area.

 

Configuring OSPF areas

Before you configure an OSPF area, perform the following tasks:

·          Configure IP addresses for interfaces to ensure IP connectivity between neighboring nodes.

·          Enable OSPF.

Configuring a stub area

You can configure a non-backbone area at an AS edge as a stub area. To do so, issue the stub command on all routers attached to the area. The routing table size is reduced because Type-5 LSAs will not be flooded within the stub area. The ABR generates a default route into the stub area so all packets destined outside of the AS are sent through the default route.

To further reduce the routing table size and routing information exchanged in the stub area, configure a totally stub area by using the stub [ no-summary ] command on the ABR. AS external routes and inter-area routes will not be distributed into the area. All the packets destined outside of the AS or area will be sent to the ABR for forwarding.

A stub or totally stub area cannot have an ASBR because external routes cannot be distributed into the area.

To configure an OSPF stub area:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enter area view.

area area-id

N/A

4.       Configure the area as a stub area.

stub [ default-route-advertise-always | no-summary ] *

By default, no stub area is configured.

5.       (Optional.) Specify a cost for the default route advertised to the stub area.

default-cost cost

The default setting is 1.

The default-cost cost command takes effect only on the ABR of a stub area or totally stub area.

 

Configuring an NSSA area

A stub area cannot import external routes, but an NSSA area can import external routes into the OSPF routing domain while retaining other stub area characteristics.

Do not configure the backbone area as an NSSA area or totally NSSA area.

To configure an NSSA area, configure the nssa command on all the routers attached to the area.

To configure a totally NSSA area, configure the nssa command on all the routers attached to the area and configure the nssa no-summary command on the ABR. The ABR of a totally NSSA area does not advertise inter-area routes into the area.

To configure an NSSA area:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enter area view.

area area-id

N/A

4.       Configure the area as an NSSA area.

nssa [ default-route-advertise [ cost cost | nssa-only | route-policy route-policy-name | type type ] * | no-import-route | no-summary | suppress-fa | [ translate-always | translate-never ] | translator-stability-interval value ] *

By default, no area is configured as an NSSA area.

5.       (Optional.) Specify a cost for the default route advertised to the NSSA area.

default-cost cost

The default setting is 1.

This command takes effect only on the ABR/ASBR of an NSSA or totally NSSA area.

 

Configuring a virtual link

Virtual links are configured for connecting backbone area routers that have no direct physical links.

To configure a virtual link:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enter area view.

area area-id

N/A

4.       Configure a virtual link.

vlink-peer router-id [ dead seconds | hello seconds | { { hmac-md5 | md5 } key-id { cipher cipher-string | plain plain-string } | simple { cipher cipher-string | plain plain-string } } | retransmit seconds | trans-delay seconds ] *

By default, no virtual link is configured.

Configure this command on both ends of a virtual link, and the hello and dead intervals must be identical on both ends of the virtual link.

 

Configuring OSPF network types

OSPF classifies networks into the following types based on the link layer protocol:

·          BroadcastWhen the link layer protocol is Ethernet or FDDI, OSPF classifies the network type as broadcast by default.

·          NBMAWhen the link layer protocol is Frame Relay, ATM, or X.25, OSPF classifies the network type as NBMA by default.

·          P2PWhen the link layer protocol is PPP, LAPB, or HDLC, OSPF classifies the network type as P2P by default.

When you change the network type of an interface, follow these guidelines:

·          When an NBMA network becomes fully meshed, change the network type to broadcast to avoid manual configuration of neighbors.

·          If any routers in a broadcast network do not support multicasting, change the network type to NBMA.

·          An NBMA network must be fully meshed. OSPF requires that an NBMA network be fully meshed. If a network is partially meshed, change the network type to P2MP.

·          If a router on an NBMA network has only one neighbor, you can change the network type to P2P to save costs.

Two broadcast-, NBMA-, and P2MP-interfaces can establish a neighbor relationship only when they are on the same network segment.

Configuration prerequisites

Before you configure OSPF network types, perform the following tasks:

·          Configure IP addresses for interfaces to ensure IP connectivity between neighboring nodes.

·          Enable OSPF.

Configuring the broadcast network type for an interface

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Configure the OSPF network type for the interface as broadcast.

ospf network-type broadcast

By default, the network type of an interface depends on the link layer protocol.

4.       (Optional.) Configure a router priority for the interface.

ospf dr-priority priority

The default router priority is 1.

 

Configuring the NBMA network type for an interface

After you configure the network type as NBMA, you must specify neighbors and their router priorities because NBMA interfaces cannot find neighbors by broadcasting hello packets.

To configure the NBMA network type for an interface:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Configure the OSPF network type for the interface as NBMA.

ospf network-type nbma

By default, the network type of an interface depends on the link layer protocol.

4.       (Optional.) Configure a router priority for the interface.

ospf dr-priority priority

The default setting is 1.

The router priority configured with this command is for DR election.

5.       Return to system view.

quit

N/A

6.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

7.       Specify a neighbor and its router priority.

peer ip-address [ cost value | dr-priority dr-priority ]

By default, no neighbor is specified.

The priority configured with this command indicates whether a neighbor has the election right or not. If you configure the router priority for a neighbor as 0, the local router determines the neighbor has no election right, and does not send hello packets to this neighbor. However, if the local router is the DR or BDR, it still sends hello packets to the neighbor for neighbor relationship establishment.

 

Configuring the P2MP network type for an interface

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Configure the OSPF network type for the interface as P2MP.

ospf network-type p2mp [ unicast ]

By default, the network type of an interface depends on the link layer protocol.

After you configure the OSPF network type for an interface as P2MP unicast, all packets are unicast over the interface. The interface cannot broadcast hello packets to discover neighbors, so you must manually specify the neighbors.

4.       Return to system view.

quit

N/A

5.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

6.       (Optional.) Specify a neighbor and its router priority.

peer ip-address [ cost value | dr-priority dr-priority ]

By default, no neighbor is specified.

This step must be performed if the network type is P2MP unicast, and is optional if the network type is P2MP.

 

Configuring the P2P network type for an interface

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Configure the OSPF network type for the interface as P2P.

ospf network-type p2p

[ peer-address-check ]

By default, the network type of an interface depends on the link layer protocol.

 

Configuring OSPF route control

This section describes how to control the advertisement and reception of OSPF routing information, as well as route redistribution from other protocols.

Configuration prerequisites

Before you configure OSPF route control, perform the following tasks:

·          Configure IP addresses for interfaces to ensure IP connectivity between neighboring nodes.

·          Enable OSPF.

·          Configure filters if routing information filtering is needed.

Configuring OSPF route summarization

Configure route summarization on an ABR or ASBR to summarize contiguous networks into a single network and distribute it to other areas.

Route summarization reduces the routing information exchanged between areas and the size of routing tables, and improves routing performance. For example, three internal networks 19.1.1.0/24, 19.1.2.0/24, and 19.1.3.0/24 are available within an area. You can summarize the three networks into network 19.1.0.0/16, and advertise the summary network to other areas.

Configuring route summarization on an ABR

After you configure a summary route on an ABR, the ABR generates a summary LSA instead of more specific LSAs so that the scale of LSDBs on routers in other areas and the influence of topology changes are reduced.

To configure route summarization on an ABR:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enter OSPF area view.

area area-id

N/A

4.       Configure ABR route summarization.

abr-summary ip-address { mask-length | mask } [ advertise | not-advertise ] [ cost cost ]

By default, no route summarization is configured.

The command takes effect only on an ABR.

 

Configuring route summarization when redistributing routes into OSPF on an ASBR

Without route summarization, an ASBR advertises each redistributed route in a separate ASE LSA. After you configure a summary route, the ASBR advertises only the summary route in an ASE LSA instead of more specific routes, reducing the number of LSAs in the LSDB.

The ASBR summarizes redistributed Type-5 LSAs within the specified address range. If the ASBR is in an NSSA area, it also summarizes Type-7 LSAs within the specified address range. If the ASBR is also the ABR, it summarizes Type-5 LSAs translated from Type-7 LSAs.

To configure route summarization when redistributing routes into OSPF on an ASBR:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ]*

N/A

3.       Configure ASBR route summarization.

asbr-summary ip-address { mask-length | mask } [ cost cost | not-advertise | nssa-only | tag tag ] *

By default, no ASBR route summarization is configured.

The command takes effect only on an ASBR.

 

Configuring discard routes for summary networks

Discard routes help prevent routing black holes when route summarization is configured on ABRs and ASBRs.

During route summarization, an ABR or ASBR generates a discard route for the summary network. The destination and output interface of the discard route is the summary network and interface Null 0. When receiving packets destined for a nonexistent network that is a part of the summary network, the ABR or ASBR discards the packets according to the discard route.

For example, Router A summarizes networks 19.1.1.0/24, 19.1.2.0/24, and 19.1.3.0/24 into network 19.1.0.0/16, and advertises the summary network to Router B. When Router B receives a packet destined for 19.1.4.0/24, Router B forwards the packet to Router A according to the summary route. Because no specific route to 19.1.4.0/24 exists, Router A discards the packet according to the discard route.

To configure discard routes for summary networks:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id ] *

N/A

3.       Configure discard routes for summary networks.

discard-route { external { external-preference | suppression } | internal { internal-preference | suppression } } *

By default:

·         The ABR or ASBR generates discard routes for summary networks.

·         The preference of discard routes is 255.

 

Configuring received OSPF route filtering

Perform this task to filter routes calculated using received LSAs.

The following filtering methods are available:

·          Use an ACL or IP prefix list to filter routing information by destination address.

·          Use the gateway keyword to filter routing information by next hop.

·          Use an ACL or IP prefix list to filter routing information by destination address and at the same time use the gateway keyword to filter routing information by next hop.

·          Use a routing policy to filter routing information.

To configure OSPF to filter routes calculated using received LSAs:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure OSPF to filter routes calculated using received LSAs.

filter-policy { acl-number [ gateway prefix-list-name ] | gateway prefix-list-name | prefix-list prefix-list-name [ gateway prefix-list-name ] | route-policy route-policy-name } import

By default, OSPF accepts all routes calculated using received LSAs.

 

Configuring Type-3 LSA filtering

Perform this task to filter Type-3 LSAs advertised to an area on an ABR.

To configure Type-3 LSA filtering:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enter area view.

area area-id

N/A

4.       Configure Type-3 LSA filtering.

filter { acl-number | prefix-list prefix-list-name | route-policy route-policy-name } { export | import }

By default, the ABR does not filter Type-3 LSAs.

 

Configuring an OSPF cost for an interface

Configure an OSPF cost for an interface by using either of the following methods:

·          Configure the cost value in interface view.

·          Configure a bandwidth reference value for the interface. OSPF computes the cost with this formula: Interface OSPF cost = Bandwidth reference value (100 Mbps) / Expected interface bandwidth (Mbps). The expected bandwidth of an interface is configured with the bandwidth command (see Interface Command Reference). If the calculated cost is greater than 65535, the value of 65535 is used. If the calculated cost is less than 1, the value of 1 is used. If no cost or bandwidth reference value is configured for an interface, OSPF computes the interface cost based on the interface bandwidth and default bandwidth reference value.

To configure an OSPF cost for an interface:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Configure an OSPF cost for the interface.

ospf cost value

By default, the OSPF cost is calculated according to the interface bandwidth. For a loopback interface, the OSPF cost is 0 by default.

 

To configure a bandwidth reference value:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure a bandwidth reference value.

bandwidth-reference value

The default setting is 100 Mbps.

 

Configuring the maximum number of ECMP routes

Perform this task to implement load sharing over ECMP routes.

To configure the maximum number of ECMP routes:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the maximum number of ECMP routes.

maximum load-balancing maximum

By default, the maximum number of ECMP routes is 128.

 

Configuring OSPF preference

A router can run multiple routing protocols, and each protocol is assigned a preference. If multiple routes are available to the same destination, the one with the highest protocol preference is selected as the best route.

To configure OSPF preference:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure a preference for OSPF.

preference [ ase ] [ route-policy route-policy-name ] value

By default, the preference of OSPF internal routes is 10 and the preference of OSPF external routes is 150.

 

Configuring OSPF route redistribution

On a router running OSPF and other routing protocols, you can configure OSPF to redistribute routes from other protocols, such as RIP, IS-IS, BGP, static, and direct, and advertise them in Type-5 LSAs or Type-7 LSAs. In addition, you can configure OSPF to filter redistributed routes so that OSPF advertises only permitted routes.

 

IMPORTANT

IMPORTANT:

The import-route bgp command redistributes only EBGP routes. Because the import-route bgp allow-ibgp command redistributes both EBGP and IBGP routes, and might cause routing loops, use it with caution.

 

Configuring OSPF to redistribute routes from another routing protocol

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure OSPF to redistribute routes from another routing protocol.

import-route protocol [ process-id | all-processes | allow-ibgp ] [ cost cost | nssa-only | route-policy route-policy-name | tag tag | type type ] *

By default, no route redistribution is configured.

This command redistributes only active routes. To view information about active routes, use the display ip routing-table protocol command.

4.       (Optional.) Configure OSPF to filter redistributed routes.

filter-policy { acl-number | prefix-list prefix-list-name } export [ protocol [ process-id ] ]

By default, OSPF accepts all redistributed routes.

 

Configuring OSPF to redistribute a default route

The import-route command cannot redistribute a default external route. Perform this task to redistribute a default route.

To redistribute a default route:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Redistribute a default route.

default-route-advertise [ [ [ always | permit-calculate-other ] | cost cost | route-policy route-policy-name | type type ] *

By default, no default route is redistributed.

 

Configuring default parameters for redistributed routes

Perform this task to configure default parameters for redistributed routes, including cost, tag, and type. Tags indicate information about protocols. For example, when redistributing BGP routes, OSPF uses tags to identify AS IDs.

To configure the default parameters for redistributed routes:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the default parameters for redistributed routes (cost, upper limit, tag, and type).

default { cost cost | tag tag | type type } *

By default, the cost is 1, the tag is 1, and the type is Type-2.

 

Advertising a host route

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enter area view.

area area-id

N/A

4.       Advertise a host route.

host-advertise ip-address cost

By default, no host route is advertised.

 

Tuning and optimizing OSPF networks

You can use one of the following methods to optimize an OSPF network:

·          Change OSPF packet timers to adjust the convergence speed and network load. On low-speed links, consider the delay time for sending LSAs.

·          Change the SPF calculation interval to reduce resource consumption caused by frequent network changes.

·          Configure OSPF authentication to improve security.

Configuration prerequisites

Before you configure OSPF network optimization, perform the following tasks:

·          Configure IP addresses for interfaces to ensure IP connectivity between neighboring nodes.

·          Enable OSPF.

Configuring OSPF timers

An OSPF interface includes the following timers:

·          Hello timerInterval for sending hello packets. It must be identical on OSPF neighbors.

·          Poll timerInterval for sending hello packets to a neighbor that is down on the NBMA network.

·          Dead timerInterval within which if the interface receives no hello packet from the neighbor, it declares the neighbor is down.

·          LSA retransmission timerInterval within which if the interface receives no acknowledgement packets after sending a LSA to the neighbor, it retransmits the LSA.

To configure OSPF timers:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Specify the hello interval.

ospf timer hello seconds

By default:

·         The hello interval on P2P and broadcast interfaces is 10 seconds.

·         The hello interval on P2MP and NBMA interfaces is 30 seconds.

 

The default hello interval is restored when the network type for an interface is changed.

4.       Specify the poll interval.

ospf timer poll seconds

The default setting is 120 seconds.

The poll interval is at least four times the hello interval.

5.       Specify the dead interval.

ospf timer dead seconds

By default:

·         The dead interval on P2P and broadcast interfaces is 40 seconds.

·         The dead interval on P2MP and NBMA interfaces is 120 seconds.

The dead interval must be at least four times the hello interval on an interface.

The default dead interval is restored when the network type for an interface is changed.

6.       Specify the retransmission interval.

ospf timer retransmit interval

The default setting is 5 seconds.

A retransmission interval setting that is too small can cause unnecessary LSA retransmissions. This interval is typically set bigger than the round-trip time of a packet between two neighbors.

 

Specifying LSA transmission delay

To avoid LSAs from aging out during transmission, set an LSA retransmission delay especially for low speed links.

To specify the LSA transmission delay on an interface:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Specify the LSA transmission delay.

ospf trans-delay seconds

The default setting is 1 second.

 

Specifying SPF calculation interval

LSDB changes result in SPF calculations. When the topology changes frequently, a large amount of network and router resources are occupied by SPF calculation. You can adjust the SPF calculation interval to reduce the impact.

When network changes are not frequent, the minimum-interval is adopted. If network changes become frequent, the SPF calculation interval is incremented by incremental-interval × 2n-2 (n is the number of calculation times) each time a calculation occurs until the maximum-interval is reached.

To configure the SPF calculation interval:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Specify the SPF calculation interval.

spf-schedule-interval maximum-interval [ minimum-interval [ incremental-interval ] ]

By default:

·         The maximum interval is 5 seconds.

·         The minimum interval is 50 milliseconds.

·         The incremental interval is 200 milliseconds.

 

Specifying the LSA arrival interval

If OSPF receives an LSA that has the same LSA type, LS ID, and router ID as the previously received LSA within the LSA arrival interval, OSPF discards the LSA to save bandwidth and route resources.

To configure the LSA arrival interval:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the LSA arrival interval.

lsa-arrival-interval interval

The default setting is 1000 milliseconds.

Make sure this interval is smaller than or equal to the interval set with the lsa-generation-interval command.

 

Specifying the LSA generation interval

Adjust the LSA generation interval to protect network resources and routers from being overwhelmed by LSAs at the time of frequent network changes.

When network changes are not frequent, LSAs are generated at the minimum-interval. If network changes become frequent, the LSA generation interval is incremented by incremental-interval × 2n-2 (n is the number of generation times) each time a LSA generation occurs until the maximum-interval is reached.

To configure the LSA generation interval:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the LSA generation interval.

lsa-generation-interval maximum-interval [ minimum-interval [ incremental-interval ] ]

By default:

·         The maximum interval is 5 seconds.

·         The minimum interval is 50 milliseconds.

·         The incremental interval is 200 milliseconds.

 

Disabling interfaces from receiving and sending OSPF packets

To enhance OSPF adaptability and reduce resource consumption, you can set an OSPF interface to "silent." A silent OSPF interface blocks OSPF packets and cannot establish any OSPF neighbor relationship. However, other interfaces on the router can still advertise direct routes of the interface in Router LSAs.

To disable interfaces from receiving and sending routing information:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Disable interfaces from receiving and sending OSPF packets.

silent-interface { interface-type interface-number | all }

By default, an OSPF interface can receive and send OSPF packets.

The silent-interface command disables only the interfaces associated with the current process rather than other processes. Multiple OSPF processes can disable the same interface from receiving and sending OSPF packets.

 

Configuring stub routers

A stub router is used for traffic control. It reports its status as a stub router to neighboring OSPF routers. The neighboring routers do not use the stub router to forward data although they have a route to it.

Router LSAs from the stub router might contain different link type values. A value of 3 means a link to a stub network, and the cost of the link will not be changed by default. To set the cost of the link to 65535, specify the include-stub keyword in the stub-router command. A value of 1, 2 or 4 means a point-to-point link, a link to a transit network, or a virtual link. On such links, a maximum cost value of 65535 is used. Neighbors do not send packets to the stub router as long as they have a route with a smaller cost.

To configure a router as a stub router:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the router as a stub router.

stub-router [ external-lsa [ max-metric-value ] | include-stub | on-startup { seconds | wait-for-bgp [ seconds ] } | summary-lsa [ max-metric-value ] ] *

By default, the router is not configured as a stub router.

A stub router has no associations with a stub area.

 

Configuring OSPF authentication

Perform this task to configure OSPF area and interface authentication.

OSPF adds the configured password into sent packets, and uses the password to authenticate received packets. Only packets that pass the authentication can be received. If a packet fails the authentication, the OSPF neighbor relationship cannot be established.

If you configure OSPF authentication for both an area and an interface in that area, the interface uses the OSPF authentication configured on it.

Configuring OSPF area authentication

You must configure the same authentication mode and password on all the routers in an area.

To configure OSPF area authentication:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enter area view.

area area-id

N/A

4.       Configure area authentication mode.

·         Configure MD5 authentication:
authentication-mode { hmac-md5 | md5 } key-id { cipher | plain } password

·         Configure simple authentication:
authentication-mode simple { cipher | plain } password

Use either method.

By default, no authentication is configured.

 

Configuring OSPF interface authentication

You must configure the same authentication mode and password on both the local interface and its peer interface.

To configure OSPF interface authentication:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Configure interface authentication mode.

·         Configure simple authentication:
ospf authentication-mode simple { cipher cipher-string | plain plain-string }

·         Configure MD5 authentication:
ospf authentication-mode { hmac-md5 | md5 } key-id { cipher cipher-string | plain plain-string }

Use either method.

By default, no authentication is configured.

 

Adding the interface MTU into DD packets

By default, an OSPF interface adds a value of 0 into the interface MTU field of a DD packet rather than the actual interface MTU. You can enable an interface to add its MTU into DD packets.

To add the interface MTU into DD packets:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Enable the interface to add its MTU into DD packets.

ospf mtu-enable

By default, the interface adds an MTU value of 0 into DD packets.

 

Configuring a DSCP value for OSPF packets

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure a DSCP value for OSPF packets.

dscp dscp-value

By default, the DSCP value for OSPF packets is 48.

 

Configuring the maximum number of external LSAs in LSDB

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Specify the maximum number of external LSAs in the LSDB.

lsdb-overflow-limit number

By default, the maximum number of external LSAs in the LSDB is not limited.

 

Configuring OSPF exit overflow interval

When the number of LSAs in the LSDB exceeds the upper limit, the LSDB is in an overflow state. To save resources, OSPF does not receive any external LSAs and deletes the external LSAs generated by itself when in this state.

Perform this task to configure the interval that OSPF exits overflow state.

To configure the OSPF exit overflow interval:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the OSPF exit overflow interval.

lsdb-overflow-interval interval

The default setting is 300 seconds.

The value of 0 indicates that OSPF does not exit overflow state.

 

Enabling compatibility with RFC 1583

RFC 1583 specifies a different method than RFC 2328 for selecting the optimal route to a destination in another AS. When multiple routes are available to the ASBR, OSPF selects the optimal route by using the following procedure:

1.        Selects the route with the highest preference:

¡  If RFC 2328 is compatible with RFC 1583, all these routes have equal preference.

¡  If RFC 2328 is not compatible with RFC 1583, the intra-area route in a non-backbone area is preferred to reduce the burden of the backbone area. The inter-area route and intra-area route in the backbone area have equal preference.

2.        Selects the route with lower cost if two routes have equal preference.

3.        Selects the route with larger originating area ID if two routes have equal cost.

To avoid routing loops, set identical RFC 1583-compatibility on all routers in a routing domain.

To enable compatibility with RFC 1583:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable compatibility with RFC 1583.

rfc1583 compatible

By default, this feature is enabled.

 

Logging neighbor state changes

Perform this task to enable output of neighbor state change logs to the information center. The information center processes the logs according to user-defined output rules (whether to output logs and where to output). For more information about the information center, see Network Management and Monitoring Configuration Guide.

To enable the logging of neighbor state changes:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable the logging of neighbor state changes.

log-peer-change

By default, this feature is enabled.

 

Configuring OSPF network management

This task involves the following configurations:

·          Bind an OSPF process to MIB so that you can use network management software to manage the specified OSPF process.

·          Enable SNMP notifications for OSPF to report important events.

·          Configure the maximum number of output SNMP notifications within a specified time interval.

SNMP notifications are sent to the SNMP module, which outputs SNMP notifications according to the configured output rules. For more information about SNMP notifications, see Network Management and Monitoring Configuration Guide.

To configure OSPF network management:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Bind OSPF MIB to an OSPF process.

ospf mib-binding process-id

By default, OSPF MIB is bound to the process with the smallest process ID.

3.       Enable SNMP notifications for OSPF.

snmp-agent trap enable ospf [ authentication-failure | bad-packet | config-error | grhelper-status-change | grrestarter-status-change | if-state-change | lsa-maxage | lsa-originate | lsdb-approaching-overflow | lsdb-overflow | neighbor-state-change | nssatranslator-status-change | retransmit | virt-authentication-failure | virt-bad-packet | virt-config-error | virt-retransmit | virtgrhelper-status-change | virtif-state-change | virtneighbor-state-change ] *

By default, SNMP notifications for OSPF is enabled.

4.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

5.       Configure the maximum number of output SNMP notifications within a specified time interval.

snmp trap rate-limit interval trap-interval count trap-number

By default, OSPF outputs up to seven SNMP notifications within 10 seconds.

 

Configuring the LSU transmit rate

Sending large numbers of LSU packets affects router performance and consumes too much network bandwidth. You can configure the router to send LSU packets at a proper interval and limit the maximum number of LSU packets sent out of an OSPF interface each time.

To configure the LSU transmit rate:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the LSU transmit rate.

transmit-pacing interval interval count count

By default, an OSPF interface sends a maximum of three LSU packets every 20 milliseconds.

 

Enabling OSPF ISPF

When the topology changes, Incremental Shortest Path First (ISPF) computes only the affected part of the SPT, instead of the entire SPT.

To enable OSPF ISPF:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable OSPF ISPF.

ispf enable

By default, OSPF ISPF is enabled.

 

Configuring prefix suppression

An OSPF interface by default advertises all its prefixes in LSAs. You can suppress interfaces from advertising all its prefixes to speed up OSPF convergence. This function also helps improve the network security by preventing IP routing toward the suppressed networks.

When prefix suppression is enabled:

·          On P2P and P2MP networks, OSPF does not advertise Type-3 links in Router LSAs. Other routing information can still be advertised to ensure traffic forwarding.

·          On broadcast and NBMA networks, the DR generates Network LSAs with a mask length of 32 to suppress network routes. Other routing information can still be advertised to ensure traffic forwarding. If no neighbors exist, the DR does not advertise the primary IP addresses of interfaces in Router LSAs.

 

IMPORTANT

IMPORTANT:

As a best practice, configure prefix suppression on all OSPF routers if you want to use prefix suppression.

 

Configuring prefix suppression for an OSPF process

Enabling prefix suppression for an OSPF process does not suppress the prefixes of secondary IP addresses, loopback interfaces, and passive interfaces. To suppress the prefixes of loopback interfaces and passive interfaces, enable prefix suppression on the interfaces.

To configure prefix suppression for an OSPF process:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable prefix suppression for the OSPF process.

prefix-suppression

By default, prefix suppression is disabled for an OSPF process.

 

Configuring prefix suppression on an interface

Interface prefix suppression does not suppress prefixes of secondary IP addresses.

To configure interface prefix suppression:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Enable prefix suppression on the interface.

ospf prefix-suppression [ disable ]

By default, prefix suppression is disabled on an interface.

 

Configuring prefix prioritization

This feature enables the device to install prefixes in descending priority order: critical, high, medium, and low. The prefix priorities are assigned through routing policies. When a route is assigned multiple prefix priorities, the route uses the highest priority.

By default, the 32-bit OSPF host routes have a medium priority and other routes a low priority.

To configure prefix prioritization:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable prefix prioritization.

prefix-priority route-policy route-policy-name

By default, prefix prioritization is disabled.

 

Configuring OSPF PIC

Prefix Independent Convergence (PIC) enables the device to speed up network convergence by ignoring the number of prefixes.

When both OSPF PIC and OSPF FRR are configured, OSPF FRR takes effect.

OSPF PIC applies to only inter-area routes and external routes.

Enabling OSPF PIC

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable PIC for OSPF.

pic [ additional-path-always ]

By default, OSPF PIC is enabled.

 

Configuring BFD for OSPF PIC

By default, OSPF PIC does not use BFD to detect primary link failures. To speed up OSPF convergence, enable BFD single-hop echo detection for OSPF PIC to detect the primary link failures.

To configure BFD for OSPF PIC:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Configure the source IP address of BFD echo packets.

bfd echo-source-ip ip-address

By default, the source IP address of BFD echo packets is not configured.

3.       Enter interface view.

interface interface-type interface-number

N/A

4.       Enable BFD for OSPF PIC.

ospf primary-path-detect bfd echo

By default, BFD for OSPF PIC is disabled.

 

Configuring the number of OSPF logs

OSPF logs include LSA aging logs, neighbor logs, and route calculation logs.

To configure the number of OSPF logs:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Configure the number of OSPF logs.

event-log { lsa-flush | peer | spf } size count

By default, the number of LSA aging logs, neighbor logs, or route calculation logs is 10.

 

Configuring OSPF GR

GR ensures forwarding continuity when a routing protocol restarts or an active/standby switchover occurs.

Two routers are required to complete a GR process. The following are router roles in a GR process.

·          GR restarter—Graceful restarting router. It must have GR capability.

·          GR helper—A neighbor of the GR restarter. It helps the GR restarter to complete the GR process.

OSPF GR has the following types:

·          IETF GR—Uses Opaque LSAs to implement GR.

·          Non-IETF GR—Uses link local signaling (LLS) to advertise GR capability and uses out of band synchronization to synchronize the LSDB.

A device can act as a GR restarter and GR helper at the same time.

Configuring the OSPF GR restarter

You can configure the IETF or non IETF OSPF GR restarter.

Configuring the IETF OSPF GR restarter

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enable OSPF and enter its view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable opaque LSA reception and advertisement capability.

opaque-capability enable

By default, opaque LSA reception and advertisement capability is enabled.

4.       Enable the IETF GR.

graceful-restart ietf [ global | planned-only ] *

By default, the IETF GR capability is disabled.

5.       (Optional.) Configure GR interval.

graceful-restart interval interval-value

The default setting is 120 seconds.

 

Configuring the non-IETF OSPF GR restarter

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enable OSPF and enter its view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable the link-local signaling capability.

enable link-local-signaling

By default, the link-local signaling capability is disabled.

4.       Enable the out-of-band re-synchronization capability.

enable out-of-band-resynchronization

By default, the out-of-band re-synchronization capability is disabled.

5.       Enable non-IETF GR.

graceful-restart [ nonstandard ] [ global | planned-only ] *

By default, non-IETF GR capability is disabled.

6.       (Optional.) Configure GR interval.

graceful-restart interval interval-value

The default setting is 120 seconds.

 

Configuring OSPF GR helper

You can configure the IETF or non IETF OSPF GR helper.

Configuring the IETF OSPF GR helper

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enable OSPF and enter its view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable opaque LSA reception and advertisement capability.

opaque-capability enable

By default, opaque LSA reception and advertisement capability is enabled.

4.       (Optional.) Enable GR helper capability.

graceful-restart helper enable [ planned-only ]

By default, GR helper capability is enabled.

5.       (Optional.) Enable strict LSA checking for the GR helper.

graceful-restart helper strict-lsa-checking

By default, strict LSA checking for the GR helper is disabled.

 

Configuring the non-IETF OSPF GR helper

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enable OSPF and enter its view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable the link-local signaling capability.

enable link-local-signaling

By default, the link-local signaling capability is disabled.

4.       Enable the out-of-band re-synchronization capability.

enable out-of-band-resynchronization

By default, the out-of-band re-synchronization capability is disabled.

5.       (Optional.) Enable GR helper.

graceful-restart helper enable

By default, GR helper is enabled.

6.       (Optional.) Enable strict LSA checking for the GR helper.

graceful-restart helper strict-lsa-checking

By default, strict LSA checking for the GR helper is disabled.

 

Triggering OSPF GR

OSPF GR is triggered by an active/standby switchover or when the following command is executed.

To trigger OSPF GR, perform the following command in user view:

 

Task

Command

Trigger OSPF GR.

reset ospf [ process-id ] process graceful-restart

 

Configuring OSPF NSR

Nonstop routing (NSR) backs up OSPF link state information from the active process to the standby process. After an active/standby switchover, NSR can complete link state recovery and route regeneration without tearing down adjacencies or impacting forwarding services.

NSR does not require the cooperation of neighboring devices to recover routing information, and is used more often than GR.

 

IMPORTANT

IMPORTANT:

A device that has OSPF NSR enabled cannot act as GR restarter.

 

To enable OSPF NSR:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable OSPF NSR.

non-stop-routing

By default, OSPF NSR is disabled.

 

Configuring BFD for OSPF

BFD provides a single mechanism to quickly detect and monitor the connectivity of links between OSPF neighbors, which improves the network convergence speed. For more information about BFD, see High Availability Configuration Guide.

OSPF supports the following BFD detection modes:

·          Bidirectional control detection—Requires BFD configuration to be made on both OSPF routers on the link.

·          Single-hop echo detection—Requires BFD configuration to be made on one OSPF router on the link.

Configuring bidirectional control detection

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter interface view.

interface interface-type interface-number

N/A

3.       Enable BFD bidirectional control detection.

ospf bfd enable

By default, BFD bidirectional control detection is disabled.

Both ends of a BFD session must be on the same network segment and in the same area.

 

Configuring single-hop echo detection

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Configure the source address of echo packets.

bfd echo-source-ip ip-address

By default, the source address of echo packets is not configured.

3.       Enter interface view.

interface interface-type interface-number

N/A

4.       Enable BFD single-hop echo detection.

ospf bfd enable echo

By default, BFD single-hop echo detection is disabled.

 

Configuring OSPF FRR

A link or router failure on a path can cause packet loss and even routing loop until OSPF completes routing convergence based on the new network topology. FRR uses BFD to detect failures and enables fast rerouting to minimize the impact of link or node failures.

Figure 7 Network diagram for OSPF FRR

 

As shown in Figure 7, configure FRR on Router B by using a routing policy to specify a backup next hop. When the primary link fails, OSPF directs packets to the backup next hop. At the same time, OSPF calculates the shortest path based on the new network topology, and forwards packets over the path after network convergence.

You can configure OSPF FRR to calculate a backup next hop by using the loop free alternate (LFA) algorithm, or specify a backup next hop by using a routing policy.

Configuration prerequisites

Before you configure OSPF FRR, perform the following tasks:

·          Configure IP addresses for interfaces to ensure IP connectivity between neighboring nodes.

·          Enable OSPF.

Configuration guidelines

·          Do not use FRR and BFD at the same time. Otherwise, FRR might fail to take effect.

·          Do not use the fast-reroute lfa command together with the vlink-peer command.

·          When both OSPF PIC and OSPF FRR are configured, OSPF FRR takes effect.

Configuration procedure

Configuring OSPF FRR to calculate a backup next hop using the LFA algorithm

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Configure the source address of echo packets.

bfd echo-source-ip ip-address

By default, the source address of echo packets is not configured.

3.       Enter interface view.

interface interface-type interface-number

N/A

4.       Enable LFA calculation on an interface.

ospf fast-reroute lfa-backup

By default, the interface on which LFA calculation is enabled can be selected as a backup interface.

5.       Return to system view.

quit

N/A

6.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

7.       Enable OSPF FRR to calculate a backup next hop by using the LFA algorithm.

fast-reroute lfa [ abr-only ]

By default, OSPF FRR is not configured.

If abr-only is specified, the route to the ABR is selected as the backup path.

 

Configuring OSPF FRR to specify a backup next hop using a routing policy

Before you configure this task, use the apply fast-reroute backup-interface command to specify a backup next hop in the routing policy to be referenced. For more information about the apply fast-reroute backup-interface command and routing policy configuration, see "Configuring routing policies."

To configure OSPF FRR to specify a backup next hop using a routing policy:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Configure the source address of echo packets.

bfd echo-source-ip ip-address

By default, the source address of echo packets is not configured.

3.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

4.       Enable OSPF FRR to specify a backup next hop by using a routing policy.

fast-reroute route-policy route-policy-name

By default, OSPF FRR is not configured.

 

Configuring BFD for OSPF FRR

By default, OSPF FRR does not use BFD to detect primary link failures. To speed up OSPF convergence, enable BFD single-hop echo detection for OSPF FRR to detect primary link failures.

To configure BFD for OSPF FRR:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Configure the source IP address of BFD echo packets.

bfd echo-source-ip ip-address

By default, the source IP address of BFD echo packets is not configured.

3.       Enter interface view.

interface interface-type interface-number

N/A

4.       Enable BFD for OSPF FRR.

ospf primary-path-detect bfd echo

By default, BFD for OSPF FRR is disabled.

 

Enabling the device to advertise OSPF link state information to BGP

After the device advertises OSPF link state information to BGP, BGP can advertise the information for intended applications. For more information about BGP LS, see "Configuring BGP."

To enable the device to advertise OSPF link state information to BGP:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enter OSPF view.

ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *

N/A

3.       Enable the device to advertise OSPF link state information to BGP.

distribute bgp-ls

By default, the device does not advertise OSPF link state information to BGP.

 

Displaying and maintaining OSPF

Execute display commands in any view and reset commands in user view.

 

Task

Command

Display OSPF process information (in standalone mode).

display ospf [ process-id ] [ verbose ] [ standby slot slot-number ]

Display OSPF process information (in IRF mode).

display ospf [ process-id ] [ verbose ] [ standby chassis chassis-number slot slot-number ]

Display OSPF GR information.

display ospf [ process-id ] graceful-restart [ verbose ]

Display OSPF FRR backup next hop information.

display ospf [ process-id ] [ area area-id ] fast-reroute lfa-candidate

Display OSPF LSDB information.

display ospf [ process-id ] lsdb [ area area-id | brief | [ { asbr | ase | network | nssa | opaque-area | opaque-as | opaque-link | router | summary } [ link-state-id ] ] [ originate-router advertising-router-id | self-originate ] ]

Display OSPF next hop information.

display ospf [ process-id ] nexthop

Display OSPF NSR information.

display ospf [ process-id ] non-stop-routing status

Display OSPF neighbor information.

display ospf [ process-id ] peer [ verbose ] [ interface-type interface-number ] [ neighbor-id ]

Display neighbor statistics of OSPF areas.

display ospf [ process-id ] peer statistics

Display OSPF routing table information.

display ospf [ process-id ] routing [ ip-address { mask-length | mask } ] [ interface interface-type interface-number ] [ nexthop nexthop-address ] [ verbose ]

Display OSPF topology information.

display ospf [ process-id ] [ area area-id ] spf-tree [ verbose ]

Display OSPF statistics.

display ospf [ process-id ] statistics [ error | packet [ interface-type interface-number ] ]

Display OSPF virtual link information.

display ospf [ process-id ] vlink

Display OSPF request queue information.

display ospf [ process-id ] request-queue [ interface-type interface-number ] [ neighbor-id ]

Display OSPF retransmission queue information.

display ospf [ process-id ] retrans-queue [ interface-type interface-number ] [ neighbor-id ]

Display OSPF ABR and ASBR information.

display ospf [ process-id ] abr-asbr [ verbose ]

Display summary route information on the OSPF ABR.

display ospf [ process-id ] [ area area-id ] abr-summary [ ip-address { mask-length | mask } ] [ verbose ]

Display OSPF interface information.

display ospf [ process-id ] interface [ interface-type interface-number | verbose ]

Display OSPF log information.

display ospf [ process-id ] event-log { lsa-flush | peer | spf }

Display OSPF ASBR route summarization information.

display ospf [ process-id ] asbr-summary [ ip-address { mask-length | mask } ]

Display the global route ID.

display router id

Clear OSPF statistics.

reset ospf [ process-id ] statistics

Clear OSPF log information.

reset ospf [ process-id ] event-log [ lsa-flush | peer | spf ]

Reset an OSPF process.

reset ospf [ process-id ] process [ graceful-restart ]

Re-enable OSPF route redistribution.

reset ospf [ process-id ] redistribution

 

OSPF configuration examples

These configuration examples only cover commands for OSPF configuration.

Basic OSPF configuration example

Network requirements

·          Enable OSPF on all switches, and split the AS into three areas.

·          Configure Switch A and Switch B as ABRs.

Figure 8 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF:

# Configure Switch A.

<SwitchA> system-view

[SwitchA] router id 10.2.1.1

[SwitchA] ospf

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] quit

[SwitchA-ospf-1] area 1

[SwitchA-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.1] quit

[SwitchA-ospf-1] quit

# Configure Switch B.

<SwitchB> system-view

[SwitchB] router id 10.3.1.1

[SwitchB] ospf

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] quit

[SwitchB-ospf-1] area 2

[SwitchB-ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.2] quit

[SwitchB-ospf-1] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] router id 10.4.1.1

[SwitchC] ospf

[SwitchC-ospf-1] area 1

[SwitchC-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.1] network 10.4.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.1] quit

[SwitchC-ospf-1] quit

# Configure Switch D.

<SwitchD> system-view

[SwitchD] router id 10.5.1.1

[SwitchD] ospf

[SwitchD-ospf-1] area 2

[SwitchD-ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.2] network 10.5.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.2] quit

[SwitchD-ospf-1] quit

Verifying the configuration

# Display information about neighbors on Switch A.

[SwitchA] display ospf peer verbose

 

          OSPF Process 1 with Router ID 10.2.1.1

                  Neighbors

 

 Area 0.0.0.0 interface 10.1.1.1(Vlan-interface100)'s neighbors

 Router ID: 10.3.1.1         Address: 10.1.1.2         GR State: Normal

   State: Full  Mode: Nbr is Master  Priority: 1

   DR: 10.1.1.1  BDR: 10.1.1.2  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 37  sec

   Neighbor is up for 06:03:59

   Authentication Sequence: [ 0 ]

   Neighbor state change count: 5

 

                  Neighbors

 

 Area 0.0.0.1 interface 10.2.1.1(Vlan-interface200)'s neighbors

 Router ID: 10.4.1.1         Address: 10.2.1.2         GR State: Normal

   State: Full  Mode: Nbr is Master  Priority: 1

   DR: 10.2.1.1  BDR: 10.2.1.2  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 32  sec

   Neighbor is up for 06:03:12

   Authentication Sequence: [ 0 ]

   Neighbor state change count: 5

# Display OSPF routing information on Switch A.

[SwitchA] display ospf routing

 

          OSPF Process 1 with Router ID 10.2.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 10.2.1.0/24        1        Transit 10.2.1.1        10.2.1.1        0.0.0.1

 10.3.1.0/24        2        Inter   10.1.1.2        10.3.1.1        0.0.0.0

 10.4.1.0/24        2        Stub    10.2.1.2        10.4.1.1        0.0.0.1

 10.5.1.0/24        3        Inter   10.1.1.2        10.3.1.1        0.0.0.0

 10.1.1.0/24        1        Transit 10.1.1.1        10.2.1.1        0.0.0.0

 

 Total Nets: 5

 Intra Area: 3  Inter Area: 2  ASE: 0  NSSA: 0

# Display OSPF routing information on Switch D.

[SwitchD] display ospf routing

 

          OSPF Process 1 with Router ID 10.5.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 10.2.1.0/24        3       Inter    10.3.1.1        10.3.1.1        0.0.0.2

 10.3.1.0/24        1       Transit  10.3.1.2        10.3.1.1        0.0.0.2

 10.4.1.0/24        4       Inter    10.3.1.1        10.3.1.1        0.0.0.2

 10.5.1.0/24        1       Stub     10.5.1.1        10.5.1.1        0.0.0.2

 10.1.1.0/24        2       Inter    10.3.1.1        10.3.1.1        0.0.0.2

 

 Total Nets: 5

 Intra Area: 2  Inter Area: 3  ASE: 0  NSSA: 0

# On Switch D, ping the IP address 10.4.1.1 to test reachability.

[SwitchD] ping 10.4.1.1

Ping 10.4.1.1 (10.4.1.1): 56 data bytes, press CTRL_C to break

56 bytes from 10.4.1.1: icmp_seq=0 ttl=253 time=1.549 ms

56 bytes from 10.4.1.1: icmp_seq=1 ttl=253 time=1.539 ms

56 bytes from 10.4.1.1: icmp_seq=2 ttl=253 time=0.779 ms

56 bytes from 10.4.1.1: icmp_seq=3 ttl=253 time=1.702 ms

56 bytes from 10.4.1.1: icmp_seq=4 ttl=253 time=1.471 ms

 

--- Ping statistics for 10.4.1.1 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.779/1.408/1.702/0.323 ms

OSPF route redistribution configuration example

Network requirements

·          Enable OSPF on all the switches.

·          Split the AS into three areas.

·          Configure Switch A and Switch B as ABRs.

·          Configure Switch C as an ASBR to redistribute external routes (static routes).

Figure 9 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF (see "Basic OSPF configuration example").

3.        Configure OSPF to redistribute routes:

# On Switch C, configure a static route destined for network 3.1.2.0/24.

<SwitchC> system-view

[SwitchC] ip route-static 3.1.2.1 24 10.4.1.2

# On Switch C, configure OSPF to redistribute static routes.

[SwitchC] ospf 1

[SwitchC-ospf-1] import-route static

Verifying the configuration

# Display the ABR/ASBR information of Switch D.

<SwitchD> display ospf abr-asbr

 

          OSPF Process 1 with Router ID 10.5.1.1

                  Routing Table to ABR and ASBR

 

 Type        Destination     Area            Cost  Nexthop         RtType

 Intra       10.3.1.1        0.0.0.2         10    10.3.1.1        ABR

 Inter       10.4.1.1        0.0.0.2         22    10.3.1.1        ASBR

# Display the OSPF routing table on Switch D.

<SwitchD> display ospf routing

 

          OSPF Process 1 with Router ID 10.5.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 10.2.1.0/24        22       Inter   10.3.1.1        10.3.1.1        0.0.0.2

 10.3.1.0/24        10       Transit 10.3.1.2        10.3.1.1        0.0.0.2

 10.4.1.0/24        25       Inter   10.3.1.1        10.3.1.1        0.0.0.2

 10.5.1.0/24        10       Stub    10.5.1.1        10.5.1.1        0.0.0.2

 10.1.1.0/24        12       Inter   10.3.1.1        10.3.1.1        0.0.0.2

 

 Routing for ASEs

 Destination        Cost     Type    Tag         NextHop         AdvRouter

 3.1.2.0/24         1        Type2   1           10.3.1.1        10.4.1.1

 

 Total Nets: 6

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

OSPF summary route advertisement configuration example

Network requirements

·          Configure OSPF on Switch A and Switch B in AS 200.

·          Configure OSPF on Switch C, Switch D, and Switch E in AS 100.

·          Configure an EBGP connection between Switch B and Switch C. Configure Switch B and Switch C to redistribute OSPF routes and direct routes into BGP and BGP routes into OSPF.

·          Configure Switch B to advertise only summary route 10.0.0.0/8 to Switch A.

Figure 10 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF:

# Configure Switch A.

<SwitchA> system-view

[SwitchA] router id 11.2.1.2

[SwitchA] ospf

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 11.2.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] quit

[SwitchA-ospf-1] quit

# Configure Switch B.

<SwitchB> system-view

[SwitchB] router id 11.2.1.1

[SwitchB] ospf

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 11.2.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] quit

[SwitchB-ospf-1] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] router id 11.1.1.2

[SwitchC] ospf

[SwitchC-ospf-1] area 0

[SwitchC-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] quit

[SwitchC-ospf-1] quit

# Configure Switch D.

<SwitchD> system-view

[SwitchD] router id 10.3.1.1

[SwitchD] ospf

[SwitchD-ospf-1] area 0

[SwitchD-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0] quit

# Configure Switch E.

<SwitchE> system-view

[SwitchE] router id 10.4.1.1

[SwitchE] ospf

[SwitchE-ospf-1] area 0

[SwitchE-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255

[SwitchE-ospf-1-area-0.0.0.0] network 10.4.1.0 0.0.0.255

[SwitchE-ospf-1-area-0.0.0.0] quit

[SwitchE-ospf-1] quit

3.        Configure BGP to redistribute OSPF routes and direct routes:

# Configure Switch B.

[SwitchB] bgp 200

[SwitchB-bgp] peer 11.1.1.2 as 100

[SwitchB-bgp] address-family ipv4 unicast

[SwitchB-bgp-ipv4] import-route ospf

[SwitchB-bgp-ipv4] import-route direct

[SwitchB-bgp ipv4] quit

[SwitchB-bgp] quit

# Configure Switch C.

[SwitchC] bgp 100

[SwitchC-bgp] peer 11.1.1.1 as 200

[SwitchC-bgp] address-family ipv4 unicast

[SwitchC-bgp-ipv4] import-route ospf

[SwitchC-bgp-ipv4]import-route direct

[SwitchC-bgp-ipv4] quit

[SwitchC-bgp] quit

4.        Configure Switch B and Switch C to redistribute BGP routes into OSPF:

# Configure OSPF to redistribute routes from BGP on Switch B.

[SwitchB] ospf

[SwitchB-ospf-1] import-route bgp

# Configure OSPF to redistribute routes from BGP on Switch C.

[SwitchC] ospf

[SwitchC-ospf-1] import-route bgp

# Display the OSPF routing table on Switch A.

[SwitchA] display ip routing-table

 

         Destinations : 16        Routes : 16

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

0.0.0.0/32          Direct 0    0            127.0.0.1       InLoop0

10.1.1.0/24         OSPF   150  1            11.2.1.1        Vlan100

10.2.1.0/24         OSPF   150  1            11.2.1.1        Vlan100

10.3.1.0/24         OSPF   150  1            11.2.1.1        Vlan100

10.4.1.0/24         OSPF   150  1            11.2.1.1        Vlan100

11.2.1.0/24         Direct 0    0            11.2.1.2        Vlan100

11.2.1.0/32         Direct 0    0            11.2.1.2        Vlan100

11.2.1.2/32         Direct 0    0            127.0.0.1       InLoop0

11.2.1.255/32       Direct 0    0            11.2.1.2        Vlan100

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/32        Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

127.255.255.255/32  Direct 0    0            127.0.0.1       InLoop0

224.0.0.0/4         Direct 0    0            0.0.0.0         NULL0

224.0.0.0/24        Direct 0    0            0.0.0.0         NULL0

255.255.255.255/32  Direct 0    0            127.0.0.1       InLoop0

5.        Configure route summarization:

# Configure route summarization on Switch B to advertise a summary route 10.0.0.0/8.

[SwitchB-ospf-1] asbr-summary 10.0.0.0 8

# Display the IP routing table on Switch A.

[SwitchA] display ip routing-table

 

         Destinations : 13        Routes : 13

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

0.0.0.0/32          Direct 0    0            127.0.0.1       InLoop0

10.0.0.0/8          OSPF   150  2            11.2.1.1        Vlan100

11.2.1.0/24         Direct 0    0            11.2.1.2        Vlan100

11.2.1.0/32         Direct 0    0            11.2.1.2        Vlan100

11.2.1.2/32         Direct 0    0            127.0.0.1       InLoop0

11.2.1.255/32       Direct 0    0            11.2.1.2        Vlan100

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/32        Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

127.255.255.255/32  Direct 0    0            127.0.0.1       InLoop0

224.0.0.0/4         Direct 0    0            0.0.0.0         NULL0

224.0.0.0/24        Direct 0    0            0.0.0.0         NULL0

255.255.255.255/32  Direct 0    0            127.0.0.1       InLoop0

The output shows that routes 10.1.1.0/24, 10.2.1.0/24, 10.3.1.0/24 and 10.4.1.0/24 are summarized into a single route 10.0.0.0/8.

OSPF stub area configuration example

Network requirements

·          Enable OSPF on all switches, and split the AS into three areas.

·          Configure Switch A and Switch B as ABRs to forward routing information between areas.

·          Configure Switch D as the ASBR to redistribute static routes.

·          Configure Area 1 as a stub area to reduce advertised LSAs without influencing reachability.

Figure 11 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF (see "Basic OSPF configuration example").

3.        Configure route redistribution:

# Configure Switch D to redistribute static routes.

<SwitchD> system-view

[SwitchD] ip route-static 3.1.2.1 24 10.5.1.2

[SwitchD] ospf

[SwitchD-ospf-1] import-route static

[SwitchD-ospf-1] quit

# Display ABR/ASBR information on Switch C.

<SwitchC> display ospf abr-asbr

 

          OSPF Process 1 with Router ID 10.4.1.1

                  Routing Table to ABR and ASBR

 

 Type        Destination     Area            Cost  Nexthop         RtType

 Intra       10.2.1.1        0.0.0.1         3     10.2.1.1        ABR

 Inter       10.5.1.1        0.0.0.1         7     10.2.1.1        ASBR

# Display OSPF routing table on Switch C.

<SwitchC> display ospf routing

 

          OSPF Process 1 with Router ID 10.4.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 10.2.1.0/24        3        Transit 10.2.1.2        10.2.1.1        0.0.0.1

 10.3.1.0/24        7        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.4.1.0/24        3        Stub    10.4.1.1        10.4.1.1        0.0.0.1

 10.5.1.0/24        17       Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.1.1.0/24        5        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 

 Routing for ASEs

 Destination        Cost     Type    Tag         NextHop         AdvRouter

 3.1.2.0/24         1        Type2   1           10.2.1.1        10.5.1.1

 

 Total Nets: 6

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

Because Switch C resides in a normal OSPF area, its routing table contains an AS external route.

4.        Configure Area 1 as a stub area:

# Configure Switch A.

<SwitchA> system-view

[SwitchA] ospf

[SwitchA-ospf-1] area 1

[SwitchA-ospf-1-area-0.0.0.1] stub

[SwitchA-ospf-1-area-0.0.0.1] quit

[SwitchA-ospf-1] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] ospf

[SwitchC-ospf-1] area 1

[SwitchC-ospf-1-area-0.0.0.1] stub

[SwitchC-ospf-1-area-0.0.0.1] quit

[SwitchC-ospf-1] quit

# Display OSPF routing information on Switch C

[SwitchC] display ospf routing

 

          OSPF Process 1 with Router ID 10.4.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 0.0.0.0/0          4        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.2.1.0/24        3        Transit 10.2.1.2        10.2.1.1        0.0.0.1

 10.3.1.0/24        7        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.4.1.0/24        3        Stub    10.4.1.1        10.4.1.1        0.0.0.1

 10.5.1.0/24        17       Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.1.1.0/24        5        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 

 Total Nets: 6

 Intra Area: 2  Inter Area: 4  ASE: 0  NSSA: 0

After the area where Switch C resides is configured as a stub area, a default route takes the place of the AS external route.

# Configure the area as a totally stub area by filtering Type-3 LSAs out of the stub area.

[SwitchA] ospf

[SwitchA-ospf-1] area 1

[SwitchA-ospf-1-area-0.0.0.1] stub no-summary

[SwitchA-ospf-1-area-0.0.0.1] quit

# Display OSPF routing information on Switch C.

[SwitchC] display ospf routing

 

          OSPF Process 1 with Router ID 10.4.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 0.0.0.0/0          4        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.2.1.0/24        3        Transit 10.2.1.2        10.4.1.1        0.0.0.1

 10.4.1.0/24        3        Stub    10.4.1.1        10.4.1.1        0.0.0.1

 

 Total Nets: 3

 Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0

After this configuration, inter-area routes are removed, and only one external route (a default route) exists.

OSPF NSSA area configuration example

Network requirements

·          Configure OSPF on all switches and split AS into three areas.

·          Configure Switch A and Switch B as ABRs to forward routing information between areas.

·          Configure Area 1 as an NSSA area and configure Switch C as an ASBR to redistribute static routes into the AS.

Figure 12 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces.

2.        Enable OSPF (see "Basic OSPF configuration example").

3.        Configure Area 1 as an NSSA area:

# Configure Switch A.

<SwitchA> system-view

[SwitchA] ospf

[SwitchA-ospf-1] area 1

[SwitchA-ospf-1-area-0.0.0.1] nssa default-route-advertise no-summary

[SwitchA-ospf-1-area-0.0.0.1] quit

[SwitchA-ospf-1] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] ospf

[SwitchC-ospf-1] area 1

[SwitchC-ospf-1-area-0.0.0.1] nssa

[SwitchC-ospf-1-area-0.0.0.1] quit

[SwitchC-ospf-1] quit

 

 

NOTE:

·      To allow Switch C in the NSSA area to reach other areas within the AS, you must provide the keyword default-route-advertise for the nssa command issued on Switch A (the ABR) so that Switch C can obtain a default route.

·      Configuring the nssa command with the keyword no-summary on Switch A can reduce the routing table size on NSSA Switches. On other NSSA Switches, you only need to configure the nssa command.

 

# Display OSPF routing information on Switch C.

[SwitchC] display ospf routing

 

          OSPF Process 1 with Router ID 10.4.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 0.0.0.0/0          65536    Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.2.1.0/24        65535    Transit 10.2.1.2        10.4.1.1        0.0.0.1

 10.4.1.0/24        3        Stub    10.4.1.1        10.4.1.1        0.0.0.1

 

 Total Nets: 3

 Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0

4.        Configure route redistribution:

# Configure Switch C to redistribute static routes.

[SwitchC] ip route-static 3.1.3.1 24 10.4.1.2

[SwitchC] ospf

[SwitchC-ospf-1] import-route static

[SwitchC-ospf-1] quit

# Display OSPF routing information on Switch D.

<SwitchD> display ospf routing

 

          OSPF Process 1 with Router ID 10.5.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 10.2.1.0/24        22       Inter   10.3.1.1        10.3.1.1        0.0.0.2

 10.3.1.0/24        10       Transit 10.3.1.2        10.3.1.1        0.0.0.2

 10.4.1.0/24        25       Inter   10.3.1.1        10.3.1.1        0.0.0.2

 10.5.1.0/24        10       Stub    10.5.1.1        10.5.1.1        0.0.0.2

 10.1.1.0/24        12       Inter   10.3.1.1        10.3.1.1        0.0.0.2

 

 Routing for ASEs

 Destination        Cost     Type    Tag         NextHop         AdvRouter

 3.1.3.0/24         1        Type2   1           10.3.1.1        10.2.1.1

 

 Total Nets: 6

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

The output shows an external route imported from the NSSA area exists on Switch D.

OSPF DR election configuration example

Network requirements

·          Enable OSPF on Switches A, B, C, and D on the same network.

·          Configure Switch A as the DR, and configure Switch C as the BDR.

Figure 13 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF:

# Configure Switch A.

<SwitchA> system-view

[SwitchA] router id 1.1.1.1

[SwitchA] ospf

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] quit

[SwitchA-ospf-1] quit

# Configure Switch B.

<SwitchB> system-view

[SwitchB] router id 2.2.2.2

[SwitchB] ospf

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] quit

[SwitchB-ospf-1] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] router id 3.3.3.3

[SwitchC] ospf

[SwitchC-ospf-1] area 0

[SwitchC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] quit

[SwitchC-ospf-1] quit

# Configure Switch D.

<SwitchD> system-view

[SwitchD] router id 4.4.4.4

[SwitchD] ospf

[SwitchD-ospf-1] area 0

[SwitchD-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0] quit

[SwitchD-ospf-1] return

# Display OSPF neighbor information of Switch A.

[SwitchA] display ospf peer verbose

 

          OSPF Process 1 with Router ID 1.1.1.1

                  Neighbors

 

 Area 0.0.0.0 interface 192.168.1.1(Vlan-interface1)'s neighbors

 Router ID: 2.2.2.2          Address: 192.168.1.2      GR State: Normal

   State: 2-Way  Mode: None  Priority: 1

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 38  sec

   Neighbor is up for 00:01:31

   Authentication Sequence: [ 0 ]

 

 Router ID: 3.3.3.3          Address: 192.168.1.3      GR State: Normal

   State: Full  Mode: Nbr is Master  Priority: 1

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 31  sec

   Neighbor is up for 00:01:28

   Authentication Sequence: [ 0 ]

 

 Router ID: 4.4.4.4          Address: 192.168.1.4      GR State: Normal

   State: Full  Mode: Nbr is Master  Priority: 1

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 31  sec

   Neighbor is up for 00:01:28

   Authentication Sequence: [ 0 ]

The output shows that Switch D is the DR and Switch C is the BDR.

3.        Configure router priorities on interfaces:

# Configure Switch A.

[SwitchA] interface vlan-interface 1

[SwitchA-Vlan-interface1] ospf dr-priority 100

[SwitchA-Vlan-interface1] quit

# Configure Switch B.

[SwitchB] interface vlan-interface 1

[SwitchB-Vlan-interface1] ospf dr-priority 0

[SwitchB-Vlan-interface1] quit

# Configure Switch C.

[SwitchC] interface vlan-interface 1

[SwitchC-Vlan-interface1] ospf dr-priority 2

[SwitchC-Vlan-interface1] quit

# Display neighbor information of Switch D.

<SwitchD> display ospf peer verbose

 

          OSPF Process 1 with Router ID 4.4.4.4

                  Neighbors

 

 Area 0.0.0.0 interface 192.168.1.4(Vlan-interface1)'s neighbors

 Router ID: 1.1.1.1      Address: 192.168.1.1      GR State: Normal

   State: Full  Mode:Nbr is  Slave  Priority: 100

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 31  sec

   Neighbor is up for 00:11:17

   Authentication Sequence: [ 0 ]

 

 Router ID: 2.2.2.2      Address: 192.168.1.2      GR State: Normal

   State: Full  Mode:Nbr is  Slave  Priority: 0

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 35  sec

   Neighbor is up for 00:11:19

   Authentication Sequence: [ 0 ]

 

 Router ID: 3.3.3.3      Address: 192.168.1.3      GR State: Normal

   State: Full  Mode:Nbr is  Slave  Priority: 2

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 33  sec

   Neighbor is up for 00:11:15

   Authentication Sequence: [ 0 ]

The output shows that the DR and BDR are not changed, because the priority settings do not take effect immediately.

4.        Restart OSPF process:

# Restart the OSPF process of Switch D.

<SwitchD> reset ospf 1 process

Warning : Reset OSPF process? [Y/N]:y

# Display neighbor information of Switch D.

<SwitchD> display ospf peer verbose

 

          OSPF Process 1 with Router ID 4.4.4.4

                  Neighbors

 

 Area 0.0.0.0 interface 192.168.1.4(Vlan-interface1)'s neighbors

 Router ID: 1.1.1.1          Address: 192.168.1.1      GR State: Normal

   State: Full  Mode: Nbr is Slave  Priority: 100

   DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 39  sec

   Neighbor is up for 00:01:40

   Authentication Sequence: [ 0 ]

 

 Router ID: 2.2.2.2          Address: 192.168.1.2      GR State: Normal

   State: 2-Way  Mode: None  Priority: 0

   DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 35  sec

   Neighbor is up for 00:01:44

   Authentication Sequence: [ 0 ]

 

 Router ID: 3.3.3.3          Address: 192.168.1.3      GR State: Normal

   State: Full  Mode: Nbr is Slave  Priority: 2

   DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 39  sec

   Neighbor is up for 00:01:41

   Authentication Sequence: [ 0 ]

If the neighbor state is full, Switch D has established an adjacency with the neighbor. If the neighbor state is 2-way, the two switches are not the DR or the BDR, and they do not exchange LSAs.

# Display OSPF interface information.

[SwitchA] display ospf interface

 

          OSPF Process 1 with Router ID 1.1.1.1

                  Interfaces

 

 Area: 0.0.0.0

 IP Address      Type      State   Cost  Pri   DR             BDR

 192.168.1.1     Broadcast DR      1     100   192.168.1.1    192.168.1.3

 

[SwitchB] display ospf interface

 

          OSPF Process 1 with Router ID 2.2.2.2

                  Interfaces

 

 Area: 0.0.0.0

 IP Address      Type      State    Cost  Pri   DR            BDR

 192.168.1.2     Broadcast DROther  1     0     192.168.1.1   192.168.1.3

The interface state DROther means the interface is not the DR or BDR.

OSPF virtual link configuration example

Network requirements

Configure a virtual link between Switch B and Switch C to connect Area 2 to the backbone area. After configuration, Switch B can learn routes to Area 2.

Figure 14 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF:

# Configure Switch A.

<SwitchA> system-view

[SwitchA] ospf 1 router-id 1.1.1.1

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] quit

# Configure Switch B.

<SwitchB> system-view

[SwitchB] ospf 1 router-id 2.2.2.2

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] quit

[SwitchB-ospf-1] area 1

[SwitchB–ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255

[SwitchB–ospf-1-area-0.0.0.1] quit

[SwitchB-ospf-1] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] ospf 1 router-id 3.3.3.3

[SwitchC-ospf-1] area 1

[SwitchC-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.1] quit

[SwitchC-ospf-1] area 2

[SwitchC–ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255

[SwitchC–ospf-1-area-0.0.0.2] quit

[SwitchC-ospf-1] quit

# Configure Switch D.

<SwitchD> system-view

[SwitchD] ospf 1 router-id 4.4.4.4

[SwitchD-ospf-1] area 2

[SwitchD-ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.2] quit

# Display the OSPF routing table on Switch B.

[SwitchB] display ospf routing

 

          OSPF Process 1 with Router ID 2.2.2.2

                   Routing Tables

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 10.2.1.0/24        2        Transit 10.2.1.1        3.3.3.3         0.0.0.1

 10.1.1.0/24        2        Transit 10.1.1.2        2.2.2.2         0.0.0.0

 Total Nets: 2

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

Area 0 has no direct connection to Area 2, so the routing table of Switch B has no route to Area 2.

3.        Configure a virtual link:

# Configure Switch B.

[SwitchB] ospf

[SwitchB-ospf-1] area 1

[SwitchB-ospf-1-area-0.0.0.1] vlink-peer 3.3.3.3

[SwitchB-ospf-1-area-0.0.0.1] quit

[SwitchB-ospf-1] quit

# Configure Switch C.

[SwitchC] ospf 1

[SwitchC-ospf-1] area 1

[SwitchC-ospf-1-area-0.0.0.1] vlink-peer 2.2.2.2

[SwitchC-ospf-1-area-0.0.0.1] quit

# Display the OSPF routing table on Switch B.

[SwitchB] display ospf routing

 

          OSPF Process 1 with Router ID 2.2.2.2

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 10.2.1.0/24        2        Transit 10.2.1.1        3.3.3.3         0.0.0.1

 10.3.1.0/24        5        Inter   10.2.1.2        3.3.3.3         0.0.0.0

 10.1.1.0/24        2        Transit 10.1.1.2        2.2.2.2         0.0.0.0

 

 Total Nets: 3

 Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0

The output shows that Switch B has learned the route 10.3.1.0/24 to Area 2.

OSPF GR configuration example

Network requirements

·          As shown in Figure 15, Switch A, Switch B, and Switch C that belong to the same AS and the same OSPF routing domain are GR capable.

·          Switch A acts as the non-IETF GR restarter; Switch B and Switch C are the GR helpers and re-synchronize their LSDB with Switch A through OOB communication of GR.

Figure 15 Network diagram

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF:

# Configure Switch A.

SwitchA> system-view

[SwitchA] router id 1.1.1.1

[SwitchA] ospf 100

[SwitchA-ospf-100] area 0

[SwitchA-ospf-100-area-0.0.0.0] network 192.1.1.0 0.0.0.255

[SwitchA-ospf-100-area-0.0.0.0] quit

# Configure Switch B.

<SwitchB> system-view

[SwitchB] router id 2.2.2.2

[SwitchB] ospf 100

[SwitchB-ospf-100] area 0

[SwitchB-ospf-100-area-0.0.0.0] network 192.1.1.0 0.0.0.255

[SwitchB-ospf-100-area-0.0.0.0] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] router id 3.3.3.3

[SwitchC] ospf 100

[SwitchC-ospf-100] area 0

[SwitchC-ospf-100-area-0.0.0.0] network 192.1.1.0 0.0.0.255

[SwitchC-ospf-100-area-0.0.0.0] quit

3.        Configure OSPF GR:

# Configure Switch A as the non-IETF OSPF GR restarter: enable the link-local signaling capability, the out-of-band re-synchronization capability, and non-IETF GR capability for OSPF process 100.

[SwitchA-ospf-100] enable link-local-signaling

[SwitchA-ospf-100] enable out-of-band-resynchronization

[SwitchA-ospf-100] graceful-restart

[SwitchA-ospf-100] return

# Configure Switch B as the GR helper: enable the link-local signaling capability and the out-of-band re-synchronization capability for OSPF process 100.

[SwitchB-ospf-100] enable link-local-signaling

[SwitchB-ospf-100] enable out-of-band-resynchronization

# Configure Switch C as the GR helper: enable the link-local signaling capability and the out-of-band re-synchronization capability for OSPF process 100.

[SwitchC-ospf-100] enable link-local-signaling

[SwitchC-ospf-100] enable out-of-band-resynchronization

Verifying the configuration

# After the configurations on Switch A, Switch B, and Switch C are complete and the switches are running steadily, enable OSPF GR event debugging and then restart the OSPF process using GR on Switch A.

<SwitchA> debugging ospf event graceful-restart

<SwitchA> terminal monitor

<SwitchA> terminal logging level 7

<SwitchA> reset ospf 100 process graceful-restart

Reset OSPF process? [Y/N]:y

%Oct 21 15:29:28:727 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Full to Down.

%Oct 21 15:29:28:729 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Full to Down.

*Oct 21 15:29:28:735 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 nonstandard GR Started for OSPF Router

*Oct 21 15:29:28:735 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 created GR wait timer,timeout interval is 40(s).

*Oct 21 15:29:28:735 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 created GR Interval timer,timeout interval is 120(s).

*Oct 21 15:29:28:758 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 created OOB Progress timer for neighbor 192.1.1.3.

*Oct 21 15:29:28:766 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 created OOB Progress timer for neighbor 192.1.1.2.

%Oct 21 15:29:29:902 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Loading to Full.

*Oct 21 15:29:29:902 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 deleted OOB Progress timer for neighbor 192.1.1.2.

%Oct 21 15:29:30:897 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Loading to Full.

*Oct 21 15:29:30:897 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 deleted OOB Progress timer for neighbor 192.1.1.3.

*Oct 21 15:29:30:911 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF GR: Process 100 Exit Restart,Reason : DR or BDR change,for neighbor : 192.1.1.3.

*Oct 21 15:29:30:911 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 deleted GR Interval timer.

*Oct 21 15:29:30:912 2011 SwitchA OSPF/7/DEBUG: -MDC=1;

OSPF 100 deleted GR wait timer.

%Oct 21 15:29:30:920 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Full to Down.

%Oct 21 15:29:30:921 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Full to Down.

%Oct 21 15:29:33:815 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.3(Vlan-interface100) from Loading to Full.

%Oct 21 15:29:35:578 2011 SwitchA OSPF/5/OSPF_NBR_CHG: -MDC=1; OSPF 100 Neighbor 192.1.1.2(Vlan-interface100) from Loading to Full.

The output shows that Switch A completes GR.

OSPF NSR configuration example

Network requirements

As shown in Figure 16, Switch S, Switch A, and Switch B belong to the same OSPF routing domain. Enable OSPF NSR on Switch S to ensure correct routing when an active/standby switchover occurs on Switch S.

Figure 16 Network diagram

 

Configuration procedure

1.        Configure IP addresses and subnet masks for interfaces on the switches. (Details not shown.)

2.        Configure OSPF on the switches to ensure the following: (Details not shown.)

¡  Switch S, Switch A, and Switch B can communicate with each other at Layer 3.

¡  Dynamic route update can be implemented among them with OSPF.

3.        Enable OSPF NSR on Switch S.

<SwitchS> system-view

[SwitchS] ospf 100

[SwitchS-ospf-100] non-stop-routing

[SwitchS-ospf-100] quit

Verifying the configuration

# Perform an active/standby switchover on Switch S.

[SwitchS] placement reoptimize

Predicted changes to the placement

Program                           Current location       New location

---------------------------------------------------------------------

rib                               0/0                    0/0

staticroute                       0/0                    0/0

ospf                              0/0                    1/0

rib6                              0/0                    0/0

staticroute6                      0/0                    0/0

isis                              0/0                    0/0

ospfv3                            0/0                    0/0

Continue? [y/n]:y

Re-optimization of the placement start. You will be notified on completion

Re-optimization of the placement complete. Use 'display placement' to view the new placement

# During the switchover period, display OSPF neighbors on Switch A to verify the neighbor relationship between Switch A and Switch S.

<SwitchA> display ospf peer

 

          OSPF Process 1 with Router ID 2.2.2.1

               Neighbor Brief Information

 

 Area: 0.0.0.0

 Router ID       Address         Pri Dead-Time  State             Interface

 3.3.3.1         12.12.12.2      1   37         Full/BDR          Vlan100

# Display OSPF routes on Switch A to verify if Switch A has a route to the loopback interface on Switch B.

<SwitchA> display ospf routing

 

          OSPF Process 1 with Router ID 2.2.2.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 44.44.44.44/32     2        Stub    12.12.12.2      4.4.4.1         0.0.0.0

 14.14.14.0/24      2        Transit 12.12.12.2      4.4.4.1         0.0.0.0

 22.22.22.22/32     0        Stub    22.22.22.22     2.2.2.1         0.0.0.0

 12.12.12.0/24      1        Transit 12.12.12.1      2.2.2.1         0.0.0.0

 

 Total Nets: 4

 Intra Area: 4  Inter Area: 0  ASE: 0  NSSA: 0

# Display OSPF neighbors on Switch B to verify the neighbor relationship between Switch B and Switch S.

<SwitchB> display ospf peer

 

          OSPF Process 1 with Router ID 4.4.4.1

               Neighbor Brief Information

 

 Area: 0.0.0.0

 Router ID       Address         Pri Dead-Time  State             Interface

 3.3.3.1         14.14.14.2      1   39         Full/BDR          Vlan200

# Display OSPF routes on Switch B to verify if Switch B has a route to the loopback interface on Switch A.

<SwitchB> display ospf routing

 

          OSPF Process 1 with Router ID 4.4.4.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 44.44.44.44/32     0        Stub    44.44.44.44     4.4.4.1         0.0.0.0

 14.14.14.0/24      1        Transit 14.14.14.1      4.4.4.1         0.0.0.0

 22.22.22.22/32     2        Stub    14.14.14.2      2.2.2.1         0.0.0.0

 12.12.12.0/24      2        Transit 14.14.14.2      2.2.2.1         0.0.0.0

 

 Total Nets: 4

 Intra Area: 4  Inter Area: 0  ASE: 0  NSSA: 0

The output shows that when an active/standby switchover occurs on Switch S, the neighbor relationships and routing information on Switch A and Switch B have not changed, and the traffic from Switch A to Switch B has not been impacted.

BFD for OSPF configuration example

Network requirements

As shown in Figure 17, run OSPF on Switch A, Switch B, and Switch C so that they are reachable to each other at the network layer. When the link over which Switch A and Switch B communicate through a Layer 2 switch fails, BFD can quickly detect the failure and notify OSPF of the failure. Switch A and Switch B then communicate through Switch C.

Figure 17 Network diagram

 

Table 1 Interface and IP address assignment

Device

Interface

IP address

Device

Interface

IP address

Switch A

Vlan-int10

192.168.0.102/24

Switch B

Vlan-int13

13.1.1.1/24

Switch A

Vlan-int11

10.1.1.102/24

Switch C

Vlan-int11

10.1.1.100/24

Switch B

Vlan-int10

192.168.0.100/24

Switch C

Vlan-int13

13.1.1.2/24

 

Configuration procedure

1.        Configure IP addresses for interfaces. (Details not shown.)

2.        Enable OSPF:

# Configure Switch A.

<SwitchA> system-view

[SwitchA] ospf

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] network 121.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0] quit

[SwitchA-ospf-1] quit

[SwitchA] interface vlan 11

[SwitchA-Vlan-interface11] ospf cost 2

[SwitchA-Vlan-interface11] quit

# Configure Switch B.

<SwitchB> system-view

[SwitchB] ospf

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] network 120.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0] quit

[SwitchB-ospf-1] quit

[SwitchB] interface vlan-interface 13

[SwitchB-Vlan-interface13] ospf cost 2

[SwitchA-Vlan-interface13] quit

# Configure Switch C.

<SwitchC> system-view

[SwitchC] ospf

[SwitchC-ospf-1] area 0

[SwitchC-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0] quit

[SwitchC-ospf-1] quit

3.        Configure BFD:

# Enable BFD on Switch A and configure BFD parameters.

[SwitchA] bfd session init-mode active

[SwitchA] interface vlan-interface 10

[SwitchA-Vlan-interface10] ospf bfd enable

[SwitchA-Vlan-interface10] bfd min-transmit-interval 500

[SwitchA-Vlan-interface10] bfd min-receive-interval 500

[SwitchA-Vlan-interface10] bfd detect-multiplier 7

[SwitchA-Vlan-interface10] quit

[SwitchA] quit

# Enable BFD on Switch B and configure BFD parameters.

[SwitchB] bfd session init-mode active

[SwitchB] interface vlan-interface 10

[SwitchB-Vlan-interface10] ospf bfd enable

[SwitchB-Vlan-interface10] bfd min-transmit-interval 500

[SwitchB-Vlan-interface10] bfd min-receive-interval 500

[SwitchB-Vlan-interface10] bfd detect-multiplier 6

Verifying the configuration

# Display the BFD information on Switch A.

<SwitchA> display bfd session

 

 Total Session Num: 1     Up Session Num: 1     Init Mode: Active

 

 IPv4 Session Working Under Ctrl Mode:

 

 LD/RD          SourceAddr      DestAddr        State    Holdtime    Interface

 3/1            192.168.0.102   192.168.0.100   Up       1700ms      Vlan10

# Display routes destined for 120.1.1.0/24 on Switch A.

<SwitchA> display ip routing-table 120.1.1.0 verbose

 

Summary Count : 1

 

Destination: 120.1.1.0/24

   Protocol: OSPF            Process ID: 1

  SubProtID: 0x1                    Age: 04h20m37s

       Cost: 2               Preference: 10

        Tag: 0                    State: Active Adv

  OrigTblID: 0x0                OrigVrf: default-vrf

    TableID: 0x2                 OrigAs: 0

      NBRID: 0x26000002          LastAs: 0

     AttrID: 0xffffffff        Neighbor: 0.0.0.0

      Flags: 0x1008c        OrigNextHop: 192.168.0.100

      Label: NULL           RealNextHop: 192.168.0.100

    BkLabel: NULL             BkNextHop: N/A

  Tunnel ID: Invalid          Interface: Vlan-interface10

BkTunnel ID: Invalid        BkInterface: N/A

The output shows that Switch A communicates with Switch B through VLAN-interface 10. Then the link over VLAN-interface 10 fails.

# Display routes destined for 120.1.1.0/24 on Switch A.

<SwitchA> display ip routing-table 120.1.1.0 verbose

 

Summary Count : 1

 

Destination: 120.1.1.0/24

   Protocol: OSPF            Process ID: 1

  SubProtID: 0x1                    Age: 04h20m37s

       Cost: 4               Preference: 10

        Tag: 0                    State: Active Adv

  OrigTblID: 0x0                OrigVrf: default-vrf

    TableID: 0x2                 OrigAs: 0

      NBRID: 0x26000002          LastAs: 0

     AttrID: 0xffffffff        Neighbor: 0.0.0.0

      Flags: 0x1008c        OrigNextHop: 10.1.1.100

      Label: NULL           RealNextHop: 10.1.1.100

    BkLabel: NULL             BkNextHop: N/A

  Tunnel ID: Invalid          Interface: Vlan-interface11

BkTunnel ID: Invalid        BkInterface: N/A

The output shows that Switch A communicates with Switch B through VLAN-interface 11.

OSPF FRR configuration example

Network requirements

As shown in Figure 18, Switch S, Switch A, and Switch D reside in the same OSPF domain. Configure OSPF FRR so that when the link between Switch S and Switch D fails, traffic is immediately switched to Link B.

Figure 18 Network diagram

 

Configuration procedure

1.        Configure IP addresses and subnet masks for interfaces on the switches. (Details not shown.)

2.        Configure OSPF on the switches to make sure Switch S, Switch A, and Switch D can communicate with each other at the network layer. (Details not shown.)

3.        Configure OSPF FRR to automatically calculate the backup next hop:

You can enable OSPF FRR to either calculate a backup next hop by using the LFA algorithm, or specify a backup next hop by using a routing policy.

¡  (Method 1.) Enable OSPF FRR to calculate the backup next hop by using the LFA algorithm:

# Configure Switch S.

<SwitchS> system-view

[SwitchS] bfd echo-source-ip 2.2.2.2

[SwitchS] ospf 1

[SwitchS-ospf-1] fast-reroute lfa

[SwitchS-ospf-1] quit

# Configure Switch D.

<SwitchD> system-view

[SwitchD] bfd echo-source-ip 3.3.3.3

[SwitchD] ospf 1

[SwitchD-ospf-1] fast-reroute lfa

[SwitchD-ospf-1] quit

¡  (Method 2.) Enable OSPF FRR to designate a backup next hop by using a routing policy.

# Configure Switch S.

<SwitchS> system-view

[SwitchS] bfd echo-source-ip 2.2.2.2

[SwitchS] ip prefix-list abc index 10 permit 4.4.4.4 32

[SwitchS] route-policy frr permit node 10

[SwitchS-route-policy-frr-10] if-match ip address prefix-list abc

[SwitchS-route-policy-frr-10] apply fast-reroute backup-interface vlan-interface 100 backup-nexthop 12.12.12.2

[SwitchS-route-policy-frr-10] quit

[SwitchS] ospf 1

[SwitchS-ospf-1] fast-reroute route-policy frr

[SwitchS-ospf-1] quit

# Configure Switch D.

<SwitchD> system-view

[SwitchD] bfd echo-source-ip 3.3.3.3

[SwitchD] ip prefix-list abc index 10 permit 1.1.1.1 32

[SwitchD] route-policy frr permit node 10

[SwitchD-route-policy-frr-10] if-match ip address prefix-list abc

[SwitchD-route-policy-frr-10] apply fast-reroute backup-interface vlan-interface 101 backup-nexthop 24.24.24.2

[SwitchD-route-policy-frr-10] quit

[SwitchD] ospf 1

[SwitchD-ospf-1] fast-reroute route-policy frr

[SwitchD-ospf-1] quit

Verifying the configuration

# Display route 4.4.4.4/32 on Switch S to view the backup next hop information.

[SwitchS] display ip routing-table 4.4.4.4 verbose

 

Summary Count : 1

 

Destination: 4.4.4.4/32

   Protocol: OSPF            Process ID: 1

  SubProtID: 0x1                    Age: 04h20m37s

       Cost: 1               Preference: 10

        Tag: 0                    State: Active Adv

  OrigTblID: 0x0                OrigVrf: default-vrf

    TableID: 0x2                 OrigAs: 0

      NBRID: 0x26000002          LastAs: 0

     AttrID: 0xffffffff        Neighbor: 0.0.0.0

      Flags: 0x1008c        OrigNextHop: 13.13.13.2

      Label: NULL           RealNextHop: 13.13.13.2

    BkLabel: NULL             BkNextHop: 12.12.12.2

  Tunnel ID: Invalid          Interface: Vlan-interface200

BkTunnel ID: Invalid        BkInterface: Vlan-interface100

# Display route 1.1.1.1/32 on Switch D to view the backup next hop information.

[SwitchD] display ip routing-table 1.1.1.1 verbose

 

Summary Count : 1

 

Destination: 1.1.1.1/32

   Protocol: OSPF            Process ID: 1

  SubProtID: 0x1                    Age: 04h20m37s

       Cost: 1               Preference: 10

        Tag: 0                    State: Active Adv

  OrigTblID: 0x0                OrigVrf: default-vrf

    TableID: 0x2                 OrigAs: 0

      NBRID: 0x26000002          LastAs: 0

     AttrID: 0xffffffff        Neighbor: 0.0.0.0

      Flags: 0x1008c        OrigNextHop: 13.13.13.1

      Label: NULL           RealNextHop: 13.13.13.1

    BkLabel: NULL             BkNextHop: 24.24.24.2

  Tunnel ID: Invalid          Interface: Vlan-interface200

BkTunnel ID: Invalid        BkInterface: Vlan-interface101

Troubleshooting OSPF configuration

No OSPF neighbor relationship established

Symptom

No OSPF neighbor relationship can be established.

Analysis

If the physical link and lower layer protocols work well, verify OSPF parameters configured on interfaces. Two neighbors must have the same parameters, such as the area ID, network segment, and mask (a P2P or virtual link can have different network segments and masks).

Solution

To resolve the problem:

1.        Use the display ospf peer command to verify OSPF neighbor information.

2.        Use the display ospf interface command to verify OSPF interface information.

3.        Ping the neighbor router's IP address to verify that the connectivity is normal.

4.        Verify OSPF timers. The dead interval on an interface must be at least four times the hello interval.

5.        On an NBMA network, use the peer ip-address command to manually specify the neighbor.

6.        At least one interface must have a router priority higher than 0 on an NBMA or a broadcast network.

7.        If the problem persists, contact H3C Support.

Incorrect routing information

Symptom

OSPF cannot find routes to other areas.

Analysis

The backbone area must maintain connectivity to all other areas. If a router connects to more than one area, at least one area must be connected to the backbone. The backbone cannot be configured as a stub area.

In a stub area, all routers cannot receive external routes, and all interfaces connected to the stub area must belong to the stub area.

Solution

To resolve the problem:

1.        Use the display ospf peer command to verify neighbor information.

2.        Use the display ospf interface command to verify OSPF interface information.

3.        Use the display ospf lsdb command to verify the LSDB.

4.        Use the display current-configuration configuration ospf command to verify area configuration. If more than two areas are configured, at least one area is connected to the backbone.

5.        In a stub area, all routers attached are configured with the stub command. In an NSSA area, all routers attached are configured with the nssa command.

6.        If a virtual link is configured, use the display ospf vlink command to verify the state of the virtual link.

7.        If the problem persists, contact H3C Support.