Configuring OSPF
Configuring OSPF
This module describes how to configure Open Shortest Path First (OSPF). OSPF is an Interior Gateway
Protocol (IGP) developed by the OSPF working group of the Internet Engineering Task Force (IETF). OSPF
was designed expressly for IP networks and it supports IP subnetting and tagging of externally derived routing
information. OSPF also allows packet authentication and uses IP multicast when sending and receiving packets.
Cisco supports RFC 1253, OSPF Version 2 Management Information Base, August 1991. The OSPF MIB
defines an IP routing protocol that provides management information related to OSPF and is supported by
Cisco routers.
For protocol-independent features that work with OSPF, see the "Configuring IP Routing Protocol-Independent
Features" module.
• Finding Feature Information, on page 1
• Information About OSPF, on page 1
• How to Configure OSPF, on page 9
• Configuration Examples for OSPF, on page 32
• Additional References for OSPF Not-So-Stubby Areas (NSSA), on page 50
Configuring OSPF
1
Configuring OSPF
Router Coordination for OSPF
• Route redistribution—Routes learned via any IP routing protocol can be redistributed into any other IP
routing protocol. At the intradomain level, OSPF can import routes learned via Interior Gateway Routing
Protocol (IGRP), Routing Information Protocol (RIP), and Intermediate System-to-Intermediate System
(IS-IS). OSPF routes can also be exported into IGRP, RIP, and IS-IS. At the interdomain level, OSPF
can import routes learned via Exterior Gateway Protocol (EGP) and Border Gateway Protocol (BGP).
OSPF routes can be exported into EGP and BGP.
• Authentication—Plain text and message-digest algorithm 5 (MD5) authentication among neighboring
routers within an area is supported.
• Routing interface parameters—Configurable parameters supported include interface output cost,
retransmission interval, interface transmit delay, router priority, router “dead” and hello intervals, and
authentication key.
• Virtual links—Virtual links are supported.
• Not-so-stubby area (NSSA)—RFC 3101, which replaces and is backward compatible with RFC 1587.
• OSPF over demand circuit—RFC 1793.
Configuring OSPF
2
Configuring OSPF
OSPF Network Type
On point-to-multipoint broadcast networks, there is no need to specify neighbors. However, you can specify
neighbors with the neighbor router configuration command, in which case you should specify a cost to that
neighbor.
Before the point-to-multipoint keyword was added to the ip ospf network interface configuration command,
some OSPF point-to-multipoint protocol traffic was treated as multicast traffic. Therefore, the neighbor router
configuration command was not needed for point-to-multipoint interfaces because multicast took care of the
traffic. Hello, update, and acknowledgment messages were sent using multicast. In particular, multicast hello
messages discovered all neighbors dynamically.
On any point-to-multipoint interface (broadcast or not), the Cisco IOS software assumed that the cost to each
neighbor was equal. The cost was configured with the ip ospf cost interface configuration command. In reality,
the bandwidth to each neighbor is different, so the cost should differ. With this feature, you can configure a
separate cost to each neighbor. This feature applies to point-to-multipoint interfaces only.
Because many routers might be attached to an OSPF network, a designated router is selected for the network.
Special configuration parameters are needed in the designated router selection if broadcast capability is not
configured.
These parameters need only be configured in those devices that are themselves eligible to become the designated
router or backup designated router (in other words, routers with a nonzero router priority value).
You can specify the following neighbor parameters, as required:
• Priority for a neighboring router
• Nonbroadcast poll interval
On point-to-multipoint, nonbroadcast networks, use the neighbor router configuration command to identify
neighbors. Assigning a cost to a neighbor is optional.
Configuring OSPF
3
Configuring OSPF
Area Parameters
Prior to Cisco IOS Release 12.0, some customers were using point-to-multipoint on nonbroadcast media (such
as classic IP over ATM), so their routers could not dynamically discover their neighbors. This feature allows
the neighbor router configuration command to be used on point-to-multipoint interfaces.
Area Parameters
Use OSPF Not-So-Stubby Areas (NSSA) feature to simplify administration if you are an Internet service
provider (ISP) or a network administrator that must connect a central site that is using OSPF to a remote site
that is using a different routing protocol.
Prior to NSSA, the connection between the corporate site border router and the remote router could not be
run as an OSPF stub area because routes for the remote site could not be redistributed into the stub area, and
two routing protocols needed to be maintained. A simple protocol such as 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 the remote router as an NSSA.
As with OSPF stub areas, NSSA areas cannot be injected with distributed routes via Type 5 LSAs. Route
redistribution into an NSSA area is possible only with a special type of LSA that is known as Type 7 that can
exist only in an NSSA area. An NSSA ASBR generates the Type 7 LSA so that the routes can be redistributed,
and an NSSA ABR translates the Type 7 LSA into a Type 5 LSA, which can be flooded throughout the whole
OSPF routing domain. Summarization and filtering are supported during the translation.
RFC 3101 allows you to configure an NSSA ABR router as a forced NSSA LSA translator. This means that
the NSSA ABR router will unconditionally assume the role of LSA translator, preempting the default behavior,
which would only include it among the candidates to be elected as translator.
Note Even a forced translator might not translate all LSAs; translation depends on the contents of each LSA.
The figure below shows a network diagram in which OSPF Area 1 is defined as the stub area. The Enhanced
Interior Gateway Routing Protocol (EIGRP) routes cannot be propagated into the OSPF domain because
routing redistribution is not allowed in the stub area. However, once OSPF Area 1 is defined as an NSSA, an
NSSA ASBR can inject the EIGRP routes into the OSPF NSSA by creating Type 7 LSAs.
Configuring OSPF
4
Configuring OSPF
Area Parameters
The redistributed routes from the RIP router will not be allowed into OSPF Area 1 because NSSA is an
extension to the stub area. The stub area characteristics will still exist, including the exclusion of Type 5 LSAs.
Route summarization is the consolidation of advertised addresses. This feature causes a single summary route
to be advertised to other areas by an ABR. In OSPF, an ABR will advertise networks in one area into another
area. If the network numbers in an area are assigned in a way such that they are contiguous, you can configure
the ABR to advertise a summary route that covers all the individual networks within the area that fall into the
specified range.
When routes from other protocols are redistributed into OSPF (as described in the module "Configuring IP
Routing Protocol-Independent Features"), each route is advertised individually in an external LSA. However,
you can configure the Cisco IOS software to advertise a single route for all the redistributed routes that are
covered by a specified network address and mask. Doing so helps decrease the size of the OSPF link-state
database.
In OSPF, all areas must be connected to a backbone area. If there is a break in backbone continuity, or the
backbone is purposefully partitioned, you can establish a virtual link. The two endpoints of a virtual link are
ABRs. The virtual link must be configured in both routers. The configuration information in each router
consists of the other virtual endpoint (the other ABR) and the nonbackbone area that the two routers have in
common (called the transit area). Note that virtual links cannot be configured through stub areas.
You can force an ASBR to generate a default route into an OSPF routing domain. Whenever you specifically
configure redistribution of routes into an OSPF routing domain, the router automatically becomes an ASBR.
However, an ASBR does not, by default, generate a defaultroute into the OSPF routing domain.
You can configure OSPF to look up Domain Naming System (DNS) names for use in all OSPF show EXEC
command displays. You can use this feature to more easily identify a router, because the router is displayed
by name rather than by its router ID or neighbor ID.
OSPF uses the largest IP address configured on the interfaces as its router ID. If the interface associated with
this IP address is ever brought down, or if the address is removed, the OSPF process must recalculate a new
router ID and resend all its routing information out its interfaces.
Configuring OSPF
5
Configuring OSPF
Area Parameters
If a loopback interface is configured with an IP address, the Cisco IOS software will use this IP address as its
router ID, even if other interfaces have larger IP addresses. Because loopback interfaces never go down,
greater stability in the routing table is achieved.
OSPF automatically prefers a loopback interface over any other kind, and it chooses the highest IP address
among all loopback interfaces. If no loopback interfaces are present, the highest IP address in the router is
chosen. You cannot tell OSPF to use any particular interface.
In Cisco IOS Release 10.3 and later releases, by default OSPF calculates the OSPF metric for an interface
according to the bandwidth of the interface. For example, a 64-kbps link gets a metric of 1562, and a T1 link
gets a metric of 64.
The OSPF metric is calculated as the ref-bw value divided by the bandwidth value, with the ref-bw value
equal to 108 by default, and the bandwidth value determined by the bandwidth interface configuration command.
The calculation gives FDDI a metric of 1. If you have multiple links with high bandwidth, you might want
to specify a larger number to differentiate the cost on those links.
An administrative distance is a rating of the trustworthiness of a routing information source, such as an
individual router or a group of routers. Numerically, an administrative distance is an integer from 0 to 255.
In general, the higher the value, the lower the trust rating. An administrative distance of 255 means the routing
information source cannot be trusted at all and should be ignored.
OSPF uses three different administrative distances: intra-area, interarea, and external. Routes within an area
are intra-area; routes to another area are interarea; and routes from another routing domain learned via
redistribution are external. The default distance for each type of route is 110.
Because simplex interfaces between two devices on an Ethernet represent only one network segment, for
OSPF you must configure the sending interface to be a passive interface. This configuration prevents OSPF
from sending hello packets for the sending interface. Both devices are able to see each other via the hello
packet generated for the receiving interface.
You can configure the delay time between when OSPF receives a topology change and when it starts a shortest
path first (SPF) calculation. You can also configure the hold time between two consecutive SPF calculations.
The OSPF on-demand circuit is an enhancement to the OSPF protocol that allows efficient operation over
on-demand circuits such as ISDN, X.25 switched virtual circuits (SVCs), and dialup lines. This feature supports
RFC 1793, Extending OSPF to Support Demand Circuits.
Prior to this feature, OSPF periodic hello and LSA updates would be exchanged between routers that connected
the on-demand link, even when no changes occurred in the hello or LSA information.
With this feature, periodic hellos are suppressed and the periodic refreshes of LSAs are not flooded over the
demand circuit. These packets bring up the link only when they are exchanged for the first time, or when a
change occurs in the information they contain. This operation allows the underlying data link layer to be
closed when the network topology is stable.
This feature is useful when you want to connect telecommuters or branch offices to an OSPF backbone at a
central site. In this case, OSPF for on-demand circuits allows the benefits of OSPF over the entire domain,
without excess connection costs. Periodic refreshes of hello updates, LSA updates, and other protocol overhead
are prevented from enabling the on-demand circuit when there is no "real" data to send.
Overhead protocols such as hellos and LSAs are transferred over the on-demand circuit only upon initial setup
and when they reflect a change in the topology. This means that critical changes to the topology that require
new SPF calculations are sent in order to maintain network topology integrity. Periodic refreshes that do not
include changes, however, are not sent across the link.
The OSPF LSA group pacing feature allows the router to group OSPF LSAs and pace the refreshing,
checksumming, and aging functions. The group pacing results in more efficient use of the router.
Configuring OSPF
6
Configuring OSPF
Original LSA Behavior
The router groups OSPF LSAs and paces the refreshing, checksumming, and aging functions so that sudden
increases in CPU usage and network resources are avoided. This feature is most beneficial to large OSPF
networks.
OSPF LSA group pacing is enabled by default. For typical customers, the default group pacing interval for
refreshing, checksumming, and aging is appropriate and you need not configure this feature.
Configuring OSPF
7
Configuring OSPF
LSA Group Pacing with Multiple Timers
The group pacing interval is inversely proportional to the number of LSAs that the router is refreshing,
checksumming, and aging. For example, if you have approximately 10,000 LSAs, decreasing the pacing
interval would benefit you. If you have a very small database (40 to 100 LSAs), increasing the pacing interval
to 10 to 20 minutes might benefit you slightly.
The default value of pacing between LSA groups is 240 seconds (4 minutes). The range is from 10 seconds
to 1800 seconds (30 minutes).
By default, OSPF floods new LSAs over all interfaces in the same area, except the interface on which the
LSA arrives. Some redundancy is desirable, because it ensures robust flooding. However, too much redundancy
can waste bandwidth and might destabilize the network due to excessive link and CPU usage in certain
topologies. An example would be a fully meshed topology.
You can block OSPF flooding of LSAs in two ways, depending on the type of networks:
• On broadcast, nonbroadcast, and point-to-point networks, you can block flooding over specified OSPF
interfaces.
• On point-to-multipoint networks, you can block flooding to a specified neighbor.
The growth of the Internet has increased the importance of scalability in IGPs such as OSPF. By design, OSPF
requires LSAs to be refreshed as they expire after 3600 seconds. Some implementations have tried to improve
the flooding by reducing the frequency to refresh from 30 minutes to about 50 minutes. This solution reduces
the amount of refresh traffic but requires at least one refresh before the LSA expires. The OSPF flooding
reduction solution works by reducing unnecessary refreshing and flooding of already known and unchanged
information. To achieve this reduction, the LSAs are now flooded with the higher bit set. The LSAs are now
set as “do not age.”
Cisco routers do not support LSA Type 6 Multicast OSPF (MOSPF), and they generate syslog messages if
they receive such packets. If the router is receiving many MOSPF packets, you might want to configure the
router to ignore the packets and thus prevent a large number of syslog messages.
The former OSPF implementation for sending update packets needed to be more efficient. Some update
packets were getting lost in cases where the link was slow, a neighbor could not receive the updates quickly
enough, or the router was out of buffer space. For example, packets might be dropped if either of the following
topologies existed:
Configuring OSPF
8
Configuring OSPF
How to Configure OSPF
OSPF update packets are now automatically paced so they are not sent less than 33 milliseconds apart. Pacing
is also added between resends to increase efficiency and minimize lost retransmissions. Also, you can display
the LSAs waiting to be sent out an interface. The benefit of pacing is that OSPF update and retransmission
packets are sent more efficiently. There are no configuration tasks for this feature; it occurs automatically.
You can display specific statistics such as the contents of IP routing tables, caches, and databases. Information
provided can be used to determine resource utilization and solve network problems. You can also display
information about node reachability and discover the routing path that your device packets are taking through
the network.
Enabling OSPF
SUMMARY STEPS
1. enable
2. configure terminal
3. router ospf process-id
4. network ip-address wildcard-mask area area-id
5. end
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Configuring OSPF
9
Configuring OSPF
Configuring OSPF Interface Parameters
Device(config-router)# end
DETAILED STEPS
Device> enable
Step 3 interface type number Configures an interface type and enters interface
configuration mode.
Example:
Configuring OSPF
10
Configuring OSPF
Configuring OSPF Interface Parameters
Step 4 ip ospf cost cost Explicitly specifies the cost of sending a packet on an
OSPF interface.
Example:
Step 5 ip ospf retransmit-interval seconds Specifies the number of seconds between link-state
advertisement (LSA) retransmissions for adjacencies
Example:
belonging to an OSPF interface.
Device(config-if)# ip ospf retransmit-interval 1
Step 6 ip ospf transmit-delay seconds Sets the estimated number of seconds required to send a
link-state update packet on an OSPF interface.
Example:
Step 7 ip ospf priority number-value Sets priority to help determine the OSPF designated router
for a network.
Example:
Step 8 ip ospf hello-interval seconds Specifies the length of time between the hello packets that
the Cisco IOS software sends on an OSPF interface.
Example:
Step 9 ip ospf dead-interval seconds Sets the number of seconds that a device must wait before
it declares a neighbor OSPF router down because it has
Example:
not received a hello packet.
Device(config-if)# ip ospf dead-interval 1
Step 11 ip ospf message-digest-key key-id md5 key Enables OSPF MD5 authentication. The values for the
key-id and key arguments must match values specified for
Example:
other neighbors on a network segment.
Device(config-if)# ip ospf message-digest-key 1
md5 23456789
Step 12 ip ospf authentication [message-digest | null] Specifies the authentication type for an interface.
Example:
Configuring OSPF
11
Configuring OSPF
Configuring OSPF over Different Physical Networks
Device(config-if)# end
SUMMARY STEPS
1. configure terminal
2. interface type number
3. ip ospf network point-to-multipoint
4. exit
5. router ospf process-id
6. neighbor ip-address [cost number]
DETAILED STEPS
Step 2 interface type number Specifies an interface type and number, and enters interface
configuration mode.
Example:
Device#(config-if) exit
Configuring OSPF
12
Configuring OSPF
Configuring OSPF for Nonbroadcast Networks
Step 6 neighbor ip-address [cost number] Specifies a neighbor and assigns a cost to the neighbor.
Example: Note Repeat this step for each neighbor if you want
to specify a cost. Otherwise, neighbors will
Device#(config-router) neighbor 192.168.3.4 cost assume the cost of the interface, based on the ip
180 ospf cost interface configuration command.
SUMMARY STEPS
1. configure terminal
2. interface type number
3. ip ospf network point-to-multipoint non-broadcast
4. exit
5. router ospf process-id
6. neighbor ip-address [cost number]
DETAILED STEPS
Step 2 interface type number Specifies an interface type and number, and enters interface
configuration mode.
Example:
Device#(config-if) exit
Configuring OSPF
13
Configuring OSPF
Configuring OSPF Area Parameters
Step 6 neighbor ip-address [cost number] Specifies a neighbor and assigns a cost to the neighbor.
Example: Note Repeat this step for each neighbor if you want
to specify a cost. Otherwise, neighbors will
Device#(config-router) neighbor 192.168.3.4 cost assume the cost of the interface, based on the ip
180 ospf cost interface configuration command.
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Configuring OSPF
14
Configuring OSPF
Configuring OSPFv2 NSSA
Step 5 area area-id stub [no summary] Defines an area to be a stub area.
Example:
Step 6 area area-id default-cost cost Specifies a cost for the default summary route that is sent
into a stub area or not-so-stubby area (NSSA)
Example:
Device(config-router)# end
SUMMARY STEPS
1. enable
2. configure terminal
3. router ospf process-id
4. redistribute protocol [process-id] {level-1 | level-1-2 | level-2} [autonomous-system-number] [metric
{metric-value | transparent}] [metric-type type-value] [match {internal | external 1 | external 2}]
[tag tag-value] [route-map map-tag] [subnets] [nssa-only]
5. network ip-address wildcard-mask area area-id
6. area area-id nssa [no-redistribution] [default-information-originate [metric] [metric-type]]
[no-summary] [nssa-only]
7. summary-address prefix mask [not-advertise] [tag tag] [nssa-only]
8. end
DETAILED STEPS
Device> enable
Configuring OSPF
15
Configuring OSPF
Configuring an OSPFv2 NSSA Area and Its Parameters
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example: • The process-id argument identifies the OSPF process.
The range is from 1 to 65535.
Device(config)# router ospf 10
Step 4 redistribute protocol [process-id] {level-1 | level-1-2 | Redistributes routes from one routing domain to another
level-2} [autonomous-system-number] [metric routing domain.
{metric-value | transparent}] [metric-type type-value]
• In the example, Routing Information Protocol (RIP)
[match {internal | external 1 | external 2}] [tag tag-value]
subnets are redistributed into the OSPF domain.
[route-map map-tag] [subnets] [nssa-only]
Example:
Step 5 network ip-address wildcard-mask area area-id Defines the interfaces on which OSPF runs and the area ID
for those interfaces.
Example:
Step 6 area area-id nssa [no-redistribution] Configures a Not-So-Stubby Area (NSSA) area.
[default-information-originate [metric] [metric-type]]
[no-summary] [nssa-only]
Example:
Step 7 summary-address prefix mask [not-advertise] [tag tag] Controls the route summarization and filtering during the
[nssa-only] translation and limits the summary to NSSA areas.
Example:
Device(config-router)# end
Configuring OSPF
16
Configuring OSPF
Configuring an NSSA ABR as a Forced NSSA LSA Translator
SUMMARY STEPS
1. enable
2. configure terminal
3. router ospf process-id
4. area area-id nssa translate type7 always
5. area area-id nssa translate type7 suppress-fa
6. end
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example: • The process-id argument identifies the OSPF process.
The range is from 1 to 65535.
Device(config)# router ospf 1
Step 4 area area-id nssa translate type7 always Configures a Not-So-Stubby Area Area Border Router
(NSSA ABR) device as a forced NSSA Link State
Example:
Advertisement (LSA) translator.
Device(config-router)# area 10 nssa translate type7 Note You can use the always keyword in the area
always nssa translate command to configure an NSSA
ABR device as a forced NSSA LSA translator.
This command can be used if RFC 3101 is
disabled and RFC 1587 is used.
Step 5 area area-id nssa translate type7 suppress-fa Allows ABR to suppress the forwarding address in
translated Type-5 LSA.
Example:
Configuring OSPF
17
Configuring OSPF
Disabling RFC 3101 Compatibility and Enabling RFC 1587 Compatibility
Device(config-router)# end
SUMMARY STEPS
1. enable
2. configure terminal
3. router ospf process-id
4. compatible rfc1587
5. end
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example: • The process-id argument identifies the OSPF process.
Device(config-router)# end
Configuring OSPF
18
Configuring OSPF
Configuring OSPF NSSA Parameters
DETAILED STEPS
DETAILED STEPS
Configuring OSPF
19
Configuring OSPF
Generating a Default Route
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Step 4 default-information originate [always] [metric Forces the ASBR to generate a default route into the OSPF
metric-value] [metric-type type-value] [route-map routing domain.
map-name]
Note The always keyword includes the following
Example: exception when a route map is used. When a
route map is used, the origination of the default
Device(config-router)# default-information route by OSPF is not bound to the existence of
originate always a default route in the routing table.
Device(config-router)# end
Configuring OSPF
20
Configuring OSPF
Configuring Lookup of DNS Names
DETAILED STEPS
Device> enable
Step 3 ip ospf name-lookup Enables OSPF routing and enters router configuration mode.
Example:
Device(config)# end
DETAILED STEPS
Configuring OSPF
21
Configuring OSPF
Controlling Default Metrics
Step 2 interface type number Creates a loopback interface and enters interface
configuration mode.
Example:
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Configuring OSPF
22
Configuring OSPF
Changing the OSPF Administrative Distances
Device(config-router)# auto-cost
reference-bandwidth 101
Device(config-router)# end
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Step 4 distance ospf {intra-area | inter-area | external} dist Changes the OSPF distance values.
Example:
Configuring OSPF
23
Configuring OSPF
Configuring OSPF on Simplex Ethernet Interfaces
Device(config-router)# end
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Step 4 timers throttle spf spf-start spf-hold spf-max-wait Configures route calculation timers.
Example:
Configuring OSPF
24
Configuring OSPF
Configuring OSPF over On-Demand Circuits
Device(config-router)# end
DETAILED STEPS
What to do next
Note You can prevent an interface from accepting demand-circuit requests from other routers to by specifying the
ignore keyword in the ip ospf demand-circuit command.
Prerequisites
Evaluate the following considerations before implementing the On-Demand Circuits feature:
• Because LSAs that include topology changes are flooded over an on-demand circuit, we recommend
that you put demand circuits within OSPF stub areas or within NSSAs to isolate the demand circuits
from as many topology changes as possible.
• Every router within a stub area or NSSA must have this feature loaded in order to take advantage of the
on-demand circuit functionality. If this feature is deployed within a regular area, all other regular areas
must also support this feature before the demand circuit functionality can take effect because Type 5
external LSAs are flooded throughout all areas.
• Hub-and-spoke network topologies that have a point-to-multipoint (P2MP) OSPF interface type on a
hub might not revert to nondemand circuit mode when needed. You must simultaneously reconfigure
OSPF on all interfaces on the P2MP segment when reverting them from demand circuit mode to
nondemand circuit mode.
Configuring OSPF
25
Configuring OSPF
Logging Neighbors Going Up or Down
• Do not implement this feature on a broadcast-based network topology because the overhead protocols
(such as hello and LSA packets) cannot be successfully suppressed, which means the link will remain
up.
• Configuring the router for an OSPF on-demand circuit with an asynchronous interface is not a supported
configuration. The supported configuration is to use dialer interfaces on both ends of the circuit. For
more information, refer to Why OSPF Demand Circuit Keeps Bringing Up the Link .
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Configuring OSPF
26
Configuring OSPF
Changing the LSA Group Pacing Interval
Device(config-router)# end
SUMMARY STEPS
1. enable
2. configure terminal
3. router ospf process-id
4. timers pacing lsa-group seconds
5. end
DETAILED STEPS
Device> enable
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
Example:
Step 4 timers pacing lsa-group seconds Changes the group pacing of LSAs.
Example:
Device(config-router)# end
Configuring OSPF
27
Configuring OSPF
Blocking OSPF LSA Flooding
On point-to-multipoint networks, to block flooding of OSPF LSAs, use the following command in router
configuration mode:
Command Purpose
Prevents the router from generating syslog messages when it receives MOSPF LSA
ignore lsa mospf packets.
Configuring OSPF
28
Configuring OSPF
Monitoring and Maintaining OSPF
Command Purpose
Configuring OSPF
29
Configuring OSPF
Monitoring and Maintaining OSPF
Command Purpose
Configuring OSPF
30
Configuring OSPF
Displaying OSPF Update Packet Pacing
Command Purpose
Command Purpose
SUMMARY STEPS
1. show ip ospf flood-list interface-type interface-number
Configuring OSPF
31
Configuring OSPF
Restrictions for OSPF
DETAILED STEPS
Router 1 Configuration
hostname Router 1
!
Configuring OSPF
32
Configuring OSPF
Example: OSPF Point-to-Multipoint with Broadcast
interface serial 1
ip address 10.0.0.2 255.0.0.0
ip ospf network point-to-multipoint
encapsulation frame-relay
frame-relay map ip 10.0.0.1 201 broadcast
frame-relay map ip 10.0.0.3 202 broadcast
frame-relay map ip 10.0.0.4 203 broadcast
!
router ospf 1
network 10.0.0.0 0.0.0.255 area 0
Router 2 Configuration
hostname Router 2
!
interface serial 0
ip address 10.0.0.1 255.0.0.0
ip ospf network point-to-multipoint
encapsulation frame-relay
frame-relay map ip 10.0.0.2 101 broadcast
frame-relay map ip 10.0.0.4 102 broadcast
!
router ospf 1
network 10.0.0.0 0.0.0.255 area 0
Router 3 Configuration
hostname Router 3
!
interface serial 3
ip address 10.0.0.4 255.0.0.0
ip ospf network point-to-multipoint
encapsulation frame-relay
clock rate 1000000
frame-relay map ip 10.0.0.1 401 broadcast
frame-relay map ip 10.0.0.2 402 broadcast
!
router ospf 1
network 10.0.0.0 0.0.0.255 area 0
Router 4 Configuration
hostname Router 4
!
interface serial 2
ip address 10.0.0.3 255.0.0.0
ip ospf network point-to-multipoint
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 10.0.0.2 301 broadcast
!
router ospf 1
network 10.0.0.0 0.0.0.255 area 0
Configuring OSPF
33
Configuring OSPF
Example: OSPF Point-to-Multipoint with Nonbroadcast
interface Serial0
ip address 10.0.1.1 255.255.255.0
encapsulation frame-relay
ip ospf cost 100
ip ospf network point-to-multipoint
frame-relay map ip 10.0.1.3 202 broadcast
frame-relay map ip 10.0.1.4 203 broadcast
frame-relay map ip 10.0.1.5 204 broadcast
frame-relay local-dlci 200
!
router ospf 1
network 10.0.1.0 0.0.0.255 area 0
neighbor 10.0.1.5 cost 5
neighbor 10.0.1.4 cost 10
interface serial 0
ip address 10.0.1.3 255.255.255.0
ip ospf network point-to-multipoint
encapsulation frame-relay
frame-relay local-dlci 301
frame-relay map ip 10.0.1.1 300 broadcast
no shutdown
!
router ospf 1
network 10.0.1.0 0.0.0.255 area 0
interface Serial0
ip address 10.0.1.1 255.255.255.0
Configuring OSPF
34
Configuring OSPF
Example: Variable-Length Subnet Masks
The following example is the configuration for the router on the other side:
interface Serial9/2
ip address 10.0.1.3 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-multipoint non-broadcast
no ip mroute-cache
no keepalive
no fair-queue
frame-relay local-dlci 301
frame-relay map ip 10.0.1.1 300
no shutdown
!
router ospf 1
network 10.0.1.0 0.0.0.255 area 0
interface ethernet 0
ip address 172.16.10.1 255.255.255.0
! 8 bits of host address space reserved for ethernets
interface serial 0
ip address 172.16.20.1 255.255.255.252
! 2 bits of address space reserved for serial lines
! Router is configured for OSPF and assigned AS 107
router ospf 107
! Specifies network directly connected to the router
network 172.16.0.0 0.0.255.255 area 0.0.0.0
Configuring OSPF
35
Configuring OSPF
Example: Configuring OSPF NSSA
Device 1
hostname Device1
!
interface Loopback1
ip address 10.1.0.1 255.255.255.255
!
interface Ethernet0/0
ip address 192.168.0.1 255.255.255.0
ip ospf 1 area 0
no cdp enable
!
interface Serial10/0
description Device2 interface s11/0
ip address 192.168.10.1 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
no cdp enable
!
router ospf 1
area 1 nssa
!
end
Device 2
hostname Device2
!
!
interface Loopback1
ip address 10.1.0.2 255.255.255.255
!
interface Serial10/0
description Device1 interface s11/0
no ip address
shutdown
serial restart-delay 0
no cdp enable
!
interface Serial11/0
description Device1 interface s10/0
ip address 192.168.10.2 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
no cdp enable
!
interface Serial14/0
description Device3 interface s13/0
ip address 192.168.14.2 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
no cdp enable
!
Configuring OSPF
36
Configuring OSPF
Example: Configuring OSPF NSSA
router ospf 1
area 1 nssa
!
end
Device 3
hostname Device3
!
interface Loopback1
ip address 10.1.0.3 255.255.255.255
!
interface Ethernet3/0
ip address 192.168.3.3 255.255.255.0
no cdp enable
!
interface Serial13/0
description Device2 interface s14/0
ip address 192.168.14.3 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
no cdp enable
!
router ospf 1
log-adjacency-changes
area 1 nssa
redistribute rip subnets
!
router rip
version 2
redistribute ospf 1 metric 15
network 192.168.3.0
end
Device 4
hostname Device4
!
interface Loopback1
ip address 10.1.0.4 255.255.255.255
!
interface Ethernet3/0
ip address 192.168.3.4 255.255.255.0
no cdp enable
!
interface Ethernet4/1
ip address 192.168.41.4 255.255.255.0
!
router rip
version 2
network 192.168.3.0
network 192.168.41.0
!
end
Device 5
hostname Device5
!
interface Loopback1
Configuring OSPF
37
Configuring OSPF
Example: OSPF NSSA Area with RFC 3101 Disabled and RFC 1587 Active
Example: OSPF NSSA Area with RFC 3101 Disabled and RFC 1587 Active
In the following example, the output for the show ip ospf and show ip ospf database nssa commands shows
an Open Shortest Path First Not-So-Stubby Area (OSPF NSSA) area where RFC 3101 is disabled, RFC 1587
is active, and an NSSA Area Border Router (ABR) device is configured as a forced NSSA LSA translator. If
RFC 3101 is disabled, the forced NSSA LSA translator remains inactive.
Configuring OSPF
38
Configuring OSPF
Example: OSPF Routing and Route Redistribution
The table below describes the show ip ospf display fields and their descriptions.
Field Description
Supports NSSA (compatible with RFC Specifies that RFC 1587 is active or that the OSPF NSSA area
1587) is RFC 1587 compatible.
Configured to translate Type-7 LSAs, Specifies that OSPF NSSA area has an ABR device configured
inactive (RFC3101 support disabled) to act as a forced translator of Type 7 LSAs. However, it is
inactive because RFC 3101 is disabled
The table below describes the show ip ospf database nssa display fields and their descriptions.
Field Description
Unconditional NSSA translator Specifies that NSSA ASBR device is a forced NSSA LSA translator
Configuring OSPF
39
Configuring OSPF
Example: Basic OSPF Configuration
• The second example illustrates a configuration for an internal router, ABR, and ASBRs within a single,
arbitrarily assigned, OSPF autonomous system.
• The third example illustrates a more complex configuration and the application of various tools available
for controlling OSPF-based routing environments.
interface ethernet 0
ip address 10.93.1.1 255.255.255.0
ip ospf cost 1
!
interface ethernet 1
ip address 10.94.1.1 255.255.255.0
!
router ospf 9000
network 10.93.0.0 0.0.255.255 area 0.0.0.0
redistribute rip metric 1 subnets
!
router rip
network 10.94.0.0
redistribute ospf 9000
default-metric 1
Example: Basic OSPF Configuration for Internal Router ABR and ASBRs
The following example illustrates the assignment of four area IDs to four IP address ranges. In the example,
OSPF routing process 109 is initialized, and four OSPF areas are defined: 10.9.50.0, 2, 3, and 0. Areas
10.9.50.0, 2, and 3 mask specific address ranges, and area 0 enables OSPF for all other networks.
Configuring OSPF
40
Configuring OSPF
Example: Complex Internal Router with ABR and ASBR
Each network area router configuration command is evaluated sequentially, so the order of these commands
in the configuration is important. The Cisco software sequentially evaluates the address/wildcard-mask pair
for each interface. See the network area command page in the Cisco IOS IP Routing: OSPF Command
Reference for more information.
Consider the first network area command. Area ID 10.9.50.0 is configured for the interface on which subnet
192.168.10.0 is located. Assume that a match is determined for Ethernet interface 0. Ethernet interface 0 is
attached to area 10.9.50.0 only.
The second network area command is evaluated next. For area 2, the same process is then applied to all
interfaces (except Ethernet interface 0). Assume that a match is determined for Ethernet interface 1. OSPF is
then enabled for that interface, and Ethernet interface 1 is attached to area 2.
This process of attaching interfaces to OSPF areas continues for all network area commands. Note that the
last network area command in this example is a special case. With this command, all available interfaces
(not explicitly attached to another area) are attached to area 0.
Configuring OSPF
41
Configuring OSPF
Example: Complex Internal Router with ABR and ASBR
Note You do not need to include definitions of all areas in an OSPF autonomous system in the configuration of all
routers in the autonomous system. Only the directly connected areas must be defined. In the example that
follows, routes in area 0 are learned by the routers in area 1 (Router A and Router B) when the ABR (Router
C) injects summary LSAs into area 1.
Configuring OSPF
42
Configuring OSPF
Example: Complex Internal Router with ABR and ASBR
The OSPF domain in BGP autonomous system 109 is connected to the outside world via the BGP link to the
external peer at IP address 10.0.0.6. Sample configurations follow.
Following is the sample configuration for the general network map shown in the figure above.
interface ethernet 1
ip address 192.168.1.1 255.255.255.0
router ospf 1
network 192.168.0.0 0.0.255.255 area 1
interface ethernet 2
ip address 192.168.1.2 255.255.255.0
router ospf 202
network 192.168.0.0 0.0.255.255 area 1
Router C Configuration—ABR
interface ethernet 3
ip address 192.168.1.3 255.255.255.0
interface serial 0
ip address 192.168.2.3 255.255.255.0
router ospf 999
network 192.168.1.0 0.0.0.255 area 1
network 192.168.2.0 0.0.0.255 area 0
interface ethernet 4
ip address 10.0.0.4 255.0.0.0
interface serial 1
ip address 192.168.2.4 255.255.255.0
router ospf 50
network 192.168.2.0 0.0.0.255 area 0
network 10.0.0.0 0.255.255.255 area 0
Router E Configuration—ASBR
interface ethernet 5
ip address 10.0.0.5 255.0.0.0
interface serial 2
ip address 172.16.1.5 255.255.255.0
router ospf 65001
network 10.0.0.0 0.255.255.255 area 0
redistribute bgp 109 metric 1 metric-type 1
router bgp 109
network 192.168.0.0
network 10.0.0.0
neighbor 172.16.1.6 remote-as 110
Configuring OSPF
43
Configuring OSPF
Example: Complex OSPF Configuration for ABR
The specific tasks outlined in this configuration are detailed briefly in the following descriptions. The figure
below illustrates the network address ranges and area assignments for the interfaces.
Figure 6: Interface and Area Specifications for OSPF Sample Configuration
interface ethernet 0
Configuring OSPF
44
Configuring OSPF
Examples: Route Map
Configuring OSPF
45
Configuring OSPF
Examples: Route Map
The following example redistributes RIP routes with a hop count equal to 1 into OSPF. These routes will be
redistributed into OSPF as external LSAs with a metric of 5, a metric type of Type 1, and a tag equal to 1.
The following example redistributes OSPF learned routes with tag 7 as a RIP metric of 15:
router rip
redistribute ospf 109 route-map 5
!
route-map 5 permit
match tag 7
set metric 15
The following example redistributes OSPF intra-area and interarea routes with next-hop routers on serial
interface 0 into BGP with an INTER_AS metric of 5:
The following example redistributes two types of routes into the integrated IS-IS routing table (supporting
both IP and CLNS). The first type is OSPF external IP routes with tag 5; these routes are inserted into Level
2 IS-IS link state packets (LSPs) with a metric of 5. The second type is ISO-IGRP derived CLNS prefix routes
that match CLNS access list 2000; these routes will be redistributed into IS-IS as Level 2 LSPs with a metric
of 30.
router isis
redistribute ospf 109 route-map 2
redistribute iso-igrp nsfnet route-map 3
!
route-map 2 permit
match route-type external
match tag 5
set metric 5
set level level-2
!
route-map 3 permit
match address 2000
set metric 30
With the following configuration, OSPF external routes with tags 1, 2, 3, and 5 are redistributed into RIP with
metrics of 1, 1, 5, and 5, respectively. The OSPF routes with a tag of 4 are not redistributed.
router rip
Configuring OSPF
46
Configuring OSPF
Example: Changing the OSPF Administrative Distances
In the following configuration, a RIP-learned route for network 192.168.0.0 and an ISO-IGRP-learned route
with prefix 49.0001.0002 are redistributed into an IS-IS Level 2 LSP with a metric of 5:
router isis
redistribute rip route-map 1
redistribute iso-igrp remote route-map 1
!
route-map 1 permit
match ip address 1
match clns address 2
set metric 5
set level level-2
!
access-list 1 permit 192.168.0.0 0.0.255.255
clns filter-set 2 permit 49.0001.0002...
The following configuration example illustrates how a route map is referenced by the default-information
router configuration command. This type of reference is called conditional default origination. OSPF will
originate the default route (network 0.0.0.0) with a Type 2 metric of 5 if 172.16.0.0 is in the routing table.
Note Only routes external to the OSPF process can be used for tracking, such as non-OSPF routes or OSPF routes
from a separate OSPF process.
Configuring OSPF
47
Configuring OSPF
Example: OSPF over On-Demand Routing
Router A Configuration
router ospf 1
redistribute ospf 2 subnet
distance ospf external 200
!
router ospf 2
redistribute ospf 1 subnet
distance ospf external 200
Router B Configuration
router ospf 1
redistribute ospf 2 subnet
distance ospf external 200
!
router ospf 2
redistribute ospf 1 subnet
distance ospf external 200
Configuring OSPF
48
Configuring OSPF
Example: OSPF over On-Demand Routing
Router A Configuration
Router B Configuration
Configuring OSPF
49
Configuring OSPF
Example: LSA Group Pacing
router ospf
timers pacing lsa-group 60
interface ethernet 0
ip ospf database-filter all out
The following example prevents flooding of OSPF LSAs to point-to-multipoint networks to the neighbor at
IP address 10.10.10.45:
Cisco IOS commands Cisco IOS Master Command List, All Releases
RFCs
RFC Title
Configuring OSPF
50
Configuring OSPF
Additional References for OSPF Not-So-Stubby Areas (NSSA)
Technical Assistance
Description Link
Configuring OSPF
51
Configuring OSPF
Additional References for OSPF Not-So-Stubby Areas (NSSA)
Configuring OSPF
52