06-Layer 3 - IP Routing Configuration Guide

HomeSupportRoutersH3C SR8800 Router SeriesConfigure & DeployConfiguration GuidesH3C SR8800 Configuration Guide-Release3347-6W10306-Layer 3 - IP Routing Configuration Guide
04-OSPF Configuration
Title Size Download
04-OSPF Configuration 946.66 KB

Contents

Configuring OSPF· 1

Introduction to OSPF· 1

Basic concepts 1

Area based OSPF network partition· 3

Router types 6

OSPF network classification· 7

DR and BDR· 8

OSPF packet formats 9

Supported features 17

Protocols and standards 19

OSPF configuration task list 19

Enabling OSPF· 21

Configuration prerequisites 21

Configuration procedure· 21

Configuring OSPF areas 22

Configuration prerequisites 22

Configuring a stub area· 22

Configuring an NSSA area· 23

Configuring a virtual link· 24

Configuring OSPF network types 24

Configuration prerequisites 25

Configuring the OSPF network type for an interface as broadcast 25

Configuring the OSPF network type for an interface as NBMA·· 25

Configuring the OSPF network type for an interface as P2MP· 26

Configuring the OSPF network type for an interface as P2P· 26

Configuring OSPF route control 27

Configuration prerequisites 27

Configuring OSPF route summarization· 27

Configuring OSPF inbound route filtering· 28

Configuring ABR Type-3 LSA filtering· 29

Configuring an OSPF cost for an interface· 29

Configuring the maximum number of OSPF routes 30

Configuring the maximum number of load-balanced routes 30

Configuring OSPF preference· 30

Configuring OSPF route redistribution· 31

Advertising a host route· 32

Tuning and optimizing OSPF networks 33

Configuration prerequisites 33

Configuring OSPF packet timers 33

Specifying LSA transmission delay· 34

Specifying SPF calculation interval 34

Specifying the LSA arrival interval 35

Specifying the LSA generation interval 35

Disabling interfaces from receiving and sending OSPF packets 36

Configuring stub routers 36

Configuring OSPF authentication· 37

Adding the interface MTU into DD packets 37

Configuring the maximum number of external LSAs in LSDB· 38

Enabling compatibility with RFC 1583· 38

Logging neighbor state changes 38

Configuring OSPF network management 39

Enabling message logging· 39

Enabling the advertisement and reception of opaque LSAs 40

Configuring OSPF to give priority to receiving and processing hello packets 40

Configuring the LSU transmit rate· 40

Enabling OSPF ISPF· 41

Configuring OSPF FRR· 41

Configuring OSPF Graceful Restart 42

Configuring the OSPF GR Restarter 43

Configuring the OSPF GR Helper 43

Triggering OSPF Graceful Restart 44

Configuring BFD for OSPF· 44

Configuring control packet bidirectional detection· 45

Configuring echo packet single-hop detection· 45

Displaying and maintaining OSPF· 46

OSPF configuration examples 47

Configuring OSPF basic functions 47

Configuring OSPF route redistribution· 50

Configuring OSPF to advertise a summary route· 51

Configuring an OSPF stub area· 54

Configuring an OSPF NSSA area· 57

Configuring OSPF DR election· 59

Configuring OSPF virtual links 63

Configuring OSPF Graceful Restart 64

Configuring route filtering· 67

Configuring OSPF FRR· 69

Configuring BFD for OSPF· 71

Troubleshooting OSPF configuration· 75

No OSPF neighbor relationship established· 75

Incorrect routing information· 75

 


Configuring OSPF

Open Shortest Path First (OSPF) is a link state interior gateway protocol developed by the OSPF working group of the Internet Engineering Task Force (IETF). Now, OSPF version 2 (RFC 2328) is used.

 

 

NOTE:

Unless otherwise noted, OSPF refers to OSPFv2 throughout this document.

 

Introduction to OSPF

OSPF has the following features:

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

·           Fast convergence—Transmits routing updates instantly upon network topology changes.

·           Loop-free—Computes routes with the shortest path first (SPF) algorithm to avoid routing loops

·           Area-based network partition—Splits an AS into different areas to faciliate management. In addition, routing information transmitted between areas is summarized to reduce traffic and routing table sizes.

·           Equal-cost multi-path (ECMP) routing—Supports multiple equal-cost routes to a destination.

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

·           Authentication—Supports interface-based packet authentication to ensure the security of packet exchange.

·           Support for multicast—Multicasts protocol packets on some types of links.

Basic concepts

Autonomous System

An Autonomous System (AS) comprises a group of routers that run the same routing protocol.

OSPF route computation

OSPF computes routes in an area as follows:

·           Based on the network topology around itself, each router generates Link State Advertisements (LSAs) and sends them to other routers in update packets.

·           Each OSPF router collects LSAs from other routers to compose a link state database (LSDB). An LSA describes the network topology around a router, and the LSDB describes the entire network topology of the AS.

·           Each router transforms the LSDB to a weighted directed graph, which is the topology of the entire network. All the routers 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 AS. The router itself is the root of the tree.

Router ID

An OSPF process running on a router must have its own router ID. This ID is a 32-bit unsigned integer that uniquely identifies the router in the AS.

OSPF packets

OSPF uses the following types of packets:

·           Hello—Periodically sent to find and maintain neighbors, containing the values of some timers, 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 the neighbor. After exchanging the DD packets, the two routers know which LSAs of the neighbor are missing from their LSDBs. They then send an LSR packet to each other, requesting the missing LSAs. The LSA packet contains 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 sends routing information in LSAs, which—as defined in RFC 2328—have the following types:

·           Router LSA—Type-1 LSA, originated by all routers, 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, 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 ABRs (Area Border Routers), 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 ASBR (Autonomous System Boundary Router).

·           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 (Not-So-Stubby Areas) and flooded throughout a single NSSA. NSSA LSAs describe routes to other ASs.

·           Opaque LSA—A proposed type of LSA, the format of which consists of a standard LSA header and application specific information. Opaque LSAs are used by the OSPF protocol or by some application 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 whole AS.

Neighbor and Adjacency

In OSPF, Neighbor and Adjacency are two different concepts.

Neighbor: After startup, OSPF sends a hello packet on each OSPF interface. A router that receives the hello packet checks parameters in the packet. If the parameters match its own, the router considers the sending router an OSPF neighbor.

Adjacency: Two OSPF neighbors establish an adjacency relationship to synchronize their LSDBs. Therefore, any two neighbors without exchanging route information do not establish an adjacency.

Area based OSPF network partition

Network partition

In a large OSPF routing domain, the LSDB becomes very huge and SPF computation consumes many storage and CPU resources.

In addition, because topology changes can easily occur, OSPF packets generated for route information synchronization are enormous, occupying excessive bandwidth.

To solve these problems, OSPF splits an AS into multiple areas, each of which 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. An OSPF interface must be specified to belong to its attached area, as shown in Figure 1.

Figure 1 Area based OSPF network partition

 

After network partition, ABRs perform route summarization to reduce the number of LSAs advertised to other areas and minimize the effect of topology changes.

Backbone area and virtual links

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

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

·           The backbone area must maintain connectivity within itself.

In practice, the requirements may not be satisfied due to lack of physical links. OSPF virtual links can solve this problem.

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

In the following figure, 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 due to 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

A stub area does not distribute Type-5 LSAs, so the routing table size and amount of routing information in this area are reduced significantly. The ABR generates a default route into the area.

You can configure the stub area as a totally stub area, where the ABR advertises neither inter-area routes nor external routes.

Stub area configuration is optional, and not every area is eligible to be a stub area. In general, a stub area resides on the border of the AS.

When you configure a (totally) stub area, follow these guidelines:

·           The backbone area cannot be a (totally) stub area.

·           To configure an area as a stub area, the stub command must be configured on routers in the area.

·           To configure an area as a totally stub area, the stub command must be configured on routers in the area, and the ABR of the area must be configured with the stub [ no-summary ] command.

·           A (totally) stub area cannot have an ASBR because AS external routes cannot be distributed into the stub area.

·           Virtual links cannot transit (totally) stub areas.

NSSA area

Similar to a stub 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.

In the following figure, 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 these Type-7 LSAs, the NSSA ABR translates them to Type-5 LSAs, and then 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 these Type-5 LSAs because it is an NSSA area.

Virtual links cannot transit NSSA areas.

Figure 4 NSSA area

 

Comparsion between the areas

Figure 5 Comparison between the areas

 

Figure 5 shows the comparison of the areas:

·           In a totally stub area, the ABR distributes a Type 3 default route, rather than external routes and inter-area routes.

·           A stub area can import inter-area routes, but a stub area cannot.

·           An NSSA area can import external routes in Type 7 LSAs through the ASBR, but a stub area cannot.

·           A totally NSSA area cannot import inter-area routes but an NSSA area can.

Router types

Router classification

OSPF routers fall into following types according to their positions in the AS:

·           Internal router

All interfaces on an internal router belong to one OSPF area.

·           Area Border Router (ABR)

An ABR belongs to more than two areas, one of which must be the backbone area. It connects the backbone area to a non-backbone area. The connection between an ABR and the backbone area can be physical or logical.

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

·           Autonomous System Boundary Router (ASBR)

A router exchanging routing information with another AS is an ASBR, which may not reside on the border of the AS. It can be an internal router or an ABR.

Figure 6 OSPF router types

 

Route types

OSPF prioritize routes into the following 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.

OSPF classifies external routes as Type-1 or Type-2. A Type-1 external route has high credibility. The cost from a router to the destination of the 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, so OSPF considers the cost from the ASBR to the destination of the 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 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.

OSPF network classification

OSPF network types

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

·           Broadcast—When 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 224.0.0.6 that identifies the DR, and DD packets and LSR packets are unicast.

·           NBMA (Non-Broadcast Multi-Access)—When 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.

·           P2MP (point-to-multipoint)—By default, OSPF considers no link layer protocol as P2MP, which is a conversion from other network types such as NBMA. On a P2MP network, OSPF packets are multicast to 224.0.0.5.

·           P2P (point-to-point)—When 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.

NBMA network configuration guidelines

Typical NBMA networks include ATM and Frame Relay networks.

Becasue NBMA interfaces cannot broadcast hello packets, you must specify neighbors manually and configure router priorities for the neighbors.

An NBMA network is fully meshed, which means any two routers in the NBMA network have a direct virtual circuit for communication. If direct connections are not available between some routers, the network type of associated interfaces should be configured as P2MP. If such an interface has only one neighbor, configure its network type as P2P.

The following describes the differences between NBMA and P2MP networks:

·           NBMA networks are fully meshed, non-broadcast, and multi access. P2MP networks are not required to be fully meshed.

·           Elect a DR and BDR on an NBMA network. No DR or BDR is available on a P2MP network.

·           NBMA is the default network type, but P2MP is a conversion from another network type, such as NBMA.

·           On a NBMA network, OSPF packets are unicast, and neighbors are manually configured on routers. On a P2MP network, OSPF packets are multicast.

DR and BDR

Introduction

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 required. In addition, any topology change on the network results in traffic for route synchronization, which consumes many system and bandwidth resources. The Designated Router (DR) was introduced to solve this problem. On a network, a DR is elected to advertise routing information among other routers.

If the DR fails, routers on the network have to elect another DR and synchronize information with the new DR. It is time-consuming and prone to routing calculation errors. The Backup Designated Router (BDR) can solve this problem.

The BDR is elected along with the DR and establishes adjacencies with all other routers. When the DR fails, the BDR becomes the new DR in a very short time. Meanwhile, other routers elect a new BDR.

Routers other than the DR and BDR are called “Drothers”. They do not establish adjacencies with one another. Thus the number of adjacencies is reduced.

In Figure 7, solid lines are Ethernet physical links, and dashed lines represent OSPF adjacencies. In the network with the DR and BDR, only seven adjacencies are needed.

Figure 7 DR and BDR in a network

 

DR and BDR election

Routers in a network elect the DR and BDR according to their router priorities and router IDs. Routers with a router priority value higher than 0 are candidates for DR/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. In addition, a router with router priority 0 cannot become the DR or BDR.

·           DR election is available on broadcast and NBMA interfaces rather than P2P and P2MP interfaces.

·           A DR is an interface of a router and belongs to a single network segment. Another interface of the router may be a BDR or DRother.

·           If a router with the highest router priority is added after DR/BDR election, the router cannot become the DR immediately.

·           The DR may not be the router with the highest priority in a network, and the BDR may not be the router with the second highest priority.

OSPF packet formats

OSPF packets are directly encapsulated into IP packets. OSPF uses the IP protocol number 89. The format of an OSPF LSU packet is shown in Figure 8.

Figure 8 OSPF packet format

 

OSPF packet header

OSPF packets are classified into five types that have the same packet header.

Figure 9 OSPF packet header

 

·           Version—OSPF version number, which is 2 for OSPFv2.

·           Type—OSPF packet type from 1 to 5, corresponding to hello, DD, LSR, LSU and LSAck respectively.

·           Packet length—Total length of the OSPF packet in bytes, including the header.

·           Router ID—ID of the advertising router.

·           Area ID—ID of the area where the advertising router resides.

·           Checksum—Checksum of the message.

·           Autype—Authentication type, ranging from 0 to 2, corresponding to non-authentication, simple (plaintext) authentication, and MD5 authentication, respectively.

·           Authentication—Information determined by authentication type. It is not defined for authentication type 0. It is defined as password information for authentication type 1, and defined as Key ID, MD5 authentication data length and sequence number for authentication type 2.

 

 

NOTE:

MD5 authentication data is added following an OSPF packet rather than contained in the Authentication field.

 

Hello packet

A router sends hello packets periodically to find and maintain neighbor relationships and to elect the DR/BDR, including information about values of timers, DR, BDR, and neighbors that are already known.

Figure 10 Hello packet format

 

Major fields:

·           Network mask—Network mask associated with the router’s sending interface. If two routers have different network masks, they cannot become neighbors.

·           HelloInterval—Interval for sending hello packets. If two routers have different intervals, they cannot become neighbors.

·           Rtr Pr—Router priority. A value of 0 means the router cannot become the DR/BDR.

·           RouterDeadInterval—Time before declaring a silent router down. If two routers have different dead intervals, they cannot become neighbors.

·           Designated router—IP address of the DR.

·           Backup designated router—IP address of the BDR.

·           Neighbor—Router ID of the neighbor router.

DD packet

Two routers exchange database description (DD) packets describing their LSDBs for database synchronization. A DD packet contains only the headers of LSAs to reduce traffic.

Figure 11 DD packet format

 

Major fields:

·           Interface MTU—Specifies the largest IP datagram in bytes that the interface can send without fragmentation.

·           I (Initial)—The Init bit, which is set to 1 if the packet is the first DD packet. It is set to 0 if not.

·           M (More)—The More bit, which is set to 0 if the packet is the last DD packet. It is set to 1 if more DD packets are to follow.

·           MS (Master/Slave)—The Master/Slave bit. When set to 1, it indicates that the router is the master during the database exchange process; otherwise, the router is the slave router.

·           DD Sequence Number—Used to sequence the collection of DD packets. The initial value is set by the master. The DD sequence number then increments until the complete database description has been sent.

LSR packet

After exchanging DD packets, two routers know which LSAs of the peer are missing from the local LSDB. Then, they send (link state request) LSR packets to request the missing LSAs. An LSR packet contains the digests of the missing LSAs.

Figure 12 LSR packet format

 

Major fields:

·           LS type—Type of the LSA to be requested. Type 1 for example indicates the Router LSA.

·           Link State ID—Determined by LSA type.

·           Advertising Router—ID of the router that sent the LSA.

LSU packet

LSU (Link State Update) packets are used to send the requested LSAs to the peer. Each packet carries a collection of LSAs.

Figure 13 LSU packet format

 

LSAck packet

Link State Acknowledgment (LSAck) packets are used to acknowledge received LSU packets. An LSAack packet carries the headers of LSAs to be acknowledged.

Figure 14 LSAck packet format

 

LSA header format

All LSAs have the same header.

Figure 15 LSA header format

 

Major fields:

·           LS age—Time in seconds elapsed since the LSA was originated. An LSA ages in the LSDB (added by 1 per second), but does not age during transmission.

·           LS type—Type of the LSA.

·           Link State ID—The contents of this field depend on the LSA's type.

·           LS sequence number—Used by other routers to judge new and old LSAs.

·           LS checksum—Checksum of the LSA except the LS age field.

·           Length—Length in bytes of the LSA, including the LSA header.

LSA formats

·           Router LSA

Figure 16 Router LSA format

 

Major fields:

¡  Link State ID—ID of the router that originated the LSA.

¡  V (Virtual Link)—Set to 1 if the router that originated the LSA is a virtual link endpoint.

¡  E (External)—Set to 1 if the router that originated the LSA is an ASBR.

¡  B (Border)—Set to 1 if the router that originated the LSA is an ABR.

¡  # Links—Number of router links (interfaces) to the area, described in the LSA.

¡  Link ID—Determined by Link type.

¡  Link data—Determined by Link type.

¡  Type—Link type. A value of 1 indicates a point-to-point link to a remote router; a value of 2 indicates a link to a transit network; a value of 3 indicates a link to a stub network; a value of 4 indicates a virtual link.

¡  #TOS—Number of different TOS metrics given for this link. If no TOS metric is given for the link, this field is set to 0. TOS is not supported in RFC 2328. The #TOS field is reserved for early versions of OSPF.

¡  Metric—Cost of using this router link.

¡  TOS—IP Type of Service that this metric refers to.

¡  TOS metric—TOS-specific metric information.

·           Network LSA

A Network LSA is originated by the DR on a broadcast or NBMA network. The LSA describes all routers attached to the network.

Figure 17 Network LSA format

 

Major fields:

¡  Link State ID—The interface address of the DR

¡  Network mask—The mask of the network (a broadcast or NBMA network)

¡  Attached router—The IDs of the routers, which are adjacent to the DR, including the DR itself

·           Summary LSA

Network summary LSAs (Type-3 LSAs) and ASBR summary LSAs (Type-4 LSAs) are originated by ABRs. Except for the Link State ID field, the formats of type 3 and 4 summary-LSAs are identical.

Figure 18 Summary LSA format

 

Major fields:

¡  Link State ID—For a Type-3 LSA, it is an IP address outside the area. For a type 4 LSA, it is the router ID of an ASBR outside the area.

¡  Network mask—The network mask for the type 3 LSA. It is set to 0.0.0.0 for the Type-4 LSA.

¡  Metric—The metric to the destination.

 

 

NOTE:

A Type-3 LSA can be used to advertise a default route, having the Link State ID and Network Mask set to 0.0.0.0.

 

·           AS external LSA

An AS external LSA is originated by an ASBR, describing routing information to a destination outside the AS.

Figure 19 AS external LSA format

 

Major fields:

¡  Link State ID—The IP address of another AS to be advertised. When describing a default route, the Link State ID is always set to Default Destination (0.0.0.0) and the Network Mask is set to 0.0.0.0.

¡  Network mask—The IP address mask for the advertised destination.

¡  E (External Metric) —The type of the external metric value, which is set to 1 for type 2 external routes, and set to 0 for type 1 external routes. See “Route types“ for descriptions of external route types.

¡  Metric—The metric to the destination.

¡  Forwarding Addres—Data traffic for the advertised destination will be forwarded to this address.

¡  External Route Tag—A tag attached to each external route. This is not used by the OSPF protocol itself. It may be used to manage external routes.

·           NSSA external LSA

An NSSA external LSA originates from the ASBR in a NSSA and is flooded in the NSSA area only. It has the same format as the AS external LSA.

Figure 20 NSSA external LSA format

 

Supported features

Multi-process

This feature allows multiple OSPF processes to run on a router both simultaneously and independently. Routing information interactions between different processes seem like interactions between different routing protocols. Multiple OSPF processes can use the same RID.

An interface of a router can only belong to a single OSPF process.

Authentication

OSPF can authenticate OSPF packets. Only packets that pass the authentication are received. If an incoming hello packet cannot pass authentication, the neighbor relationship cannot be established.

The authentication type for interfaces attached to a single area must be identical. Authentication types include non-authentication, plaintext authentication, and MD5 ciphertext authentication. The authentication password for interfaces that are attached to a network segment must be identical.

Active/Standby failover

A router can back up the OSPF information of the active main board (AMB) to the standby main board (SMB). Once the AMB fails, the SMB begins to work to ensure the normal operation of OSPF.

OSPF provides the Graceful restart (GR) backup mode, which backs up only the OSPF configuration information to the SMB. Once the AMB fails, OSPF will perform GR to synchronize the LSDB with neighbors.

OSPF Graceful Restart

Graceful Restart (GR) ensures the continuity of packet forwarding when a routing protocol restarts or an active/standby switchover occurs:

·           GR Restarte—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.

After an OSPF GR Restarter restarts, it needs to perform the following tasks.

·           To obtain OSPF neighbor information.

·           To obtain the LSDB.

Before restart, the GR Restarter negotiates GR capability with GR Helpers. During the restart of the GR Restarter, GR Helpers still advertise their adjacencies with the GR Restarter. After restart, the GR Restarter sends GR Helpers an OSPF GR signal so that the GR Helpers do not reset their neighbor relationships with the GR Restarter. Upon receiving responses from neighbors, the GR Restarter creates the neighbor relationships.

After that, the GR Restarter synchronizes the LSDB with GR-capable neighbors, updates its routing table and forwarding table, and removes stale routes.

TE and DS-TE

OSPF Traffic Engineering (TE) provides for the establishment and maintenance of Label Switched Paths (LSPs) of TE.

When establishing Constraint-based Routed LSPs (CR LSPs), MPLS obtains the TE information of links in the area via OSPF.

OSPF has a new LSA, Opaque LSA, which can be used for carrying TE information.

DiffServ Aware TE (DS-TE) provides for network resource optimization and allocation, flow classification, and indication of network bandwidth consumption of each flow in a link. TE is implemented on the classified type (thin granularity summarization type) rather than the summarized type (thick granularity summarization type) to improve performance and bandwidth utilization.

To support DS-TE application in MPLS, OSPF supports Local Overbooking Multiplier TLV and Bandwidth Constraint (BC) TLV.

 

 

NOTE:

For OSPF TE configuration, see MPLS Configuration Guide.

 

IGP shortcut and forwarding adjacency

IGP Shortcut and Forwarding Adjacency enable OSPF to use an LSP as the outbound interface for a destination. Without them, OSPF cannot use the LSP as the outbound interface.

Differences between IGP Shortcut and Forwarding Adjacency:

·           If Forwarding Adjacency is enabled only, OSPF can also use an LSP as the outbound interface for a destination

·           If LGP Shortcut is enabled only, only the router enabled with it can use LSPs for routing.

 

 

NOTE:

For configuration of this feature, see MPLS Configuration Guide.

 

VPN support

In BGP MPLS VPNs, multiple sites in the same VPN can use OSPF as the internal routing protocol, but they are treated as different ASs. An OSPF route learned by a site is forwarded to another site as an external route. Thie mechanism leads to heavy OSPF routing traffic and management issues.

To solve this problem, domain IDs are used to differentiate VPNs. Sites in the same VPN are considered as directly connected. PE routers exchange OSPF routing information like on a dedicated line. Thus network management and OSPF operation efficiency are improved.

 

 

NOTE:

For configuration of this feature, see MPLS Configuration Guide.

 

OSPF sham link

An OSPF sham link is a point-to-point link between two PE routers on the MPLS VPN backbone.

In general, BGP peers exchange routing information on the MPLS VPN backbone by using the BGP extended community attributes. OSPF running on the remote PE uses the routing information to originate Type-3 summary LSAs (inter-area routes) transmitted to CEs.

If a CE has an intra-area route (backdoor route) to another CE, VPN traffic will always travel on the backdoor route rather than the corresponding inter-area route because an intra-area route has a higher priority than an inter-area route. To avoid this, an unnumbered sham link can be configured between PEs to connect the CEs via an intra-area route over the backbone.

 

 

NOTE:

For more information about sham link, see MPLS Configuration Guide.

 

BFD

 

 

NOTE:

For more information about BFD, see High Availability Configuration Guide.

 

Bidirectional forwarding detection (BFD) provides a single mechanism to quickly detect and monitor the connectivity of links between OSPF neighbors, reducing network convergence time.

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 3630, Traffic Engineering Extensions to OSPF Version 2

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

·           RFC 4812, OSPF Restart Signaling

·           RFC 4813, OSPF Link-Local Signaling

OSPF configuration task list

Make a proper plan before configuring OSPF.

To run OSPF in a routing domain, you must first enable OSPF on the routers. Then you can either use the default settings of parameters such as the hello interval, LSA delay timer, and SPF calculation interval. You can also configure them as needed. OSPF routers should be configured on an area basis. Wrong configurations may cause communication failures, routing information block, and routing loops.

Complete the following tasks to configure OSPF:

 

Task

Remarks

Enabling OSPF

Required

Configuring OSPF areas

Configuring a stub area

Optional

Configuring an NSSA area

Configuring a virtual link

Configuring OSPF network types

Configuring the OSPF network type for an interface as broadcast

Optional

Configuring the OSPF network type for an interface as NBMA

Optional

Configuring the OSPF network type for an interface as P2MP

Optional

Configuring the OSPF network type for an interface as P2P

Optional

Configuring OSPF route control

Configuring OSPF route summarization

Optional

Configuring OSPF inbound route filtering

Optional

Configuring ABR Type-3 LSA filtering

Optional

Configuring an OSPF cost for an interface

Optional

Configuring the maximum number of OSPF routes

Optional

Configuring the maximum number of load-balanced routes

Optional

Configuring OSPF preference

Optional

Configuring OSPF route redistribution

Optional

Tuning and optimizing OSPF networks

Configuring OSPF packet timers

Optional

Specifying LSA transmission delay

Optional

Specifying SPF calculation interval

Optional

Specifying the LSA arrival interval

Optional

Specifying the LSA generation interval

Optional

Disabling interfaces from receiving and sending OSPF packets

Optional

Configuring stub routers

Optional

Configuring OSPF authentication

Optional

Adding the interface MTU into DD packets

Optional

Configuring the maximum number of external LSAs in LSDB

Optional

Enabling compatibility with RFC 1583

Optional

Logging neighbor state changes

Optional

Configuring OSPF network management

Optional

Enabling message logging

Optional

Enabling the advertisement and reception of opaque LSAs

Optional

Configuring OSPF to give priority to receiving and processing hello packets

Optional

Configuring the LSU transmit rate

Optional

Enabling OSPF ISPF

Optional

Configuring OSPF FRR

Optional

Configuring OSPF Graceful Restart

Configuring the OSPF GR Restarter

Optional

Configuring the OSPF GR Helper

Optional

Triggering OSPF Graceful Restart

Optional

Configuring BFD for OSPF

Optional

 

Enabling OSPF

You must enable OSPF before performing other OSPF configuration tasks.

Configuration prerequisites

Configure the link layer protocol, and IP addresses for interfaces so that neighboring nodes can reach each other.

Configuration procedure

To enable OSPF on a router, create an OSPF process and specify areas with which the process is associated, and the network segments contained in each area. If an interface’s IP address resides on a network segment of an area, the interface belongs to the area and is enabled with OSPF, and OSPF advertises the direct route of the interface.

To run OSPF, a router must have a router ID, which is the unique identifier of the router in the AS.

·           You can specify a router ID when creating the OSPF process. Any two routers in an AS must have different router IDs. In practice, the ID of a router is the IP address of one of its interfaces.

·           If you specify no router ID when creating the OSPF process, the global router ID is used. H3C recommends you to specify a router ID when you create the OSPF process.

OSPF can run multiple processes and supports VPNs:

·           When a router runs multiple OSPF processes, you must specify a router ID for each process, which takes effect locally and has no influence on packet exchange between routers. Two routers having different process IDs can exchange packets.

·           OSPF support for VPNs enables an OSPF process to run in a specified VPN.

To enable OSPF:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Configure a global router ID.

router id router-id

Optional.

Not configured by default.

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.

3.     Enable an OSPF process and enter OSPF view.

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

Not enabled by default.

4.     Configure a description for the OSPF process.

description description

Optional.

Not configured by default.

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

area area-id

Not configured by default.

6.     Configure a description for the area.

description description

Optional.

Not configured by default.

7.     Specify a network to enable OSPF on the interface attached to the network.

network ip-address wildcard-mask

Not configured by default.

 

 

NOTE:

·       A network segment can belong to only one area.

·       Configure a description for each OSPF process to help identify purposes of processes and for ease of management and memorization.

·       Configure a description for each area to help identify purposes of areas and for ease of management and memorization.

 

Configuring OSPF areas

After you split an OSPF AS into multiple areas, you can further configure some areas as stub areas or NSSA areas as needed.

If no connection can be achieved between the backbone and a non-backbone area, or within the backbone itself, you can configure virtual links to solve it.

Configuration prerequisites

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

·           Configure IP addresses for interfaces, and make sure that all neighboring nodes are reachable to each other at the network layer.

·           Enable OSPF.

Configuring a stub area

You can configure a non-backbone area at the AS edge as a stub area by configuring the stub command on all the routers attached to the area. In this way, Type-5 LSAs will not be flooded within the stub area, reducing the routing table size. The ABR generates a default route into the stub area so that 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 it as a totally stub area by using the stub [ no-summary ] command on the ABR. In this way, neither AS external routes nor inter-area routing information will be distributed into the area. All the packets destined outside of the AS or area will be sent to the ABR for forwarding.

To configure OSPF areas:

 

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 [ no-summary ]

Not configured by default.

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

default-cost cost

Optional.

The default setting is 1.

 

 

NOTE:

·       Issue the stub command on routers attached to a stub area.

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

·       The backbone area cannot be a (totally) stub area.

·       A (totally) stub area cannot have an ASBR because AS external routes cannot be distributed into the stub area.

·       Virtual links cannot transit (totally) stub areas.

 

Configuring an NSSA area

A stub area cannot redistribute routes. You can configure the area as an NSSA area to allow for route redistribution by keeping other stub area characteristics.

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 | no-import-route | no-summary | translate-always | translator-stability-interval value ] *

Not configured by default.

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

default-cost cost

Optional.

The default setting is1.

 

 

NOTE:

·       Issue the nssa command on all the routers attached to an NSSA area.

·       The default-cost command takes effect only on the ABR/ASBR of an NSSA area.

 

Configuring a virtual link

Non-backbone areas exchange routing information via the backbone area. Connectivity between the backbone and non-backbone areas and within the backbone must be maintained.

If necessary physical links are not available for this connectivity maintenance, you can configure virtual links to solve it.

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 [ hello seconds | retransmit seconds | trans-delay seconds | dead seconds | simple [ plain | cipher ] password | { md5 | hmac-md5 } key-id [ plain | cipher ] password ] *

Configure this command on both ends of a virtual link.

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 by the link layer protocol:

·           Broadcast—When the link layer protocol is Ethernet or FDDI, OSPF considers the network type as broadcast by default.

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

·           P2P—When the link layer protocol is PPP, LAPB, HDLC, or POS, OSPF considers the network type as P2P by default.

You can change the network type of an interface as needed.

·           When an NBMA network becomes fully meshed through address mapping—any two routers in the network have a direct virtual circuit in between, you can change the network type to broadcast to avoid manual configuration of neighbors.

·           When some routers in the broadcast network do not support multicast, you can change the network type to NBMA.

·           An NBMA network must be fully meshed. If it is partially meshed, you can change the network type to P2MP to simplify configuration and save costs.

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

If two interfaces on a link are both configured as the broadcast, NBMA, or P2MP network type, they cannot establish a neighbor relationship unless they are on the same network segment.

Configuration prerequisites

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

·           Configure IP addresses for interfaces, and make sure that all neighboring nodes are reachable to each other at network layer.

·           Enable OSPF.

Configuring the OSPF network type for an interface as broadcast

To configure the OSPF network type for an interface as broadcast:

 

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.     Configure a router priority for the interface.

ospf dr-priority priority

Optional.

The default router priority is 1.

 

Configuring the OSPF network type for an interface as NBMA

After you configure the network type of an interface as NBMA, make some special configurations.

Because NBMA interfaces cannot find neighbors via broadcasting Hello packets, you must specify neighbors and their router priorities. (A router priority of 0 means the router does not have the DR election right. A router priority greater than 0 means the router has the DR election right.)

To configure the OSPF network type for an Interface as NBMA:

 

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.     Configure a router priority for the interface.

ospf dr-priority priority

Optional.

The default router priority is 1.

5.     Exit 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 ]

N/A

 

 

NOTE:

The router priority configured with the ospf dr-priority command and the one configured with the peer command have the following differences.

·       The former is for actual DR election.

·       The latter is to indicate whether a neighbor has the election right or not. If you configure the router priority for a neighbor as 0, the local router will assume the neighbor has no election right, and thus send no hello packets to this neighbor. However, if the local router is the DR or BDR, it still sends hello packets to the neighbor with priority 0 for adjacency establishment.

 

Configuring the OSPF network type for an interface as P2MP

To configure the OSPF network type for an interface as P2MP:

 

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. In that case, you need to manually specify the neighbors.

4.     Exit 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.     Specify a neighbor and its router priority on a P2MP unicast network.

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

Required if the interface type is P2MP unicast.

 

Configuring the OSPF network type for an interface as P2P

To configure the OSPF network type for an interface as P2P:

 

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

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 this task, complete the following tasks:

·           Configure IP addresses for interfaces.

·           Enable OSPF.

·           Configure filters if routing information filtering is needed.

Configuring OSPF route summarization

You can configure route summarization on an ABR or ASBR to summarize routes with the same prefix into a single route and distribute it to other areas.

Route summarization reduces the traffic of routing information exchanged between areas and the sizes of routing tables on routers, improving route calculation speed on routers.

For example, in an area are three internal routes 19.1.1.0/24, 19.1.2.0/24, and 19.1.3.0/24. By configuring route summarization on the ABR, the three routes are summarized into the route 19.1.0.0/16 that is advertised to other areas.

Configuring route summarization on an ABR

If contiguous network segments are available in the area, you can summarize them into a single network segment. An ABR generates Type-3 LSAs on a per network segment basis for an attached non-backbone area.

In this way, the ABR in the area distributes only the summary LSA to reduce the scale of LSDBs on routers in other areas and the influence of topology changes.

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 | mask-length } [ advertise | not-advertise ] [ cost cost ]

Not configured by default.

The command is available on an ABR only.

 

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 a summary route is configured, 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 that fall into the specified address range. If the ASBR is in an NSSA area, it also summarizes Type-7 LSAs that fall into 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 | mask-length } [ tag tag | not-advertise | cost cost ] *

The command is available on an ASBR only.

Not configured by default.

 

Configuring OSPF inbound route filtering

 

 

NOTE:

For more information about IP prefix list and routing policy, see the chapter “Configuring routing policies.”

 

OSPF calculates routes by using LSAs. The calculated routes can be filtered and only permitted routes are installed into the OSPF routing table.

OSPF provides the following filtering methods:

·           Filters routing information by destination address through ACLs and IP address prefixes

·           Filters routing information by next hop through the filtering criteria configured with the gateway keyword

·           Filters routing information by destination address through ACLs and IP address prefixes and by next hop through the filtering criteria configured with the gateway keyword

·           Filters routing information by routing policy specified by the route-policy keyword

To configure inbound route 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.     Configure inbound route filtering.

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

Not configured by default

 

Configuring ABR Type-3 LSA filtering

You can configure an ABR to filter Type-3 LSAs advertised to an area.

To configure Type-3 LSA filtering 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 area view.

area area-id

N/A

4.     Configure ABR Type-3 LSA filtering.

filter { acl-number | ip-prefix ip-prefix-name } { import | export }

Not configured by default

 

Configuring an OSPF cost for an interface

You can 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 ÷ Interface bandwidth. 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 is configured for an interface, OSPF computes the interface cost automatically.

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

Optional.

By default, an interface computes its cost according to the bandwidth.

The cost value defaults to 0 on loopback interfaces.

 

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

Optional.

The value defaults to 100 Mbps.

 

Configuring the maximum number of OSPF routes

To configure the maximum number of 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 OSPF routes.

maximum-routes { external | inter | intra } number

Optional

 

Configuring the maximum number of load-balanced routes

If several equal-cost routes to the same destination are available, you can configure them as load-balanced routes to improve link utilization.

To configure the maximum number of load-balanced 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 load-balanced routes.

maximum load-balancing maximum

Optional

 

Configuring OSPF preference

A router may run multiple routing protocols, and each protocol is assigned a preference. When the routing protocols find routes to the same destination, the route found by the protocol with the highest 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

Optional.

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

 

Configuring OSPF route redistribution

Configuring OSPF to redistribute routes from another routing protocol

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 routes, and advertise them in Type-5 LSAs or Type-7 LSAs.

By filtering redistributed routes, OSPF translates only permitted routes into Type-5 LSAs or Type-7 LSAs for advertisement.

To configure OSPF route redistribution:

 

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

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

Not configured by default.

4.     Configure OSPF to filter redistributed routes before advertisement.

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

Optional.

Not configured by default.

 

 

NOTE:

·       Using the import-route command cannot redistribute a default external route. To do so, you must use the default-route-advertise command.

·       You can configure default parameters such as the cost, upper limit, tag, and type for redistributed routes. Tags are used to indicate information related to protocols. For example, when redistributing BGP routes, OSPF uses tags as AS IDs.

·       Only active routes can be redistributed. You can use the display ip routing-table protocol command to view route state information.

 

Configuring OSPF to redistribute a default route

Using the import-route command cannot redistribute a default external route. To do so, you must use the default-route-advertise command.

To configure OSPF to redistribute a default external 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.

·       Approach 1:
default-route-advertise [ always | cost cost | type type | route-policy route-policy-name ] *

·       Approach 2:
default-route-advertise summary cost cost

Optional

Not redistributed by default

 

 

NOTE:

The default-route-advertise summary cost command is applicable only to VPN, and the default route is redistributed in a Type-3 LSA. The PE router will advertise the default route to the CE router.

 

Configuring the default parameters for redistributed routes

You can configure default parameters such as the cost, upper limit, tag and type for redistributed routes. Tags indicate information related to 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, route number, tag and type).

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

Optional.

The default cost is 1, the default maximum number of routes redistributed per time is 1000, the default tag is 1, and default type of redistributed routes is Type-2.

 

Advertising a host route

To advertise 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

Optional

Not advertised by default

 

Tuning and optimizing OSPF networks

You can optimize your OSPF network in the following ways.

·           Change OSPF packet timers to adjust the OSPF network convergence speed and network load. On low speed links, you must 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.

·           Configure OSPF network management functions, such as binding OSPF MIB with a process, sending trap information and collecting log information.

Configuration prerequisites

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

·           Configure IP addresses for interfaces.

·           Enable OSPF.

Configuring OSPF packet timers

You can configure the following timers on OSPF interfaces as needed.

·           Hello timer—Interval for sending hello packets. It must be identical on OSPF neighbors. The longer the interval, the lower the convergence speed, and the smaller the network load.

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

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

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

To configure timers for OSPF packets:

 

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

Optional.

The hello interval defaults to 10 seconds on P2P and broadcast interfaces, and defaults to 30 seconds on P2MP and NBMA interfaces.

4.     Specify the poll interval.

ospf timer poll seconds

Optional.

The poll interval defaults to 120 seconds.

5.     Specify the dead interval.

ospf timer dead seconds

Optional.

The default dead interval is 40 seconds on P2P and broadcast interfaces and 120 seconds on P2MP and NBMA interfaces.

6.     Specify the retransmission interval.

ospf timer retransmit interval

Optional.

The retransmission interval defaults to 5 seconds.

 

 

NOTE:

·       The hello and dead intervals restore to default values after you change the network type for an interface.

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

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

·       The retransmission interval should not be so small to avoid unnecessary LSA retransmissions. In general, this value is bigger than the round-trip time of a packet between two neighbors.

 

Specifying LSA transmission delay

Each LSA in the LSDB has an age that is incremented by 1 every second, but the age does not change during transmission. It is necessary to add a transmission delay into the age time 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

Optional

1 second by default

 

Specifying SPF calculation interval

LSDB changes lead to 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.

To configure 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 ] ]

Optional.

By default, the interval is 5 seconds.

 

 

NOTE:

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.

 

Specifying the LSA arrival interval

After receiving the same LSA as the previously received LSA within the LSA arrival interval, OSPF discards the LSA.

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

Optional

1000 milliseconds by default

 

 

NOTE:

The interval set with the lsa-arrival-interval command should be smaller than or equal to the interval set with the lsa-generation-interval command.

 

Specifying the LSA generation interval

You can adjust the LSA generation interval to protect network resources and routers from being over consumed due to frequent network changes.

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 [ initial-interval [ incremental-interval ] ]

Optional.

By default, the maximum interval is 5 seconds, the minimum interval is 0 milliseconds and the incremental interval is 5000 milliseconds.

 

 

NOTE:

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.

 

Disabling interfaces from receiving and sending OSPF packets

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 }

Optional

Not disabled by default

 

 

NOTE:

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

·       After an OSPF interface is set to silent, other interfaces on the router can still advertise direct routes of the interface in Router LSAs, but the interface cannot send any packet. This configuration can enhance OSPF adaptability and reduce resource consumption.

 

Configuring stub routers

A stub router is used for traffic control. It tells other OSPF routers to not use it to forward data.

The Router LSAs from the stub router may 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. 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. Thus, neighbors find that the links to the stub router have such big costs that they will not send packets to the stub router for forwarding as long as another route with a smaller cost exists.

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

Not configured by default

 

 

NOTE:

A stub router has nothing to do with a stub area.

 

Configuring OSPF authentication

You can configure OSPF packet authentication to ensure the security of packet exchange.

After authentication is configured, OSPF only receives packets that pass authentication. Failed packets cannot establish neighboring relationships.

To configure OSPF authentication, you must configure the same area authentication mode on all the routers in the area. In addition, the authentication mode and password for all interfaces attached to the same area must be identical.

To configure OSPF 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 the authentication mode.

authentication-mode { md5 | simple }

Not configured by default.

5.     Return to OSPF view.

quit

N/A

6.     Return to system view.

quit

N/A

7.     Enter interface view.

interface interface-type interface-number

N/A

8.     Configure OSPF authentication.

·       Configure the authentication mode (simple authentication) for the interface:
ospf authentication-mode simple [ cipher | plain ] password

·       Configure the authentication mode (MD5 authentication) for the interface:
ospf authentication-mode { hmac-md5 | md5 } key-id [ cipher | plain ] password

Use either approach.

Not configured by default.

 

Adding the interface MTU into DD packets

By default, an interface adds 0 into the interface MTU field of a DD packet to be sent rather than the 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

Optional

Not enabled by default

 

Configuring the maximum number of external LSAs in LSDB

To configure the maximum number of external LSAs in the Link State Database:

 

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

Optional

Not specified by default

 

Enabling compatibility with RFC 1583

The selection of an external route from multiple LSAs as defined in RFC 2328 is different from the one defined in RFC 1583. If RFC 1583 is made compatible with RFC 2328, the routes in the backbone area are preferred; if not, the routes in the non-backbone area are preferred to reduce the burden of the backbone area.

To make them compatible:

 

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

Optional

Enabled by default

 

 

NOTE:

To avoid routing loops, H3C recommends configuring all the routers to be either compatible or incompatible with RFC 1583.

 

Logging neighbor state changes

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

Optional

Enabled by default

 

Configuring OSPF network management

With trap generation enabled, OSPF generates traps to report important events. Traps fall into the following levels.

·           Level-3Fault traps

·           Level-4Alarm traps

·           Level-5Normal but important traps

·           Level-6Notification traps

The generated traps are sent to the information center of the router. The output rules of the traps such as whether to output the traps and the output direction are determined according to the information center configuration. (For information center configuration, 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

Optional.

The OSPF process with the smallest process-id is bound with OSPF MIB by default.

3.     Enable OSPF trap generation.

snmp-agent trap enable ospf [ process-id ] [ ifauthfail | ifcfgerror | ifrxbadpkt | ifstatechange | iftxretransmit | lsdbapproachoverflow | lsdboverflow | maxagelsa | nbrstatechange | originatelsa | vifcfgerror | virifauthfail | virifrxbadpkt | virifstatechange | viriftxretransmit | virnbrstatechange ] *

Optional.

Enabled by default.

 

Enabling message logging

To enable message logging:

 

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 message logging.

enable log [ config | error | state ]

Not enabled by default

 

Enabling the advertisement and reception of opaque LSAs

With this feature enabled, OSPF can receive and advertise Type 9, Type 10, and Type 11 opaque LSAs.

To enable the advertisement and reception of opaque 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.     Enable the advertisement and reception of opaque LSAs.

opaque-capability enable

Optional

Disabled by default

 

Configuring OSPF to give priority to receiving and processing hello packets

To ensure OSPF runs properly, a router receives and processes Hello packets and other protocol packets at the same time. When the router has established neighbor relationships with multiple routers and the routing table size is big, the router needs to receive and process large numbers of packets. In this case, you can configure OSPF to give priority to receiving and processing Hello packets to ensure stable neighbor relationships.

To configure OSPF to give priority to receiving and processing Hello packets:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Configure OSPF to give priority to receiving and processing Hello packets.

ospf packet-process prioritized-treatment

Not configured by default

 

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

Optional.

By default, an OSPF interface sends up to three LSU packets every 20 milliseconds.

 

Enabling OSPF ISPF

When a network topology is changed, Incremental Shortest Path First (ISPF) allows the system to recomputes only the affected part of the shortest path tree (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

Optional

Disabled by default

 

Configuring OSPF FRR

 

 

NOTE:

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

·       Do not use the fast-reroute auto command together with the commands vlink-peer, sham-link, enable traffic-adjustment, and enable traffic-adjustment advertise (in MPLS Command Reference).

 

Introduction

When a link fails, the packets on the link are discarded, and a routing loop may occur until OSPF completes routing convergence based on the new network topology.

You can enable OSPF fast reroute (FRR) to solve this problem.

Figure 21 Network diagram for OSPF FRR

 

In Figure 21, after you enable FRR on Router B, OSPF automatically calculates or designates a backup next hop when a link failure is detected. Packets are directed 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 routing convergence.

You can either configure OSPF FRR to calculate a backup next hop automatically, or to designate a backup next hop by using a routing policy.

Configuration prerequisites

Before you configure OSPF FRR, complete the following tasks:

·           Configure network layer addresses for interfaces.

·           Enable OSPF.

Configuring OSPF FRR to automatically calculate a backup next hop

To configure automatic OSPF FRR:

 

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

Not configured by default.

3.     Enter OSPF view.

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

N/A

4.     Enable OSPF FRR to automatically calculate a backup next hop.

fast-reroute auto [ abr-only ]

Not configured by default.

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

 

Configuring OSPF FRR to designate a backup next hop with a routing policy

Before configuring 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 the chapter “Configuring routing policies.”

To configure OSPF FRR:

 

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

Not configured by default

3.     Enter OSPF view.

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

N/A

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

fast-reroute route-policy route-policy-name

Not configured by default

 

Configuring OSPF Graceful Restart

OSPF GR involves:

·           IETF standard GR—Uses Opaque LSAs to implement GR.

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

A router can act as a GR Restarter and GR Helper at the same time.

Configuring the OSPF GR Restarter

You can configure the IETF standard or non IETF standard OSPF GR Restarter.

Configuring the IETF standard OSPF GR Restarter

To configure the standard 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 advertisement capability.

opaque-capability enable

Disabled by default

4.     Enable the IETF standard Graceful Restart capability.

graceful-restart ietf

Disabled by default

5.     Configure the Graceful Restart interval.

graceful-restart interval timer

Optional

120 seconds by default

 

Configuring the non-IETF standard OSPF GR Restarter

To configure non-IETF standard 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

Disabled by default

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

enable out-of-band-resynchronization

Disabled by default

5.     Enable non IETF standard Graceful Restart capability for OSPF.

graceful-restart [ nonstandard ]

Disabled by default

6.     Configure Graceful Restart interval for OSPF.

graceful-restart interval timer

Optional

120 seconds by default

 

Configuring the OSPF GR Helper

You can configure the IETF standard or non IETF standard OSPF GR Helper.

Configuring the IETF standard OSPF GR Helper

To configure the IETF standard 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.

opaque-capability enable

Not enabled by default.

4.     Configure the neighbors for which the router can serve as a GR Helper.

graceful-restart help { acl-number | prefix prefix-list }

Optional.

The router can server as a GR Helper for any OSPF neighbor by default.

 

Configuring the non IETF standard OSPF GR Helper

To configure the non IETF standard 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

Disabled by default.

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

enable out-of-band-resynchronization

Disabled by default.

5.     Configure the neighbors for which the router can serve as a GR Helper.

graceful-restart help { acl-number | prefix prefix-list }

Optional.

The router can server as a GR Helper for any OSPF neighbor by default.

 

Triggering OSPF Graceful Restart

Performing an active/standby switchover on a router will trigger OSPF Graceful Restart.

To trigger OSPF Graceful Restart:

 

Task

Command

Remarks

Trigger OSPF Graceful Restart.

reset ospf [ process-id ] process graceful-restart

Available in user view

 

Configuring BFD for OSPF

OSPF supports the following BFD detection methods:

·           Control packet bidirectional detection, which requires BFD configuration to be made on both OSPF routers on the link.

·           Echo packet single-hop detection, which requires BFD configuration to be made on one OSPF router on the link.

Configuring control packet bidirectional detection

To enable BFD control packet bidirectional detection on an OSPF interface:

 

Step

Command

Description

1.     Enter system view.

system-view

N/A

2.     Enable an OSPF process and enter OSPF view.

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

N/A

3.     Specify a network to enable OSPF on the interface attached to the network.

network ip-address wildcard-mask

Not specified by default

4.     Exit to system view.

quit

N/A

5.     Enter interface view.

interface interface-type interface-number

N/A

6.     Enable BFD control packet bidirectional detection on the interface.

ospf bfd enable

Not enabled by default

 

 

NOTE:

·       One network segment can only belong to one area.

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

 

Configuring echo packet single-hop detection

To enable BFD echo packet single-hop detection on an OSPF interface:

 

Step

Command

Description

1.     Enter system view.

system-view

N/A

2.     Configure the source address of echo packets.

bfd echo-source-ip ip-address

Not configured by default

3.     Enable an OSPF process and enter OSPF view.

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

N/A

4.     Specify a network to enable OSPF on the interface attached to the network.

network ip-address wildcard-mask

N/A

5.     Return to system view.

quit

N/A

6.     Enter interface view.

interface interface-type interface-number

N/A

7.     Enable BFD echo packet single-hop detection on the interface.

ospf bfd enable echo

Not enabled by default

 

Displaying and maintaining OSPF

 

Task

Command

Remarks

Display OSPF brief information.

display ospf [ process-id ] brief [ | { begin | exclude | include } regular-expression ]

Available in any view

Display OSPF statistics.

display ospf [ process-id ] cumulative [ | { begin | exclude | include } regular-expression ]

Available in any view

Display Link State Database information.

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

Available in any view

Display OSPF neighbor information.

display ospf [ process-id ] peer [ verbose ] [ interface-type interface-number ] [ neighbor-id ] [ | { begin | exclude | include } regular-expression ]

Available in any view

Display neighbor statistics of OSPF areas.

display ospf [ process-id ] peer statistics [ | { begin | exclude | include } regular-expression ]

Available in any view

Display next hop information.

display ospf [ process-id ] nexthop [ | { begin | exclude | include } regular-expression ]

Available in any view

Display routing table information.

display ospf [ process-id ] routing [ interface interface-type interface-number ] [ nexthop nexthop-address ] [ | { begin | exclude | include } regular-expression ]

Available in any view

Display virtual link information.

display ospf [ process-id ] vlink [ | { begin | exclude | include } regular-expression ]

Available in any view

Display OSPF request queue information.

display ospf [ process-id ] request-queue [ interface-type interface-number ] [ neighbor-id ] [ | { begin | exclude | include } regular-expression ]

Available in any view

Display OSPF retransmission queue information.

display ospf [ process-id ] retrans-queue [ interface-type interface-number ] [ neighbor-id ] [ | { begin | exclude | include } regular-expression ]

Available in any view

Display OSPF ABR and ASBR information.

display ospf [ process-id ] abr-asbr [ | { begin | exclude | include } regular-expression ]

Available in any view

Display OSPF interface information.

display ospf [ process-id ] interface [ all | interface-type interface-number ] [ | { begin | exclude | include } regular-expression ]

Available in any view

Display OSPF error information.

display ospf [ process-id ] error [ | { begin | exclude | include } regular-expression ]

Available in any view

Display OSPF ASBR summarization information.

display ospf [ process-id ] asbr-summary [ ip-address { mask | mask-length } ] [ | { begin | exclude | include } regular-expression ]

Available in any view

Display the global router ID.

display router id [ | { begin | exclude | include } regular-expression ]

Available in any view

Reset OSPF counters.

reset ospf [ process-id ] counters [ neighbor [ interface-type interface-number ] [ router-id ] ]

Available in user view

Reset an OSPF process.

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

Available in any view

Re-enable OSPF route redistribution.

reset ospf [ process-id ] redistribution

Available in any view

 

OSPF configuration examples

 

 

NOTE:

These examples only cover OSPF configuration related commands.

 

Configuring OSPF basic functions

Network requirements

·           As shown in Figure 22, all routers run OSPF. The AS is split into three areas, in which, Router A and Router B act as ABRs.

·           After configuration, all routers can learn routes to every network segment in the AS.

Figure 22 Network diagram

 

Configuration procedure

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

2.      Configure OSPF basic functions:

# Configure Router A.

<RouterA> system-view

[RouterA] ospf

[RouterA-ospf-1] area 0

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

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

[RouterA-ospf-1] area 1

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

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

[RouterA-ospf-1] quit

# Configure Router B.

<RouterB> system-view

[RouterB] ospf

[RouterB-ospf-1] area 0

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

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

[RouterB-ospf-1] area 2

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

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

[RouterB-ospf-1] quit

# Configure Router C.

<RouterC> system-view

[RouterC] ospf

[RouterC-ospf-1] area 1

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

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

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

[RouterC-ospf-1] quit

# Configure Router D.

<RouterD> system-view

[RouterD] ospf

[RouterD-ospf-1] area 2

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

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

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

[RouterD-ospf-1] quit

3.      Verify the configuration:

# Display the OSPF neighbors of Router A.

[RouterA] 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(GigabitEthernet1/1/1)'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

   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(GigabitEthernet1/1/2)'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

   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 Router A.

[RouterA] 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 the Link State Database on Router A.

[RouterA] display ospf lsdb

 

          OSPF Process 1 with Router ID 10.2.1.1

                  Link State Database

 

                          Area: 0.0.0.0

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    10.2.1.1        10.2.1.1          1069  36    80000012       0

 Router    10.3.1.1        10.3.1.1           780  36    80000011       0

 Network   10.1.1.1        10.2.1.1          1069  32    80000010       0

 Sum-Net   10.5.1.0        10.3.1.1           780  28    80000003      12

 Sum-Net   10.2.1.0        10.2.1.1          1069  28    8000000F      10

 Sum-Net   10.3.1.0        10.3.1.1           780  28    80000014       2

 Sum-Net   10.4.1.0        10.2.1.1           769  28    8000000F      13

                          Area: 0.0.0.1

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    10.2.1.1        10.2.1.1           769  36    80000012       0

 Router    10.4.1.1        10.4.1.1          1663  48    80000012       0

 Network   10.2.1.1        10.2.1.1           769  32    80000010       0

 Sum-Net   10.5.1.0        10.2.1.1           769  28    80000003      14

 Sum-Net   10.3.1.0        10.2.1.1          1069  28    8000000F       4

 Sum-Net   10.1.1.0        10.2.1.1          1069  28    8000000F       2

 Sum-Asbr  10.3.1.1        10.2.1.1          1069  28    8000000F       2

# Display OSPF routing information on Router D.

[RouterD] 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

# Ping 10.4.1.1 to check connectivity.

[RouterD] ping 10.4.1.1

  PING 10.4.1.1: 56  data bytes, press CTRL_C to break

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

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

    Reply from 10.4.1.1: bytes=56 Sequence=3 ttl=255 time=2 ms

    Reply from 10.4.1.1: bytes=56 Sequence=4 ttl=255 time=2 ms

    Reply from 10.4.1.1: bytes=56 Sequence=5 ttl=255 time=3 ms

 

  --- 10.4.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

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

Configuring OSPF route redistribution

Network requirements

As shown in Figure 23:

·           All the routers run OSPF, and the AS is divided into three areas.

·           Router A and Router B act as ABRs to forward routes between areas.

·           Router C is configured as an ASBR to redistribute external routes (static routes). Routing information is propagated properly in the AS.

Figure 23 Network diagram

 

Configuration procedure

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

2.      Configure OSPF basic functions (see “Configuring OSPF basic functions”).

3.      Configure OSPF to redistribute routes:

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

<RouterC> system-view

[RouterC] ip route-static 3.1.2.1 24 10.4.1.2

# On Router C, configure OSPF to redistribute the static route.

[RouterC] ospf 1

[RouterC-ospf-1] import-route static

4.      Verify the configuration:

# Display the ABR/ASBR information of Router D.

 <RouterD> 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 of Router D.

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

Configuring OSPF to advertise a summary route

Network requirements

As shown in Figure 24:

·           Router A and Router B are in AS 200, running OSPF.

·           Router C, Router D, and Router E are in AS 100, running OSPF.

·           An EBGP connection is established between Router B and Router C. Router B and Router C are configured to redistribute OSPF routes and direct routes into BGP and BGP routes into OSPF.

·           Router B is configured with route summarization and advertises only the summary route 10.0.0.0/8 to reduce Router A's routing table size.

Figure 24 Network diagram

 

Configuration procedure

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

2.      Configure OSPF basic functions:

# Configure Router A.

<RouterA> system-view

[RouterA] ospf

[RouterA-ospf-1] area 0

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

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

[RouterA-ospf-1] quit

# Configure Router B.

<RouterB> system-view

[RouterB] ospf

[RouterB-ospf-1] area 0

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

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

[RouterB-ospf-1] quit

# Configure Router C.

<RouterC> system-view

[RouterC] ospf

[RouterC-ospf-1] area 0

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

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

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

[RouterC-ospf-1] quit

# Configure Router D.

<RouterD> system-view

[RouterD] ospf

[RouterD-ospf-1] area 0

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

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

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

# Configure Router E.

<RouterE> system-view

[RouterE] ospf

[RouterE-ospf-1] area 0

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

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

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

[RouterE-ospf-1] quit

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

# Configure Router B.

[RouterB] bgp 200

[RouterB-bgp] peer 11.1.1.2 as-number 100

[RouterB-bgp] import-route ospf

[RouterB-bgp] import-route direct

[RouterB-bgp] quit

# Configure Router C.

[RouterC] bgp 100

[RouterC-bgp] peer 11.1.1.1 as-number 200

[RouterC-bgp] import-route ospf

[RouterC-bgp] import-route direct

[RouterC-bgp] quit

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

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

[RouterB] ospf

[RouterB-ospf-1] import-route bgp

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

[RouterC] ospf

[RouterC-ospf-1] import-route bgp

# Display the routing table of Router A.

[RouterA] display ip routing-table

Routing Tables: Public

         Destinations : 8        Routes : 8

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

10.1.1.0/24         O_ASE  150  1            11.2.1.1        GE3/1/1

10.2.1.0/24         O_ASE  150  1            11.2.1.1        GE3/1/1

10.3.1.0/24         O_ASE  150  1            11.2.1.1        GE3/1/1

10.4.1.0/24         O_ASE  150  1            11.2.1.1        GE3/1/1

11.2.1.0/24         Direct 0    0            11.2.1.2        GE3/1/1

11.2.1.2/32         Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

5.      Configure summary route 10.0.0.0/8 on Router B and advertise it:

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

# Display the routing table of Router A.

[RouterA] display ip routing-table

Routing Tables: Public

         Destinations : 5        Routes : 5

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

10.0.0.0/8          O_ASE  150  2            11.2.1.1        GE3/1/1

11.2.1.0/24         Direct 0    0            11.2.1.2        GE3/1/1

11.2.1.2/32         Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/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 summaried into one route 10.0.0.0/8.

Configuring an OSPF stub area

Network requirements

Figure 25 shows an AS is split into three areas, where all routers run OSPF. Router A and Router B act as ABRs to forward routing information between areas. Router D acts as the ASBR and is enabled to redistribute static routes.

Configure Area 1 as a Stub area, reducing LSAs to this area without influencing route reachability.

Figure 25 OSPF Stub area configuration

 

Configuration procedure

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

2.      Configure OSPF basic functions (see “Configuring OSPF basic functions”).

3.      Configure Router D to redistribute static routes:

<RouterD> system-view

[RouterD] ip route-static 3.1.3.1 24 GigabitEthernet 1/1/2 10.5.1.10

[RouterD] ospf

[RouterD-ospf-1] import-route static

[RouterD-ospf-1] quit

# Display ABR/ASBR information on Router C.

<RouterC> 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         1     10.2.1.1        ABR

 Inter       10.3.1.1        0.0.0.1         2     10.2.1.1        ABR

 Inter       10.5.1.1        0.0.0.1         3     10.2.1.1        ASBR

 

# Display OSPF routing information on Router C.

<RouterC> 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        1        Transit 10.2.1.2        10.2.1.1        0.0.0.1

 10.3.1.0/24        3        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.4.1.0/24        1        Stub    10.4.1.1        10.4.1.1        0.0.0.1

 10.5.1.0/24        4        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.1.1.0/24        2        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 

 Routing for ASEs

 Destination        Cost     Type    Tag         NextHop         AdvRouter

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

 

 

NOTE:

Since Router C resides in a normal OSPF area, its routing table contains an external route.

 

4.      Configure Area1 as a Stub area:

# Configure Router A.

<RouterA> system-view

[RouterA] ospf

[RouterA-ospf-1] area 1

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

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

[RouterA-ospf-1] quit

# Configure Router C.

<RouterC> system-view

[RouterC] ospf

[RouterC-ospf-1] area 1

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

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

[RouterC-ospf-1] quit

# Display routing information on Router C.

[RouterC] 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          1        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.2.1.0/24        1        Transit 10.2.1.2        10.2.1.1        0.0.0.1

 10.3.1.0/24        3        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.4.1.0/24        1        Stub    10.4.1.1        10.4.1.1        0.0.0.1

 10.5.1.0/24        4        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.1.1.0/24        2        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

 

 

NOTE:

After the area where Router C resides is configured as a Stub area, a default route takes the place of the external route.

 

# Filter Type-3 LSAs out the Stub area.

[RouterA] ospf

[RouterA-ospf-1] area 1

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

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

# Display OSPF routing information on Router C.

[RouterC] 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          1        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.2.1.0/24        1        Transit 10.2.1.2        10.4.1.1        0.0.0.1

 10.4.1.0/24        1        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

 

 

NOTE:

After this configuration, route entries on the stub router are further reduced, containing only the default external route.

 

Configuring an OSPF NSSA area

Network requirements

Figure 26 shows an AS is split into three areas, where all routers run OSPF. Router A and Router B act as ABRs to forward routing information between areas.

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

Figure 26 Network diagram

 

Configuration procedure

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

2.      Configuring OSPF basic functions (see “Configuring OSPF basic functions”).

3.      Configure Area 1 as an NSSA area:

# Configure Router A.

<RouterA> system-view

[RouterA] ospf

[RouterA-ospf-1] area 1

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

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

# Configure Router C.

<RouterC> system-view

[RouterC] ospf

[RouterC-ospf-1] area 1

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

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

[RouterC-ospf-1] quit

 

 

NOTE:

·       If Router C in the NSSA area wants to obtain routes to other areas within the AS, you must configure the nssa command with the keyword default-route-advertise on Router A (an ABR) so that Router C can obtain a default route.

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

 

# Display routing information on Router C

[RouterC] 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          1        Inter   10.2.1.1        10.2.1.1        0.0.0.1

 10.2.1.0/24        1        Transit 10.2.1.2        10.2.1.1        0.0.0.1

 10.4.1.0/24        1        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 Router C to redistribute static routes:

[RouterC] ip route-static 3.1.3.1 24 GigabitEthernet 1/1/2 10.4.1.2

[RouterC] ospf

[RouterC-ospf-1] import-route static

[RouterC-ospf-1] quit

# Display routing information on Router D.

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

 

 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

 

 

NOTE:

The output shows that on Router D an external route imported from the NSSA area.

 

Configuring OSPF DR election

Network requirements

In Figure 27:

·           Router A, B, C and D are on the same network, running OSPF.

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

Figure 27 Network diagram

 

Configuration procedure

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

2.      Configure OSPF basic functions:

# Configure Router A.

<RouterA> system-view

[RouterA] router id 1.1.1.1

[RouterA] ospf

[RouterA-ospf-1] area 0

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

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

[RouterA-ospf-1] quit

# Configure Router B.

<RouterB> system-view

[RouterB] router id 2.2.2.2

[RouterB] ospf

[RouterB-ospf-1] area 0

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

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

[RouterB-ospf-1] quit

# Configure Router C.

<RouterC> system-view

[RouterC] router id 3.3.3.3

[RouterC] ospf

[RouterC-ospf-1] area 0

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

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

[RouterC-ospf-1] quit

# Configure Router D.

<RouterD> system-view

[RouterD] router id 4.4.4.4

[RouterD] ospf

[RouterD-ospf-1] area 0

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

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

[RouterD-ospf-1] return

# Display neighbor information on Router A.

[RouterA] 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(GigabitEthernet1/1/1)'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

   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

   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

   Dead timer due in 31  sec

   Neighbor is up for 00:01:28

   Authentication Sequence: [ 0 ]

Router D becomes the DR, and Router C becomes the BDR.

3.      Configure router priorities on interfaces:

# Configure Router A.

[RouterA] interface GigabitEthernet 1/1/1

[RouterA-GigabitEthernet1/1/1] ospf dr-priority 100

[RouterA-GigabitEthernet1/1/1] quit

# Configure Router B.

[RouterB] interface GigabitEthernet 1/1/1

[RouterB-GigabitEthernet1/1/1] ospf dr-priority 0

[RouterB-GigabitEthernet1/1/1] quit

# Configure Router C.

[RouterC] interface GigabitEthernet 1/1/1

[RouterC-GigabitEthernet1/1/1] ospf dr-priority 2

[RouterC-GigabitEthernet1/1/1] quit

# Display information about neighbors on Router D.

<RouterD> 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(GigabitEthernet1/1/1)'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

   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

   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

   Dead timer due in 33  sec

   Neighbor is up for 00:11:15

   Authentication Sequence: [ 0 ]

The DR and BDR have no change.

 

 

NOTE:

The output shows that the priority configuration does not take effect immediately.

 

4.      Restart the OSPF process:

# Restart the OSPF process on Router D.

<RouterD> reset ospf 1 process

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

# Display neighbor information on Router D.

<RouterD> 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(GigabitEthernet1/1/1)'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

   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

   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

   Dead timer due in 39  sec

   Neighbor is up for 00:01:41

   Authentication Sequence: [ 0 ]

Router A becomes the DR, and Router C becomes the BDR.

 

 

NOTE:

In the above output, the full neighbor state means an adjacency has been established. The 2-way neighbor state means the two routers are neither the DR nor the BDR, and they do not exchange LSAs.

 

# Display OSPF interface information

[RouterA] 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

[RouterB] 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

 

 

NOTE:

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

 

Configuring OSPF virtual links

Network requirements

·           In Figure 28, Area 2 has no direct connection to Area 0, the backbone, and Area 1 acts as the Transit Area to connect Area 2 to Area 0 via a virtual link between Router A and Router B.

·           After configuration, Router A can learn routes to Area 2.

Figure 28 Network diagram

 

Configuration procedure

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

2.      Configure OSPF basic functions:

# Configure Router A.

<RouterA> system-view

[RouterA] ospf 1 router-id 1.1.1.1

[RouterA-ospf-1] area 0

[RouterA-ospf-1-area-0.0.0.0] network 10.0.0.0 0.255.255.255

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

[RouterA-ospf-1] area 1

[RouterA-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255

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

# Configure Router B.

<RouterB> system-view

[RouterB] ospf 1 router-id 2.2.2.2

[RouterB-ospf-1] area 1

[RouterB-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255

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

[RouterB-ospf-1] area 2

[RouterB–ospf-1-area-0.0.0.2] network 172.16.0.0 0.0.255.255

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

[RouterB-ospf-1] quit

# Display OSPF routing information on Router A.

[RouterA] display ospf routing

          OSPF Process 1 with Router ID 1.1.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     Type    NextHop         AdvRouter     Area

 10.0.0.0/8         1        Stub    10.1.1.1        1.1.1.1       0.0.0.0

 192.168.1.0/24     1562     Stub    192.168.1.1     1.1.1.1       0.0.0.1

 

 Total Nets: 2

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

 

 

NOTE:

Since Area 0 has no direct connection to Area 2, the OSPF routing table of Router A has no route to Area 2.

 

3.      Configure a virtual link:

# Configure Router A.

[RouterA] ospf

[RouterA-ospf-1] area 1

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

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

[RouterA-ospf-1] quit

# Configure Router B.

[RouterB] ospf

[RouterB-ospf-1] area 1

[RouterB-ospf-1-area-0.0.0.1] vlink-peer 1.1.1.1

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

# Display OSPF routing information on Router A.

[RouterA] display ospf routing

 

          OSPF Process 1 with Router ID 1.1.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost  Type       NextHop         AdvRouter     Area

 172.16.0.0/16      1563  Inter      192.168.1.2     2.2.2.2       0.0.0.0

 10.0.0.0/8         1     Stub       10.1.1.1        1.1.1.1       0.0.0.0

 192.168.1.0/24     1562  Stub       192.168.1.1     1.1.1.1       0.0.0.1

 

 Total Nets: 3

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

Router A has learned the route 172.16.0.0/16 to Area 2.

Configuring OSPF Graceful Restart

Network requirements

As shown in Figure 29:

·           Router A, Router B and Router C that belong to the same autonomous system and the same OSPF routing domain are GR capable.

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

Figure 29 Network diagram

 

Configuration procedure

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

2.      Configure OSPF basic functions:

# Configure Router A

<RouterA> system-view

[RouterA] router id 1.1.1.1

[RouterA] ospf 100

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

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

[RouterA-ospf-100] graceful-restart

[RouterA-ospf-100] area 0

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

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

# Configure Router B

<RouterB> system-view

[RouterB] router id 2.2.2.2

[RouterB] ospf 100

[RouterB-ospf-100] area 0

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

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

# Configure Router C

<RouterC> system-view

[RouterC] router id 3.3.3.3

[RouterC] ospf 100

[RouterC-ospf-100] area 0

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

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

3.      Configure OSPF GR:

# Configure Router A as the non-IETF standard OSPF GR Restarter: enable the link-local signaling capability, the out-of-band re-synchronization capability, and non IETF standard Graceful Restart capability for OSPF process 100.

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

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

[RouterA-ospf-100] graceful-restart

[RouterA-ospf-100] return

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

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

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

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

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

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

4.      Verify the configuration:

# If all routers function steadily after the above configurations, enable OSPF Graceful Restart event debugging, and then restart the OSPF process using GR on Router A.

<RouterA> debugging ospf event graceful-restart

<RouterA> terminal monitor

<RouterA> terminal debugging

<RouterA> reset ospf 100 process graceful-restart

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

%Dec 12 09:36:12:500 2006 RouterA RM/3/RMLOG:OSPF-NBRCHANGE: Process 1, Neighbour

192.1.1.1(GigabitEthernet1/1/1) from Full to Down

OSPF 1: Intf 192.1.1.1 Rcv InterfaceDown State BackupDR -> Down.

OSPF 1 nonstandard GR Started for OSPF Router

OSPF 1 notify RM that OSPF process will enter GR.

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

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

OSPF 1: Intf 192.1.1.1 Rcv InterfaceUp State Down -> Waiting.

OSPF 1: Intf 192.1.1.1 Rcv BackupSeen State Waiting -> BackupDR.

OSPF 1 created OOB Progress timer for neighbor 192.1.1.2.

OSPF 1 restarted OOB Progress timer for neighbor 192.1.1.2.

OSPF 1 restarted OOB Progress timer for neighbor 192.1.1.2.

%Oct 22 09:36:12:566 2008 RouterA RM/3/RMLOG:OSPF-NBRCHANGE: Process 1, Neighbour

192.1.1.2(GigabitEthernet1/1/1) from Loading to Full

OSPF 1 restarted OOB Progress timer for neighbor 192.1.1.2.

OSPF 1 deleted OOB Progress timer for neighbor 192.1.1.2.

OSPF 1 Gr Wait Timeout timer fired.

OSPF 1 deleted GR wait timer.

OSPF 1 deleted GR Interval timer.

OSPF 1 GR Completed for OSPF Router

OSPF 1 notified RM that OSPF process left GR.

RM notified that all protocol left GR.

OSPF 1 started flushing STALE LSA after all protocol left GR.

OSPF 1: Flush Stale Area LSAs

OSPF 1: Start Flush Stale ASE + NSSA LSAs

OSPF 1: End Flush Stale ASE + NSSA LSAs

Router A completes GR with the help of Router B.

Configuring route filtering

Network requirements

As shown in Figure 30:

·           All the routers in the network run OSPF. The AS is divided into three areas.

·           Router A works as the ABR between Area 0 and Area 1. Router B works as the ABR between Area 0 and Area 2.

·           Configure Router C as an ASBR to redistribute external routes (static routes), and configure a filter policy on Router C to filter out route 3.1.3.0/24.

·           Configure a routing policy on Router A to filter route 10.5.1.0/24.

Figure 30 Network diagram

 

Configuration procedure

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

2.      Configure OSPF basic functions (see “Configuring OSPF basic functions”).

3.      Configure OSPF to redistribute routes:

# On Router C, configure a static route destined for network 3.1.1.0/24.

<RouterC> system-view

[RouterC] ip route-static 3.1.1.0 24 10.4.1.2

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

[RouterC] ip route-static 3.1.2.0 24 10.4.1.2

# On Router C, configure a static route destined for network 3.1.3.0/24.

[RouterC] ip route-static 3.1.3.0 24 10.4.1.2

# Configure OSPF to redistribute static routes on Router C.

[RouterC] ospf 1

[RouterC-ospf-1] import-route static

[RouterC-ospf-1] quit

# Display the OSPF routing table of Router A.

<RouterA> display ip routing-table

Routing Tables: Public

         Destinations : 12       Routes : 12

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

3.1.1.0/24          O_ASE  150  1            10.2.1.2        GE3/1/2

3.1.2.0/24          O_ASE  150  1            10.2.1.2        GE3/1/2

3.1.3.0/24          O_ASE  150  1            10.2.1.2        GE3/1/2

10.1.1.0/24         Direct 0    0            10.1.1.1        GE3/1/1

10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0

10.2.1.0/24         Direct 0    0            10.2.1.1        GE3/1/2

10.2.1.1/32         Direct 0    0            127.0.0.1       InLoop0

10.3.1.0/24         OSPF   10   4            10.1.1.2        GE3/1/1

10.4.1.0/24         OSPF   10   13           10.2.1.2        GE3/1/2

10.5.1.0/24         OSPF   10   14           10.1.1.2        GE3/1/1

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

4.      Configure Router C to filter out the route 3.1.3.0/24:

# Configure the IPv4 prefix list.

[RouterC] ip ip-prefix prefix1 index 1 deny 3.1.3.0 24

[RouterC] ip ip-prefix prefix1 index 2 permit 3.1.1.0 24

[RouterC] ip ip-prefix prefix1 index 3 permit 3.1.2.0 24

# Reference the prefix list to filter out the route 3.1.3.0/24.

[RouterC] ospf 1

[RouterC-ospf-1] filter-policy ip-prefix prefix1 export static

# Display the OSPF routing table of Router A.

<RouterA> display ip routing-table

Routing Tables: Public

         Destinations : 11       Routes : 11

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

3.1.1.0/24          O_ASE  150  1            10.2.1.2        GE3/1/2

3.1.2.0/24          O_ASE  150  1            10.2.1.2        GE3/1/2

10.1.1.0/24         Direct 0    0            10.1.1.1        GE3/1/1

10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0

10.2.1.0/24         Direct 0    0            10.2.1.1        GE3/1/2

10.2.1.1/32         Direct 0    0            127.0.0.1       InLoop0

10.3.1.0/24         OSPF   10   4            10.1.1.2        GE3/1/1

10.4.1.0/24         OSPF   10   13           10.2.1.2        GE3/1/2

10.5.1.0/24         OSPF   10   14           10.1.1.2        GE3/1/1

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

The route destined for network 3.1.3.0/24 is filtered out.

5.      Configure Router A to filter out route 10.5.1.1/24:

# Configure the ACL on Router A.

<RouterA> system-view

[RouterA] acl number 2000

[RouterA-acl-basic-2000] rule 0 deny source 10.5.1.0 0.0.0.255

[RouterA-acl-basic-2000] rule 1 permit source any

[RouterA-acl-basic-2000] quit

# Use the ACL to filter route 10.5.1.0/24.

[RouterA] ospf 1

[RouterA-ospf-1] filter-policy 2000 import

[RouterA-ospf-1] quit

# Display the OSPF routing table of Router A.

[RouterA] display ip routing-table

Routing Tables: Public

         Destinations : 10       Routes : 10

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

3.1.1.0/24          O_ASE  150  1            10.2.1.2        GE3/1/2

3.1.2.0/24          O_ASE  150  1            10.2.1.2        GE3/1/2

10.1.1.0/24         Direct 0    0            10.1.1.1        GE3/1/1

10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0

10.2.1.0/24         Direct 0    0            10.2.1.1        GE3/1/2

10.2.1.1/32         Direct 0    0            127.0.0.1       InLoop0

10.3.1.0/24         OSPF   10   4            10.1.1.2        GE3/1/1

10.4.1.0/24         OSPF   10   13           10.2.1.2        GE3/1/2

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

The route to 10.5.1.1/24 is filtered out.

Configuring OSPF FRR

Network requirements

Router S, Router A, and Router D belong to the same OSPF domain as illustrated in Figure 31. Configure OSPF FRR so that when the link between Router S and Router D fails, traffic can be switched to Link B immediately.

Figure 31 Network diagram

 

Configuration procedure

1.      Configure IP addresses for the interfaces on each router and configure OSPF:

Follow Figure 31 to configure the IP address and subnet mask of each interface on the routers. (Details not shown)

Configure OSPF on the routers, ensuring that Router S, Router A, and Router D can communicate with each other at Layer 3. (Details not shown)

2.      Configure OSPF FRR:

You can enable OSPF FRR to either automatically calculate a backup next hop, or to designate a backup next hop by using a routing policy.

¡  Method I

Enable OSPF FRR to automatically calculate a backup next hop.

# Configure Router S.

<RouterS> system-view

[RouterS] bfd echo-source-ip 1.1.1.1

[RouterS] ospf 1

[RouterS-ospf-1] fast-reroute auto

[RouterS-ospf-1] quit

# Configure Router D.

<RouterD> system-view

[RouterD] bfd echo-source-ip 4.4.4.4

[RouterD] ospf 1

[RouterD-ospf-1] fast-reroute auto

[RouterD-ospf-1] quit

¡  Method II

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

# Configure Router S.

<RouterS> system-view

[RouterS] bfd echo-source-ip 1.1.1.1

[RouterS] ip ip-prefix abc index 10 permit 4.4.4.4 32

[RouterS] route-policy frr permit node 10

[RouterS-route-policy] if-match ip-prefix abc

[RouterS-route-policy] apply fast-reroute backup-interface GigabitEthernet 3/1/1 backup-nexthop 12.12.12.2

[RouterS-route-policy] quit

[RouterS] ospf 1

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

[RouterS-ospf-1] quit

# Configure Router D.

<RouterD> system-view

[RouterD] bfd echo-source-ip 4.4.4.4

[RouterD] ip ip-prefix abc index 10 permit 1.1.1.1 32

[RouterD] route-policy frr permit node 10

[RouterD-route-policy] if-match ip-prefix abc

[RouterD-route-policy] apply fast-reroute backup-interface GigabitEthernet 3/1/1 backup-nexthop 24.24.24.2

[RouterD-route-policy] quit

[RouterD] ospf 1

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

[RouterD-ospf-1] quit

3.      Verify the configuration:

# Display route 4.4.4.4/32 on Router S and you can view the backup next hop information.

[RouterS] display ip routing-table 4.4.4.4 verbose

Routing Table : Public

Summary Count : 1

  Destination: 4.4.4.4/32

     Protocol: OSPF            Process ID: 1

   Preference: 10                    Cost: 1

      NextHop: 13.13.13.2       Interface: GigabitEthernet3/1/2

    BkNextHop: 12.12.12.2     BkInterface: GigabitEthernet3/1/1

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

        State: Active Adv             Age: 00h01m27s

          Tag: 0

# Display route 1.1.1.1/32 on Router D. You can find the backup next hop information.

[RouterS] display ip routing-table 1.1.1.1 verbose

Routing Table : Public

Summary Count : 1

  Destination: 1.1.1.1/32

     Protocol: OSPF            Process ID: 1

   Preference: 10                    Cost: 1

      NextHop: 13.13.13.1       Interface: GigabitEthernet3/1/2

    BkNextHop: 24.24.24.2     BkInterface: GigabitEthernet3/1/1

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

        State: Active Adv             Age: 00h01m27s

          Tag: 0

Configuring BFD for OSPF

Network requirements

As shown in Figure 32:

·           OSPF is enabled on Router A, Router B and Router C so that they are reachable to each other at the network layer.

·           After the link over which Router A and Router B communicate through a Layer 2 switch fails, BFD can quickly detect the failure and notify OSPF of the failure. Router A and Router B then communicate through Router C.

Figure 32 Network diagram

Device

Interface

IP address

Device

Interface

IP address

Router A

GE 3/1/1

192.168.0.102/24

Router B

GE 3/1/1

192.168.0.100/24

 

GE 3/1/2

10.1.1.102/24

 

GE 3/1/2

13.1.1.1/24

Router C

GE 3/1/1

10.1.1.100/24

 

 

 

 

GE 3/1/2

13.1.1.2/24

 

 

 

 

Configuration procedure

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

2.      Configure OSPF basic functions:

# Configure Router A.

<RouterA> system-view

[RouterA] ospf

[RouterA-ospf-1] area 0

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

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

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

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

[RouterA-ospf-1] quit

[RouterA] interface GigabitEthernet 3/1/1

[RouterA-GigabitEthernet3/1/1] ospf cost 2

# Configure Router B.

<RouterB> system-view

[RouterB] ospf

[RouterB-ospf-1] area 0

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

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

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

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

[RouterB-ospf-1] quit

[RouterB] interface GigabitEthernet 3/1/2

[RouterB-GigabitEthernet3/1/2] ospf cost 2

# Configure Router C.

<RouterC> system-view

[RouterC] ospf

[RouterC-ospf-1] area 0

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

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

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

[RouterC-ospf-1] quit

3.      Configure BFD:

# Enable BFD on Router A and configure BFD parameters.

<RouterA> system-view

[RouterA] bfd session init-mode active

[RouterA] interface GigabitEthernet 3/1/1

[RouterA-GigabitEthernet3/1/1] ospf bfd enable

[RouterA-GigabitEthernet3/1/1] bfd min-transmit-interval 400

[RouterA-GigabitEthernet3/1/1] bfd min-receive-interval 400

[RouterA-GigabitEthernet3/1/1] bfd detect-multiplier 7

[RouterA-GigabitEthernet3/1/1] return

# Enable BFD on Router B and configure BFD parameters.

<RouterB> system-view

[RouterB] bfd session init-mode active

[RouterB] interface GigabitEthernet 3/1/1

[RouterB-GigabitEthernet3/1/1] ospf bfd enable

[RouterB-GigabitEthernet3/1/1] bfd min-transmit-interval 400

[RouterB-GigabitEthernet3/1/1] bfd min-receive-interval 400

[RouterB-GigabitEthernet3/1/1] bfd detect-multiplier 6

4.      Verify the configuration:

The following operations are performed on Router A. The operations on Router B and Router C are similar. (Details not shown)

# Display the BFD information of Router A.

<RouterA> display bfd session

 Total Session Num: 1            Init Mode: Active

 Session Working Under Ctrl Mode:

 LD/RD         SourceAddr      DestAddr        State Holdtime Interface

 3/1           192.168.0.102   192.168.0.100   Up    1700ms   GE3/1/1

# Display routes to 120.1.1.0/24 on Router A, and you can see that Router A communicates with Router B through the Layer 2 switch.

<RouterA> display ip routing-table 120.1.1.0 verbose

Routing Table : Public

Summary Count : 2

  Destination: 120.1.1.0/24

     Protocol: OSPF            Process ID: 0

   Preference: 0                     Cost: 2

      NextHop: 192.168.0.100    Interface: GigabitEthernet3/1/1

    BkNextHop: 0.0.0.0        BkInterface:

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

        State: Active Adv             Age: 00h58m10s

          Tag: 0

  Destination: 120.1.1.0/24

     Protocol: OSPF            Process ID: 1

   Preference: 10                    Cost: 4

      NextHop: 10.1.1.100       Interface: GigabitEthernet3/1/2

    BkNextHop: 0.0.0.0        BkInterface:

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

        State: Invalid Adv            Age: 00h58m05s

          Tag: 0

# Enable BFD debugging on Router A.

<RouterA> debugging bfd scm

<RouterA> debugging bfd event

<RouterA> debugging ospf event bfd

<RouterA> terminal debugging

# After the link over which Router A and Router B communicates through the Layer 2 switch fails, Router A quickly detects the change on Router B.

%Nov 12 18:34:48:823 2005 RouterA BFD/5/LOG: Sess[192.168.0.102/192.168.0.100, GE3/1/1], Sta : UP->DOWN, Diag: 1

%Nov 12 18:34:48:824 2005 RouterA RM/4/RMLOG:OSPF-NBRCHANGE: Process 1, Neighbour 192.168.0.102 (GigabitEthernet3/1/1) from Full to Down

*0.50673825 RouterA BFD/8/SCM:Sess[192.168.0.102/192.168.0.100,GE3/1/1],Oper: Reset

*0.50673825 RouterA BFD/8/EVENT:Send sess-down Msg, [Src:192.168.0.102, Dst:192.168.0.100, GigabitEthernet3/1/1] Protocol: OSPF

*0.50673826 RouterA RM/7/RMDEBUG:OSPF-BFD: Message Type rcv BFD down, Connect Type direct-connect, Src IP Address 192.168.0.102, Src IFIndex 5, Dst IP Address 192.168.0.100

*0.50673827 RouterA RM/7/RMDEBUG:OSPF-BFD: Message Type delete session, Connect Type direct-connect, Src IP Address 192.168.0.102, Src IFIndex 5, Dst IP Address 192.168.0.100

OSPF 1: Nbr 192.168.0.100 Rcv KillNbr State Full -> Down.

*0.50673829 RouterA BFD/8/EVENT:Receive Delete-sess, [Src:192.168.0.102, Dst:192.168.0.100,GigabitEthernet3/1/1], Direct, Proto:OSPF

*0.50673830 RouterA BFD/8/SCM:Sess[192.168.0.102/192.168.0.100,GE3/1/1], Oper: Del application(OSPF)

*0.50673831 RouterA BFD/8/SCM:No application in session, delete session[192.168.0.102/192.168.0.100,GE3/1/1]

*0.50673831 RouterA BFD/8/SCM:Sess[192.168.0.102/192.168.0.100,GE3/1/1], Oper: Delete

*0.50673832 RouterA BFD/8/SCM:Delete send-packet timer

*0.50673833 RouterA BFD/8/SCM:Delete session entry

*0.50673833 RouterA BFD/8/SCM:Delete session from IP hash table

*0.50673834 RouterA BFD/8/SCM:Delete session from bfd interface

*0.50673834 RouterA BFD/8/SCM:No session under bfd-int[GigabitEthernet3/1/1] with default configuration, delete bfd-if

*0.50673835 RouterA BFD/8/SCM:Bfd-if[GigabitEthernet3/1/1], Oper: Delete

*0.50673840 RouterA BFD/8/SCM:No bfd session exists, stop receiving any bfd packets

# Display the BFD information of Router A.

The BFD session between Router A and Router B is deleted and no information is output.

<RouterA> display bfd session

# Display routes to 120.1.1.0/24 on Router A, and you can see that Router A communicates with Router B through Router C.

<RouterA> display ip routing-table 120.1.1.0 verbose

Routing Table : Public

Summary Count : 2

  Destination: 120.1.1.0/24

     Protocol: OSPF            Process ID: 1

   Preference: 10                    Cost: 4

      NextHop: 10.1.1.100       Interface: GigabitEthernet3/1/2

    BkNextHop: 0.0.0.0        BkInterface:

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

        State: Active Adv             Age: 00h58m10s

          Tag: 0

  Destination: 120.1.1.0/24

     Protocol: OSPF            Process ID: 0

   Preference: 0                     Cost: 2

      NextHop: 192.168.0.100    Interface: GigabitEthernet3/1/1

    BkNextHop: 0.0.0.0        BkInterface:

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

        State: Invalid Adv            Age: 00h58m05s

          Tag: 0

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, check 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 may have different network segments and masks).

Solution

1.      Display OSPF neighbor information using the display ospf peer command.

2.      Display OSPF interface information using the display ospf interface command.

3.      Ping the neighbor router’s IP address to check connectivity.

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

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

6.      On an NBMA or a broadcast network, at least one connected interface must have a router priority higher than 0.

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

1.      Use the display ospf peer command to display neighbors.

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

3.      Use the display ospf lsdb command to display the Link State Database to check its integrity.

4.      Display information about area configuration using the display current-configuration configuration ospf command. 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 check the state of the virtual link.

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网