OSPF Commands

area nssa

To configure a not-so-stubby area ( NSSA), use the area nssa command in router address family topology or router configuration mode. To remove the NSSA distinction from the area, use the no form of this command.

area area-id nssa [ no-summary ]

no area area-id nssa [ no-summary ]

Syntax Description

area-id

Identifier for the stub area or NSSA. The identifier can be specified as either a decimal value or an IP address.

no-summary

(Optional) Allows an area to be an NSSA but not have summary routes injected into it.

Command Default

No NSSA area is defined.

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE area nssa command.

The following example makes area 1 an NSSA area:


router ospf 1
 area 4294967295 nssa no-summary

area range

To consolidate and summarize routes at an area boundary, use the area range command in router configuration mode. To disable this function, use the no form of this command.

area area-id range ip-address/mask [ advertise | cost cost | not-advertise ]

no area area-id range ip-address/mask [ advertise | cost cost | not-advertise ]

Syntax Description

area-id

Identifier of the area about which routes are to be summarized. It can be specified as either a decimal value or as an IPv6 prefix.

ip-address/mask

IPv4 prefix and prefix length.

advertise

(Optional) Sets the address range status to advertise and generates a Type 3 summary link-state advertisement (LSA).

not-advertise

(Optional) Sets the address range status to DoNotAdvertise. The Type 3 summary LSA is suppressed, and the component networks remain hidden from other networks.

cost cost

(Optional) Metric or cost for this summary route, which is used during OSPF SPF calculation to determine the shortest paths to the destination. The value can be 0 to 16777215.

Command Default

This command is disabled by default.

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE area range command.

The following is an example of this command


router ospf 10
  area 4294967295 range 10.1.1.0 255.255.255.0 not-advertise
  area 4294967295 range 192.168.1.0 255.255.255.0 cost 16777214
  area 4294967295 range 172.16.5.0 255.255.255.0 advertise

auto-cost

To control how Open Shortest Path First (OSPF) calculates default metrics for the interface, use the auto-cost command in router configuration mode. To assign cost based only on the interface type, use the no form of this command.

auto-cost reference-bandwidth mbps

no auto-cost reference-bandwidth

Syntax Description

reference-bandwidth mbps

Rate in Mbps (bandwidth). The range is from 1 to 4294967; the default is 100.

Command Default

100 Mbps

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE auto-cost command.

The following example changes the cost of the FDDI link to 10, while the gigabit Ethernet link remains at a cost of 10. Thus, the link costs are differentiated.


router ospf 10
 auto-cost reference-bandwidth 100

compatible rfc1583

To restore the method used to calculate summary route costs per RFC 1583, use the compatible rfc1583 in router configuration mode. To disable RFC1583 compatibility, use the no form of this command.

compatible rfc1583

no compatible rfc1583

Syntax Description

This command has no arguments or keywords.

Command Default

Compatible with RFC 1583.

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE compatible rfc1583 command.

The following example shows how to disable the default RFC 1583 optimization for OSPFv2:


Device(config-router)# no compatible rfc1583

default-information originate (OSPF)

To generate a default external route into an Open Shortest Path First (OSPF) routing domain, use the default-information originate command in router configuration or router address family topology configuration mode. To disable this feature, use the no form of this command.

default-information originate { always metric metric-value | metric-type type-value }

no default-information originate { always metric metric-value | metric-type type-value }

Syntax Description

always

(Optional) Always advertises the default route regardless of whether the software has a default route.

Note

 

The always keyword includes the following exception when the route map is used. When a route map is used, the origination of the default route by OSPF is not bound to the existence of a default route in the routing table and the always keyword is ignored.

metric metric-value

(Optional) Metric used for generating the default route. If you omit a value and do not specify a value using the default-metric router configuration command, the default metric value is 10. The value used is specific to the protocol.

metric-type type-value

(Optional) External link type associated with the default route that is advertised into the OSPF routing domain. It can be one of the following values:

  • Type 1 external route.

  • Type 2 external route.

The default is type 2 external route.

Command Default

This command is disabled by default. No default external route is generated into the OSPF routing domain.

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE default-information originate command.

The following example specifies a metric for the default route that is redistributed into the OSPF routing domain and specifies an external metric type of 1:


router ospf 10
 default-information originate metric-type 1

distance ospf

To define Open Shortest Path First (OSPF) route administrative distances based on route type, use the distance ospf command in router address family topology or router configuration mode. To restore the default value, use the no form of this command.

distance ospf { external dist1 | inter-area dist2 | intra-area dist3 }

no distance ospf

Syntax Description

external dist1

(Optional) Sets the distance for routes from other routing domains, learned by redistribution. Range is 1 to 255. The default value is 110.

inter-area dist2

(Optional) Sets the distance for all routes from one area to another area. Range is 1 to 255. The default value is 110.

intra-area dist3

(Optional) Sets the distance for all routes within an area. Range is 1 to 255. The default value is 110.

Command Default

dist1 : 110

dist2 : 110

dist3 : 110

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE distance ospf command.

Router A Configuration


router ospf 1
 distance ospf external 110
  distance ospf inter-area 110
  distance ospf intra-area 110

max-metric router-lsa-ospf

To configure the Open Shortest Path First (OSPF) protocol to advertise a maximum metric so that other routers do not prefer the router as an intermediate hop in their shortest path first (SPF) calculations, use the max-metric router-lsa command. To disable the advertisement of a maximum metric, use the no form of this command.

max-metric router-lsa [ on-startup | seconds ]

no max-metric router-lsa [ on-startup | seconds ]

Syntax Description

on-startup

(Optional) Configures the router to advertise a maximum metric at startup.

seconds

(Optional) Maximum metric (in seconds) that is advertised for the specified time interval. The configurable range is from 5 to 86400 seconds. The default is 600 seconds.

Command Default

Originates router link-state advertisements (LSAs) with normal link metrics.

Command Modes

Router configuration mode (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

Use the max-metric router-lsa command to originate LSAs with a maximum metric (LSInfinity: 0xFFFF) through all nonstub links. This command allows Border Gateway Protocol (BGP) routing tables to converge without attracting transit traffic (if there are not alternate lower cost paths to the router). The router advertises accurate (normal) metrics after the configured or default timers expire or after BGP sends a notification that routing tables have converged.


Note


Directly connected links in a stub network are not affected by the configuration of a maximum or infinite metric because the cost of a stub link is always set to the output interface cost.


You can use the max-metric router-lsa command in the following situations:

  • Reloading a router. After a router is reloaded, Interior Gateway Protocols (IGPs) converge very quickly, and other routers may try to forward traffic through the newly reloaded router. If the router is still building BGP routing tables, the packets that are destined for other networks that the router has not learned through BGP may be dropped.

  • Introducing a router into a network without routing traffic through it. You might want to connect a router to an OSPF network but not want real traffic to flow through the router if there are better alternate paths. If no alternate paths exist, then this router would still accept transit traffic.

This command requires the LAN Base Services license.

This example shows how to configure a router that is running OSPF to advertise a maximum metric for 100 seconds:


Device(config)# router ospf 100
Device(config-router)# max-metric router-lsa on-startup 100

router-id

To use a fixed router ID, use the router-id command in router configuration mode. To force Open Shortest Path First (OSPF) to use the previous OSPF router ID behavior, use the no form of this command.

router-id ip-address

no router-id ip-address

Syntax Description

ip-address

Router ID in IP address format.

Command Default

No OSPF routing process is defined.

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE router-id command.

The following example specifies a fixed router-id:


router-id 10.1.1.1

router ospf

To configure an Open Shortest Path First (OSPF) routing process, use the router ospf command in global configuration mode. To terminate an OSPF routing process, use the no form of this command.

router ospf process-id

no router ospf process-id

Syntax Description

process-id

Internally used identification parameter for an OSPF routing process. It is locally assigned and can be any positive integer. A unique value is assigned for each OSPF routing process.

Command Default

No OSPF routing process is defined.

Command Modes

Global configuration (config)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

You can specify multiple OSPF routing processes in each router.

After you enter the router ospf command, you can enter the maximum number of paths. There can be from 1 to 32 paths.

The following example configures an OSPF routing process and assign a process number of 10:


Router(config)# router ospf 10

timers throttle spf

To turn on Open Shortest Path First ( OSPF) shortest path first (SPF) throttling, use the timers throttle spf command in the appropriate configuration mode. To turn off OSPF SPF throttling, use the no form of this command.

timers throttle spf spf-start spf-hold spf-max-wait

no timers throttle spf spf-start spf-hold spf-max-wait

Syntax Description

spf-start

Initial delay to schedule an SPF calculation after a change, in milliseconds. Range is from 1 to 600000. In OSPF for IPv6, the default value is 5000.

spf-hold

Minimum hold time between two consecutive SPF calculations, in milliseconds. Range is from 1 to 600000. In OSPF for IPv6, the default value is 10,000.

spf-max-wait

Maximum wait time between two consecutive SPF calculations, in milliseconds. Range is from 1 to 600000. In OSPF for IPv6, the default value is 10,000.

Command Default

SPF throttling is not set.

Command Modes

Router configuration (config-router)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE timers throttle spf command.

The following example shows how to configure a router with the delay, hold, and maximum interval values for the timers throttle spf command:

router ospf 1 10
  timers throttle spf 200 1000 10000