Configuring OSPF
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.
• Finding Feature Information, page 1
• Information About OSPF, page 2
• How to Configure OSPF, page 9
• Configuration Examples for OSPF, page 22
• Additional References, page 41
• Feature Information for OSPF, page 43
• , page 44
1
Cisco OSPF Implementation
Information About OSPF
2
Route Distribution for OSPF
Information About OSPF
3
Route Distribution for OSPF
Information About OSPF
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 XE 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.
This feature allows the neighbor router configuration command to be used on point-to-multipoint
interfaces.
On any point-to-multipoint interface (broadcast or not), the software assumed 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.
Our OSPF software allows you to configure several area parameters. These area parameters, shown in the
following task table, include authentication, defining stub areas, and assigning specific costs to the default
summary route. Authentication allows password-based protection against unauthorized access to an area.
Stub areas are areas into which information on external routes is not sent. Instead, there is a default external
route generated by the ABR, into the stub area for destinations outside the autonomous system. To take
advantage of the OSPF stub area support, default routing must be used in the stub area. To further reduce
the number of LSAs sent into a stub area, you can configure the no-summary keyword of the area
stubrouter configuration command on the ABR to prevent it from sending summary link advertisement
(LSAs Type 3) into the stub area.
The OSPF NSSA feature is described by RFC 3101. In Cisco IOS Release XE3.3S and later releases, RFC
3101 replaces RFC 1587. RFC 3101 is backward compatible with RFC 1587. For a detailed list of
differences between them, see Appendix F of RFC 3101. NSSA support was first integrated into Cisco IOS
XE Release 2.1. OSPF NSSA is a nonproprietary extension of the existing OSPF stub area feature.
RFC 3101 support enhances both the Type 7 autonomous-system external routing calculation and the
translation of Type 7 LSAs into Type 5 LSAs. For more information, see RFC 3101.
Use NSSA 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.
4
Route Distribution for OSPF
Information About OSPF
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.
Cisco IOS Release XE3.3S and later releases support RFC 3101, which 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.
Evaluate the following considerations before you implement OSPF NSSA:
• You can set a Type 7 default route that can be used to reach external destinations. If you do, the router
generates a Type 7 default into the NSSA or the NSSA ABR.
• Every router within the same area must agree that the area is NSSA; otherwise, the routers will not be
able to communicate.
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.
5
Route Distribution for OSPF
Information About OSPF
In Cisco IOS XE Release 3.3S and later releases, RFC 3101 replaces RFC 1587, and you can use the
always keyword in the area nssa translate command to configure an NSSA ABR router as a forced NSSA
LSA translator. This command will work if RFC 3101 is disabled and RFC 1587 is being used.
In Cisco IOS XE Release 3.3S and later releases, RFC 3101 replaces RFC 1587, and RFC 3101 behavior is
automatically enabled. You can choose the route selection behavior by configuring a router to run as RFC
3101 or RFC 1587 compatible.
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 XE 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 default route 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.
If a loopback interface is configured with an IP address, the Cisco IOS XE 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.
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.
6
Route Distribution for OSPF
Original LSA Behavior
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 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 over 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.
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.
• Original LSA Behavior, page 7
• LSA Group Pacing with Multiple Timers, page 8
7
Route Distribution for OSPF
LSA Group Pacing with Multiple Timers
would scan the whole database every 30 minutes, refreshing every LSA the router generated, no matter
how old it was. The figure below illustrates all the LSAs being refreshed at once. This process wasted CPU
resources because only a small portion of the database needed to be refreshed. A large OSPF database
(several thousand LSAs) could have thousands of LSAs with different ages. Refreshing on a single timer
resulted in the age of all LSAs becoming synchronized, which resulted in much CPU processing at once.
Furthermore, a large number of LSAs could cause a sudden increase of network traffic, consuming a large
amount of network resources in a short period of time.
The group pacing interval is inversely proportional to the number of LSAs the router is refreshing,
checksumming, and aging. For example, if you have approximately 10,000 LSAs, decreasing the pacing
8
Route Distribution for OSPF
How to Configure OSPF
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 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 of 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:
• A fast router was connected to a slower router over a point-to-point link.
• During flooding, several neighbors sent updates to a single router at the same time.
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 the pacing is that OSPF update and
retransmission packets are sent more efficiently.
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.
9
Enabling OSPF
How to Configure OSPF
Enabling OSPF
SUMMARY STEPS
DETAILED STEPS
10
Configuring OSPF over Different Physical Networks
Configuring Your OSPF Network Type
Command Purpose
Specifies the number of seconds between link-state
Router(config-if)# ip ospf retransmit- advertisement (LSA) retransmissions for
interval seconds adjacencies belonging to an OSPF interface.
11
Configuring OSPF over Different Physical Networks
Configuring Point-to-Multipoint Broadcast Networks
SUMMARY STEPS
DETAILED STEPS
To treat the interface as point-to-multipoint when the media does not support broadcast, use the following
commands beginning in interface configuration mode:
SUMMARY STEPS
DETAILED STEPS
12
Configuring OSPF Area Parameters
Configuring OSPF for Nonbroadcast Networks
To control summarization and filtering of Type 7 LSAs into Type 5 LSAs, use the following command in
router configuration mode on the ASBR:
Command Purpose
Controls the summarization and filtering during the
Router(config-router)# summary address translation.
prefix mask [not advertise] [tag tag]
13
Configuring OSPF NSSA
Configuring an NSSA ABR as a Forced NSSA LSA Translator
Note In Cisco IOS XE Release 3.3S and later releases, the output of the show ip ospf command shows whether
the NSSA ABR is configured as a forced translator, and whether the router is running as RFC 3101 or RFC
1587 compatible.
SUMMARY STEPS
1. enable
2. configure terminal
3. router ospf process-id
4. area area-id nssa translate type7 [ always ]
5. end
DETAILED STEPS
Example:
Router# configure terminal
Step 3 router ospf process-id Enables OSPF routing and enters router configuration
mode.
Example: • The process-id argument identifies the OSPF process.
Router(config)# router ospf 1
Step 4 area area-id nssa translate type7 [ always ] Configures an NSSA ABR router as a forced NSSA LSA
translator.
Example:
Router(config-router)# area 10 nssa translate type7
always
14
Configuring Route Summarization Between OSPF Areas
Disabling RFC 3101 Compatibility and Enabling RFC 1587 Compatibility
Note In Cisco IOS XE Release 3.3S and later releases, the output of the show ip ospf command will indicate if
the NSSA ABR is configured as RFC 3101 or RFC 1587 compatible.
SUMMARY STEPS
1. enable
2. configure terminal
3. router ospf process-id
4. compatible rfc1587
5. end
DETAILED STEPS
Example:
Router# configure terminal
Step 3 router ospf process-id Enables OSPF routing and enters router configuration mode.
• The process-id argument identifies the OSPF process.
Example:
Router(config)# router ospf 1
Step 4 compatible rfc1587 Changes the method used to perform route selection to RFC 1587
compatibility and disables RFC 3101.
Example:
Router(config-router)# compatible rfc1587
Step 5 end Exits router configuration mode and returns to privileged EXEC mode.
Example:
Router(config-router)# end
15
Configuring Route Summarization When Redistributing Routes into OSPF
Disabling RFC 3101 Compatibility and Enabling RFC 1587 Compatibility
Command Purpose
Specifies an address range for which a single route
Router(config-router)# area area-id range ip- will be advertised.
address mask
[advertise
| not-advertise][cost cost]
To display information about virtual links, use the show ip ospf virtual-links EXEC command. To display
the router ID of an OSPF router, use the show ip ospf EXEC command.
16
Forcing the Router ID Choice with a Loopback Interface
Disabling RFC 3101 Compatibility and Enabling RFC 1587 Compatibility
DETAILED STEPS
17
Configuring OSPF over On-Demand Circuits
Prerequisites
DETAILED STEPS
If the router is part of a point-to-point topology, then only one end of the demand circuit must be
configured with this command. However, all routers must have this feature loaded.
If the router is part of a point-to-multipoint topology, only the multipoint end must be configured with this
command.
Note You can prevent an interface from accepting demand-circuit requests from other routers by specifying the
ignore keyword in the ip ospf demand-circuit command.
• Prerequisites, page 18
Prerequisites
Evaluate the following considerations before implementing this 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.
• To take advantage of the on-demand circuit functionality within a stub area or NSSA, every router in
the area must have this feature loaded. 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.
• 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 the following document, http://www.cisco.com/en/US/tech/
18
Logging Neighbors Going Up or Down
Prerequisites
On point-to-multipoint networks, to block flooding of OSPF LSAs, use the following command in router
configuration mode:
Command Purpose
Blocks the flooding of OSPF LSA packets to the
Router(config-router)# neighbor ip- specified neighbor.
address database-filter all out
19
Ignoring MOSPF LSA Packets
Prerequisites
Command Purpose
Suppresses the unnecessary flooding of LSAs in
Router(config-if)# ip ospf flood-reduction stable topologies.
20
Monitoring and Maintaining OSPF
Prerequisites
Command Purpose
[area-id]] database [router] [adv-router [ip-
address]]
21
Example OSPF Point-to-Multipoint
Configuration Examples for OSPF
Command Purpose
Displays OSPF neighbor information on a per-
Router# show ip ospf neighbor [interface- interface basis.
name] [neighbor-id] detail
22
Example OSPF Point-to-Multipoint
Configuration Examples for OSPF
the router named Router 3. Router 2 uses DLCI 101 to communicate with Router 1 and DLCI 102 to
communicate with Router 3. Router 3 communicates with Router 2 (DLCI 401) and Router 1 (DLCI 402).
Router 4 communicates with Router 1 (DLCI 301). Configuration examples follow the figure.
Router 1 Configuration
hostname Router 1
!
interface serial 1/0/0
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/0/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/0/0
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
23
Example OSPF Point-to-Multipoint Broadcast
Configuration Examples for OSPF
Router 4 Configuration
hostname Router 4
!
interface serial 2/0/0
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
interface Serial0/0/0
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
24
Example OSPF Point-to-Multipoint Nonbroadcast
Configuration Examples for OSPF
interface Serial0/0/0
ip address 10.0.1.1 255.255.255.0
ip ospf network point-to-multipoint non-broadcast
encapsulation frame-relay
no keepalive
frame-relay local-dlci 200
frame-relay map ip 10.0.1.3 202
frame-relay map ip 10.0.1.4 203
frame-relay map ip 10.0.1.5 204
no shutdown
!
router ospf 1
network 10.0.1.0 0.0.0.255 area 0
neighbor 10.0.1.3 cost 5
neighbor 10.0.1.4 cost 10
neighbor 10.0.1.5 cost 15
The following example is the configuration for the router on the other side:
interface Serial9/2/1
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
25
Example OSPF NSSA
Configuration Examples for OSPF
Router 1
hostname Router1
!
interface Loopback1
ip address 10.1.0.1 255.255.255.255
!
interface gigabitethernet 0/0/0
ip address 192.168.0.1 255.255.255.0
ip ospf 1 area 0
no cdp enable
!
interface Serial10/0/0
description Router2 interface s11/0/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
Router 2
hostname Router2
!
!
interface Loopback1
ip address 10.1.0.2 255.255.255.255
!
interface Serial10/0/0
description Router1 interface s11/0/0
no ip address
shutdown
serial restart-delay 0
no cdp enable
!
interface Serial11/0/0
description Router1 interface s10/0/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/0
description Router3 interface s13/0/0
ip address 192.168.14.2 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
no cdp enable
!
router ospf 1
area 1 nssa
!
end
26
Example OSPF NSSA
Configuration Examples for OSPF
Router 3
hostname Router3
!
interface Loopback1
ip address 10.1.0.3 255.255.255.255
!
interface gigabitethernet3/0/0
ip address 192.168.3.3 255.255.255.0
no cdp enable
!
interface Serial13/0/0
description Router2 interface s14/0/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
Router 4
hostname Router4
!
interface Loopback1
ip address 10.1.0.4 255.255.255.255
!
interface gigabitethernet3/0/0
ip address 192.168.3.4 255.255.255.0
no cdp enable
!
interface gigabitethernet4/1/0
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
Router 5
hostname Router5
!
interface Loopback1
ip address 10.1.0.5 255.255.255.255
!
interface gigabitethernet0/0/0
ip address 192.168.0.10 255.255.255.0
ip ospf 1 area 0
no cdp enable
!
interface gigabitethernet1/1/0
ip address 192.168.11.10 255.255.255.0
ip ospf 1 area 0
!
router ospf 1
!
end
27
Example OSPF NSSA
Configuration Examples for OSPF
The figure below shows the OSPF stub network with NSSA Area 1. The redistributed routes that Router 4
is propagating from the two RIP networks will be translated into Type 7 LSAs by NSSA ASBR Router 3.
Router 2, which is configured to be the NSSA ABR, will translate the Type 7 LSAs back to Type 5 so that
they can be flooded through the rest of the OSPF stub network within OSPF Area 0.
Figure 5: OSPF NSSA Network with NSSA ABR and ASBR Routers
When the show ip ospf command is entered on Router 2, the output confirms that OSFP Area 1 is an
NSSA area:
28
Example OSPF NSSA
Configuration Examples for OSPF
Entering the show ip ospf database datacommand displays additional information about redistribution
between Type 5 and Type 7 LSAs for routes that have been injected into the NSSA area and then flooded
through the OSPF network.
Entering the show ip ospf database nssa command also displays detailed information for Type 7 to Type 5
translations:
29
Example OSPF NSSA Area with RFC 3101 Disabled and RFC 1587 Active
Configuration Examples for OSPF
LS age: 1903
! Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 192.168.41.0 (External Network Number )
Advertising Router: 10.1.0.3
LS Seq Number: 80000015
Checksum: 0xA4CC
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 192.168.14.3
External Route Tag: 0
Router 3
Entering the show ip ospf command on Router 3 displays the information to confirm that Router 3 is acting
as an ASBR and that OSPF Area 1 has been configured to be an NSSA area:
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 is
for an OSPF NSSA area where RFC 3101 is disabled, RFC 1587 is active, and an NSSA ABR router is
configured as a forced NSSA LSA translator. As described in the "Configuring OSPF NSSA", if RFC 3101
is disabled, the forced NSSA LSA translator remains inactive. The command output demonstrates this.
30
Example OSPF NSSA Area with RFC 3101 Disabled and RFC 1587 Active
Configuration Examples for OSPF
The "Supports NSSA (compatible with RFC 1587)" line in the output indicates that RFC 1587 is active or
that the OSPF NSSA area is RFC 1587 compatible.
The "Configured to translate Type-7 LSAs, inactive (RFC3101 support disabled)" line indicates that the
OSPF NSSA area has an ABR router configured to act as a forced translator of Type 7 LSAs, but it is
inactive because RFC 3101 is disabled.
31
Examples OSPF Routing and Route Redistribution
Basic OSPF Configuration Examples
The "Unconditional NSSA translator" line indicates that the status of the NSSA ASBR router is as a forced
NSSA LSA translator.
Basic OSPF Configuration for Internal Router for ABR and ASBRs Example
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.
32
Examples OSPF Routing and Route Redistribution
Complex Internal Router with ABR and ASBRs Example
Each network arearouter configuration command is evaluated sequentially, so the order of these
commands in the configuration is important. The Cisco IOS XE software sequentially evaluates the
address/wildcard-mask pair for each interface. See the network areacommand in the Cisco IOS IP
Routing: OSPF Command Reference for more information.
Consider the first network areacommand. 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 GigabitEthernet interface 0/0/0.
GigabitEthernet interface 0/0/0 is attached to area 10.9.50.0 only.
The second network areacommand is evaluated next. For area 2, the same process is then applied to all
interfaces (except GigabitEthernet interface 0/0/0). Assume that a match is determined for interface
GigabitEthernet 1/0/0. OSPF is then enabled for that interface and GigabitEthernet interface 1/0/0 is
attached to area 2.
This process of attaching interfaces to OSPF areas continues for all network areacommands. Note that the
last network areacommand in this example is a special case. With this command, all available interfaces
(not explicitly attached to another area) are attached to area 0.
33
Examples OSPF Routing and Route Redistribution
Complex Internal Router with ABR and ASBRs Example
The following example outlines a configuration for several routers within a single OSPF autonomous
system. The figure below provides a general network map that illustrates this example configuration.
34
Examples OSPF Routing and Route Redistribution
Complex Internal Router with ABR and ASBRs Example
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.
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. Example configurations follow.
Following is the sample configuration for the general network map shown in the figure above.
Router C Configuration--ABR
Router E Configuration--ASBR
35
Examples OSPF Routing and Route Redistribution
Complex OSPF Configuration for ABR Examples
36
Examples Route Map
Complex OSPF Configuration for ABR Examples
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.
37
Examples Route Map
Complex OSPF Configuration for ABR Examples
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:
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
redistribute ospf 109 route-map 1
!
route-map 1 permit
match tag 1 2
set metric 1
!
route-map 1 permit
match tag 3
set metric 5
!
route-map 1 deny
match tag 4
!
route map 1 permit
match tag 5
set metric 5
In the following configuration, a RIP learned route for network 192.89.0.0 and an ISO-IGRP learned route
with prefix 49.0001.0002 will be redistributed into an IS-IS Level 2 LSP with a metric of 5:
router isis
38
Example Changing OSPF Administrative Distance
Complex OSPF Configuration for ABR Examples
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.
39
Example OSPF over On-Demand Routing
Complex OSPF Configuration for ABR Examples
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
Router A Configuration
40
Example LSA Group Pacing
Additional References
Router B Configuration
router ospf
timers pacing lsa-group 60
Additional References
The following sections provide references related to OSPF. To locate documentation of commands other
than OSPF commands, use the command reference master index or search online.
41
Example Ignore MOSPF LSA Packets
Additional References
Related Documents
Standards
Standard Title
No new or modified standards are supported, and --
support for existing standards has not been
modified.
MIBs
RFCs
RFC Title
RFC 1253 OSPF Version 2 Management Information Base,
August 1991.
Technical Assistance
Description Link
The Cisco Support and Documentation website http://www.cisco.com/cisco/web/support/
provides online resources to download index.html
documentation, software, and tools. Use these
42
Example Ignore MOSPF LSA Packets
Feature Information for OSPF
Description Link
resources to install and configure the software and
to troubleshoot and resolve technical issues with
Cisco products and technologies. Access to most
tools on the Cisco Support and Documentation
website requires a Cisco.com user ID and
password.
OSPF Flooding Reduction Cisco IOS XE Release 2.1 The OSPF flooding reduction
solution works by reducing
unnecessary refreshing and
flooding of already known and
unchanged information. This
feature is documented in the
following section:
OSPF Not-So-Stubby Areas Cisco IOS XE Release 2.1 OSPF NSSA is a nonproprietary
extension of the existing OSPF
stub area feature. This feature is
documented in the following
sections:
OSPF On Demand Circuit Cisco IOS XE Release 2.1 OSPF on-demand circuit is an
enhancement to the OSPF
protocol that allows efficient
43
Example Ignore MOSPF LSA Packets
OSPF Packet Pacing Cisco IOS XE Release 2.1 OSPF update packets are
automatically paced so they are
not sent less than 33 milliseconds
apart. This feature is documented
in the following section:
OSPF-Demand Circuit Disable Cisco IOS XE Release 3.2S The ignore keyword was added
to the ip ospf demand-circuit
command, allowing you to
prevent an interface from
accepting demand-circuit requests
from other routers.
OSPF Support for NSSA RFC Cisco IOS XE Release 3.3S This feature adds support for the
3101 OSPF NSSA specification
described by RFC 3101. RFC
3101 replaced RFC 1587 and is
backward compatible with RFC
1587.
The following commands were
introduced or modified: area
nssa translate , compatible
rfc1587.
Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other
countries. A listing of Cisco's trademarks can be found at www.cisco.com/go/trademarks. Third party
trademarks mentioned are the property of their respective owners. The use of the word partner does not
imply a partnership relationship between Cisco and any other company. (1005R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be
actual addresses and phone numbers. Any examples, command display output, network topology diagrams,
and other figures included in the document are shown for illustrative purposes only. Any use of actual IP
addresses or phone numbers in illustrative content is unintentional and coincidental.
44