B Routing cg42crs Chapter 0100 PDF
B Routing cg42crs Chapter 0100 PDF
Open Shortest Path First (OSPF) is an Interior Gateway Protocol (IGP) developed by the OSPF working
group of the Internet Engineering Task Force (IETF). Designed expressly for IP networks, OSPF supports
IP subnetting and tagging of externally derived routing information. OSPF also allows packet authentication
and uses IP multicast when sending and receiving packets.
OSPF Version 3 (OSPFv3) expands on OSPF Version 2, providing support for IPv6 routing prefixes.
This module describes the concepts and tasks you need to implement both versions of OSPF on your
Cisco CRS Router . The term “OSPF" implies both versions of the routing protocol, unless otherwise noted.
Note For more information about OSPF on Cisco IOS XR software and complete descriptions of the OSPF
commands listed in this module, see the Related Documents, on page 93 section of this module. To locate
documentation for other commands that might appear during execution of a configuration task, search
online in the Cisco IOS XR Commands Master List for the Cisco CRS Router
Release Modification
Release 2.0 This feature was introduced.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
1
Implementing OSPF
Release Modification
Release 3.4.0 Support was added for the following features:
• OSPF Forwarding Adjacency
• OSPF SNMP Trap MIB
Release 3.4.1 Support was added for the multi-area adjacency feature.
Release 3.7.0 OSPFv2 Sham Link and Nonstop Routing for OSPFv2 were
added.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
2
Implementing OSPF
Prerequisites for Implementing OSPF
Release Modification
Release 4.2.0 Support was added for the following features:
• OSPFv2 Fast Re-route Per-Prefix Computation
• OSPFv3 Non-stop Routing (NSR)
Release 5.3.0 Support was added for OSPFv2 Segment Routing Topology
Independent Fast Reroute
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
3
Implementing OSPF
Information About Implementing OSPF
• Configuring authentication (IP Security) is an optional task. If you choose to configure authentication,
you must first decide whether to configure plain text or Message Digest 5 (MD5) authentication, and
whether the authentication applies to an entire area or specific interfaces.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
4
Implementing OSPF
Key Features Supported in the Cisco IOS XR Software OSPF Implementation
OSPF runs directly on top of IP; it does not use TCP or User Datagram Protocol (UDP). OSPF performs its
own error correction by means of checksums in its packet header and LSAs.
In OSPFv3, the fundamental concepts are the same as OSPF Version 2, except that support is added for the
increased address size of IPv6. New LSA types are created to carry IPv6 addresses and prefixes, and the
protocol runs on an individual link basis rather than on an individual IP-subnet basis.
OSPF typically requires coordination among many internal routers: Area Border Routers (ABRs), which are
routers attached to multiple areas, and Autonomous System Border Routers (ASBRs) that export reroutes
from other sources (for example, IS-IS, BGP, or static routes) into the OSPF topology. At a minimum,
OSPF-based routers or access servers can be configured with all default parameter values, no authentication,
and interfaces assigned to areas. If you intend to customize your environment, you must ensure coordinated
configurations of all routers.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
5
Implementing OSPF
Comparison of Cisco IOS XR Software OSPFv3 and OSPFv2
Tip Understanding hierarchical CLI and CLI inheritance saves you considerable configuration time. See
Configuring Authentication at Different Hierarchical Levels for OSPF Version 2, on page 36 to understand
how to implement these fundamentals. In addition, Cisco IOS XR Software examples are provided in
Configuration Examples for Implementing OSPF , on page 85.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
6
Implementing OSPF
OSPF Routing Components
Autonomous Systems
The autonomous system is a collection of networks, under the same administrative control, that share routing
information with each other. An autonomous system is also referred to as a routing domain. Figure 1: OSPF
Routing Components, on page 7 shows two autonomous systems: 109 and 65200. An autonomous system
can consist of one or more OSPF areas.
Areas
Areas allow the subdivision of an autonomous system into smaller, more manageable networks or sets of
adjacent networks. As shown in Figure 1: OSPF Routing Components, on page 7, autonomous system 109
consists of three areas: Area 0, Area 1, and Area 2.
OSPF hides the topology of an area from the rest of the autonomous system. The network topology for an
area is visible only to routers inside that area. When OSPF routing is within an area, it is called intra-area
routing. This routing limits the amount of link-state information flood into the network, reducing routing
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
7
Implementing OSPF
OSPF Routing Components
traffic. It also reduces the size of the topology information in each router, conserving processing and memory
requirements in each router.
Also, the routers within an area cannot see the detailed network topology outside the area. Because of this
restricted view of topological information, you can control traffic flow between areas and reduce routing
traffic when the entire autonomous system is a single routing domain.
Backbone Area
A backbone area is responsible for distributing routing information between multiple areas of an autonomous
system. OSPF routing occurring outside of an area is called interarea routing.
The backbone itself has all properties of an area. It consists of ABRs, routers, and networks only on the
backbone. As shown in Figure 1: OSPF Routing Components, on page 7, Area 0 is an OSPF backbone area.
Any OSPF backbone area has a reserved area ID of 0.0.0.0.
Stub Area
A stub area is an area that does not accept route advertisements or detailed network information external to
the area. A stub area typically has only one router that interfaces the area to the rest of the autonomous system.
The stub ABR advertises a single default route to external destinations into the stub area. Routers within a
stub area use this route for destinations outside the area and the autonomous system. This relationship conserves
LSA database space that would otherwise be used to store external LSAs flooded into the area. In Figure 1:
OSPF Routing Components, on page 7, Area 2 is a stub area that is reached only through ABR 2. Area 0
cannot be a stub area.
Not-so-Stubby Area
A Not-so-Stubby Area (NSSA) is similar to the stub area. NSSA does not flood Type 5 external LSAs from
the core into the area, but can import autonomous system external routes in a limited fashion within the area.
NSSA allows importing of Type 7 autonomous system external routes within an NSSA area by redistribution.
These Type 7 LSAs are translated into Type 5 LSAs by NSSA ABRs, which are flooded throughout the whole
routing domain. Summarization and filtering are supported during the translation.
Use NSSA to simplify administration if you are a network administrator that must connect a central site using
OSPF to a remote site that is using a different routing protocol.
Before NSSA, the connection between the corporate site border router and remote router could not be run as
an OSPF stub area because routes for the remote site could not be redistributed into a stub area, and two
routing protocols needed to be maintained. A simple protocol like RIP was usually run and handled the
redistribution. With NSSA, you can extend OSPF to cover the remote connection by defining the area between
the corporate router and remote router as an NSSA. Area 0 cannot be an NSSA.
Routers
The OSPF network is composed of ABRs, ASBRs, and interior routers.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
8
Implementing OSPF
OSPF Process and Router ID
area that is attached to, including the backbone area. ABRs also send configuration summaries for their attached
areas to the backbone area, which then distributes this information to other OSPF areas in the autonomous
system. In Figure 1: OSPF Routing Components, on page 7, there are two ABRs. ABR 1 interfaces Area
1 to the backbone area. ABR 2 interfaces the backbone Area 0 to Area 2, a stub area.
Interior Routers
An interior router (such as R1 in Figure 1: OSPF Routing Components, on page 7) is attached to one area
(for example, all the interfaces reside in the same area).
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
9
Implementing OSPF
Supported OSPF Network Types
We recommend that the router ID be set by the router-id command in router configuration mode. Separate
OSPF processes could share the same router ID, in which case they cannot reside in the same OSPF routing
domain.
You can configure your Cisco IOS XR network as either a broadcast or an NBMA network. Using this feature,
you can configure broadcast networks as NBMA networks when, for example, you have routers in your
network that do not support multicast addressing.
MD5 Authentication
MD5 authentication provides a means of security. No password travels on the physical medium. Instead, the
router uses MD5 to produce a message digest of the OSPF packet plus the key, which is sent on the physical
medium. Using MD5 authentication prevents a router from accepting unauthorized or deliberately malicious
routing updates, which could compromise your network security by diverting your traffic.
Note MD5 authentication supports multiple keys, requiring that a key number be associated with a key.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
10
Implementing OSPF
Neighbors and Adjacency for OSPF
Authentication Strategies
Authentication can be specified for an entire process or area, or on an interface or a virtual link. An interface
or virtual link can be configured for only one type of authentication, not both. Authentication configured for
an interface or virtual link overrides authentication configured for the area or process.
If you intend for all interfaces in an area to use the same type of authentication, you can configure fewer
commands if you use the authentication command in the area configuration submode (and specify the
message-digest keyword if you want the entire area to use MD5 authentication). This strategy requires fewer
commands than specifying authentication for each interface.
Key Rollover
To support the changing of an MD5 key in an operational network without disrupting OSPF adjacencies (and
hence the topology), a key rollover mechanism is supported. As a network administrator configures the new
key into the multiple networking devices that communicate, some time exists when different devices are using
both a new key and an old key. If an interface is configured with a new key, the software sends two copies
of the same packet, each authenticated by the old key and new key. The software tracks which devices start
using the new key, and the software stops sending duplicate packets after it detects that all of its neighbors
are using the new key. The software then discards the old key. The network administrator must then remove
the old key from each the configuration file of each router.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
11
Implementing OSPF
Default Route for OSPF
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
12
Implementing OSPF
Link-State Advertisement Types for OSPFv3
An address prefix occurs in almost all newly defined LSAs. The prefix is represented by three fields: Prefix
Length, Prefix Options, and Address Prefix. In OSPFv3, addresses for these LSAs are expressed as “prefix
and prefix length” instead of “address and mask.” The default route is expressed as a prefix with length 0.
Inter-area-prefix and intra-area-prefix LSAs carry all IPv6 prefix information that, in IPv4, is included in
router LSAs and network LSAs. The Options field in certain LSAs (router LSAs, network LSAs, interarea-router
LSAs, and link LSAs) has been expanded to 24 bits to provide support for OSPF in IPv6.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
13
Implementing OSPF
Virtual Link and Transit Area for OSPF
In OSPFv3, the sole function of link-state ID in interarea-prefix LSAs, interarea-router LSAs, and autonomous
system external LSAs is to identify individual pieces of the link-state database. All addresses or router IDs
that are expressed by the link-state ID in OSPF Version 2 are carried in the body of the LSA in OSPFv3.
Passive Interface
Setting an interface as passive disables the sending of routing updates for the neighbors, hence adjacencies
will not be formed in OSPF. However, the particular subnet will continue to be advertised to OSPF neighbors.
Use the passive command in appropriate mode to suppress the sending of OSPF protocol operation on an
interface.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
14
Implementing OSPF
OSPFv2 Sham Link Support for MPLS VPN
It is recommended to use passive configuration on interfaces that are connecting LAN segments with hosts
to the rest of the network, but are not meant to be transit links between routers.
For example, Figure 3: Backdoor Paths Between OSPF Client Sites , on page 15 shows three client sites,
each with backdoor links. Because each site runs OSPF within Area 1 configuration, all routing between the
sites follows the intra-area path across the backdoor links instead of over the MPLS VPN backbone.
If the backdoor links between the sites are used only for backup purposes, default route selection over the
backbone link is not acceptable as it creates undesirable traffic flow. To establish the desired path selection
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
15
Implementing OSPF
OSPF SPF Prefix Prioritization
over the MPLS backbone, an additional OSPF intra-area (sham link) link between the ingress and egress
PErouters must be created.
A sham link is required between any two VPN sites that belong to the same OSPF area and share an OSPF
backdoor link. If no backdoor link exists between sites, no sham link is required.
Figure 4: Sham Link Between PE Routers to Connected OSPF Client Sites , on page 16 shows an MPLS
VPN topology where a sham link configuration is necessary. A VPN client has three sites, each with a backdoor
link. Two sham links are configured, one between PE-1 and PE-2 and another between PE-2 and PE-3. A
sham link is not required between PE-1 and PE-3, because there is no backdoor link between these sites.
When a sham link is configured between the PE routers, the PE routers can populate the virtual routing and
forwarding (VRF) table with the OSPF routes learned over the sham link. These OSPF routes have a larger
administrative distance than BGP routes. If BGP routes are available, they are preferred over these OSPF
routes with the high administrative distance.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
16
Implementing OSPF
OSPF SPF Prefix Prioritization
prefixes of the same route type per area. Before RIB and FIB installation, routes and prefixes are assigned to
various priority batch queues in the OSPF local RIB, based on specified route policy. The RIB priority batch
queues are classified as "critical," "high," "medium," and "low," in the order of decreasing priority.
When enabled, prefix alters the sequence of updating the RIB with this prefix priority:
Critical > High > Medium > Low
As soon as prefix priority is configured, /32 prefixes are no longer preferred by default; they are placed in the
low-priority queue, if they are not matched with higher-priority policies. Route policies must be devised to
retain /32s in the higher-priority queues (high-priority or medium-priority queues).
Priority is specified using route policy, which can be matched based on IP addresses or route tags. During
SPF, a prefix is checked against the specified route policy and is assigned to the appropriate RIB batch priority
queue.
These are examples of this scenario:
• If only high-priority route policy is specified, and no route policy is configured for a medium priority:
◦Permitted prefixes are assigned to a high-priority queue.
◦Unmatched prefixes, including /32s, are placed in a low-priority queue.
• If both high-priority and medium-priority route policies are specified, and no maps are specified for
critical priority:
◦Permitted prefixes matching high-priority route policy are assigned to a high-priority queue.
◦Permitted prefixes matching medium-priority route policy are placed in a medium-priority queue.
◦Unmatched prefixes, including /32s, are moved to a low-priority queue.
• If both critical-priority and high-priority route policies are specified, and no maps are specified for
medium priority:
◦Permitted prefixes matching critical-priority route policy are assigned to a critical-priority queue.
◦Permitted prefixes matching high-priority route policy are assigned to a high-priority queue.
◦Unmatched prefixes, including /32s, are placed in a low-priority queue.
• If only medium-priority route policy is specified and no maps are specified for high priority or critical
priority:
◦Permitted prefixes matching medium-priority route policy are assigned to a medium-priority queue.
◦Unmatched prefixes, including /32s, are placed in a low-priority queue.
Use the [no] spf prefix-priority route-policy rpl command to prioritize OSPF prefix installation into
the global RIB during SPF.
SPF prefix prioritization is disabled by default. In disabled mode, /32 prefixes are installed into the
global RIB, before other prefixes. If SPF prioritization is enabled, routes are matched against the
route-policy criteria and are assigned to the appropriate priority queue based on the SPF priority set.
Unmatched prefixes, including /32s, are placed in the low-priority queue.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
17
Implementing OSPF
Route Redistribution for OSPF
If all /32s are desired in the high-priority queue or medium-priority queue, configure this single route
map:
prefix-set ospf-medium-prefixes
0.0.0.0/0 ge 32
end-set
This figure shows the intervals at which the SPF calculations occur as long as at least one topology change
event is received in a given wait interval.
Figure 5: SPF Calculation Intervals Set by the timers spf Command
Notice that the wait interval between SPF calculations doubles when at least one topology change event is
received during the previous wait interval. After the maximum wait time is reached, the wait interval remains
the same until the topology stabilizes and no event is received in that interval.
If the first topology change event is received after the current wait interval, the SPF calculation is delayed by
the amount of time specified as the start interval. The subsequent wait intervals continue to follow the dynamic
pattern.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
18
Implementing OSPF
Nonstop Forwarding for OSPF Version 2
If the first topology change event occurs after the maximum wait interval begins, the SPF calculation is again
scheduled at the start interval and subsequent wait intervals are reset according to the parameters specified in
the timers throttle spf command. Notice in Figure 6: Timer Intervals Reset After Topology Change Event,
on page 19that a topology change event was received after the start of the maximum wait time interval and
that the SPF intervals have been reset.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
19
Implementing OSPF
Graceful Shutdown for OSPFv3
• Unplanned OSPFv3 process restart, such as a restart resulting from a process crash
In addition, OSPFv3 will unilaterally shutdown and enter the exited state when a critical memory event,
indicating the processor is critically low on available memory, is received from the sysmon watch dog process.
This feature supports nonstop data forwarding on established routes while the OSPFv3 routing protocol restarts.
Therefore, this feature enhances high availability of IPv6 forwarding.
Restart Mode
When the OSPFv3 process starts up, it determines whether it must attempt a graceful restart. The determination
is based on whether graceful restart was previously enabled. (OSPFv3 does not attempt a graceful restart upon
the first-time startup of the router.) When OSPFv3 graceful restart is enabled, it changes the purge timer in
the RIB to a nonzero value. See Configuring OSPFv3 Graceful Restart, on page 57,for descriptions of how
to enable and configure graceful restart.
During a graceful restart, the router does not populate OSPFv3 routes in the RIB. It tries to bring up full
adjacencies with the fully adjacent neighbors that OSPFv3 had before the restart. Eventually, the OSPFv3
process indicates to the RIB that it has converged, either for the purpose of terminating the graceful restart
(for any reason) or because it has completed the graceful restart.
The following are general details about restart mode. More detailed information on behavior and certain
restrictions and requirements appears in Graceful Restart Requirements and Restrictions, on page 21 section.
• If OSPFv3 attempts a restart too soon after the most recent restart, the OSPFv3 process is most likely
crashing repeatedly, so the new graceful restart stops running. To control the period between allowable
graceful restarts, use the graceful-restart interval command.
• When OSFPv3 starts a graceful restart with the first interface that comes up, a timer starts running to
limit the duration (or lifetime) of the graceful restart. You can configure this period with the
graceful-restart lifetime command. On each interface that comes up, a grace LSA (Type 11) is flooded
to indicate to the neighboring routers that this router is attempting graceful restart. The neighbors enter
into helper mode.
• The designated router and backup designated router check of the hello packet received from the restarting
neighbor is bypassed, because it might not be valid.
Helper Mode
Helper mode is enabled by default. When a (helper) router receives a grace LSA (Type 11) from a router that
is attempting a graceful restart, the following events occur:
• If helper mode has been disabled through the graceful-restart helper disable command, the router
drops the LSA packet.
• If helper mode is enabled, the router enters helper mode if all of the following conditions are met:
◦The local router itself is not attempting a graceful restart.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
20
Implementing OSPF
Graceful Shutdown for OSPFv3
◦The local (helping) router has full adjacency with the sending neighbor.
◦The value of lsage (link state age) in the received LSA is less than the requested grace period.
◦The sender of the grace LSA is the same as the originator of the grace LSA.
• Upon entering helper mode, a router performs its helper function for a specific period of time. This time
period is the lifetime value from the router that is in restart mode—minus the value of lsage in the
received grace LSA. If the graceful restart succeeds in time, the helper’s timer is stopped before it expires.
If the helper’s timer does expire, the adjacency to the restarting router is brought down, and normal
OSPFv3 functionality resumes.
• The dead timer is not honored by the router that is in helper mode.
• A router in helper mode ceases to perform the helper function in any of the following cases:
◦The helper router is able to bring up a FULL adjacency with the restarting router.
◦The local timer for the helper function expires.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
21
Implementing OSPF
Warm Standby and Nonstop Routing for OSPF Version 2
• This feature utilizes the available support for changing the purge time of existing OSPFv3 routes in the
Routing Information Base (RIB). When graceful restart is enabled, the purge timer is set to 90 seconds
by default. If graceful restart is disabled, the purge timer setting is 0.
• This feature has an associated grace LSA. This link-scope LSA is type11.
• According to the RFC, the OSPFv3 process should flush all old, self-originated LSAs during a restart.
With the Graceful Restart feature, however, the router delays this flushing of unknown self-originated
LSAs during a graceful restart. OSPFv3 can learn new information and build new LSAs to replace the
old LSAs. When the delay is over, all old LSAs are flushed.
• If graceful restart is enabled, the adjacency creation time of all the neighbors is saved in the system
database (SysDB). The purpose for saving the creation time is so that OSPFv3 can use the original
adjacency creation time to display the uptime for that neighbor after the restart.
Note It is recommended to set the hello timer interval to the default of 10 seconds. OSPF sessions may flap
during switchover if hello-interval timer configured is less then default value.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
22
Implementing OSPF
Load Balancing in OSPF Version 2 and OSPFv3
(from an SPF perspective). PIM cannot use IGP shortcuts for propagating PIM joins, because reverse path
forwarding (RPF) cannot work across a unidirectional tunnel.
When you enable multicast-intact on an IGP, the IGP publishes a parallel or alternate set of equal-cost next
hops for use by PIM. These next hops are called mcast-intact next hops. The mcast-intact next hops have the
following attributes:
• They are guaranteed not to contain any IGP shortcuts.
• They are not used for unicast routing but are used only by PIM to look up an IPv4 next-hop to a PIM
source.
• They are not published to the FIB.
• When multicast-intact is enabled on an IGP, all IPv4 destinations that were learned through link-state
advertisements are published with a set equal-cost mcast-intact next hops to the RIB. This attribute
applies even when the native next hops have no IGP shortcuts.
In OSPF, the max-paths (number of equal-cost next hops) limit is applied separately to the native and
mcast-intact next hops. The number of equal cost mcast-intact next hops is the same as that configured for
the native next hops.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
23
Implementing OSPF
Label Distribution Protocol IGP Auto-configuration for OSPF
• Advertises an unnumbered point-to-point link in the router link state advertisement (LSA) for the
corresponding area when the neighbor state is full.
• Created as a point-to-point network type. You can configure multi-area adjacency on any interface where
only two OSF speakers are attached. In the case of native broadcast networks, the interface must be
configured as an OPSF point-to-point type using the network point-to-point command to enable the
interface for a multi-area adjacency.
• Inherits the Bidirectional Forwarding Detection (BFD) characteristics from its primary interface. BFD
is not configurable under a multi-area interface; however, it is configurable under the primary interface.
The multi-area interface inherits the interface characteristics from its primary interface, but some interface
characteristics can be configured under the multi-area interface configuration mode as shown below:
RP/0/RP0/CPU0:router(config-ospf-ar-mif)#
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
24
Implementing OSPF
GTSM TTL Security Mechanism for OSPF
packet and the secret key. Each key is identified by the combination of interface used and the key identification.
An interface may have multiple keys active at any time.
To manage the rollover of keys and enhance MD5 authentication for OSPF, you can configure a container of
keys called a keychain with each key comprising the following attributes: generate/accept time, key
identification, and authentication algorithm.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
25
Implementing OSPF
OSPF Queue Tuning Parameters
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
26
Implementing OSPF
Unequal Cost Multipath Load-balancing for OSPF
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
27
Implementing OSPF
Enabling OSPF
Enabling OSPF
This task explains how to perform the minimum OSPF configuration on your router that is to enable an OSPF
process with a router ID, configure a backbone or nonbackbone area, and then assign one or more interfaces
on which OSPF runs.
SUMMARY STEPS
1. configure
2. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
3. router-id { router-id }
4. area area-id
5. interface type interface-path-id
6. Repeat Step 5 for each interface that uses OSPF.
7. log adjacency changes [ detail ] [ enable | disable ]
8. commit
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
28
Implementing OSPF
Configuring Stub and Not-So-Stubby Area Types
RP/0/RP0/CPU0:router(config-ospf)# router-id
192.168.4.3
Step 4 area area-id Enters area configuration mode and configures an area for the
OSPF process.
Example: • Backbone areas have an area ID of 0.
RP/0/RP0/CPU0:router(config-ospf)# area 0
• Nonbackbone areas have a nonzero area ID.
• The area-id argument can be entered in dotted-decimal
or IPv4 address notation, such as area 1000 or
area 0.0.3.232. However, you must choose one form or
the other for an area. We recommend using the IPv4
address notation.
Step 5 interface type interface-path-id Enters interface configuration mode and associates one or more
interfaces for the area configured in Step 4.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# interface
GigabitEthernet 0/1/0/3
Step 8 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
29
Implementing OSPF
Configuring Stub and Not-So-Stubby Area Types
SUMMARY STEPS
1. configure
2. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
3. router-id { router-id }
4. area area-id
5. Do one of the following:
• stub [ no-summary ]
• nssa [ no-redistribution ] [ default-information-originate ] [ no-summary ]
7. default-cost cost
8. commit
9. Repeat this task on all other routers in the stub area or NSSA.
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
30
Implementing OSPF
Configuring Stub and Not-So-Stubby Area Types
Step 5 Do one of the following: Defines the nonbackbone area as a stub area.
• stub [ no-summary ] • Specify the no-summary keyword to further reduce the
number of LSAs sent into a stub area. This keyword
• nssa [ no-redistribution ] [
prevents the ABR from sending summary link-state
default-information-originate ] [ no-summary ]
advertisements (Type 3) in the stub area.
or
Example:
Defines an area as an NSSA.
RP/0/RP0/CPU0:router(config-ospf-ar)# stub no
summary
or
RP/0/RP0/CPU0:router(config-ospf-ar)# nssa
no-redistribution
Step 6 Do one of the following: (Optional) Turns off the options configured for stub and NSSA
areas.
• stub
• If you configured the stub and NSSA areas using the
• nssa
optional keywords ( no-summary , no-redistribution
, default-information-originate , and no-summary )
in Step 5, you must now reissue the stub and nssa
Example: commands without the keywords—rather than using the
RP/0/RP0/CPU0:router(config-ospf-ar)# stub no form of the command.
or
• For example, the no nssa default-information-originate
form of the command changes the NSSA area into a
RP/0/RP0/CPU0:router(config-ospf-ar)# nssa
normal area that inadvertently brings down the existing
adjacencies in that area.
Step 7 default-cost cost (Optional) Specifies a cost for the default summary route sent
into a stub area or an NSSA.
Example: • Use this command only on ABRs attached to the NSSA.
RP/0/RP0/CPU0:router(config-ospf-ar)#default-cost Do not use it on any other routers in the area.
15
• The default cost is 1.
Step 8 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
31
Implementing OSPF
Configuring Neighbors for Nonbroadcast Networks
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
32
Implementing OSPF
Configuring Neighbors for Nonbroadcast Networks
SUMMARY STEPS
1. configure
2. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
3. router-id { router-id }
4. area area-id
5. network { broadcast | non-broadcast | { point-to-multipoint [ non-broadcast ] | point-to-point
}}
6. dead-interval seconds
7. hello-interval seconds
8. interface type interface-path-id
9. Do one of the following:
• neighbor ip-address [ priority number ] [ poll-interval seconds ][ cost number ]
• neighbor ipv6-link-local-address [ priority number ] [ poll-interval seconds ][ cost number
] [ database-filter [ all ]]
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
33
Implementing OSPF
Configuring Neighbors for Nonbroadcast Networks
Step 4 area area-id Enters area configuration mode and configures an area for the OSPF
process.
Example: • The example configures a backbone area.
RP/0/RP0/CPU0:router(config-ospf)# area 0
• The area-id argument can be entered in dotted-decimal or
IPv4 address notation, such as area 1000 or area 0.0.3.232.
However, you must choose one form or the other for an area.
We recommend using the IPv4 address notation.
Step 5 network { broadcast | non-broadcast | { Configures the OSPF network type to a type other than the default
point-to-multipoint [ non-broadcast ] | for a given medium.
point-to-point }}
• The example sets the network type to NBMA.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# network
non-broadcast
Step 6 dead-interval seconds (Optional) Sets the time to wait for a hello packet from a neighbor
before declaring the neighbor down.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)#
dead-interval 40
Step 7 hello-interval seconds (Optional) Specifies the interval between hello packets that OSPF
sends on the interface.
Example: Note It is recommended to set the hello timer interval to the
default of 10 seconds. OSPF sessions may flap during
RP/0/RP0/CPU0:router(config-ospf-ar)# switchover if hello-interval timer configured is less then
hello-interval 10
default value.
Step 8 interface type interface-path-id Enters interface configuration mode and associates one or more
interfaces for the area configured in Step 4.
Example: • In this example, the interface inherits the nonbroadcast network
RP/0/RP0/CPU0:router(config-ospf-ar)# type and the hello and dead intervals from the areas because
interface GigabitEthernet 0/2/0/0 the values are not set at the interface level.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
34
Implementing OSPF
Configuring Neighbors for Nonbroadcast Networks
• neighbor ipv6-link-local-address [ priority Configures the link-local IPv6 address of OSPFv3 neighbors.
number ] [ poll-interval seconds ][ cost • The ipv6-link-local-address argument must be in the form
number ] [ database-filter [ all ]] documented in RFC 2373 in which the address is specified in
hexadecimal using 16-bit values between colons.
Example:
• The priority keyword notifies the router that this neighbor
is eligible to become a DR or BDR. The priority value should
RP/0/RP0/CPU0:router(config-ospf-ar-if)# match the actual priority setting on the neighbor router. The
neighbor 10.20.20.1 priority 3 poll-interval
15 neighbor priority default value is zero. This keyword does not
or apply to point-to-multipoint interfaces.
• The poll-interval keyword does not apply to
RP/0/RP0/CPU0:router(config-ospf-ar-if)#
neighbor fe80::3203:a0ff:fe9d:f3fe point-to-multipoint interfaces. RFC 1247 recommends that this
value be much larger than the hello interval. The default is 120
seconds (2 minutes).
• Neighbors with no specific cost configured assumes the cost
of the interface, based on the cost command. On
point-to-multipoint interfaces, cost number is the only
keyword and argument combination that works. The cost
keyword does not apply to NBMA networks.
• The database-filter keyword filters outgoing LSAs to an
OSPF neighbor. If you specify the all keyword, incoming and
outgoing LSAs are filtered. Use with extreme caution since
filtering may cause the routing topology to be seen as entirely
different between two neighbors, resulting in ‘black-holing ’ of
data traffic or routing loops.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar-if)# exit
Step 12 interface type interface-path-id Enters interface configuration mode and associates one or more
interfaces for the area configured in Step 4.
Example: • In this example, the interface inherits the nonbroadcast network
RP/0/RP0/CPU0:router(config-ospf-ar)# type and the hello and dead intervals from the areas because
interface GigabitEthernet 0/3/0/1 the values are not set at the interface level.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
35
Implementing OSPF
Configuring Authentication at Different Hierarchical Levels for OSPF Version 2
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
36
Implementing OSPF
Configuring Authentication at Different Hierarchical Levels for OSPF Version 2
Note Authentication configured at the interface level overrides authentication configured at the area level and
the router process level. If an interface does not have authentication specifically configured, the interface
inherits the authentication parameter value from a higher hierarchical level. See OSPF Hierarchical CLI
and CLI Inheritance, on page 6 for more information about hierarchy and inheritance.
SUMMARY STEPS
1. configure
2. router ospf process-name
3. router-id { router-id }
4. authentication [ message-digest | null ]
5. message-digest-key key-id md5 { key | clear key | encrypted key | LINE}
6. area area-id
7. interface type interface-path-id
8. Repeat Step 7 for each interface that must communicate, using the same authentication.
9. exit
10. area area-id
11. authentication [ message-digest | null ]
12. interface type interface-path-id
13. Repeat Step 12 for each interface that must communicate, using the same authentication.
14. interface type interface-path-id
15. authentication [ message-digest | null ]
16. commit
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
37
Implementing OSPF
Configuring Authentication at Different Hierarchical Levels for OSPF Version 2
Example:
RP/0/RP0/CPU0:router(config-ospf)# router-id
192.168.4.3
Step 4 authentication [ message-digest | null ] Enables MD5 authentication for the OSPF process.
• This authentication type applies to the entire router
Example: process unless overridden by a lower hierarchical
RP/0/RP0/CPU0:router(config-ospf)#authentication level such as the area or interface.
message-digest
Step 5 message-digest-key key-id md5 { key | clear key | Specifies the MD5 authentication key for the OSPF
encrypted key | LINE} process.
• The neighbor routers must have the same key
Example: identifier.
RP/0/RP0/CPU0:router(config-ospf)#message-digest-key
4 md5 yourkey
Step 7 interface type interface-path-id Enters interface configuration mode and associates one
or more interfaces to the backbone area.
Example: • All interfaces inherit the authentication parameter
RP/0/RP0/CPU0:router(config-ospf-ar)# interface values specified for the OSPF process (Step 4, Step
GigabitEthernet 0/1/0/3 5, and Step 6).
Step 8 Repeat Step 7 for each interface that must communicate, using —
the same authentication.
Step 9 exit Enters area OSPF configuration mode.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# exit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
38
Implementing OSPF
Controlling the Frequency That the Same LSA Is Originated or Accepted for OSPF
Step 12 interface type interface-path-id Enters interface configuration mode and associates one
or more interfaces to the nonbackbone area 1 specified
Example: in Step 7.
Step 13 Repeat Step 12 for each interface that must communicate, using —
the same authentication.
Step 14 interface type interface-path-id Enters interface configuration mode and associates one
or more interfaces to a different authentication type.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# interface
GigabitEthernet 0/3/0/0
Step 16 commit
Controlling the Frequency That the Same LSA Is Originated or Accepted for
OSPF
This task explains how to tune the convergence time of OSPF routes in the routing table when many LSAs
need to be flooded in a very short time interval.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
39
Implementing OSPF
Controlling the Frequency That the Same LSA Is Originated or Accepted for OSPF
SUMMARY STEPS
1. configure
2. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
3. router-id { router-id }
4. Perform Step 5 or Step 6 or both to control the frequency that the same LSA is originated or accepted.
5. timers lsa refresh seconds
6. timers lsa min-arrival seconds
7. timers lsa group-pacing seconds
8. commit
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
40
Implementing OSPF
Creating a Virtual Link with MD5 Authentication to Area 0 for OSPF
Step 7 timers lsa group-pacing seconds Changes the interval at which OSPF link-state LSAs are
collected into a group for flooding.
Example: • The default is 240 seconds.
RP/0/
RP0/CPU0:router(config-ospf)# timers lsa
group-pacing 1000
Step 8 commit
Note After you explicitly configure area parameter values, they are inherited by all interfaces bound to that
area—unless you override the values and configure them explicitly for the interface. An example is
provided in Virtual Link Configured with MD5 Authentication for OSPF Version 2: Example, on page
90.
• Before configuring your virtual link for OSPF Version 2, you must decide whether to configure plain
text authentication, MD5 authentication, or no authentication (which is the default). Your decision
determines whether you need to perform additional tasks related to authentication.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
41
Implementing OSPF
Creating a Virtual Link with MD5 Authentication to Area 0 for OSPF
Note If you decide to configure plain text authentication or no authentication, see the authentication command
provided in OSPF Commands on Cisco IOS XR Software module in Cisco IOS XR Routing Command
Reference for the Cisco CRS Router.
SUMMARY STEPS
2. configure
3. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
4. router-id { router-id }
5. area area-id
6. virtual-link router-id
7. authentication message-digest
8. message-digest-key key-id md5 { key | clear key | encrypted key }
9. Repeat all of the steps in this task on the ABR that is at the other end of the virtual link. Specify the same
key ID and key that you specified for the virtual link on this router.
10. commit
11. Do one of the following:
• show ospf [ process-name ] [ area-id ] virtual-links
• show ospfv3 [ process-name ] virtual-links
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router# show ospf
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
42
Implementing OSPF
Creating a Virtual Link with MD5 Authentication to Area 0 for OSPF
Step 2 configure
Step 3 Do one of the following: Enables OSPF routing for the specified routing
process and places the router in router configuration
• router ospf process-name mode.
• router ospfv3 process-name or
Enables OSPFv3 routing for the specified routing
process and places the router in router ospfv3
Example:
configuration mode.
RP/0/RP0/CPU0:router(config)# router ospf 1
Note The process-name argument is any
or
alphanumeric string no longer than 40
characters.
RP/0/RP0/CPU0:router(config)# router ospfv3 1
Step 7 authentication message-digest Selects MD5 authentication for this virtual link.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar-vl)#authentication
message-digest
Step 8 message-digest-key key-id md5 { key | clear key | encrypted Defines an OSPF virtual link.
key }
• See to understand a virtual link.
Example: • The key-id argument is a number in the
range from 1 to 255. The key argument is
RP/0/RP0/CPU0:router(config-ospf-ar-vl)#message-digest-key
4 md5 yourkey an alphanumeric string of up to 16 characters.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
43
Implementing OSPF
Creating a Virtual Link with MD5 Authentication to Area 0 for OSPF
Step 9 Repeat all of the steps in this task on the ABR that is at the other end —
of the virtual link. Specify the same key ID and key that you specified
for the virtual link on this router.
Step 10 commit
Step 11 Do one of the following: (Optional) Displays the parameters and the current
state of OSPF virtual links.
• show ospf [ process-name ] [ area-id ] virtual-links
• show ospfv3 [ process-name ] virtual-links
Example:
RP/0/RP0/CPU0:router# show ospf 1 2 virtual-links
or
Examples
In the following example, the show ospfv3 virtual links EXEC configuration command verifies that the
OSPF_VL0 virtual link to the OSPFv3 neighbor is up, the ID of the virtual link interface is 2, and the IPv6
address of the virtual link endpoint is 2003:3000::1.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
44
Implementing OSPF
Summarizing Subnetwork LSAs on an OSPF ABR
SUMMARY STEPS
1. configure
2. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
3. router-id { router-id }
4. area area-id
5. Do one of the following:
• range ip-address mask [ advertise | not-advertise ]
• range ipv6-prefix / prefix-length [ advertise | not-advertise ]
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
45
Implementing OSPF
Summarizing Subnetwork LSAs on an OSPF ABR
RP/0/RP0/CPU0:router(config)# router
ospfv3 1
Step 4 area area-id Enters area configuration mode and configures a nonbackbone area
for the OSPF process.
Example: • The area-id argument can be entered in dotted-decimal or IPv4
RP/0/RP0/CPU0:router(config-ospf)# area address notation, such as area 1000 or area 0.0.3.232. However,
0 you must choose one form or the other for an area. We
recommend using the IPv4 address notation.
Step 5 Do one of the following: Consolidates and summarizes OSPF routes at an area boundary.
• range ip-address mask [ advertise | • The advertise keyword causes the software to advertise the
not-advertise ] address range of subnetworks in a Type 3 summary LSA.
• range ipv6-prefix / prefix-length [ • The not-advertise keyword causes the software to suppress
advertise | not-advertise ] the Type 3 summary LSA, and the subnetworks in the range
remain hidden from other areas.
• In the first example, all subnetworks for network 192.168.0.0
Example: are summarized and advertised by the ABR into areas outside
RP/0/RP0/CPU0:router(config-ospf-ar)# the backbone.
range 192.168.0.0 255.255.0.0 advertise
or • In the second example, two or more IPv4 interfaces are covered
by a 192.x.x network.
RP/0/RP0/CPU0:router(config-ospf-ar)#
range 4004:f000::/32 advertise
Step 6 interface type interface-path-id Enters interface configuration mode and associates one or more
interfaces to the area.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)#
interface GigabitEthernet 0/2/0/3
Step 7 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
46
Implementing OSPF
Redistribute Routes into OSPF
SUMMARY STEPS
1. configure
2. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
3. router-id { router-id }
4. redistribute protocol [ process-id ] { level-1 | level-1-2 | level-2 } [ metric metric-value ] [
metric-type type-value ] [ match { external [ 1 | 2 ]} [ tag tag-value ] [ route-policy policy-name ]
5. Do one of the following:
• summary-prefix address mask [ not-advertise ] [ tag tag ]
• summary-prefix ipv6-prefix / prefix-length [ not-advertise ] [ tag tag ]
6. commit
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
47
Implementing OSPF
Redistribute Routes into OSPF
Step 4 redistribute protocol [ process-id ] { level-1 | Redistributes OSPF routes from one routing domain to another
level-1-2 | level-2 } [ metric metric-value ] [ routing domain.
metric-type type-value ] [ match { external [ 1 | 2 ]} or
[ tag tag-value ] [ route-policy policy-name ]
Redistributes OSPFv3 routes from one routing domain to another
routing domain.
Example:
RP/0/RP0/CPU0:router(config-ospf)# redistribute • This command causes the router to become an ASBR by
bgp 100 definition.
or
• OSPF tags all routes learned through redistribution as
RP/0/RP0/CPU0:router(config-router)#redistribute external.
bgp 110
• The protocol and its process ID, if it has one, indicate the
protocol being redistributed into OSPF.
• The metric is the cost you assign to the external route. The
default is 20 for all protocols except BGP, whose default
metric is 1.
• The OSPF example redistributes BGP autonomous system
1, Level 1 routes into OSPF as Type 2 external routes.
• The OSPFv3 example redistributes BGP autonomous system
1, Level 1 and 2 routes into OSPF. The external link type
associated with the default route advertised into the OSPFv3
routing domain is the Type 1 external route.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
48
Implementing OSPF
Configuring OSPF Shortest Path First Throttling
Step 6 commit
SUMMARY STEPS
1. configure
2. Do one of the following:
• router ospf process-name
• router ospfv3 process-name
3. router-id { router-id }
4. timers throttle spf spf-start spf-hold spf-max-wait
5. area area-id
6. interface type interface-path-id
7. commit
8. Do one of the following:
• show ospf [ process-name ]
• show ospfv3 [ process-name ]
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
49
Implementing OSPF
Configuring OSPF Shortest Path First Throttling
Step 4 timers throttle spf spf-start spf-hold spf-max-wait Sets SPF throttling timers.
Example:
RP/0/RP0/CPU0:router(config-ospf)# timers
throttle spf 10 4800 90000
Step 5 area area-id Enters area configuration mode and configures a backbone
area.
Example: • The area-id argument can be entered in dotted-decimal
RP/0/RP0/CPU0:router(config-ospf)# area 0 or IPv4 address notation, such as area 1000 or
area 0.0.3.232. However, you must choose one form
or the other for an area. We recommend using the IPv4
address notation.
Step 6 interface type interface-path-id Enters interface configuration mode and associates one or
more interfaces to the area.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# interface
GigabitEthernet 0/1/0/3
Step 7 commit
Step 8 Do one of the following: (Optional) Displays SPF throttling timers.
• show ospf [ process-name ]
• show ospfv3 [ process-name ]
Example:
RP/0/RP0/CPU0:router# show ospf 1
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
50
Implementing OSPF
Configuring Nonstop Forwarding Specific to Cisco for OSPF Version 2
Examples
In the following example, the show ospf EXEC configuration command is used to verify that the initial SPF
schedule delay time, minimum hold time, and maximum wait time are configured correctly. Additional details
are displayed about the OSPF process, such as the router type and redistribution of routes.
show ospf 1
Note For a description of each output display field, see the show ospf command in the OSPF Commands on
Cisco IOS XR Softwaremodule in Cisco IOS XR Routing Command Reference for the Cisco CRS Router.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
51
Implementing OSPF
Configuring Nonstop Forwarding Specific to Cisco for OSPF Version 2
SUMMARY STEPS
1. configure
2. router ospf process-name
3. router-id { router-id }
4. Do one of the following:
• nsf cisco
• nsf cisco enforce global
DETAILED STEPS
Step 4 Do one of the following: Enables Cisco NSF operations for the OSPF process.
• nsf cisco • Use the nsf cisco command without the optional enforce and
global keywords to abort the NSF restart mechanism on the
• nsf cisco enforce global
interfaces of detected non-NSF neighbors and allow NSF
neighbors to function properly.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
52
Implementing OSPF
Configuring OSPF Version 2 for MPLS Traffic Engineering
Step 5 nsf interval seconds Sets the minimum time between NSF restart attempts.
Note When you use this command, the OSPF process must be
Example: up for at least 90 seconds before OSPF attempts to perform
RP/0/RP0/CPU0:router(config-ospf)# nsf an NSF restart.
interval 120
Step 6 nsfflush-delay-timeseconds Sets the maximum time allowed for external route learning in
seconds.
Example:
RP/0/RP0/CPU0:router(config-ospf)#nsf
flush-delay-time 1000
Step 7 nsflifetimeseconds Sets the maximum route lifetime of NSF following a restart in
seconds.
Example:
RP/0/RP0/CPU0:router(config-ospf)#nsf
lifetime 90
Example:
RP/0/RP0/CPU0:router(config-ospf)#nsf
ietf
Step 9 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
53
Implementing OSPF
Configuring OSPF Version 2 for MPLS Traffic Engineering
Note You must enter the commands in the following task on every OSPF router in the traffic-engineered portion
of your network.
SUMMARY STEPS
1. configure
2. router ospf process-name
3. router-id { router-id }
4. mpls traffic-eng router-id interface-type interface-instance
5. area area-id
6. mpls traffic-eng
7. interface type interface-path-id
8. commit
9. show ospf [ process-name ] [ area-id ] mpls traffic-eng { link | fragment }
DETAILED STEPS
Step 4 mpls traffic-eng router-id interface-type (Optional) Specifies that the traffic engineering router identifier
interface-instance for the node is the IP address associated with a given interface.
• This IP address is flooded to all nodes in TE LSAs.
Example:
• For all traffic engineering tunnels originating at other nodes
RP/0/RP0/CPU0:router(config-ospf)# mpls
traffic-eng router-id loopback 0 and ending at this node, you must set the tunnel destination
to the traffic engineering router identifier of the destination
node because that is the address that the traffic engineering
topology database at the tunnel head uses for its path
calculation.
• We recommend that loopback interfaces be used for MPLS
TE router ID because they are more stable than physical
interfaces.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
54
Implementing OSPF
Configuring OSPF Version 2 for MPLS Traffic Engineering
Step 6 mpls traffic-eng Configures the MPLS TE under the OSPF area.
Example:
RP/0/RP0/CPU0:router(config-ospf)# mpls
traffic-eng
Step 7 interface type interface-path-id Enters interface configuration mode and associates one or more
interfaces to the area.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)#
interface interface loopback0
Step 8 commit
Step 9 show ospf [ process-name ] [ area-id ] mpls (Optional) Displays information about the links and fragments
traffic-eng { link | fragment } available on the local router for MPLS TE.
Example:
RP/0/RP0/CPU0:router# show ospf 1 0 mpls
traffic-eng link
Examples
This section provides the following output examples:
Sample Output for the show ospf Command Before Configuring MPLS TE
In the following example, the show route ospf EXEC configuration command verifies that GigabitEthernet
interface 0/3/0/0 exists and MPLS TE is not configured:
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
55
Implementing OSPF
Configuring OSPF Version 2 for MPLS Traffic Engineering
In the following example, the show ospf mpls traffic-eng EXEC configuration command verifies that the
MPLS TE links on area instance 3 are configured correctly:
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
56
Implementing OSPF
Configuring OSPFv3 Graceful Restart
Sample Output for the show ospf Command After Configuring MPLS TE
In the following example, the show route ospf EXEC configuration command verifies that the MPLS TE
tunnels replaced GigabitEthernet interface 0/3/0/0 and that configuration was performed correctly:
SUMMARY STEPS
1. configure
2. router ospfv3 process-name
3. graceful-restart
4. graceful-restart lifetime
5. graceful-restart interval seconds
6. graceful-restart helper disable
7. commit
8. show ospfv3 [ process-name [ area-id ]] database grace
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router(config-ospfv3)#graceful-restart
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
57
Implementing OSPF
Configuring OSPFv3 Graceful Restart
Example:
RP/0/RP0/CPU0:router(config-ospfv3)# graceful-restart
helper disable
Step 7 commit
Step 8 show ospfv3 [ process-name [ area-id ]] database grace Displays the state of the graceful restart link.
Example:
RP/0/RP0/CPU0:router# show ospfv3 1 database grace
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
58
Implementing OSPF
Configuring an OSPFv2 Sham Link
See Enabling OSPF, on page 28 for information on these OSPF configuration prerequisites.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
59
Implementing OSPF
Configuring an OSPFv2 Sham Link
SUMMARY STEPS
1. configure
2. interface type interface-path-id
3. vrf vrf-name
4. ipv4 address ip-address mask
5. end
6. router ospf instance-id
7. vrf vrf-name
8. router-id { router-id }
9. redistribute bgp process-id
10. area area-id
11. sham-link source-address destination-address
12. cost cost
13. commit
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router(config)# interface loopback 3
Step 3 vrf vrf-name Assigns an interface to the VPN routing and forwarding
(VRF) instance.
Example:
RP/0/RP0/CPU0:router(config-if)# vrf vrf1
Step 4 ipv4 address ip-address mask Assigns an IP address and subnet mask to the interface.
Example:
RP/0/RP0/CPU0:router(config-if)# ipv4 address
172.18.189.38 255.255.255.225
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
60
Implementing OSPF
Configuring an OSPFv2 Sham Link
Step 6 router ospf instance-id Enables OSPF routing for the specified routing process,
and places the router in router configuration mode. In this
Example: example, the OSPF instance is called isp.
Step 7 vrf vrf-name Creates a VRF instance and enters VRF configuration
mode.
Example:
RP/0/RP0/CPU0:router(config-ospf)# vrf vrf1
Step 9 redistribute bgp process-id Redistributes OSPF routes from the one routing domain
to another routing domain.
Example: • This command causes the router to become an ASBR
RP/0/RP0/CPU0:router(config-ospf-vrf)# redistribute by definition.
bgp 1
• OSPF tags all routes learned through redistribution
as external.
• The protocol and its process ID, if it has one, indicate
the protocol being redistributed into OSPF.
• The BGP MED value is copied to the LSA metric
field when BGP VPN routes are redistributed to
OSPF.
Step 10 area area-id Enters area configuration mode and configures an area for
the OSPF process.
Example: • The area-id argument can be entered in
RP/0/RP0/CPU0:router(config-ospf-vrf)# area 0 dotted-decimal or IPv4 address notation, such as area
1000 or area 0.0.3.232. However, you must choose
one form or the other for an area.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
61
Implementing OSPF
Enabling Nonstop Routing for OSPFv2
RP/0/RP0/CPU0:router(config-ospf-vrf-ar-sl)# cost
76
Step 13 commit
Step 1 configure
Enter the global configuration mode.
Example:
RP/0/RP0/CPU0:router(config)# router ospf isp
Enable OSPF routing for the specified routing process. In this example, the OSPF instance is called isp.
Step 3 nsr
Example:
RP/0/RP0/CPU0:router(config-ospf)# nsr
Enable NSR for the OSPFv2 process.
Step 4 commit
Commit your configuration.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
62
Implementing OSPF
Enabling Nonstop Routing for OSPFv3
Step 1 configure
Enter the global configuration mode.
Example:
RP/0/RP0/CPU0:router(config)# router ospfv3 isp
Enable OSPF routing for the specified routing process. In this example, the OSPF instance is called isp.
Step 3 nsr
Example:
RP/0/RP0/CPU0:router(config-ospfv3)# nsr
Enable NSR for the OSPFv3 process.
Step 4 commit
Commit your configuration.
SUMMARY STEPS
1. configure
2. prefix-set prefix-set name
3. route-policy route-policy name if destination in prefix-set name then set spf-priority {critical |
high | medium} endif
4. Use one of these commands:
• router ospf ospf-name
• router ospfv3 ospfv3-name
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
63
Implementing OSPF
Configuring OSPF SPF Prefix Prioritization
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router(config)#prefix-set ospf-critical-prefixes
RP/0/RP0/CPU0:router(config-pfx)#66.0.0.0/16
RP/0/RP0/CPU0:router(config-pfx)#end-set
Step 3 route-policy route-policy name if destination in prefix-set name then Configures route policy and sets OSPF
set spf-priority {critical | high | medium} endif SPF priority.
Example:
RP/0/RP0/CPU0:router#route-policy ospf-spf-priority
RP/0/RP0/CPU0:router(config-rpl)#if destination in
ospf-critical-prefixes then
set spf-priority critical
endif
RP/0/RP0/CPU0:router(config-rpl)#end-policy
Example:
RP/0/RP0/CPU0:router# router ospf 1
Or
Step 5 spf prefix-priority route-policy route-policy name Configures SPF prefix-priority for the
defined route policy.
Example: Note Configure the spf
Or prefix-priority command
RP/0/RP0/CPU0:router(config-ospfv3)#spf prefix-priority under router OSPF.
route-policy ospf3-spf-priority
Step 6 commit
Step 7 show rpl route-policy route-policy name detail Displays the set SPF prefix priority.
Example:
RP/0/RP0/CPU0:router#show rpl route-policy ospf-spf-priority
detail
prefix-set ospf-critical-prefixes
66.0.0.0/16
end-set
!
route-policy ospf-spf-priority
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
64
Implementing OSPF
Enabling Multicast-intact for OSPFv2
SUMMARY STEPS
1. configure
2. router ospf instance-id
3. mpls traffic-eng multicast-intact
4. commit
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router(config-ospf)# mpls
traffic-eng multicast-intact
Step 4 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
65
Implementing OSPF
Associating Interfaces to a VRF
SUMMARY STEPS
1. configure
2. router ospf process-name
3. vrf vrf-name
4. area area-id
5. interface type interface-path-id
6. commit
DETAILED STEPS
Step 3 vrf vrf-name Creates a VRF instance and enters VRF configuration mode.
Example:
RP/0/RP0/CPU0:router(config-ospf)# vrf vrf1
Step 4 area area-id Enters area configuration mode and configures an area for the
OSPF process.
Example: • The area-id argument can be entered in dotted-decimal
RP/0/RP0/CPU0:router(config-ospf-vrf)# area or IPv4 address notation, such as area 1000 or
0 area 0.0.3.232. However, you must choose one form or the
other for an area.
Step 5 interface type interface-path-id Enters interface configuration mode and associates one or more
interfaces to the VRF.
Example:
RP/0/RP0/CPU0:router(config-ospf-vrf-ar)#
interface GigabitEthernet 0/0/0/0
Step 6 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
66
Implementing OSPF
Configuring OSPF as a Provider Edge to Customer Edge (PE-CE) Protocol
1. configure
2. router ospf process-name
3. vrf vrf-name
4. router-id { router-id }
5. redistribute protocol [ process-id ] { level-1 | level-1-2 | level-2 } [ metric metric-value ] [ metric-type
type-value ] [ match { external [ 1 | 2 ] }] [ tag tag-value ] route-policy policy-name]
6. area area-id
7. interface type interface-path-id
8. exit
9. domain-id [ secondary ] type { 0005 | 0105 | 0205 | 8005 } value value
10. domain-tag tag
11. disable-dn-bit-check
12. commit
DETAILED STEPS
Step 5 redistribute protocol [ process-id ] { level-1 | level-1-2 | level-2 Redistributes OSPF routes from one routing
} [ metric metric-value ] [ metric-type type-value ] [ match { domain to another routing domain.
external [ 1 | 2 ] }] [ tag tag-value ] route-policy policy-name]
• This command causes the router to become
an ASBR by definition.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
67
Implementing OSPF
Configuring OSPF as a Provider Edge to Customer Edge (PE-CE) Protocol
RP/0/RP0/CPU0:router(config-ospf-vrf)# redistribute bgp 1 • The protocol and its process ID, if it has
level-1 one, indicate the protocol being redistributed
into OSPF.
• The metric is the cost you assign to the
external route. The default is 20 for all
protocols except BGP, whose default metric
is 1.
• The example shows the redistribution of
BGP autonomous system 1, Level 1 routes
into OSPF as Type 2 external routes.
Example:
RP/0/RP0/CPU0:router(config-if)# exit
Step 9 domain-id [ secondary ] type { 0005 | 0105 | 0205 | 8005 Specifies the OSPF VRF domain ID.
} value value
• The value argument is a six-octet hex
number.
Example:
RP/0/RP0/CPU0:router(config-ospf-vrf)# domain-id type 0105
value 1AF234
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
68
Implementing OSPF
Creating Multiple OSPF Instances (OSPF Process and a VRF)
Example:
RP/0/RP0/CPU0:router(config-ospf-vrf)# disable-dn-bit-check
Step 12 commit
SUMMARY STEPS
1. configure
2. router ospf process-name
3. area area-id
4. interface type interface-path-id
5. exit
6. vrf vrf-name
7. area area-id
8. interface type interface-path-id
9. commit
DETAILED STEPS
Step 3 area area-id Enters area configuration mode and configures a backbone
area.
Example: • The area-id argument can be entered in dotted-decimal
RP/0/RP0/CPU0:router(config-ospf)# area 0 or IPv4 address notation, such as area 1000 or
area 0.0.3.232. However, you must choose one form or
the other for an area. We recommend using the IPv4
address notation.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
69
Implementing OSPF
Configuring Multi-area Adjacency
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# exit
Step 6 vrf vrf-name Creates a VRF instance and enters VRF configuration mode.
Example:
RP/0/RP0/CPU0:router(config-ospf)# vrf vrf1
Step 7 area area-id Enters area configuration mode and configures an area for a
VRF instance under the OSPF process.
Example: • The area-id argument can be entered in dotted-decimal
RP/0/RP0/CPU0:router(config-ospf-vrf)# area 0 or IPv4 address notation, such as area 1000 or
area 0.0.3.232. However, you must choose one form or
the other for an area.
Step 8 interface type interface-path-id Enters interface configuration mode and associates one or
more interfaces to the VRF.
Example:
RP/0/RP0/CPU0:router(config-ospf-vrf)# interface
GigabitEthernet 0/0/0/0
Step 9 commit
Note You can configure multi-area adjacency on any interface where only two OSF speakers are attached. In
the case of native broadcast networks, the interface must be configured as an OPSF point-to-point type
using the network point-to-point command to enable the interface for a multi-area adjacency.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
70
Implementing OSPF
Configuring Multi-area Adjacency
SUMMARY STEPS
1. configure
2. router ospf process-name
3. area area-id
4. interface type interface-path-id
5. area area-id
6. multi-area-interface type interface-path-id
7. commit
DETAILED STEPS
Step 3 area area-id Enters area configuration mode and configures a backbone
area.
Example: • The area-id argument can be entered in dotted-decimal
RP/0/RP0/CPU0:router(config-ospf)# area 0 or IPv4 address notation, such as area 1000 or
area 0.0.3.232. However, you must choose one form or
the other for an area. We recommend using the IPv4
address notation.
Step 4 interface type interface-path-id Enters interface configuration mode and associates one or
more interfaces to the area.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# interface
Serial 0/1/0/3
Step 5 area area-id Enters area configuration mode and configures an area used
for multiple area adjacency.
Example: • The area-id argument can be entered in dotted-decimal
RP/0/RP0/CPU0:router(config-ospf)# area 1 or IPv4 address notation, such as area 1000 or
area 0.0.3.232. However, you must choose one form or
the other for an area. We recommend using the IPv4
address notation.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
71
Implementing OSPF
Configuring Label Distribution Protocol IGP Auto-configuration for OSPF
Step 7 commit
SUMMARY STEPS
1. configure
2. router ospf process-name
3. mpls ldp auto-config
4. commit
DETAILED STEPS
Step 3 mpls ldp auto-config Enables LDP IGP interface auto-configuration for an OSPF
instance.
Example: • Optionally, this command can be configured for an area of
RP/0/RP0/CPU0:router(config-ospf)# mpls an OSPF instance.
ldp auto-config
Step 4 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
72
Implementing OSPF
Configuring LDP IGP Synchronization: OSPF
SUMMARY STEPS
1. configure
2. router ospf process-name
3. Use one of the following commands:
• mpls ldp sync
• area area-id mpls ldp sync
• area area-id interface name mpls ldp sync
4. commit
DETAILED STEPS
Step 3 Use one of the following commands: Enables LDP IGP synchronization on an
interface.
• mpls ldp sync
• area area-id mpls ldp sync
• area area-id interface name mpls ldp sync
Example:
RP/0/RP0/CPU0:router(config-ospf)# mpls ldp sync
Step 4 commit
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
73
Implementing OSPF
Configuring Authentication Message Digest Management for OSPF
SUMMARY STEPS
1. configure
2. router ospf process-name
3. router-id { router-id }
4. area area-id
5. interface type interface-path-id
6. authentication message-digest keychain keychain
7. commit
DETAILED STEPS
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
74
Implementing OSPF
Configuring Authentication Message Digest Management for OSPF
Step 7 commit
Examples
The following example shows how to configure the keychain ospf_intf_1 that contains five key IDs. Each
key ID is configured with different send-lifetime values; however, all key IDs specify the same text string
for the key.
The following example shows that keychain authentication is enabled on the Gigabit Ethernet 0/4/0/1 interface:
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
75
Implementing OSPF
Configuring Generalized TTL Security Mechanism (GTSM) for OSPF
Next 0(0)/0(0)
Last flood scan length is 2, maximum is 16
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 1.1.1.1 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Keychain-based authentication enabled
Key id used is 3
Multi-area interface Count is 0
The following example shows output for configured keys that are active:
Key-chain: ospf_intf_1/ -
SUMMARY STEPS
1. configure
2. router ospf process-name
3. router-id { router-id }
4. log adjacency changes [ detail | disable ]
5. nsf { cisco [ enforce global ] | ietf [ helper disable ]}
6. timers throttle spf spf-start spf-hold spf-max-wait
7. area area-id
8. interface type interface-path-id
9. security ttl [ disable | hops hop-count ]
10. commit
11. show ospf [ process-name ] [ vrf vrf-name ] [ area-id ] interface [ type interface-path-id ]
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
76
Implementing OSPF
Configuring Generalized TTL Security Mechanism (GTSM) for OSPF
DETAILED STEPS
Step 4 log adjacency changes [ detail | disable ] (Optional) Requests notification of neighbor changes.
• By default, this feature is enabled.
Example:
• The messages generated by neighbor changes are
RP/0/RP0/CPU0:router(config-ospf-ar-if)# log
adjacency changes detail considered notifications, which are categorized as severity
Level 5 in the logging console command. The logging
console command controls which severity level of
messages are sent to the console. By default, all severity
level messages are sent.
Step 5 nsf { cisco [ enforce global ] | ietf [ helper disable (Optional) Configures NSF OSPF protocol.
]} The example enables graceful restart.
Example:
RP/0/RP0/CPU0:router(config-ospf)# nsf ietf
Step 6 timers throttle spf spf-start spf-hold spf-max-wait (Optional) Sets SPF throttling timers.
Example:
RP/0/RP0/CPU0:router(config-ospf)# timers
throttle spf 500 500 10000
Step 8 interface type interface-path-id Enters interface configuration mode and associates one or more
interfaces to the area.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)#
interface GigabitEternet0/5/0/0
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
77
Implementing OSPF
Verifying OSPF Configuration and Operation
Example:
RP/0/RP0/CPU0:router(config-ospf-ar-if)#
security ttl hopes 2
Step 10 commit
Step 11 show ospf [ process-name ] [ vrf vrf-name ] [ area-id Displays OSPF interface information.
] interface [ type interface-path-id ]
Example:
RP/0/RP0/CPU0:router# show ospf 1 interface
GigabitEthernet0/5/0/0
Examples
The following is sample output that displays the GTSM security TTL value configured on an OSPF interface:
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
78
Implementing OSPF
Verifying OSPF Configuration and Operation
SUMMARY STEPS
DETAILED STEPS
Step 2 show { ospf | ospfv3 } [ process-name ] border-routers [ (Optional) Displays the internal OSPF routing
router-id ] table entries to an ABR and ASBR.
Example:
RP/0/RP0/CPU0:router# show ospf group1 border-routers
Step 3 show { ospf | ospfv3 } [ process-name ] database (Optional) Displays the lists of information
related to the OSPF database for a specific router.
Example: • The various forms of this command deliver
RP/0/RP0/CPU0:router# show ospf group2 database information about different OSPF LSAs.
Step 4 show { ospf | ospfv3 } [ process-name ] [ area-id ] flood-list (Optional) Displays a list of OSPF LSAs waiting
interface type interface-path-id to be flooded over an interface.
Example:
RP/0/RP0/CPU0:router# show ospf 100 flood-list interface
GigabitEthernet 0/3/0/0
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
79
Implementing OSPF
Verifying OSPF Configuration and Operation
Example:
RP/0/RP0/CPU0:router# show ospf 100 interface
GigabitEthernet 0/3/0/0
Step 6 show { ospf | ospfv3 }[ process-name ] [ area-id ] neighbor [ t (Optional) Displays OSPF neighbor information
ype interface- path-id ] [ neighbor-id ] [ detail ] on an individual interface basis.
Example:
RP/0/RP0/CPU0:router# show ospf 100 neighbor
Step 7 clear { ospf | ospfv3 }[ process-name ] process (Optional) Resets an OSPF router process without
stopping and restarting it.
Example:
RP/0/
RP0/CPU0:router# clear ospf 100 process
Example:
RP/0/RP0/CPU0:router#clear ospf 100 redistribution
Example:
RP/0/RP0/CPU0:router#clear ospf 100 routes
Step 10 clear{ospf|ospfv3[ process-name ] vrf [vrf-name|all] {process Clears OSPF route table.
|redistribution|routes|statistics [interface type
interface-path-id|message-queue|neighbor]}
Example:
RP/0/RP0/CPU0:router#clear ospf 100 vrf vrf_1 process
Step 11 clear { ospf | ospfv3 }[ process-name ] statistics [ neighbor [ (Optional) Clears the OSPF statistics of neighbor
type interface-path-id ] [ ip-address ]] state transitions.
Example:
RP/0/RP0/CPU0:router# clear ospf 100 statistics
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
80
Implementing OSPF
Configuring OSPF Queue Tuning Parameters
SUMMARY STEPS
1. configure
2. router ospf process-name
3. queue dispatch incoming count
4. queue dispatch rate-limited-lsa count
5. queue dispatch spf-lsa-limit count
6. queue limit { high | medium | low } count
DETAILED STEPS
Step 3 queue dispatch incoming count Limits the number of continuous incoming events processed.
Example:
RP/0/RP0/CPU0:router# queue dispatch incoming
30
Step 4 queue dispatch rate-limited-lsa count Sets the maximum number of rate-limited link-state
advertisements (LSAs) processed per run.
Example:
RP/0/RP0/CPU0:router# queue dispatch
rate-limited-lsa 3000
Step 5 queue dispatch spf-lsa-limit count Limits the number of summary or external Type 3 to Type 7
link-state advertisements (LSAs) processed per shortest path
Example: first (SPF) run.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
81
Implementing OSPF
Configuring IP Fast Reroute Loop-free Alternate
1. configure
2. router ospf process-name
3. area area-id
4. interface type interface-path-id
5. fast-reroute per-link { enable | disable }
6. commit
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router(config-ospf)#area 1
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
82
Implementing OSPF
Excluding an Interface From IP Fast Reroute Per-link Computation
Step 5 fast-reroute per-link { enable | disable } Enables or disables per-link LFA computation for
the interface.
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)#fast-reroute
per-link enable
Step 6 commit
1. configure
2. router ospf process-name
3. area area-id
4. interface type interface-path-id
5. fast-reroute per-link exclude interface type interface-path-id
6. commit
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router(config)#area area-id
Step 4 interface type interface-path-id Enters interface configuration mode and associates
one or more interfaces to the area.
Example:
RP/0/RP0/CPU0:router(config-ospf)#interface type
interface-path-id
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
83
Implementing OSPF
Enabling OSPF Interaction with SRMS Server
Example:
RP/0/RP0/CPU0:router(config-ospf-ar)# fast-reroute
per-link exclude interface GigabitEternet0/5/0/1
Step 6 commit
SUMMARY STEPS
1. configure
2. router ospf instance-id
3. segment-routing mpls
4. segment-routing forwarding mpls
5. segment-routing prefix-sid-mapadvertise-local
6. segment-routing sr-preferprefix-list[acl-name]
DETAILED STEPS
Example:
RP/0/RP0/CPU0:router(config-ospf)#
segment-routing mpls
Step 4 segment-routing forwarding mpls Enables SR forwarding on all interfaces where this instance
OSPF is enabled.
Example:
RP/0/RP0/CPU0:router(config-ospf)#
segment-routing forwarding mpls
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
84
Implementing OSPF
Configuration Examples for Implementing OSPF
Step 6 segment-routing sr-preferprefix-list[acl-name] Enables OSPF to communicate to the routing information base
(RIB) that SR labels are preferred to LDP labels. If ACL is
Example: used, OSPF signals the preference of SR labels over LDP
RP/0/RP0/CPU0:router(config-ospf)# labels for prefixes that match ACL. If ACL is not used, OSPF
segment-routing signals the preference of SR labels for all prefixes.
sr-prefer prefix-list foo
The following example shows how OSPF advertises local mapping entries using area-flooding scope.
ipv4 prefix-list foo
permit 2.2.2.2/32
!
router ospf 1
router-id 1.1.1.1
segment-routing mpls
segment-routing forwarding mpls
segment-routing prefix-sid-map receive
segment-routing prefix-sid-map advertise-local
segment-routing sr-prefer prefix-list foo
area 0
interface Loopback0
prefix-sid index 1
!
interface GigabitEthernet0/0/0/0
!
interface GigabitEthernet0/2/0/0
!
interface GigabitEthernet0/2/0/3
!
!
area 1
interface GigabitEthernet0/2/0/7
!
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
85
Implementing OSPF
Cisco IOS XR Software for OSPF Version 2 Configuration: Example
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
86
Implementing OSPF
CLI Inheritance and Precedence for OSPF Version 2: Example
router ospf 1
router-id 10.5.4.3
cost 5
area 0
interface GigabitEthernet 0/1/0/0
!
interface GigabitEthernet 0/2/0/0
!
interface GigabitEthernet 0/3/0/0
!
!
area 1
cost 15
interface GigabitEthernet 0/1/0/1
!
interface GigabitEthernet 0/2/0/1
!
interface GigabitEthernet 0/3/0/1
!
!
area 4
interface GigabitEthernet 0/1/0/2
cost 20
!
interface GigabitEthernet 0/2/0/2
!
interface GigabitEthernet 0/3/0/2
!
!
area 6
cost 30
interface GigabitEthernet 0/1/0/3
!
interface GigabitEthernet 0/2/0/3
!
interface GigabitEthernet 0/3/0/3
cost 1
!
!
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
87
Implementing OSPF
MPLS TE for OSPF Version 2: Example
interface Loopback 0
address 10.10.10.10 255.255.255.0
!
interface GigabitEthernet 0/2/0/0
address 10.1.2.2 255.255.255.0
!
router ospf 1
router-id 10.10.10.10
nsf
auto-cost reference-bandwidth 10000
mpls traffic-eng router-id Loopback 0
area 0
mpls traffic-eng
interface GigabitEthernet 0/2/0/0
interface Loopback 0
router ospfv3 1
router-id 192.168.0.217
area 0
interface GigabitEthernet 0/2/0/1
area 1
range 2300::/16
interface GigabitEthernet 0/2/0/0
router ospfv3 1
router-id 10.0.0.217
area 0
interface GigabitEthernet 0/2/0/1
area 1
stub
interface GigabitEthernet 0/2/0/0
router ospfv3 1
router-id 10.0.0.217
area 0
interface GigabitEthernet 0/2/0/1
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
88
Implementing OSPF
Configuring OSPF SPF Prefix Prioritization: Example
area 1
stub no-summary
interface GigabitEthernet 0/2/0/0
prefix-set ospf-critical-prefixes
192.41.5.41/32,
11.1.3.0/24,
192.168.0.44/32
end-set
!
prefix-set ospf-high-prefixes
44.4.10.0/24,
192.41.4.41/32,
41.4.41.41/32
end-set
!
prefix-set ospf-medium-prefixes
0.0.0.0/0 ge 32
end-set
!
route-policy ospf-priority
if destination in ospf-high-prefixes then
set spf-priority high
else
if destination in ospf-critical-prefixes then
set spf-priority critical
else
if destination in ospf-medium-prefixes then
set spf-priority medium
endif
endif
endif
end-policy
OSPFv2
router ospf 1
spf prefix-priority route-policy ospf-priority
area 0
interface GigabitEthernet0/3/0/0
!
!
area 3
interface GigabitEthernet0/2/0/0
!
!
area 8
interface GigabitEthernet0/2/0/0.590
OSPFv3
router ospfv3 1
spf prefix-priority route-policy ospf-priority
area 0
interface GigabitEthernet0/3/0/0
!
!
area 3
interface GigabitEthernet0/2/0/0
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
89
Implementing OSPF
Route Redistribution for OSPFv3: Example
!
!
area 8
interface GigabitEthernet0/2/0/0.590
ABR 1 Configuration
router ospfv3 1
router-id 10.0.0.217
area 0
interface GigabitEthernet 0/2/0/1
area 1
virtual-link 10.0.0.212
interface GigabitEthernet 0/2/0/0
ABR 2 Configuration
router ospfv3 1
router-id 10.0.0.212
area 0
interface GigabitEthernet 0/3/0/1
area 1
virtual-link 10.0.0.217
interface GigabitEthernet 0/2/0/0
Virtual Link Configured with MD5 Authentication for OSPF Version 2: Example
The following examples show how to configure a virtual link to your backbone and apply MD5 authentication.
You must perform the steps described on both ABRs at each end of the virtual link.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
90
Implementing OSPF
VPN Backbone and Sham Link Configured for OSPF Version 2: Example
After you explicitly configure the ABRs, the configuration is inherited by all interfaces bound to that
area—unless you override the values and configure them explicitly for the interface.
To understand virtual links, see Virtual Link and Transit Area for OSPF, on page 14.
In this example, all interfaces on router ABR1 use MD5 authentication:
VPN Backbone and Sham Link Configured for OSPF Version 2: Example
The following examples show how to configure a provider edge (PE) router to establish a VPN backbone and
sham link connection:
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
91
Implementing OSPF
OSPF Queue Tuning Parameters Configuration: Example
pass
end-policy
!
router ospf 1
log adjacency changes
router-id 2.2.2.2
vrf vrf_1
router-id 22.22.22.2
domain-id type 0005 value 111122223333
domain-tag 140
nsf ietf
redistribute bgp 10
area 0
sham-link 10.0.1.3 10.0.0.101
!
interface GigabitEthernet0/2/0/2
!
!
!
!
router ospf 2
router-id 2.22.2.22
area 0
interface Loopback0
!
interface GigabitEthernet0/2/0/3
!
!
!
router bgp 10
bgp router-id 2.2.2.1
bgp graceful-restart restart-time 300
bgp graceful-restart
address-family ipv4 unicast
redistribute connected
!
address-family vpnv4 unicast
!
neighbor 2.2.2.2
remote-as 10
update-source Loopback0
address-family ipv4 unicast
!
address-family vpnv4 unicast
!
!
vrf vrf_1
rd 100:1
address-family ipv4 unicast
redistribute connected route-policy pass-all
redistribute ospf 1 match internal external
!
!
!
mpls ldp
router-id 2.2.2.1
interface GigabitEthernet0/2/0/3
!
!
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
92
Implementing OSPF
Where to Go Next
Where to Go Next
To configure route maps through the RPL for OSPF Version 2, see Implementing Routing Policy on
Cisco IOS XR Software module.
To build an MPLS TE topology, create tunnels, and configure forwarding over the tunnel for OSPF Version
2; see Cisco IOS XR MPLS Configuration Guide for the Cisco CRS Router.
Additional References
The following sections provide references related to implementing OSPF.
Related Documents
Standards
Standards Title
draft-ietf-ospf-multi-area-adj-07.txt OSPF Multi-Area Adjacency
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
93
Implementing OSPF
Additional References
MIBs
RFCs
RFCs Title
RFC 1587 The OSPF NSSA Option
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
94
Implementing OSPF
Additional References
RFCs Title
RFC 4576 Using a Link State Advertisement (LSA) Options Bit
to Prevent Looping in BGP/MPLS IP Virtual Private
Networks (VPNs) ownbit Extension for L3VPN
Technical Assistance
Description Link
The Cisco Technical Support website contains http://www.cisco.com/techsupport
thousands of pages of searchable technical content,
including links to products, technologies, solutions,
technical tips, and tools. Registered Cisco.com users
can log in from this page to access even more content.
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
95
Implementing OSPF
Additional References
Cisco IOS XR Routing Configuration Guide for the Cisco CRS Router, Release 4.2.x
96