H3C S9500 Operation Manual-Release2132[V2.03]-03 IP Routing Volume

HomeSupportSwitchesH3C S9500 Series SwitchesConfigure & DeployConfiguration GuidesH3C S9500 Operation Manual-Release2132[V2.03]-03 IP Routing Volume
04-OSPF Configuration
Title Size Download
04-OSPF Configuration 707.17 KB

Table of Contents

Chapter 1 OSPF Configuration. 1-1

1.1 Introduction to OSPF. 1-1

1.1.1 Basic Concepts. 1-2

1.1.2 OSPF Area Partition and Route Summarization. 1-4

1.1.3 Classification of OSPF Networks. 1-9

1.1.4 DR and BDR. 1-10

1.1.5 OSPF Packets. 1-12

1.1.6 Supported OSPF Features. 1-20

1.1.7 Protocols and Standards. 1-23

1.2 OSPF Configuration Task List 1-23

1.3 Configuring OSPF Basic Functions. 1-24

1.3.1 Prerequisites. 1-25

1.3.2 Configuration Procedure. 1-25

1.4 Configuring OSPF Area Parameters. 1-26

1.4.1 Prerequisites. 1-26

1.4.2 Configuration Procedure. 1-27

1.5 Configuring OSPF Network Types. 1-27

1.5.1 Prerequisites. 1-28

1.5.2 Configuring the OSPF Network Type for an Interface. 1-28

1.5.3 Configuring an NBMA Neighbor 1-28

1.5.4 Configuring a DR Priority for an OSPF Interface. 1-29

1.6 Configuring OSPF Route Control 1-29

1.6.1 Prerequisites. 1-30

1.6.2 Configuring OSPF Route Summarization. 1-30

1.6.3 Configuring OSPF Inbound Route Filtering. 1-30

1.6.4 Configuring ABR Type-3 LSA Filtering. 1-31

1.6.5 Configuring the OSPF Link Cost of an Interface. 1-31

1.6.6 Configuring the Maximum Number of OSPF Routes. 1-32

1.6.7 Configuring the Maximum Number of Equal Cost Routes for Load Balancing. 1-33

1.6.8 Configuring the Priority of OSPF Routes. 1-33

1.6.9 Configuring OSPF Route Redistribution. 1-34

1.7 Configuring OSPF Network Optimization. 1-35

1.7.1 Prerequisites. 1-35

1.7.2 Configuring OSPF Packet Timers. 1-35

1.7.3 Configuring the LSA Transmission Delay. 1-37

1.7.4 Configuring the SPF Calculation Interval 1-37

1.7.5 Configuring the Minimum LSA Repeating Arrival Interval 1-38

1.7.6 Configuring the LSA Generation Interval 1-38

1.7.7 Disabling Interfaces from Sending OSPF Packets. 1-39

1.7.8 Configuring Stub Routers. 1-39

1.7.9 Configuring OSPF Authentication. 1-40

1.7.10 Adding Interface MTU into DD Packets. 1-41

1.7.11 Configuring the Maximum Number of External LSAs in LSDB. 1-41

1.7.12 Making External Route Selection Rules Defined in RFC1583 Compatible. 1-42

1.7.13 Configuring OSPF Network Management 1-42

1.7.14 Enabling the Advertisement and Reception of Opaque LSAs. 1-43

1.8 Displaying and Maintaining OSPF Configuration. 1-44

1.9 OSPF Configuration Examples. 1-45

1.9.1 Configuring OSPF Basic Functions. 1-45

1.9.2 Configuring an OSPF Stub Area. 1-49

1.9.3 Configuring an OSPF NSSA Area. 1-52

1.9.4 Configuring OSPF DR Election. 1-54

1.9.5 Configuring OSPF Virtual Links. 1-59

1.10 Troubleshooting OSPF Configuration. 1-62

1.10.1 No OSPF Neighbor Relationship Established. 1-62

1.10.2 Incorrect Routing Information. 1-62

 


Chapter 1  OSPF Configuration

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

When configuring OSPF, go to these sections for information you are interested in:

l           Introduction to OSPF

l           OSPF Configuration Task List

l           Configuring OSPF Basic Functions

l           Configuring OSPF Area Parameters

l           Configuring OSPF Network Types

l           Configuring OSPF Route Control

l           Configuring OSPF Network Optimization

l           Displaying and Maintaining OSPF Configuration

l           OSPF Configuration Examples

l           Troubleshooting OSPF Configuration

 

&  Note:

The term “router” in this document refers to a router in a generic sense or an Ethernet switch running routing protocols.

 

1.1  Introduction to OSPF

 

&  Note:

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

 

OSPF has the following features:

l           Wide scope: Supports networks of various sizes and up to several hundred routers in an OSPF routing domain.

l           Fast convergence: Transmits updates instantly after network topology changes for routing information synchronization in the AS.

l           Loop-free: Computes routes with the shortest path first (SPF) algorithm according to the collected link states, so no route loops are generated.

l           Area partition: Allows an AS to be split into different areas for ease of management and the routing information transmitted between areas is summarized to reduce network bandwidth consumption.

l           Equal-cost multi-route: Supports multiple equal-cost routes to a destination.

l           Routing hierarchy: Supports a four-level routing hierarchy that prioritizes the routes into intra-area, inter-area, external type-1, and external type-2 routes.

l           Authentication: Supports interface-based packet authentication to guarantee the security of packet exchange and route calculation.

l           Multicast: Supports packet multicasting on some types of links.

1.1.1  Basic Concepts

I. Autonomous System

A set of routers using the same routing protocol to exchange routing information constitute an Autonomous System (AS).

II. OSPF route computation

OSPF route computation is described as follows:

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

l           Each OSPF router collects LSAs from other routers to compose a LSDB (Link State Database). An LSA describes the network topology around a router, so the LSDB describes the entire network topology of the AS.

l           Each router transforms the LSDB to a weighted directed graph, which actually reflects the topology architecture of the entire network. All the routers have the same graph.

l           Each router uses the SPF algorithm to compute a Shortest Path Tree that shows the routes to the nodes in the autonomous system. The router itself is the root of the tree.

III. Router ID

To run OSPF, a router must have a Router ID, which is a 32-bit unsigned integer, the unique identifier of the router in the AS.

You may assign a Router ID to an OSPF router manually. If no Router ID is specified, the system automatically selects one for the router as follows:

l           If the loopback interfaces are configured, select the highest IP address among them.

l           If no loopback interface is configured, select the highest IP address among addresses of active interfaces on the router.

IV. OSPF packets

OSPF uses five types of packets:

l           Hello Packet: Periodically sent to find and maintain neighbors, containing the values of some timers, information about DR, BDR and known neighbors.

l           DD packet (Database Description Packet): Describes the digest of each LSA in the LSDB, exchanged between two routers for data synchronization.

l           LSR (Link State Request) Packet: Requests needed LSAs from the peer. After exchanging the DD packets, the two routers know which LSAs of the neighbor routers are missing from the local LSDBs. In this case, they send LSR packets, requesting the missing LSAs. The packets contain the digests of the missing LSAs.

l           LSU (Link State Update) Packet: Transmits the needed LSAs to the peer router.

l           LSAck (Link State Acknowledgment) Packet: Acknowledges received LSU packets. It contains the Headers of LSAs requiring acknowledgement (a packet can acknowledge multiple LSAs).

V. LSA types

OSPF sends link state information in LSAs, which, as defined in RFC 2328, have the following types:

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

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

l           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).

l           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).

l           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 Autonomous System.

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

l           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 three types, Type 9, Type 10 and Type 11, which are used to flood into different areas. 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.

VI. Neighbor and Adjacency

In OSPF, the “Neighbor” and “Adjacency” are two different concepts.

Neighbor: Two routers that have interfaces to a common network. Neighbor relationships are maintained by, and usually dynamically discovered by, OSPF's hello packets. When a router starts, it sends a hello packet via the OSPF interface, and the router that receives the hello packet checks parameters carried in the packet. If parameters of the two routers match, they become neighbors.

Adjacency: A relationship formed between selected neighboring routers for the purpose of exchanging routing information. Not every pair of neighboring routers become adjacent, which depends on network types. Only by synchronizing the LSDB via exchanging DD packets and LSAs can two routers become adjacent.

1.1.2  OSPF Area Partition and Route Summarization

I. Area partition

When a large number of OSPF routers are present on a network, LSDBs may become so large that a great amount of storage space is occupied and CPU resources are exhausted performing SPF computation.

In addition, as the topology of a large network is prone to changes, enormous OSPF packets may be created, reducing bandwidth utilization. Each topology change makes all routers perform route calculation.

To solve this problem, OSPF splits an AS into multiple areas, which are identified by area ID. The boundaries between areas are routers rather than links. A network segment (or a link) can only reside in one area, in other words, an OSPF interface must be specified to belong to its attached area, as shown in the figure below.

Figure 1-1 OSPF area partition

The boundaries between areas are routers rather than links. A network segment (or a link) can only reside in one area, in other words, an OSPF interface must be specified to belong to its attached area. After area partition, area border routers perform route summarization to reduce the number of LSAs advertised to other areas and minimize the effect of topology changes.

II. Classification of Routers

The OSPF router falls into four types according to the position in the AS:

1)         Internal Router

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

2)         Area Border Router (ABR)

An area border router 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 area border router and the backbone area can be physical or logical.

3)         Backbone Router

At least one interface of a backbone router must be attached to the backbone area. Therefore, all ABRs and internal routers in area 0 are backbone routers.

4)         Autonomous System Border Router (ASBR)

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

Figure 1-2 OSPF router types

III. Backbone area and virtual links

1)         Backbone area

An AS has a unique area called backbone area, which is responsible for distributing routing information between none-backbone areas. Routing information between non-backbone areas must be forwarded by the backbone area. Therefore, OSPF requires:

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

l           The backbone area itself must maintain connectivity.

In practice, due to physical limitations, the requirements may not be satisfied. In this case, configuring OSPF virtual links is a solution.

2)         Virtual link

A virtual link is established between two area border routers via a non-backbone area and is configured on both ABRs to take effect. The area that provides the non-backbone area internal route for the virtual link is a “transit area”.

In the following figure, Area 2 has no direct physical link to the backbone area 0. Configuring a virtual link between ABRs can connect Area 2 to the backbone area.

Figure 1-3 Virtual link application 1

Another application of virtual links is to provide redundant links. If the backbone area cannot maintain internal connectivity due to a physical link failure, configuring a virtual link can guarantee logical connectivity in the backbone area, as shown below.

Figure 1-4 Virtual link application 2

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

The two ABRs on the virtual link exchange OSPF packets with each other directly, the OSPF routers in between simply convey these OSPF packets as normal IP packets.

IV. (Totally) Stub area

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

You can also configure the stub area as a Totally Stub area, where the ABR advertises neither the routes of other areas nor the external routes.

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

The ABR in a stub area generates a default route into the area.

Note the following when configuring a (totally) stub area:

l           The backbone area cannot be a (totally) stub area

l           The stub command must be configured on routers in a (totally) stub area

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

l           Virtual links cannot transit (totally) stub areas.

V. NSSA area

Similar to a stub area, an NSSA area imports no AS external LSA (Type-5 LSA) but can import Type-7 LSAs that are generated by the ASBR and distributed throughout the NSSA area. When traveling to the NSSA ABR, Type-7 LSAs are translated into Type-5 LSAs by the ABR for advertisement to other areas.

In the following figure, the OSPF AS contains three areas: Area 1, Area 2 and Area 0. The other two ASs employ the RIP protocol. Area 1 is an NSSA area, and the ASBR in it translates RIP routes into Type-7 LSAs and advertises them throughout Area 1. When these LSAs travel to the NSSA ABR, the ABR translates Type-7 LSAs to Type-5 LSAs for advertisement to Area 0 and Area 2.

On the left of the figure, RIP routes are translated into Type-5 LSAs by the ASBR of Area 2 and distributed into the OSPF AS. However, Area 1 is an NSSA area, so these Type-5 LSAs cannot travel to Area 1.

Similar to stub areas, virtual links cannot transit NSSA areas.

Figure 1-5 NSSA area

VI. Route summarization

Route summarization: An ABR or ASBR summarizes routes with the same prefix with a single route and distribute it to other areas.

Via route summarization, routing information across areas and the size of routing tables on routers will be reduced, improving calculation speed of routers.

For example, as shown in the following figure, in Area 1 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 Router A, the three routes are summarized with the route 19.1.0.0/16 that is advertised into Area 0.

Figure 1-6 Route summarization

OSPF has two types of route summarization:

1)         ABR route summarization

To distribute routing information to other areas, an ABR generates Type-3 LSAs on a per network segment basis for an attached non-backbone area. If contiguous network segments are available in the area, you can summarize them with a single network segment. The ABR in the area distributes only the summary LSA to reduce the scale of LSDBs on routers in other areas.

2)         ASBR route summarization

If summarization for redistributed routes is configured on an ASBR, it will summarize redistributed Type-5 LSAs that fall into the specified address range. If in an NSSA area, it also summarizes Type-7 LSAs that fall into the specified address range.

If this feature is configured on an ABR, the ABR will summarize Type-5 LSAs translated from Type-7 LSAs.

VII. Route types

OSPF prioritize routes into four levels:

l           Intra-area route

l           Inter-area route

l           Type-1 external route

l           Type-2 external route

The intra-area and inter-area routes describe the network topology of the AS, while external routes describe routes to destinations outside the AS. OSPF classifies external routes into two types: Type-1 and Type-2.

A Type-1 external route is an IGP route, such as a RIP or static route, which has high credibility and whose cost is comparable with the cost of an OSPF internal route. 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 is an EGP route, which has low credibility, so OSPF considers the cost from the ASBR to the destination of the Type-2 external route is much bigger than the cost from the ASBR to an OSPF internal router. Therefore, 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, then take the cost from the router to the ASBR into consideration.

1.1.3  Classification of OSPF Networks

I. OSPF network types

OSPF classifies networks into four types upon the link layer protocol:

l           Broadcast: when the link layer protocol is Ethernet or FDDI, OSPF considers the network type broadcast by default. On Broadcast networks, packets are sent to multicast addresses (such as 224.0.0.5 and 224.0.0.6).

l           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. Packets on these networks are sent to unicast addresses.

l           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 in general. On P2MP networks, packets are sent to multicast addresses (224.0.0.5).

l           P2P (point-to-point): when the link layer protocol is PPP or HDLC, OSPF considers the network type as P2P. On P2P networks, packets are sent to multicast addresses (224.0.0.5).

II. NBMA network configuration principle

Typical NBMA networks are ATM and Frame Relay networks.

You need to perform some special configuration on NBMA interfaces. Since these interfaces cannot broadcast hello packets for neighbor location, you need to specify neighbors manually and configure whether the neighbors have the DR election right.

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

Differences between NBMA and P2MP networks:

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

l           It is required to elect the DR and BDR on NBMA networks, while DR and BDR are not available on P2MP networks.

l           NBMA is the default network type, while P2MP is a conversion from other network types such as NBMA in general.

l           On NBMA networks, packets are unicast, and neighbors are configured manually on routers. On P2MP networks, packets are multicast.

1.1.4  DR and BDR

I. DR/BDR introduction

On broadcast or NBMA networks, any two routers exchange routing information with each other. If n routers are present on a network, n(n-1)/2 adjacencies are required. Any change on a router in the network generates traffic for routing information synchronization, consuming network resources. The Designated Router is defined to solve the problem. All other routers on the network send routing information to the DR, which is responsible for advertising link state information.

If the DR fails to work, 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) was introduced to reduce the synchronization period.

The BDR is elected along with the DR and establishes adjacencies for routing information exchange with all other routers. When the DR fails, the BDR will become the new DR in a very short period by avoiding adjacency establishment and DR reelection. Meanwhile, other routers elect another BDR, which requires a relatively long period but has no influence on routing calculation.

Other routers, also known as DRothers, establish no adjacency with each other and exchange no routing information, thus, reducing the number of adjacencies on broadcast and NBMA networks.

In the following figure, real lines are Ethernet physical links, and dashed lines represent adjacencies. With the DR and BDR in the network, only seven adjacencies are enough.

Figure 1-7 DR and BDR in a network

II. DR/BDR election

The DR and BDR in a network are elected by all routers rather than configured manually. The DR priority of an interface determines its qualification for DR/BDR election. Interfaces attached to the network and having priorities higher than 0 are election candidates.

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 DR priority wins. If DR priorities are the same, the router with the higher Router ID wins. In addition, a router with the priority 0 cannot become the DR/BDR.

Note that:

l           The DR election is available on broadcast, NBMA interfaces rather than P2P, or P2MP interfaces.

l           A DR is an interface of a router and belongs to a single network segment. The router’s other interfaces may be a BDR or DRother.

l           After DR/BDR election and then a new router joins, it cannot become the DR immediately even if it has the highest priority on the network.

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

1.1.5  OSPF Packets

OSPF packets are directly encapsulated into IP packets. OSPF has the IP protocol number 89. The OSPF packet format, taking a LSU packet as an example, is shown below.

Figure 1-8 OSPF packet format

I. OSPF packet header

OSPF packets are classified into five types that have the same packet header, as shown below.

Figure 1-9 OSPF packet header

l           Version: OSPF version number, which is 2 for OSPFv2.

l           Type: OSPF packet type from 1 to 5, corresponding with hello, DD, LSR, LSU and LSAck respectively.

l           Packet length: Total length of the OSPF packet in bytes, including the header

l           Router ID: ID of the advertising router

l           Area ID: ID of the area where the advertising router resides

l           Checksum: Checksum of the message

l           Autype: Authentication type from 0 to 2, corresponding with non-authentication, simple (plaintext) authentication and MD5 authentication respectively.

l           Authentication: Information determined by authentication type, which is not defined for authentication type 0, password information for authentication type 1, information about 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.

 

II. Hello packet

A router sends hello packets periodically to neighbors to find and maintain neighbor relationships and to elect DR/BDR, including information about values of timers, DR, BDR and neighbors already known. The format is shown below:

Figure 1-10 Hello packet format

Major fields:

l           Network Mask: The network mask associated with the router’s sending interface. If two routers have different network masks, they cannot become neighbors.

l           HelloInterval: The interval between the router’s hello packets. If two routers have different intervals, they cannot become neighbors.

l           Rtr Pri: Router priority. A value of 0 means the router cannot become the DR/BDR.

l           RouterDeadInterval: The time value before declaring a silent router down. If two routers have different time values of this kind, they cannot become neighbors.

l           Designated Router: IP address of the DR interface.

l           Backup Designated Router: IP address of the BDR interface

l           Neighbor: Router ID of the neighbor router.

III. DD packet

Two routers exchange Database Description (DD) packets describing their LSDBs for database synchronization, contents in DD packets including the header of each LSA (uniquely representing a LSA). The LSA header occupies small part of an LSA, so reducing traffic between routers. The recipient checks whether the LSA is available using the LSA header.

The DD packet format:

Figure 1-11 DD packet format

Major fields:

l           Interface MTU: The size in bytes of the largest IP datagram that can be sent out the associated interface, without fragmentation.

l           I (Initial) The Init bit, which is set to 1 if the packet is the first packet in the sequence of Database Description Packets, and set to 0 if not.

l           M (More): The More bit, which is set to 0 if the packet is the last packet in the sequence of DD packets, and set to 1 if more DD Packets are to follow.

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

l           DD Sequence Number: Used to sequence the collection of Database Description Packets for ensuring reliability and intactness of DD packets between the master and slave. The initial value is set by the master. The DD sequence number then increments until the complete database description has been sent.

IV. LSR packet

After exchanging DD packets, any two routers know which LSAs of the peer routers are missing from the local LSDBs. In this case, they send LSR (Link State Request) packets, requesting the missing LSAs. The packets contain the digests of the missing LSAs. The following figure shows the LSR packet format.

Figure 1-12 LSR packet format

Major fields:

l           LS type: The type number of the LSA to be requested, type 1 for example indicates the Router LSA

l           Link State ID: Determined by LSA type

l           Advertising Router: The ID of the router that sent the LSA

V. LSU packet

LSU (Link State Update) packets are used to send the requested LSAs to peers, and each packet carries a collection of LSAs. The LSU packet format is shown below.

Figure 1-13 LSU packet format

VI. LSAck packet

LSAack (Link State Acknowledgment) packets are used to acknowledge received LSU packets, contents including LSA headers to describe the corresponding LSAs. Multiple LSAs can be acknowledged in a single Link State Acknowledgment packet. The following figure gives its format.

Figure 1-14 LSAck packet format

VII. LSA header format

All LSAs have the same header, as shown in the following figure.

Figure 1-15 LSA header format

Major fields:

l           LS age: The time in seconds elapsed since the LSA was originated. A LSA ages in the LSDB (added 1 per second), but does not in transmission.

l           LS type: The type of the LSA

l           Link State ID: The contents of this field depend on the LSA's type

l           LS sequence number: Used by other routers to judge new and old LSAs.

l           LS checksum: Checksum of the LSA except the LS age field

l           Length: The length in bytes of the LSA, including the LSA header

VIII. Formats of LSAs

1)         Router LSA

Figure 1-16 Router LSA format

Major fields:

l           Link State ID: The ID of the router that originated the LSA.

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

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

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

l           # links: The number of router links (interfaces) to the area, described in the LSA.

l           Link ID: Determined by Link type.

l           Link Data: Determined by Link type.

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

l           #TOS: The number of different TOS metrics given for this link.

l           metric: The cost of using this router link.

l           TOS: IP Type of Service that this metric refers to.

l           TOS metric: TOS-specific metric information.

2)         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 1-17 Network LSA format

Major fields:

l           Link State ID: The interface address of the DR

l           Network Mask: The mask of the network (a broadcast or NBMA network)

l           Attached Router: The IDs of the routers, which are adjacent to the DR, including the DR itself

3)         Summary LSA

Network summary LSAs (Type-3 LSAs) and ASBR summary LSAs (Type-4 LSAs) are originated by ABRs. Other than the difference in the Link State ID field, the format of type 3 and 4 summary-LSAs is identical.

Figure 1-18 Summary LSA format

Major fields:

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

l           Network Mask: The network mask for the type 3 LSA; set to 0.0.0.0 for the Type-4 LSA

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

 

4)         AS external LSA

An AS external LSA originates from an ASBR, describing routing information to a destination outside the AS.

Figure 1-19 AS external LSA format

Major fields:

l           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

l           Network Mask: The IP address mask for the advertised destination

l           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. Refer to Route types for description about external route types

l           metric: The metric to the destination

l           Forwarding Address: Data traffic for the advertised destination will be forwarded to this address

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

5)         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 1-20 NSSA external LSA format

1.1.6  Supported OSPF Features

I. Multi-process

With multi-process support, multiple OSPF processes can run on a router 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.

II. Authentication

OSPF supports authentication on packets. Only packets that pass the authentication are received. If hello packets cannot pass authentication, no neighbor relationship can 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 attached to a network segment must be identical.

III. Hot Standby and GR

Distributed routers support OSPF Hot Standby (HSB). OSPF backups necessary information of the Active Main Board (AMB) into the Standby Main Board. Once the AMB fails, the SMB begins to work to ensure the normal operation of OSPF.

OSPF supports to backup:

l           All OSPF data to the SMB to make sure OSPF recovers normal operation immediately upon the AMB failure.

l           Only the OSPF configuration information to the SMB. Once the AMB fails, OSPF will perform Graceful Restart (GR), obtaining adjacencies from and synchronizing the Link State Database with neighbors.

The Graceful Restart of the router is mainly used for High Availability (HA) and will not interfere with any other routers.

When a router shuts down, its neighbors will delete it from their neighbor tables and inform other routers, resulting in SPF recalculation. If the router restarts in several seconds, it is unnecessary to perform SPF recalculation, and reestablish adjacencies.

To avoid unnecessary SPF calculation, when a router restarts, it will inform neighboring routers the shutdown is temporary. Then these routers will not delete the router from their neighbor tables, and other routers have no idea about this restart.

After recovering to normal, the router obtains the Link State Database from neighboring routers via the GR related synchronization mechanism.

 

&  Note:

For OSPF GR configuration, refer to GR Configuration in System Volume.

 

IV. TE and DS-TETE

OSPF Traffic Engineering (TE) provides for the establishment and maintenance of Label Switch 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, refer to MPLS TE Configuration in the MPLS VPN Volume.

 

V. IGP Shortcut and Forwarding Adjacency

IGP Shortcut and Forwarding Adjacency enable OSPF to use a 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:

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

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

 

&  Note:

For configuration of this feature, refer to MPLS TE Configuration in the MPLS VPN Volume.

 

VI. VPN

OSPF supports multi-instance, which can run on PEs in VPN networks.

In BGP MPLS VPN networks, 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 will be forwarded to another site as an external route, which leads to heavy OSPF routing traffic and management issues.

Configuring area IDs on PEs can differentiate VPNs. Sites in the same VPN are considered as directly connected. PE routers then exchange OSPF routing information like on a dedicated line, thus network management and OSPF operation efficiency are improved.

 

&  Note:

For configuration of this feature, refer to MPLS L3VPN Configuration in the MPLS VPN Volume.

 

VII. 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 using the BGP extended community attribute. OSPF running on a PE at the other end utilizes this information to originate a Type-3 summary LSA as an inter-area route between the PE and CE.

If a router connects to a PE router in the same area and establishes an internal route (backdoor route) for a special destination, in this case, since an OSPF intra-area route has a higher priority than a backbone route, VPN traffic will always travel on the backdoor route rather than the backbone route. To avoid this, an unnumbered sham link can be configured between PE routers, connecting the router to another PE router via an intra-area route with low cost.

 

&  Note:

For sham link configuration, refer to MPLS L3VPN Configuration.

 

1.1.7  Protocols and Standards

l           RFC 1765: OSPF Database Overflow

l           RFC 2328: OSPF Version 2

l           RFC 3101: OSPF Not-So-Stubby Area (NSSA) Option

l           RFC 3137: OSPF Stub Router Advertisement

l           RFC 3630: Traffic Engineering Extensions to OSPF Version 2

1.2  OSPF Configuration Task List

Complete the following tasks to configure OSPF:

Task

Description

Configuring OSPF Basic Functions

Required

Configuring OSPF Area Parameters

Optional

Configuring OSPF Network Types

Configuring the OSPF Network Type for an Interface

Optional

Configuring an NBMA Neighbor

Optional

Configuring a DR Priority for an OSPF Interface

Optional

Configuring OSPF Route Control

Configuring OSPF Route Summarization

Optional

Configuring OSPF Inbound Route Filtering

Optional

Configuring ABR Type-3 LSA Filtering

Optional

Configuring the OSPF Link Cost

Optional

Configuring the Maximum Number of OSPF Routes

Optional

Configuring the Maximum Number of Equal Cost Routes

Optional

Configuring the Priority of OSPF Routes

Optional

Configuring OSPF Route Redistribution

Optional

Configuring OSPF Network Optimization

Configuring OSPF Packet Timers

Optional

Configuring the LSA Transmission Delay

Optional

Configuring the SPF Calculation Interval

Optional

Configuring the Minimum LSA Repeating Arrival Interval

Optional

Configuring the LSA Generation Interval

Optional

Disabling Interfaces from Sending OSPF Packets

Optional

Configuring Stub Routers

Optional

Configuring OSPF Authentication

Optional

Adding Interface MTU into DD Packets

Optional

Configuring the Maximum Number of External LSAs in LSDB

Optional

Making External Route Selection Rules Defined in RFC1583 Compatible

Optional

Configuring OSPF Network Management

Optional

Enabling the Advertisement and Reception of Opaque LSAs

Optional

 

1.3  Configuring OSPF Basic Functions

You need to enable OSPF, specify an interface and area ID first before performing other tasks.

1.3.1  Prerequisites

Before configuring OSPF, you have configured the link layer protocol, and IP addresses for interfaces, making neighboring nodes accessible with each other at the network layer.

1.3.2  Configuration Procedure

To ensure OSPF stability, you need to decide on router IDs and configure them manually. Any two routers in an AS must have different IDs. In practice, the ID of a router is the IP address of one of its interfaces.

The system supports OSPF multi-process. When a router runs multiple OSPF processes, you need to specify an ID for each process, which takes effect locally and has no interference on packet exchange between routers. Therefore, two routers having different process IDs can exchange packets.

The system supports OSPF multi-instance. You can configure an OSPF process to run in a specified VPN instance to configure an association between the two.

The configurations for routers in an area are performed on the area basis. Wrong configurations may cause communication failures, even routing information block or routing loops between neighboring routers.

Follow these steps to configure OSPF basic functions:

To do…

Use the command…

Remarks

Enter system view

system-view

Enable OSPF and enter its view

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

Configure a description for the OSPF process

description description

Optional

Not configured by default

Configure an OSPF area and enter OSPF area view

area area-id

Required

Not configured by default

Configure a description for the area

description description

Optional

Not configured by default

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

network ip-address wildcard-mask

Required

Not configured by default

 

&  Note:

l      An OSPF process ID is unique, including the process ID for OSPF multi-instance, which cannot be the same as any previously configured ID.

l      A network segment can only belong to one area.

l      It is recommended to configure a description for each OSPF process to help identify purposes of processes and for ease of management and memorization.

l      It is recommended to configure a description for each area to help identify purposes of areas and for ease of management and memorization.

 

1.4  Configuring OSPF Area Parameters

Splitting an OSPF AS into multiple areas reduces the number of LSAs on networks and extends OSPF application. For those non-backbone areas residing on the AS boundary, you can configure them as Stub areas to further reduce the size of routing tables on routers in these areas and the number of LSAs.

A stub area cannot redistribute routes, thus introducing the concept of NSSA, where type 7 LSAs (NSSA External LSAs) are advertised. Type 7 LSAs originate from the ASBR in a NSSA area. When arriving at the ABR in the NSSA area, these LSAs will be translated into type 5 LSAs for advertisement to other areas.

Non-backbone areas exchange routing information via the backbone area. Therefore, the backbone and non-backbone areas, including the backbone itself must maintain connectivity.

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

1.4.1  Prerequisites

Before configuring an OSPF area, you have configured:

l           IP addresses for interfaces, making neighboring nodes accessible with each other at network layer.

l           OSPF basic functions

1.4.2  Configuration Procedure

Follow these steps to configure OSPF area parameters:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Enter area view

area area-id

Required

Configure the area as a stub area

stub [ no-summary ]

Optional

Not configured by default

Configure the area as an NSSA area

nssa [ default-route-advertise | no-import-route | no-summary ] *

Optional

Not configured by default

Specify a cost for the default route advertised to the stub or NSSA area

default-cost cost

Optional

Defaults to 1

Create and 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 ] *

Optional

Configured on both ends of a virtual link

Note that hello and dead parameters must be identical on both ends of the link

Configure and advertise a host route

host-advertise ip-address cost

Optional

Not advertised by default

 

&  Note:

l      It is required to use the stub command on routers attached to a stub area.

l      It is required to use the nssa command on routers attached to an NSSA area.

l      Using the default-cost command only takes effect on the ABR of a stub area or the ABR/ASBR of an NSSA area.

 

1.5  Configuring OSPF Network Types

OSPF classifies networks into four types upon link layer protocols. Since an NBMA network must be fully meshed, namely, any two routers in the network must have a virtual link in between. In most cases, however, the requirement cannot be satisfied, so you need to change the network type using commands.

For routers having no direct link in between, you can configure related interfaces as the P2MP mode. If a router in the NBMA network has only a single peer, you can also configure associated interfaces as the P2P mode.

In addition, when configuring broadcast and NBMA networks, you can specify for interfaces DR priorities for DR/BDR election. In practice, routers having higher reliability should become the DR/BDR.

1.5.1  Prerequisites

Before configuring OSPF network types, you have configured:

l           IP addresses for interfaces, making neighboring nodes accessible with each other at network layer.

l           OSPF basic functions

1.5.2  Configuring the OSPF Network Type for an Interface

Follow these steps to configure the OSPF network type for an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Configure the network type

ospf network-type { broadcast | nbma | p2mp | p2p }

Optional

Not configured by default

 

&  Note:

l      Configuring a new network type for an interface overwrites the previous network one (if any).

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

 

1.5.3  Configuring an NBMA Neighbor

For NBMA interfaces that cannot broadcast hello packets to find neighbors, you need to specify IP addresses and DR priorities of neighbors manually.

Follow these steps to configure a neighbor and its DR priority:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Specify an NBMA neighbor and its DR priority

peer ip-address [ dr-priority dr-priority ]

Required

 

1.5.4  Configuring a DR Priority for an OSPF Interface

For broadcast or NBMA interfaces, you can configure DR priorities for DR/BDR election. Follow these steps to configure a DR priority for an OSPF interface:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Configure a DR priority for the interface

ospf dr-priority priority

Optional

The default DR priority is 1

 

&  Note:

 

1.6  Configuring OSPF Route Control

This section is to configure control of OSPF routing information advertisement and reception, and route redistribution from other protocols.

1.6.1  Prerequisites

To configure this task, you have configured:

l           IP addresses for interfaces

l           OSPF basic functions

l           Corresponding filters if routing information filtering is needed.

1.6.2  Configuring OSPF Route Summarization

I. Configure route summarization between OSPF areas on an ABR

Follow these steps to configure route summarization between OSPF areas on an ABR:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Enter OSPF area view

area area-id

Required

Configure ABR route summarization

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

Required

Available on an ABR only

Not configured by default

 

II. Configure route summarization when redistributing routes into OSPF on an ASBR

Follow these steps to configure route summarization when redistributing routes into OSPF on an ASBR:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure ASBR route summarization

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

Required

Available on an ASBR only

Not configured by default

 

1.6.3  Configuring OSPF Inbound Route Filtering

Follow these steps to configure OSPF to filter received routes:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Required

Configure to filter received routes

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

Required

Not configured by default

 

&  Note:

Since OSPF is a link state-based internal gateway protocol, routing information is contained in LSAs. However, OSPF cannot filter LSAs. Using the filter-policy import command is to filter routes computed by OSPF, and only routes not filtered are added into the routing table.

 

1.6.4  Configuring ABR Type-3 LSA Filtering

Follow these steps to configure Type-3 LSA filtering on an ABR:

To do…

Use the command…

Remarks

Enter system view

System-view

Enter OSPF view

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

Enter area view

area area-id

Configure ABR Type-3 LSA filtering

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

Required

Not configured by default

 

1.6.5  Configuring the OSPF Link Cost of an Interface

Follow these steps to configure the link cost for an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Configure the cost value of the interface

ospf cost value

Optional

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

The cost value defaults to 1 for VLAN interfaces

 

Follow these steps to configure a bandwidth reference value:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure a bandwidth reference value

bandwidth-reference value

Optional

The value defaults to 100 Mbps

 

&  Note:

If the cost value is not configured for an interface, OSPF computes the interface cost automatically: Interface cost = Bandwidth reference value/Interface bandwidth. If the calculated cost is greater than 65535, the value of 65535 is used.

 

1.6.6  Configuring the Maximum Number of OSPF Routes

Follow these steps to configure the maximum number of routes:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure the maximum number of OSPF routes

maximum-routes { external | inter | intra } number

Optional

By default, OSPF generates up to 524288 external routes, up to 10000 inter-area routes, and up to 2000 intra-area routes.

 

1.6.7  Configuring the Maximum Number of Equal Cost Routes for Load Balancing

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

Follow these steps to configure the maximum number of equal cost routes:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure the maximum number of equal cost routes for load balancing

maximum load-balancing maximum

Optional

8 by default

 

1.6.8  Configuring the Priority of OSPF Routes

A router may run multiple routing protocols. The router sets a priority for each protocol, when a route found by several routing protocols, the route found by the protocol with the highest priority will be selected.

Follow these steps to configure the priority for OSPF routes:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure the priority of OSPF routes

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

Optional

The priority of OSPF internal routes defaults to 10

The priority of OSPF external routes defaults to 150

 

1.6.9  Configuring OSPF Route Redistribution

Follow these steps to configure OSPF route redistribution:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure OSPF to redistribute routes from other protocols

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

Required

Not configured by default

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

Redistribute a default route

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

default-route-advertise summary cost cost

Optional

Not redistributed by default

Configure the default values of parameters for redistributed routes (cost, route number, tag and type)

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

Optional

By default, the default cost is 1, default upper limit of routes redistributed per time is 1000, default tag is 1 and default type of redistributed routes is Type-2.

 

&  Note:

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

l      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 will advertise the default route to the CE.

l      By filtering redistributed routes, OSPF translates only routes, which are not filtered out, into Type-5 LSAs or Type-7 LSAs for advertisement.

l      You can configure default values of parameters for redistributed routes, such as the cost, upper limit, tag and type of external routes. The tag is used to indicate information related to protocol, for example, when redistributing BGP routes, OSPF uses the tag to differentiate AS IDs.

 

1.7  Configuring OSPF Network Optimization

You can optimize your OSPF network in the following ways:

l           Change values of OSPF packet timers to adjust the OSPF network convergence speed and network load. On low speed links, you need to consider the delay time for sending LSAs on interfaces.

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

l           Configure OSPF authentication to meet high security requirements of some mission-critical networks.

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

1.7.1  Prerequisites

Before configuring OSPF network optimization, you have configured:

l           IP addresses for interfaces

l           OSPF basic functions

1.7.2  Configuring OSPF Packet Timers

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

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

l           Poll timer: Interval for sending hello packets to the neighbor that is down on the NBMA network.

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

l           LSA retransmit timer: Interval within which if the interface receives no acknowledgement packets after sending a LSA to the neighbor, it will retransmit the LSA.

Follow these steps to configure timers for OSPF packets:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Specify the hello interval

ospf timer hello seconds

Optional

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

Specify the poll interval

ospf timer poll seconds

Optional

The poll interval defaults to 120 seconds.

Specify the dead interval

ospf timer dead seconds

Optional

The dead interval defaults to 40 seconds on P2P, Broadcast interfaces and 120 seconds on P2MP and NBMA interfaces.

Specify the retransmission interval

ospf timer retransmit interval

Optional

The retransmission interval defaults to 5 seconds.

 

&  Note:

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

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

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

l      The retransmission interval should not be so small for avoidance of unnecessary LSA retransmissions. In general, this value is bigger than the round-trip time of a packet between two adjacencies.

 

1.7.3  Configuring the LSA Transmission Delay

Since OSPF packets need time for traveling on links, extending LSA age time with some delay time is necessary, especially for low speed links.

Follow these steps to configure the LSA transmission delay time on an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Set the LSA transmission delay time

ospf trans-delay seconds

Optional

Set to 1 second by default

 

1.7.4  Configuring the SPF Calculation Interval

Link State Database changes lead to SPF calculations. When an OSPF network changes frequently, a large amount of network resources will be occupied, reducing working efficiency of routers. You can adjust the SPF calculation interval for the network to reduce negative influence.

Follow these steps to configure the SPF calculation interval:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Set the SPF calculation interval

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

Optional

By default, the interval is 5 seconds

 

&  Note:

With this command configured, when network changes are not frequent, SPF calculation applies at the minimum-interval. If network changes become frequent, SPF calculation interval is incremented by incremental-interval2n-2 (n is the number of calculation times) each time a calculation occurs, up to the maximum-interval.

 

1.7.5  Configuring the Minimum LSA Repeating Arrival Interval

When an interface receives an LSA that is the same with the previously received LSA within a specified interval, the minimum LSA repeating arrival interval, the interface will discard the LSA.

Follow these steps to configure the minimum LSA repeating arrival interval:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure the LSA minimum repeat arrival interval

lsa-arrival-interval interval

Optional

1000 milliseconds by default

 

&  Note:

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

 

1.7.6  Configuring the LSA Generation Interval

With this feature configured, you can protect network resources and routers from being over consumed due to frequent network changes.

Follow these steps to configure the LSA generation interval:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Required

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:

With this command configured, when network changes are not frequent, LSAs are generated at the minimum-interval. If network changes become frequent, LSA generation interval is incremented by incremental-interval2n-2 (n is the number of generation times) each time a generation occurs, up to the maximum-interval.

 

1.7.7  Disabling Interfaces from Sending OSPF Packets

Follow these steps to disable an interface from sending routing information to other routers:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Disable interfaces from sending OSPF packets

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

Optional

Not disabled by default

 

&  Note:

l      Different OSPF processes can disable the same interface from sending OSPF packets. Use of the silent-interface command disables only the interfaces associated with the current process rather than interfaces associated with other processes.

l      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 no OSPF packet can be advertised for the interface to find a neighbor. This configuration can enhance adaptability of OSPF networking and reduce resource consumption.

 

1.7.8  Configuring Stub Routers

A stub router is used for traffic control. It informs other OSPF routers not to use it to forward data, but they can have a route to the stub router.

The router LSAs from the stub router may contain different link type values. A value of 3 means a link to the stub network, so the cost of the link remains unchanged. A value of 1, 2 or 4 means a point-to-point link, a link to a transit network or a virtual link, in such cases, a maximum cost value of 65535 is used. Thus, other neighbors find the links to the stub router have such big costs, they will not send packets to the stub router for forwarding as long as there is a route with a smaller cost.

Follow these steps to configure a router as a stub router:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Configure the router as a stub router

stub-router

Required

Not configured by default

 

&  Note:

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

 

1.7.9  Configuring OSPF Authentication

By supporting packet authentication, OSPF receives packets that pass the authentication only, so failed packets cannot establish neighboring relationship.

Follow these steps to configure OSPF authentication:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Enter area view

area area-id

Configure the authentication mode

authentication-mode { simple | md5 }

Required

Not configured by default

Exit to OSPF view

quit

Exit to system view

quit

Enter interface view

interface interface-type interface-number

Configure the authentication mode (simple authentication) for the interface

ospf authentication-mode simple [ plain | cipher ] password

Optional

Not configured by default

Configure the authentication mode (MD5 authentication) for the interface

ospf authentication-mode { md5 | hmac-md5 } key-id [ plain | cipher ] password

 

&  Note:

The authentication mode and password for all interfaces attached to the same area must be identical.

 

1.7.10  Adding Interface MTU into DD Packets

Generally, when an interface sends a DD packet, it adds 0 into the Interface MTU field of the DD packet rather than the interface MTU.

Follow these steps to add the interface MTU into DD packets:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter interface view

interface interface-type interface-number

Enable OSPF to add interface MTU into DD packets

ospf mtu-enable

Optional

Not enabled by default, that is, the interface fills in a value of 0

 

1.7.11  Configuring the Maximum Number of External LSAs in LSDB

Follow these steps to configure the maximum number of external LSAs in the Link State Database:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Specify the maximum number of external LSAs in the LSDB

lsdb-overflow-limit number

Optional

No limitation by default

 

1.7.12  Making External Route Selection Rules Defined in RFC1583 Compatible

The selection of an external route from multiple LSAs defined in RFC2328 is different from the one defined in RFC1583.

Follow these steps to make them compatible:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Required

Make RFC1583 compatible

rfc1583 compatible

Optional

Compatible by default

 

1.7.13  Configuring OSPF Network Management

Follow these steps to configure OSPF network management:

To do…

Use the command…

Remarks

Enter system view

system-view

Bind OSPF MIB to an OSPF process

ospf mib-binding process-id

Optional

The first OSPF process bound with OSPF MIB by default

Enable OSPF trap

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

Optional

Enabled by default

Enter OSPF view

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

Enable messages logging

enable log [ config | error | state ]

Optional

Not enabled by default

Enable the logging on neighbor state changes

log-peer-change

Optional

Enabled by default

 

1.7.14  Enabling the Advertisement and Reception of Opaque LSAs

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

Follow these steps to enable the advertisement and reception of opaque LSAs:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter OSPF view

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

Enable the advertisement and reception of opaque LSAs

opaque-capability enable

Optional

Disabled by default

 

1.8  Displaying and Maintaining OSPF Configuration

To do…

Use the command…

Remarks

Display OSPF brief information

display ospf [ process-id ] brief

Available in any view

Display OSPF statistics

display ospf [ process-id ] cumulative

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

Display OSPF neighbor information

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

Display neighbor statistics of OSPF areas

display ospf [ process-id ] peer statistics

Display next hop information

display ospf [ process-id ] nexthop

Display routing table information

display ospf [ process-id ] routing [ interface interface-type interface-number ] [ nexthop nexthop-address ]

Display virtual link information

display ospf [ process-id ] vlink

Display OSPF request queue information

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

Display OSPF retransmission queue information

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

Display OSPF ABR and ASBR information

display ospf [ process-id ] abr-asbr

Display OSPF interface information

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

Display OSPF error information

display ospf [ process-id ] error

Display OSPF ASBR summarization information

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

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

Remove redistributed routes

reset ospf [ process-id ] redistribution

 

1.9  OSPF Configuration Examples

 

  Caution:

In these examples, only commands related to OSPF configuration are described.

 

1.9.1  Configuring OSPF Basic Functions

I. Network requirements

As shown in the following figure, all switches run OSPF. The AS is split into three areas, in which, Switch A and Switch B act as ABRs to forward routing information between areas.

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

II. Network diagram

Figure 1-21 Network diagram for OSPF basic configuration

III. Configuration procedure

1)         Configure IP addresses for interfaces (omitted)

2)         Configure OSPF basic functions

# Configure Switch A

<SwitchA> system-view

[SwitchA] ospf

[SwitchA-ospf-1] area 0

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

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

[SwitchA-ospf-1] area 1

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

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

[SwitchA-ospf-1] quit

# Configure Switch B

<SwitchB> system-view

[SwitchB] ospf

[SwitchB-ospf-1] area 0

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

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

[SwitchB-ospf-1] area 2

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

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

[SwitchB-ospf-1] quit

# Configure Switch C

<SwitchC> system-view

[SwitchC] ospf

[SwitchC-ospf-1] area 1

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

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

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

[SwitchC-ospf-1] quit

# Configure Switch D

<SwitchD> system-view

[SwitchD] ospf

[SwitchD-ospf-1] area 2

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

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

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

[SwitchD-ospf-1] quit

3)         Verify the configuration

# Display information about neighbors on Switch A.

[SwitchA] display ospf peer

 

          OSPF Process 1 with Router ID 192.168.1.1

                  Neighbors

 

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

 Router ID: 192.168.2.1      Address: 192.168.0.2      GR State: Normal

   State: Full  Mode: Nbr is Master  Priority: 1

   DR: 192.168.0.2  BDR: 192.168.0.1  MTU: 0

   Dead timer due in 31  sec

   Neighbor is up for 00:01:09

   Authentication Sequence: [ 0 ]

 

                  Neighbors

 

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

 Router ID: 192.168.1.2      Address: 192.168.1.2      GR State: Normal

   State: Full  Mode: Nbr is Master  Priority: 1

   DR: 192.168.1.2  BDR: 192.168.1.1  MTU: 0

   Dead timer due in 39  sec

   Neighbor is up for 00:01:01

   Authentication Sequence: [ 0 ]

# Display OSPF routing information on Switch A.

[SwitchA] display ospf routing

 

          OSPF Process 1 with Router ID 192.168.1.1

                   Routing Tables

 

 Routing for Network

 Destination        Cost     type    NextHop         AdvRouter     Area

 172.16.1.0/24      2        Stub    192.168.1.2     192.168.1.2   0.0.0.1

 172.17.1.0/24      3        Inter   192.168.0.2     192.168.2.1   0.0.0.0

 192.168.0.0/24     1        Transit 192.168.0.1     192.168.2.1   0.0.0.0

 192.168.1.0/24     1        Transit 192.168.1.1     192.168.1.2   0.0.0.1

 192.168.2.0/24     2        Inter   192.168.0.2     192.168.2.1   0.0.0.0

 

 Total Nets: 5

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

# Display the Link State Database on Switch A.

[SwitchA] display ospf lsdb

 

          OSPF Process 1 with Router ID 192.168.1.1

                  Link State Database

 

                          Area: 0.0.0.0

 type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    192.168.1.1     192.168.1.1        536  36    80000004       0

 Router    192.168.2.1     192.168.2.1        528  36    80000004       0

 Network   192.168.0.2     192.168.2.1        528  32    80000002       0

 Sum-Net   192.168.1.0     192.168.1.1        581  28    80000001       1

 Sum-Net   172.17.1.0      192.168.2.1        516  28    80000001       2

 Sum-Net   192.168.2.0     192.168.2.1        582  28    80000001       1

 Sum-Net   172.16.1.0      192.168.1.1        531  28    80000001       2

                          Area: 0.0.0.1

 type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    192.168.1.2     192.168.1.2        537  48    80000006       0

 Router    192.168.1.1     192.168.1.1        534  36    80000004       0

 Network   192.168.1.2     192.168.1.2        537  32    80000002       0

 Sum-Net   172.17.1.0      192.168.1.1        515  28    80000001       3

 Sum-Net   192.168.2.0     192.168.1.1        536  28    80000001       2

 Sum-Net   192.168.0.0     192.168.1.1        581  28    80000001       1

# Display the OSPF routing table on Switch D.

[SwitchD] display ospf routing

 

          OSPF Process 1 with Router ID 192.168.2.2

                   Routing Tables

 

 Routing for Network

 Destination        Cost     type    NextHop         AdvRouter     Area

 172.16.1.0/24      4        Inter   192.168.2.1     192.168.2.1   0.0.0.2

 172.17.1.0/24      1        Stub    172.17.1.1      192.168.2.2   0.0.0.2

 192.168.0.0/24     2        Inter   192.168.2.1     192.168.2.1   0.0.0.2

 192.168.1.0/24     3        Inter   192.168.2.1     192.168.2.1   0.0.0.2

 192.168.2.0/24     1        Transit 192.168.2.2     192.168.2.2   0.0.0.2

 

 Total Nets: 5

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

# Ping the IP address 172.16.1.1 to check connectivity.

[SwitchD] ping 172.16.1.1

  PING 172.16.1.1: 56  data bytes, press CTRL_C to break

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

    Reply from 172.16.1.1: bytes=56 Sequence=2 ttl=253 time=16 ms

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

    Reply from 172.16.1.1: bytes=56 Sequence=4 ttl=253 time=94 ms

    Reply from 172.16.1.1: bytes=56 Sequence=5 ttl=253 time=63 ms

 

  --- 172.16.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 16/59/94 ms

1.9.2  Configuring an OSPF Stub Area

I. Network requirements

The following figure shows an AS is split into three areas, where all switches run OSPF. Switch A and Switch B act as ABRs to forward routing information between areas. Switch D acts as the ASBR, redistributing routes (static routes).

It is required to configure Area 1 as a Stub area, reducing LSAs to this area without affecting route reachability.

II. Network diagram

Figure 1-22 Network diagram for OSPF Stub area configuration

III. Configuration procedure

1)         Configure IP addresses for interfaces (omitted).

2)         Configure OSPF basic functions (in the previous example).

3)         Configure Switch D to redistribute static routes.

[SwitchD] ip route-static 200.0.0.0 8 null 0

[SwitchD] ospf

[SwitchD-ospf-1] import-route static

[SwitchD-ospf-1] quit

# Display ABR/ASBR information on Switch C

[SwitchC] display ospf abr-asbr

 

          OSPF Process 1 with Router ID 192.168.1.2

                  Routing Table to ABR and ASBR

 

 type        Destination       Area       Cost  Nexthop         Rttype

 Intra       192.168.1.1       0.0.0.1    1     192.168.1.1     ABR

 Inter       192.168.2.2       0.0.0.1    3     192.168.1.1     ASBR

# Display OSPF routing table information on Switch C.

[SwitchC] display ospf routing

 

          OSPF Process 1 with Router ID 192.168.1.2

                   Routing Tables

 

 Routing for Network

 Destination        Cost     type    NextHop         AdvRouter     Area

 172.16.1.0/24      1        Stub    172.16.1.1      192.168.1.2   0.0.0.1

 172.17.1.0/24      4        Inter   192.168.1.1     192.168.1.1   0.0.0.1

 192.168.0.0/24     2        Inter   192.168.1.1     192.168.1.1   0.0.0.1

 192.168.1.0/24     1        Transit 192.168.1.2     192.168.1.2   0.0.0.1

 192.168.2.0/24     3        Inter   192.168.1.1     192.168.1.1   0.0.0.1

 

 Routing for ASEs

 Destination        Cost     type    Tag       NextHop         AdvRouter

 200.0.0.0/8         1         Type2    1         192.168.1.1      192.168.2.2

 

 Total Nets: 6

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

 

&  Note:

In the above output, since Switch C resides in a normal OSPF area, its routing table contains an external route.

 

4)         Configure Area 1 as a Stub area.

# Configure Switch A.

[SwitchA] ospf

[SwitchA-ospf-1] area 1

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

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

[SwitchA-ospf-1] quit

# Configure Switch C.

[SwitchC] ospf

[SwitchC-ospf-1] stub-router

[SwitchC-ospf-1] area 1

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

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

[SwitchC-ospf-1] quit

# Display the OSPF routing table on Switch C

[SwitchC] display ospf routing

 

          OSPF Process 1 with Router ID 192.168.1.2

                   Routing Tables

 

 Routing for Network

 Destination        Cost     type    NextHop         AdvRouter     Area

 0.0.0.0/0          65536    Inter   192.168.1.1     192.168.1.1   0.0.0.1

 172.16.1.0/24      1        Stub    172.16.1.1      192.168.1.2   0.0.0.1

 172.17.1.0/24      65538    Inter   192.168.1.1     192.168.1.1   0.0.0.1

 192.168.0.0/24     65536    Inter   192.168.1.1     192.168.1.1   0.0.0.1

 192.168.1.0/24     65535    Transit 192.168.1.2     192.168.1.2   0.0.0.1

 192.168.2.0/24     65537    Inter   192.168.1.1     192.168.1.1   0.0.0.1

 

 Total Nets: 6

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

 

&  Note:

When Switch C resides in the Stub area, a default route takes the place of the external route.

 

# Filter Type-3 LSAs for the Stub area

[SwitchA] ospf

[SwitchA-ospf-1] area 1

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

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

# Display the OSPF routing table on Switch C.

[SwitchC] display ospf routing

 

          OSPF Process 1 with Router ID 192.168.1.2

                   Routing Tables

 

 Routing for Network

 Destination        Cost     type    NextHop         AdvRouter     Area

 0.0.0.0/0          65536    Inter   192.168.1.1     192.168.1.1   0.0.0.1

 172.16.1.0/24      1        Stub    172.16.1.1      192.168.1.2   0.0.0.1

 192.168.1.0/24     65535    Transit 192.168.1.2     192.168.1.2   0.0.0.1

 

 Total Nets: 3

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

 

&  Note:

After this configuration, routing table entries on the Stub router are further reduced, containing only one default external route.

 

1.9.3  Configuring an OSPF NSSA Area

I. Network requirements

The following figure shows an AS is split into three areas, where all switches run OSPF. Switch A and Switch B act as ABRs to forward routing information between areas. Switch D acts as the ASBR, redistributing routes (static routes)

It is required to configure Area 1 as an NSSA area, RouterC as the ASBR to redistribute static routes into the AS.

II. Network diagram

Figure 1-23 Network diagram for OSPF NSSA area configuration

III. Configuration procedure

1)         Configure IP addresses for interfaces.

2)         Configure OSPF basic functions (refer to Configuring OSPF Basic Functions ).

3)         Configure Switch D to import external static routes (refer to Authentication previous example)

4)         Configure Area 1 as an NSSA area.

# Configure Switch A.

[SwitchA] ospf

[SwitchA-ospf-1] area 1

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

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

[SwitchA-ospf-1] quit

# Configure Switch C.

[SwitchC] ospf

[SwitchC-ospf-1] area 1

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

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

[SwitchC-ospf-1] quit

 

&  Note:

It is recommended to configure the nssa command with the keyword default-route-advertise no-summary on Switch A (an ABR) to reduce the routing table size on NSSA routers. On other NSSA routers, using the nssa command is ok.

 

# Display OSPF routing table information on Switch C.

[SwitchC] display ospf routing

 

          OSPF Process 1 with Router ID 192.168.1.2

                   Routing Tables

 

 Routing for Network

 Destination        Cost     type    NextHop         AdvRouter     Area

 0.0.0.0/0          2        Inter   192.168.1.1     192.168.1.1   0.0.0.1

 172.16.1.0/24      1        Stub    172.16.1.1      192.168.1.2   0.0.0.1

 192.168.1.0/24     1        Transit 192.168.1.2     192.168.1.2   0.0.0.1

 

 Total Nets: 3

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

5)         Configure Switch C to redistribute static routes.

[SwitchC] ip route-static 100.0.0.0 8 null 0

[SwitchC] ospf

[SwitchC-ospf-1] import-route static

[SwitchC-ospf-1] quit

# Display OSPF routing table information on Switch D.

[SwitchD-ospf-1] display ospf routing

 

          OSPF Process 1 with Router ID 192.168.2.2

                   Routing Tables

 

 Routing for Network

 Destination        Cost     type    NextHop         AdvRouter     Area

 172.16.1.0/24      4        Inter   192.168.2.1     192.168.2.1   0.0.0.2

 172.17.1.0/24      1        Stub    172.17.1.1      192.168.2.2   0.0.0.2

 192.168.0.0/24     2        Inter   192.168.2.1     192.168.2.1   0.0.0.2

 192.168.1.0/24     3        Inter   192.168.2.1     192.168.2.1   0.0.0.2

 192.168.2.0/24     1        Transit 192.168.2.2     192.168.2.2   0.0.0.2

 

 Routing for ASEs

 Destination        Cost     type    Tag       NextHop         AdvRouter

 100.0.0.0/8        1        Type2   1         192.168.2.1     192.168.1.1

 

 Total Nets: 6

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

 

&  Note:

You can see on Switch D an external route imported from the NSSA area.

 

1.9.4  Configuring OSPF DR Election

I. Network requirements

l           In the following figure, OSPF Switches A, B, C and D reside on the same network segment.

l           It is required to configure Switch A as the DR, Switch C as the BDR.

II. Network diagram

Figure 1-24 Network diagram for OSPF DR election configuration

III. Configuration procedure

1)         Configure IP addresses for interfaces (omitted)

2)         Configure OSPF basic functions

# Configure Switch A

<SwitchA> system-view

[Switch A] router id 1.1.1.1

[Switch A] ospf

[Switch A-ospf-1] area 0

[Switch A-ospf-1-area-0.0.0.0] network 196.1.1.0 0.0.0.255

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

[SwitchA-ospf-1] quit

# Configure Switch B

<SwitchB> system-view

[SwitchB] router id 2.2.2.2

[SwitchB] ospf

[SwitchB-ospf-1] area 0

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

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

[SwitchB-ospf-1] quit

# Configure Switch C

<SwitchC> system-view

[SwitchC] router id 3.3.3.3

[SwitchC] ospf

[SwitchC-ospf-1] area 0

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

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

[SwitchC-ospf-1] quit

# Configure Switch D

<SwitchD> system-view

[SwitchD] router id 4.4.4.4

[SwitchD] ospf

[SwitchD-ospf-1] area 0

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

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

[SwitchD-ospf-1] quit

# Display OSPF neighbor information on Switch A.

[SwitchA] display ospf peer

 

          OSPF Process 1 with Router ID 1.1.1.1

                  Neighbors

 

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

 Router ID: 2.2.2.2          Address: 192.168.1.2      GR State: Normal

   State: 2-Way  Mode: None  Priority: 1

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   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 ]

Switch D becomes the DR, and Switch C is the BDR.

3)         Configure DR priorities on interfaces

# Configure Switch A

[SwitchA] interface vlan-interface 1

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

[RouterA-Vlan-interface1] quit

# Configure Switch B

[SwitchB] interface vlan-interface 1

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

[SwitchB-Vlan-interface1] quit

# Configure Switch C

[SwitchC] interface vlan-interface 1

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

[SwitchC-Vlan-interface] quit

# Display neighbor information on Switch D.

[SwitchD] display ospf peer

 

          OSPF Process 1 with Router ID 4.4.4.4

                  Neighbors

 

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

 Router ID: 1.1.1.1      Address: 192.168.1.1      GR State: Normal

   State: Full  Mode:Nbr is  Slave  Priority: 100

   DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0

   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:

In the above output, you can find the priority configuration does not take effect immediately.

 

4)         Restart OSPF process (omitted)

# Display neighbor information on Switch D.

[SwitchD] display ospf peer

 

          OSPF Process 1 with Router ID 4.4.4.4

                  Neighbors

 

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

 Router ID: 1.1.1.1          Address: 192.168.1.1      GR State: Normal

   State: Full  Mode: Nbr is Slave  Priority: 100

   DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0

   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 ]

Switch A becomes the DR, and Switch C is the BDR.

 

&  Note:

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

 

# Display OSPF interface information.

[SwitchA] display ospf interface

 

          OSPF Process 1 with Router ID 1.1.1.1

                  Interfaces

 

 Area: 0.0.0.0

 IP Address      Type      State   Cost  Pri   DR             BDR

 192.168.1.1     Broadcast DR      1     100   192.168.1.1    192.168.1.3

 

[SwitchB] display ospf interface

 

          OSPF Process 1 with Router ID 2.2.2.2

                  Interfaces

 

 Area: 0.0.0.0

 IP Address      Type      State    Cost  Pri   DR            BDR

 192.168.1.2     Broadcast DROther  1     0     192.168.1.1   192.168.1.3

 

&  Note:

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

 

1.9.5  Configuring OSPF Virtual Links

I. Network requirements

In the following figure, Area 2 has no direct connection to Area 0, and Area 1 acts as the Transit Area to connect Area 2 to Area 0 via a configured virtual link between Switch B and Switch C.

After configuration, Switch A can learn routes to Area 2.

II. Network diagram

Figure 1-25 Network diagram for OSPF virtual link configuration

III. Configuration procedure

1)         Configure IP addresses for interfaces (omitted)

2)         Configure OSPF basic functions

# Configure Switch A

<SwitchA> system-view

[SwitchA] ospf 1 router-id 1.1.1.1

[SwitchA-ospf-1] area 0

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

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

[SwitchA-ospf-1] area 1

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

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

 # Configure Switch B

<SwitchB> system-view

[SwitchB] ospf 1 router-id 2.2.2.2

[SwitchB-ospf-1] area 1

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

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

[SwitchB-ospf-1] area 2

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

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

# Display the OSPF routing table on Switch A

[SwitchA] 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 2 has no direct connection to Area 0, the routing table of RouterA has no route to Area 2.

 

3)         Configure a virtual link

# Configure Switch A

[SwitchA] ospf

[SwitchA-ospf-1] area 1

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

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

[SwitchA-ospf-1] quit

# Configure Switch B

[SwitchB] ospf 1

[SwitchB-ospf-1] area 1

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

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

# Display the OSPF routing table on Switch A.

[SwitchA] 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.1.1/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

Switch A has learned the route 172.16.1.1/16 to Area 2.

1.10  Troubleshooting OSPF Configuration

1.10.1  No OSPF Neighbor Relationship Established

I. Symptom

No OSPF neighbor relationship can be established.

II. Analysis

If the physical link and lower 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), network type. If the network type is broadcast or NBMA, at least one interface must have a DR priority higher than 0.

III. Processing steps

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 DR priority higher than 0.

1.10.2  Incorrect Routing Information

I. Symptom

OSPF cannot find routes to other areas.

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

III. Processing steps

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 to which are configured with the stub command. In an NSSA area, all interface connected to which 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 Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网