OSPFv2

Open Shortest Path First (OSPF) is a link-state routing protocol that operates within a single autonomous system. OSPF version 2 is defined by RFC 2328.

This section contains the following topics:

OSPFv2 introduction

OSPFv2 Conceptual Overview

Configuring OSPFv2

OSPFv2 Configuration Examples

OSPFv2 Commands

OSPFv2 introduction

This section contains the following topics:

Features Not Supported

The following OSPFv2 functions are not supported in the current version:

  • NBMA, demand circuit, and P2MP interfaces
  • OSPFv2 MIB support

Supported Features

Arista switches support the following OSPFv2 functions:

  • A single OSPFv2 instance
  • Intra- and inter-area routing
  • Type 1 and 2 external routing
  • Broadcast and P2P interfaces
  • Stub areas
  • Not so stubby areas (NSSA) (RFC 3101)
  • MD5 Authentication
  • Redistribution of static, IP, and BGP routes into OSPFv2 with route map filtering
  • Opaque LSAs (RFC 2370)
  • Graceful restart (RFC 3623)

OSPFv2 Conceptual Overview

This section contains the following topics:

Topology

An autonomous system (AS) is the IP domain within which a dynamic protocol controls the routing of traffic. In OSPFv2, an AS is composed of areas, which define the LSDB computation boundaries. All routers in an area store identical LSDBs. Routers in different areas exchange updates without storing the entire database, reducing information maintenance on large, dynamic networks.

An AS shares internal routing information from its areas and external routing information from other processes to inform routers outside the AS about routes the network can access. Routers that advertise routes on other ASs commit to carry data to the IP space on the route.

OSPFv2 defines these routers:

  • Internal router (IR) a router whose interfaces are contained in a single area. All IRs in an area maintain identical LSDBs.
  • Area border router (ABR)a router that has interfaces in multiple areas. ABRs maintain one LSDB for each connected area.
  • Autonomous system boundary router (ASBR)a gateway router connecting the OSPFv2 domain to external routes, including static routes and routes from other autonomous systems.

OSPFv2 Router Types displays the OSPFv2 router types.

Figure 1. OSPFv2 Router Types

OSPFv2 areas are assigned a number between 0 and 4,294,967,295 (2321). Area numbers are often expressed in dotted decimal notation, similar to IP addresses.

Each AS has a backbone area, designated as area 0, that connects to all other areas. The backbone receives routing information from all areas, then distributes it to the other areas as required.

OSPFv2 area types include:

  • Normal areaaccepts intra-area, inter-area, and external routes. The backbone is a normal area.
  • Stub areadoes not receive router advertisements external to the AS. Stub area routing is based on a default route.
  • Not-so-stubby-area (NSSA)may import external routes from an ASBR, does not receive external routes from the backbone, and does not propagate external routes to other areas.

Link Updates

Routers periodically send hello packets to advertise status and establish neighbors. A routers hello packet includes IP addresses of other routers from which it received a hello packet within the time specified by the router dead interval. Routers become neighbors when they detect each other in their hello packets if they:

  • share a common network segment.
  • are in the same area.
  • have the same hello interval, dead interval, and authentication parameters.

Neighbors form adjacencies to exchange LSDB information. A neighbor group uses hello packets to elect a Designated Router (DR) and Backup Designated Router (BDR). The DR and BDR become adjacent to all other neighbors, including each other. Only adjacent neighbors share database information.

OSPFv2 Neighbors illustrates OSPFv2 neighbors.

Figure 2. OSPFv2 Neighbors

The DR is the central contact for database exchanges. Switches send database information to their DR, which relays the information to the other neighbors. All routers in an area maintain identical LSDBs. Switches also send database information to their BDR, which stores this data without distributing it. If the DR fails, the BDR distributes LSDB information to its neighbors.

OSPFv2 routers distribute LSAs by sending them on all of their active interfaces. The router will generate an LSA for a network defined and active on a passive interface but will not transmit this LSA on the passive interface as no adjacencies are formed.

When a routers LSDB is changed by an LSA, it sends the changes to the DR and BDR for distribution to the other neighbors. Routing information is updated only when the topology changes.

Routers use Dijkstras algorithm to calculate the shortest path to all known destinations, based on cumulative route cost. The cost of an interface indicates the transmission overhead and is usually inversely proportional to its bandwidth.

Configuring OSPFv2

Configuring the OSPFv2 Instance

Entering OSPFv2 Configuration Mode

The router ospf command places the switch in router-ospf configuration mode and creates an OSPFv2 instance if one was not previously created. The switch only supports one OSPFv2 instance and all OSPFv2 configuration commands apply to this instance.

When an OSPFv2 instance is already configured, the command must specify its process ID. Any attempt to define additional instances will fail and generate errors.

The process ID is local to the router and is used to identify the running OSPFv2 process. Neighbor OSPFv2 routers can have different process ID's.

Example

This command places the switch in router-ospf configuration mode and, if not previously created, creates an OSPFv2 instance with a process ID of 100.
switch(config)#router ospf 100
switch(config-router-ospf)#

Defining the Router ID

The router ID is a 32-bit number assigned to a router running OSPFv2. This number uniquely labels the router within an Autonomous System. Status commands identify the switch through the router ID.

The switch sets the router ID to the first available alternative in the following list:

  1. The router-id command.
  2. The loopback IP address, if a loopback interface is active on the switch.
  3. The highest IP address on the router.
    Note: When configuring VXLAN on an MLAG, always manually configure the OSPFv2 router ID to prevent the switch from using the common VTEP IP address as the router ID.

The router-id (OSPFv2) command configures the router ID for an OSPFv2 instance.

Example

This command assigns 10.1.1.1 as the OSPFv2 router ID.
switch(config-router-ospf)#router-id 10.1.1.1
switch(config-router-ospf)#

Global OSPFv2 Parameters

These router-ospf configuration mode commands define OSPFv2 behavior.

LSA Overload

The max-lsa (OSPFv2) command specifies the maximum number of LSAs allowed in an LSDB database and configures the switch behavior when the limit is approached or exceeded. An LSA overload condition triggers these actions:

  • Warning: the switch logs OSPF MAXLSAWARNING if the LSDB contains a specified percentage of the LSA maximum.
  • Temporary shutdown: when the LSDB exceeds the LSA maximum, OSPFv2 is disabled and does not accept or acknowledge new LSAs. The switch re-starts OSPFv2 after a specified period (the default is five minutes).
  • Permanent shutdown: the switch permanently disables OSPFv2 after performing a specified number of temporary shutdowns (the default is five). This state usually indicates the need to resolve a network condition that consistently generates excessive LSA packets.

OSPFv2 is re-enabled with a router ospf command.

The LSDB size restriction is removed by setting the LSA limit to zero.

Note: if OSPFv2 has entered permanent shutdown, it can also be restarted by increasing the LSA limit to a value larger than the number of LSAs in the database. Setting the max-LSA value to zero will also restart OSPFv2, and will disable overload protection.

Example

  • This command configures the OSPFv2 maximum LSA count to 20,000 and triggers these actions:
    • The switch logs an OSPF MAXLSAWARNING if the LSDB has 8,000 LSAs (40% of 20,000).
    • The switch temporarily disables OSPFv2 for 10 minutes if the LSDB contains 20,000 LSAs.
    • The switch permanently disables OSPFv2 after four temporary OSPFv2 shutdowns.
    • The shutdown counter resets if the LSDB contains less than 20,000 LSAs for 20 minutes.
    switch(config-router-ospf)#max-lsa 20000 40 ignore-time 10 ignore-count 4 reset-time 20
    switch(config-router-ospf)#
Logging Adjacency Changes

The log-adjacency-changes (OSPFv2) command configures the switch to log OSPFv2 link-state changes and transitions of OSPFv2 neighbors into the up or down state.

Examples

  • This command configures the switch to log transitions of OSPFv2 neighbors into the up or down state.
    switch(config-router-ospf)#log-adjacency-changes
    switch(config-router-ospf)#
  • This command configures the switch to log all OSPFv2 link-state changes.
    switch(config-router-ospf)#log-adjacency-changes detail
    switch(config-router-ospf)#
OSPF RFC Compatibility

RFC 2328 and RFC 1583 specify different methods for calculating summary route metrics. The compatible (OSPFv2) command allows the selective disabling of compatibility with RFC 2328.

Example

This command sets the OSPF compatibility list with RFC 1583.
switch(config)#router ospf 6
switch(config-router-ospf)#compatible rfc1583
switch(config-router-ospf)#
Intra-Area Distance

The distance ospf (OSPFv2) command configures the administrative distance for routes contained in a single OSPFv2 area. Administrative distances compare dynamic routes configured by different protocols. The default administrative distance for intra-area routes is 110.

Example

This command configures an administrative distance of 95 for OSPFv2 intra-area routes.
switch(config-router-ospf)#distance ospf intra-area 95
switch(config-router-ospf)#
Passive Interfaces

The passive-interface <interface> (OSPFv2) command prevents the transmission of hello packets on the specified interface. Passive interfaces drop all adjacencies and do not form new adjacencies. Passive interfaces send LSAs but do not receive them. The router does not send or process OSPFv2 packets received on passive interfaces. The router advertises the passive interface in the router LSA.

The no passive-interface command re-enables OSPFv2 processing on the specified interface.

Examples

  • This command configures vlan 2 as a passive interface.
    switch(config-router-ospf)#passive-interface vlan 2
    switch(config-router-ospf)#
  • This command configures vlan 2 as an active interface.
    switch(config-router-ospf)#no passive-interface vlan 2
    switch(config-router-ospf)#
Redistributing Connected Routes

Redistributing connected routes causes the OSPFv2 instance to advertise all connected routes on the switch as external OSPFv2 routes. Connected routes are routes that are established when IPv4 is enabled on an interface.

Example

The redistribute (OSPFv2) connected command converts connected routes to OSPFv2 external routes.
switch(config-router-ospf)#redistribute connected
switch(config-router-ospf)#
Redistributing Static Routes

Redistributing static routes causes the OSPFv2 instance to advertise all static routes on the switch as external OSPFv2 routes. The switch does not support redistributing individual static routes.

Examples

  • The redistribute (OSPFv2) static command converts the static routes to OSPFv2 external routes.
    switch(config-router-ospf)#redistribute static
    switch(config-router-ospf)#
  • The no redistribute (OSPFv2) command stops the advertising of the static routes as OSPFv2 external routes.

    switch(config-router-ospf)#no redistribute static
    switch(config-router-ospf)#
Filtering Routes with Distribute Lists

An OSPF distribute list uses a route map or prefix list to filter specific routes from incoming OSPF LSAs; this filtering occurs after SPF calculation. The filtered routes are not installed on the switch, but are still included in LSAs sent by the switch. An OSPF router instance can have one distribute list configured.

If a prefix list is used, destination prefixes that do not match the prefix list will not be installed. If a route map is used, routes may be filtered based on address, next hop, or metric. OSPF external routes may also be filtered by metric type or tag.

The distribute-list in command specifies the filter to be used and applies it to the OSPF instance.

Example

These commands configure a prefix-list named dist_list1 in OSPF instance 5 to filter certain routes from incoming OSPF LSAs.
switch(config)#router ospf 5
switch(config-router-ospf)#distribute-list prefix-list dist_list1 in
switch(config-router-ospf)#

Configuring OSPFv2 Areas

OSPFv2 areas are configured through area commands. The switch must be in router-ospf configuration mode, as described in Entering OSPFv2 Configuration Mode, to run area commands.

Areas are assigned a 32-bit number that is expressed in decimal or dotted-decimal notation. When an OSPFv2 instance configuration contains multiple areas, the switch only configures areas associated with its interfaces.

Configuring the Area Type

The area (OSPFv2) commands specifies the area type, refer OSPFv2 Commands section for the area commands. The switch supports three area types:

  • Normal area: Area that accepts intra-area, inter-area, and external routes. The backbone area (area 0) is a normal area.
  • Stub area: Area that does not advertise external routes. External routes are reached through a default summary route (0.0.0.0). Networks with no external routes do not require stub areas.
  • NSSA (Not So Stubby Area): ASBRs advertise external LSAs directly connected to the area. External routes from other areas are not advertised and are reached through a default summary route.

The default area type is normal.

Examples

  • This command configures area 45 as a stub area.
    switch(config-router-ospf)#area 45 stub
    switch(config-router-ospf)#
  • This command configures area 10.92.148.17 as an NSSA.
    switch(config-router-ospf)#area 10.92.148.17 NSSA
    switch(config-router-ospf)#

Blocking All Summary Routes from Flooding the NSSA

The area nssa no-summary (OSPFv2)command configures the router to not import type-3 summary LSAs into the not-so-stubby area (NSSA) and injects a default summary route (0.0.0.0/0) into the NSSA to reach the inter-area prefixes.

Example

This command directs the device not to import type-3 summary LSAs into the NSSA area and injects a default summary route (0.0.0.0/0) into the NSSA area.
switch(config)#router ospf 6
switch(config-router-ospf)#area 1.1.1.1 nssa no-summary 
switch(config-router-ospf)#

Assigning Network Segments to the Area

Assigning Routes to an Area

The network area (OSPFv2) command assigns the specified network segment to an OSPFv2 area. The network can be entered in CIDR notation or by an address and wildcard mask.

The switch zeroes the host portion of the specified network address e.g. 1.2.3.4/24 converts to 1.2.3.0/24 and 1.2.3.4/16 converts to 1.2.0.0/16

Example

Each of these equivalent commands assign the network segment 10.1.10.0/24 to area 0.
switch(config-router-ospf)#network 10.1.10.0 0.0.0.255 area 0
switch(config-router-ospf)#
switch(config-router-ospf)#network 10.1.10.0/24 area 0
switch(config-router-ospf)#

In each case, running-config stores the command in CIDR (prefix) notation.

Summarizing Routes

By default, ABRs create a summary LSA for each route in an area and advertise them to adjacent routers. The area range (OSPFv2) command aggregates routing information, allowing the ABR to advertise multiple routes with one LSA. The area range (OSPFv2) command can be used to suppress route advertisements.

Examples

  • Two network area command assigns subnets to an area. The area range (OSPFv2) command summarizes the addresses, which the ABR advertises in a single LSA.
    switch(config-router-ospf)#network 10.1.25.80 0.0.0.240 area 5
    switch(config-router-ospf)#network 10.1.25.112 0.0.0.240 area 5
    switch(config-router-ospf)#area 5 range 10.1.25.64 0.0.0.192
    switch(config-router-ospf)#
  • The network area command assigns a subnet to an area, followed by an area range (OSPFv2) command that suppresses the advertisement of that subnet.
    switch(config-router-ospf)#network 10.12.31.0 0.0.0.255 area 5
    switch(config-router-ospf)#area 5 range 10.12.31.0 0.0.0.255 not-advertise
    switch(config-router-ospf)#

Configuring Area Parameters

These router-ospf configuration mode commands define OSPFv2 behavior in a specified area.

Default Summary Route Cost

The area default-cost (OSPFv2) command specifies the cost of the default summary route that ABRs send into a stub area or NSSA. Summary routes, also called inter-area routes, originate in areas different than their destination.

Example

This command configures a cost of 15 for the default summary route in area 23.
switch(config-router-ospf)#area 23 default-cost 15
switch(config-router-ospf)#
Filtering Type 3 LSAs

The area filter (OSPFv2) command prevents an area from receiving Type 3 (Summary) LSAs from a specified subnet. Type 3 LSAs are sent by ABRs and contain information about one of its connected areas.

Example

This command prevents the switch from entering Type 3 LSAs originating from the 10.1.1.2/24 subnet into its area 2 LSDB.
switch(config-router-ospf)#area 2 filter 10.1.1.2/24
switch(config-router-ospf)#

Configuring Interfaces for OSPFv2

OSPFv2 interface configuration commands specify transmission parameters for routed ports and SVIs that handle OSPFv2 packets.

Configuring Authentication

OSPFv2 authenticates packets through passwords configured on vlan interfaces. Interfaces connecting to the same area can authenticate packets if they have the same key. By default, OSPFv2 does not authenticate packets.

OSPFv2 supports simple password and message digest authentication:

  • Simple password authentication: A password is assigned to an area. Interfaces connected to the area can authenticate packets by enabling authentication and specifying the area password.
  • Message digest authentication: Each interface is configured with a key (password) and key-id pair. When transmitting a packet, the interface generates a string, using the MD5 algorithm, based on the OSPFv2 packet, key, and key ID, then appends that string to the packet.

Message digest authentication supports uninterrupted transmissions during key changes by allowing each interface to have two keys with different key IDs. When a new key is configured on an interface, the router transmits OSPFv2 packets for both keys. Once the router detects that all neighbors are using the new key, it stops sending the old one.

Implementing authentication on an interface is a two step process:

  1. Enabling authentication.
  2. Configuring a key (password).

To configure simple authentication on a vlan interface:

  1. Enable simple authentication with the ip ospf authentication command.
    switch(config-if-vl12)#ip ospf authentication
  2. Configure the password with the ip ospf authentication-key command.
    switch(config-if-vl12)#ip ospf authentication-key 0 code123
The running-config stores the password as an encrypted string, using a proprietary algorithm.To configure Message-Digest authentication on a vlan interface:
  1. Enable Message-Digest authentication with the ip ospf authentication command.
    switch(config-if-vl12)#ip ospf authentication message-digest
  2. Configure the key ID and password with the ip ospf message-digest-key command.
    switch(config-if-vl12)#ip ospf message-digest-key 23 md5 0 code123

    The running-config stores the password as an encrypted string, using a proprietary algorithm. The key ID (23) is between keywords message-digest-key and md5.

Configuring Intervals

Interval configuration commands determine OSPFv2 packet transmission characteristics for the specified vlan interface and are entered in interface-vlan configuration mode.

Hello Interval

The hello interval specifies the period between consecutive hello packet transmissions from an interface. Each OSPFv2 neighbor should specify the same hello interval, which should not be longer than any neighbors dead interval.

The ip ospf hello-interval command configures the hello interval for the configuration mode interface. The default is 10 seconds.

Example

This command configures a hello interval of 30 seconds for vlan 2.
switch(config-if-Vl2)#ip ospf hello-interval 30
switch(config-if-Vl2)#
Dead Interval

The dead interval specifies the period that an interface waits for an OSPFv2 packet from a neighbor before it disables the adjacency under the assumption that the neighbor is down. The dead interval should be configured identically on all OSPFv2 neighbors and be longer than the hello interval of any neighbor.

The ip ospf dead-interval command configures the dead interval for the configuration mode interface. The default is 40 seconds.

Example

This command configures a dead interval of 120 seconds for vlan 4.
switch(config-if-Vl4)#ip ospf dead-interval 120
switch(config-if-Vl4)#
Retransmit Interval

Routers that send OSPFv2 advertisements to an adjacent router expect to receive an acknowledgment from that neighbor. Routers that do not receive an acknowledgment will retransmit the advertisement. The retransmit interval specifies the period between retransmissions.

The ip ospf retransmit-interval command configures the LSA retransmission interval for the configuration mode interface. The default retransmit interval is 5 seconds.

Example

This command configures a retransmit interval of 15 seconds for vlan 3.
switch(config-if-Vl3)#ip ospf retransmit-interval 15
switch(config-if-Vl3)#
Transmission Delay

The transmission delay is an estimate of the time that an interface requires to transmit a link-state update packet. OSPFv2 adds this delay to the age of outbound packets to more accurately reflect the age of the LSA when received by a neighbor. The default transmission delay is one second.

The ip ospf transmit-delay command configures the transmission delay for the configuration mode interface.

Example

This command configures a transmission delay of 5 seconds for vlan 6.
switch(config-if-Vl6)#ip ospf transmit-delay 5
switch(config-if-Vl6)#

Configuring Interface Parameters

Interface Cost

The OSPFv2 interface cost (or metric) reflects the overhead of sending packets across the interface. The cost is typically inversely proportional to the bandwidth of the interface. The default cost is 10.

The ip ospf cost command configures the OSPFv2 cost for the configuration mode interface.

Example

This command configures a cost of 15 for vlan 2.
switch(config-if-Vl2)#ip ospf cost 15
switch(config-if-Vl2)#
Router Priority

Router priority determines preference during designated router (DR) and backup designated router (BDR) elections. Routers with higher priority numbers have preference over other routers. Routers with a priority of zero cannot be elected as a DR or BDR.

The ip ospf priority command configures router priority for the configuration mode interface. The default priority is 1.

Examples

  • This command configures a router priority of 15 for vlan 8.
    switch(config-if-Vl8)#ip ospf priority 15
    switch(config-if-Vl8)#
  • This command restores the router priority of 1 for vlan 7.

    switch(config-if-Vl7)#no ip ospf priority
    switch(config-if-Vl7)#

Enabling OSPFv2

Disabling OSPFv2

The switch can disable OSPFv2 operations without disrupting the OSPFv2 configuration.

The no shutdown and no ip ospf disabled commands resume OSPFv2 activity.

Examples

  • This command disables OSPFv2 activity on the switch.
    switch(config-router-ospf)#shutdown
    switch(config-router-ospf)#
  • This command resumes OSPFv2 activity on the switch.
    switch(config-router-ospf)#no shutdown
    switch(config-router-ospf)#
  • This command disables OSPFv2 activity on vlan 5.
    switch(config-if-Vl5)#ip ospf disabled
    switch(config-if-Vl5)#

IPv4 Routing

OSPFv2 requires that IPv4 routing is enabled on the switch. When IP routing is not enabled, entering OSPFv2 configuration mode generates a message.

Examples

  • This message is displayed if, when entering router-ospf configuration mode, IP routing is not enabled.

    switch(config)#router ospf 100
    ! IP routing not enabled
    switch(config-router-ospf)#
  • This command enables IP routing on the switch.
    switch(config)#ip routing
    switch(config)#

Displaying OSPFv2 Status

This section describes OSPFv2 show commands that display OSPFv2 status. General switch methods that provide OSPFv2 information include pinging routes, viewing route status (show ip route command), and viewing the configuration (show running-config command).

OSPFv2 Summary

The show ip ospf command displays general OSPFv2 configuration information and operational statistics.

Example

  • This command displays general OSPFv2 information.
    switch#show ip ospf
    Routing Process "ospf 1" with ID 10.168.103.1
    Supports opaque LSA
    Maximum number of LSA allowed 12000
    Threshold for warning message 75%
    Ignore-time 5 minutes, reset-time 5 minutes
    Ignore-count allowed 5, current 0
    It is an area border router
    Hold time between two consecutive SPFs 5000 msecs
    SPF algorithm last executed 00:00:09 ago
    Minimum LSA interval 5 secs
    Minimum LSA arrival 1000 msecs
    Number of external LSA 0. Checksum Sum 0x000000
    Number of opaque AS LSA 0. Checksum Sum 0x000000
    Number of LSA 27.
    Number of areas in this router is 3. 3 normal 0 stub 0 nssa
    Area BACKBONE(0.0.0.0)
    Number of interfaces in this area is 2
    It is a normal area
    Area has no authentication
    SPF algorithm executed 153 times
    Number of LSA 8. Checksum Sum 0x03e13a
    Number of opaque link LSA 0. Checksum Sum 0x000000
    Area 0.0.0.2
    Number of interfaces in this area is 1
    It is a normal area
    Area has no authentication
    SPF algorithm executed 153 times
    Number of LSA 11. Checksum Sum 0x054e57
    Number of opaque link LSA 0. Checksum Sum 0x000000
    Area 0.0.0.3
    Number of interfaces in this area is 1
    It is a normal area
    Area has no authentication
    SPF algorithm executed 5 times
    Number of LSA 6. Checksum Sum 0x02a401
    Number of opaque link LSA 0. Checksum Sum 0x000000
    

The output lists configuration parameters and operational statistics and status for the OSPFv2 instance, followed by a brief description of the areas located on the switch.

Viewing OSPFv2 on the Interfaces

The show ip ospf interface command displays OSPFv2 information for switch interfaces configured for OSPFv2. Different command options allow the display of either all interfaces or a specified interface. The command can also be configured to display complete information or a brief summary.

Examples

  • This command displays complete OSPFv2 information for vlan 1.
    switch#show ip ospf interface vlan 1
    vlan1 is up, line protocol is up (connected)
    Internet Address 10.168.0.1/24, Area 0.0.0.0
    Process ID 1, Router ID 10.168.103.1, Network Type BROADCAST, Cost: 10
    Transmit Delay is 1 sec, State BDR, Priority 1
    Designated Router is 10.168.104.2
    Backup Designated router is 10.168.103.1
    Timer intervals configured, Hello 10, Dead 40, Retransmit 5
    Neighbor Count is 1
    MTU is 1500
    switch#

The display indicates the switch is an ABR by displaying a neighbor count, the Designated Router, and Backup Designated Router.

  • This command displays a summary of interface information for the switch.
    switch#show ip ospf interface brief
    InterfacePIDAreaIP AddressCostStateNbrs
    Loopback010.0.0.010.168.103.1/2410DR0
    vlan110.0.0.010.168.0.1/2410BDR1
    vlan210.0.0.210.168.2.1/2410BDR1
    vlan310.0.0.310.168.3.1/2410DR0
    switch#

Configuration information includes the Process ID (PID), area, IP address, and cost. OSPFv2 operational information includes the Designated Router status and number of neighbors.

Viewing the OSPFv2 Database

The show ip ospf database <link state list> command displays the LSAs in the LSDB for the specified area. If no area is listed, the command displays the contents of the database for each area on the switch. The database command provides options to display subsets of the LSDB database, a summary of database contents, and the link states that comprise the database.

Examples

  • This command displays LSDB contents for area 2.
    switch#show ip ospf 1 2 database
    
    OSPF Router with ID(10.168.103.1)(Process ID 1)
    
    Router Link States (Area 0.0.0.2)
    
    Link IDADV RouterAgeSeq#Checksum Link count
    10.168.103.110.168.103.100:29:080x80000031 0x001D5F 1
    10.168.104.210.168.104.200:29:090x80000066 0x00A49B 1
    
    Net Link States (Area 0.0.0.2)
    
    Link IDADV RouterAgeSeq#Checksum
    10.168.2.110.168.103.100:29:080x80000001 0x00B89D
    
    Summary Net Link States (Area 0.0.0.2)
    
    Link IDADV RouterAgeSeq#Checksum
    10.168.0.010.168.103.100:13:200x80000028 0x0008C8
    10.168.0.010.168.104.200:09:160x80000054 0x00A2FF
    10.168.3.010.168.104.200:24:160x80000004 0x00865F
    10.168.3.010.168.103.100:24:200x80000004 0x002FC2
    10.168.103.010.168.103.100:14:200x80000028 0x0096D2
    10.168.103.010.168.104.200:13:160x80000004 0x00364B
    10.168.104.010.168.104.200:08:160x80000055 0x002415
    10.168.104.010.168.103.100:13:200x80000028 0x00EF6E
    switch#
  • This command displays an LSDB content summary for area 2.
    switch#show ip ospf 1 2 database database-summary
    
    OSPF Router with ID(10.168.103.1) (Process ID 1)
    
    Area 0.0.0.2 database summary
    LSA TypeCount
    Router2
    Network1
    Summary Net8
    Summary ASBR0
    Type-7 Ext0
    Opaque Area0
    Subtotal11
    
    Process 1 database summary
    LSA TypeCount
    Router2
    Network1
    Summary Net8
    Summary ASBR0
    Type-7 Ext0
    Opaque Area0
    Type-5 Ext0
    Opaque AS0
    Total11
    switch#
  • This command displays the router Link States contained in the area 2 LSDB.
    switch#show ip ospf 1 2 database router
    
    OSPF Router with ID(10.168.103.1) (Process ID 1)
    
    Router Link States (Area 0.0.0.2)
    
    LS age: 00:02:16
    Options: (E DC)
    LS Type: Router Links
    Link State ID: 10.168.103.1
    Advertising Router: 10.168.103.1
    LS Seq Number: 80000032
    Checksum: 0x1B60
    Length: 36
    Number of Links: 1
    
    Link connected to: a Transit Network
    (Link ID) Designated Router address: 10.168.2.1
    (Link Data) Router Interface address: 10.168.2.1
    Number of TOS metrics: 0
    TOS 0 Metrics: 10
    
    
    LS age: 00:02:12
    Options: (E DC)
    LS Type: Router Links
    Link State ID: 10.168.104.2
    Advertising Router: 10.168.104.2
    LS Seq Number: 80000067
    Checksum: 0xA29C
    Length: 36
    Number of Links: 1
    
    Link connected to: a Transit Network
    (Link ID) Designated Router address: 10.168.2.1
    (Link Data) Router Interface address: 10.168.2.2
    Number of TOS metrics: 0
    TOS 0 Metrics: 10
    switch#

Viewing OSPFv2 Neighbors

The show ip ospf neighbor command displays information about the routers that are neighbors to the switch. Command options allow the display of summary or detailed information about the neighbors for all areas and interfaces on the switch. The command also allows the display of neighbors for individual interfaces or areas. The adjacency-changes option displays the interfaces adjacency changes.

Examples

  • This command displays the switchs neighbors.
    switch#show ip ospf neighbor
    Neighbor IDPriStateDead TimeAddressInterface
    10.168.104.21FULL/DR00:00:3510.168.0.2vlan1
    10.168.104.28FULL/BDR00:00:3110.168.2.2vlan2
    switch#
  • This command displays details about the neighbors to vlan 2.
    switch#show ip ospf neighbor vlan 2 detail
     Neighbor 10.168.104.2, interface address 10.168.2.2
    In the area 0.0.0.2 via interface vlan2
    Neighbor priority is 8, State is FULL, 13 state changes
    Adjacency was established 000:01:25:48 ago
    DR is 10.168.2.1 BDR is 10.168.2.2
    Options is E
    Dead timer due in 00:00:34
    switch#
  • This command displays the adjacency changes to vlan 2.
    switch#show ip ospf neighbor vlan 2 adjacency-changes
    [08-04 08:55:32] 10.168.104.2, interface vlan2 adjacency established
    [08-04 09:58:51] 10.168.104.2, interface vlan2 adjacency dropped: interface went 
    down
    [08-04 09:58:58] 10.168.104.2, interface vlan2 adjacency established
    [08-04 09:59:34] 10.168.104.2, interface vlan2 adjacency dropped: interface went 
    down
    [08-04 09:59:42] 10.168.104.2, interface vlan2 adjacency established
    [08-04 10:01:40] 10.168.104.2, interface vlan2 adjacency dropped: nbr did not 
    list our router ID
    [08-04 10:01:46] 10.168.104.2, interface vlan2 adjacency established
    switch#

The show ip ospf neighbor state command displays the state information for OSPF neighbors on a per-interface basis.

Example

This command displays OSPF information for neighboring routers that are fully adjacent.
switch#show ip ospf neighbor state full
Neighbor ID VRFPri StateDead Time Address Interface
Test1 default1 FULL/BDR 00:00:3510.17.254.105vlan3912
Test2 default1 FULL/BDR 00:00:3610.17.254.29 vlan3910
Test3 default1 FULL/DR 00:00:35 10.25.0.1vlan101
Test4 default1 FULL/DROTHER 00:00:3610.17.254.67 vlan3908
Test5 default1 FULL/DROTHER 00:00:3610.17.254.68 vlan3908
Test6 default1 FULL/BDR 00:00:3210.17.254.66 vlan3908
Test7 default1 FULL/DROTHER 00:00:3410.17.36.4 vlan3036
Test8 default1 FULL/BDR 00:00:3510.17.36.3 vlan3036
Test9 default1 FULL/DROTHER 00:00:3110.17.254.13 vlan3902
Test10default1 FULL/BDR 00:00:3710.17.254.11 vlan3902
Test11default1 FULL/DROTHER 00:00:3310.17.254.163vlan3925
Test12default1 FULL/DR00:00:3710.17.254.161vlan3925
Test13default1 FULL/DROTHER 00:00:3110.17.254.154vlan3923
Test14default1 FULL/BDR 00:00:3910.17.254.156vlan3923
Test15default1 FULL/DROTHER 00:00:3310.17.254.35 vlan3911
Test16default1 FULL/DR00:00:3410.17.254.33 vlan3911
Test17 default1 FULL/DR00:00:3610.17.254.138Ethernet12
Test18default1 FULL/DR00:00:3710.17.254.2vlan3901
switch>

The show ip ospf neighbor summary command displays a single line of summary information for each OSPFv2 neighbor.

Example

This command displays the summary information for the OSPFv2 neighbors.
switch#show ip ospf neighbor summary
OSPF Router with (Process ID 1) (VRF default)
0 neighbors are in state DOWN
0 neighbors are in state GRACEFUL RESTART
2 neighbors are in state INIT
0 neighbors are in state LOADING
0 neighbors are in state ATTEMPT
18 neighbors are in state FULL
0 neighbors are in state EXCHANGE
0 neighbors are in state 2 WAYS
0 neighbors are in state EXCH START
switch>

Viewing OSPFv2 Routes

The show ip routes command provides an OSPFv2 option.

Examples

  • This command displays all of a switchs routes.
    switch#show ip route
    Codes: C - connected, S - static, K - kernel, O - OSPF, B - BGP
    
    Gateway of last resort:
    S0.0.0.0/0 [1/0] via 10.255.255.1
    
    C10.255.255.0/24 is directly connected, Management1
    C10.168.0.0/24 is directly connected, vlan1
    C10.168.2.0/24 is directly connected, vlan2
    O10.168.3.0/24 [110/20] via 10.168.0.1
    O10.168.103.0/24 [110/20] via 10.168.0.1
    C10.168.104.0/24 is directly connected, Loopback0
    switch#
  • This command displays the switchs OSPFv2 routes.
    switch#show ip route ospf
    Codes: C - connected, S - static, K - kernel, O - OSPF, B - BGP
    
    O10.168.3.0/24 [110/20] via 10.168.0.1
    O10.168.103.0/24 [110/20] via 10.168.0.1
    switch#

Use the ping command to determine the accessibility of a route.

Example

This command pings an OSPFv2 route.
switch#ping 10.168.0.1
PING 10.168.0.1 (10.168.0.1) 72(100) bytes of data.
80 bytes from 10.168.0.1: icmp_seq=1 ttl=64 time=0.148 ms
80 bytes from 10.168.0.1: icmp_seq=2 ttl=64 time=0.132 ms
80 bytes from 10.168.0.1: icmp_seq=3 ttl=64 time=0.136 ms
80 bytes from 10.168.0.1: icmp_seq=4 ttl=64 time=0.137 ms
80 bytes from 10.168.0.1: icmp_seq=5 ttl=64 time=0.136 ms

--- 10.168.0.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 7999ms
rtt min/avg/max/mdev = 0.132/0.137/0.148/0.015 ms
switch#

Viewing OSPFv2 SPF Logs

The show ip ospf spf-log command displays when and how long the switch took to run a full SPF calculation for OSPF.

Example

This command displays the SPF information for OSPF.
switch#show ip ospf spf-log
OSPF Process 172.26.0.22
WhenDuration(msec)
13:01:341.482
13:01:291.547
13:01:241.893
13:00:501.459
13:00:451.473
13:00:402.603
11:01:491.561
11:01:401.463
11:01:351.467
11:01:301.434
11:00:541.456
11:00:491.472
11:00:441.582
15:01:491.575
15:01:441.470
15:01:391.679
15:01:341.601
15:00:571.454
15:00:521.446
15:00:471.603
switch>

OSPFv2 Configuration Examples

This section describes the commands required to configure three OSPFv2 topologies.

OSPFv2 Configuration Example 1

The OSPF Autonomous System in example 1 contains two areas that are connected through two routers. The backbone area also contains an internal router that connects two subnets.

Example 1 Topology

OSPFv2 Example 1 displays the Example 1 topology. Two ABRs connect area 0 and area 1 Router A and Router B. Router C is an internal router that connects two subnets in area 0.

Figure 3. OSPFv2 Example 1
Area 1 Configuration

Area 1 contains one subnet that is accessed by Router A and Router B.

  • Router A: The subnet 10.10.1.0/24 is accessed through vlan 1.
  • Router B: The subnet 10.10.1.0/24 is accessed through vlan 1.
  • Each router uses simple authentication, with password abcdefgh.
  • Designated Router (DR): Router A.
  • Backup Designated Router (BDR): Router B.
  • Each router defines an interface cost of 10.
  • Router priority is not specified for either router on area 1.
Area 0 ABR Configuration

Area 0 contains one subnet that is accessed by ABRs Router A and Router B.

  • Router A: The subnet 10.10.2.0/24 is accessed through vlan 2.
  • Router B: The subnet 10.10.2.0/24 is accessed through vlan 2.
  • Designated Router (DR): Router B.
  • Backup Designated Router (BDR): Router A.
  • Each router uses simple authentication, with password ijklmnop.
  • Each router defines an interface cost of 20.
  • Each router defines a retransmit-interval of 10.
  • Each router defines a transmit-delay of 2.
  • Router priority is specified such that Router B will be elected as the Designated Router.
Area 0 IR Configuration

Area 0 contains one internal router that connects two subnets.

  • Router C: The subnet 10.10.2.0/24 is accessed through vlan 2.
  • Router C: The subnet 10.10.3.0/24 is accessed through vlan 3.
  • The subnet 10.10.2.0/24 link is configured as follows:

    • Interface cost of 20.
    • Retransmit-interval of 10.
    • Transmit-delay of 2.
  • The subnet 10.10.3.0/24 link is configured as follows:

    • Interface cost of 20.
    • Dead interval of 80 seconds.

Example 1 Code

This code configures the OSPFv2 instances on the three switches.

  1. Configure the interface addresses.
    1. Router A interfaces:

      switch-A(config)#interface vlan 1
      switch-A(config-if-vl1)#ip address 10.10.1.1/24
      switch-A(config-if-vl1)#interface vlan 2
      switch-A(config-if-vl2)#ip address 10.10.2.1/24
    2. Router B interfaces:

      switch-B(config)#interface vlan 1
      switch-B(config-if-vl1)#ip address 10.10.1.2/24
      switch-B(config-if-vl1)#interface vlan 2
      switch-B(config-if-vl2)#ip address 10.10.2.2/24
    3. Router C interfaces:

      switch-C(config)#interface vlan 2
      switch-C(config-if-vl2)#ip address 10.10.2.3/24
      switch-C(config-if-vl2)#interface vlan 3
      switch-C(config-if-vl3)#ip address 10.10.3.3/24
  2. Configure the interface OSPFv2 parameters.
    1. Router A interfaces:

      switch-A(config-if-vl2)#interface vlan 1
      switch-A(config-if-vl1)#ip ospf authentication-key abcdefgh
      switch-A(config-if-vl1)#ip ospf cost 10
      switch-A(config-if-vl1)#ip ospf priority 6
      switch-A(config-if-vl1)#interface vlan 2
      switch-A(config-if-vl2)#ip ospf authentication-key ijklmnop
      switch-A(config-if-vl2)#ip ospf cost 20
      switch-A(config-if-vl2)#ip ospf retransmit-interval 10
      switch-A(config-if-vl2)#ip ospf transmit-delay 2
      switch-A(config-if-vl2)#ip ospf priority 4
    2. Router B interfaces:

      switch-B(config-if-vl2)#interface vlan 1
      switch-B(config-if-vl1)#ip ospf authentication-key abcdefgh
      switch-B(config-if-vl1)#ip ospf cost 10
      switch-B(config-if-vl1)#ip ospf priority 4
      switch-B(config-if-vl1)#interface vlan 2
      switch-B(config-if-vl2)#ip ospf authentication-key ijklmnop
      switch-B(config-if-vl2)#ip ospf cost 20
      switch-B(config-if-vl2)#ip ospf retransmit-interval 10
      switch-B(config-if-vl2)#ip ospf transmit-delay 2
      switch-B(config-if-vl2)#ip ospf priority 6
    3. Router C interfaces:

      switch-C(config-if-vl3)#interface vlan 2
      switch-C(config-if-vl2)#ip ospf cost 20
      switch-C(config-if-vl2)#ip ospf retransmit-interval 10
      switch-C(config-if-vl2)#ip ospf transmit-delay 2
      switch-C(config-if-vl2)#interface vlan 3
      switch-C(config-if-vl3)#ip ospf cost 20
      switch-C(config-if-vl3)#ip ospf dead-interval 80
  3. Attach the network segments to the areas.
    1. Router A interfaces:

      switch-A(config-if-vl2)#router ospf 1
      switch-A(config-router-ospf)#router-id 169.10.0.1
      switch-A(config-router-ospf)#network 10.10.1.0/24 area 1
      switch-A(config-router-ospf)#network 10.10.2.0/24 area 0
    2. Router B interfaces:

      switch-B(config-if-vl2)#router ospf 1
      switch-B(config-router-ospf)#router-id 169.10.0.2
      switch-B(config-router-ospf)#network 10.10.1.0/24 area 1
      switch-B(config-router-ospf)#network 10.10.2.0/24 area 0
      
    3. Router C interfaces:

      switch-C(config-if-vl3)#router ospf 1
      switch-C(config-router-ospf)#router-id 169.10.0.3
      switch-C(config-router-ospf)#network 10.10.2.0/24 area 0
      switch-C(config-router-ospf)#network 10.10.3.0/24 area 0

OSPFv2 Configuration Example 2

The AS in example 2 contains three areas. Area 0 connects to the other areas through different routers. The backbone area contains an internal router that connects two subnets. Area 0 is normal; the other areas are stub areas.

Example 2 Topology

OSPFv2 Example 2 displays the Example 2 topology. One ABR (Router B) connects area 0 and area 10.42.110.0; another ABR (router C) connects area 0 and area 36.56.0.0. Router A is an internal router that connects two subnets in area 0.

Figure 4. OSPFv2 Example 2
Area 10.42.110.0 Configuration

Area 10.42.110.0 contains one subnet that is accessed by Router B.

  • Router B: The subnet 10.42.110.0 is accessed through vlan 15.
  • Router B uses simple authentication, with password abcdefgh.
  • Each router defines a interface cost of 10.
Area 10.56.0.0 Configuration

Area 10.56.0.0 contains one subnet that is accessed by Router C.

  • Router C: The subnet 10.56.0.0 is accessed through vlan 21.
  • Router C uses simple authentication, with password ijklmnop.
  • Each router defines a interface cost of 20.
Area 0 ABR Configuration

Area 0 contains two subnets. ABR Router B connects one subnet to area 10.42.110.0. ABR Router C connects the other subnet to area 10.56.0.0.

  • Router B: The subnet 10.119.254.0/24 is accessed through vlan 16.
  • Router C: The subnet 10.119.251.0/24 is accessed through vlan 20.
  • Designated Router (DR): Router B.
  • Backup Designated Router (BDR): Router C.
  • Each ABR uses simple authentication, with password ijklmnop
  • Each router defines an interface cost of 20.
  • Each router defines a retransmit-interval of 10.
  • Each router defines a transmit-delay of 2.
Area 0 IR Configuration

Area 0 contains two subnets connected by an internal router.

  • Router A: The subnet 10.119.254.0/24 is accessed through vlan 16.
  • Router A: The subnet 10.119.251.0/24 is accessed through vlan 20.
  • The subnet 10.42.110.0 is configured as follows:

    • Interface cost of 10.
  • The subnet 10.56.0.0/24 is configured as follows:

    • Interface cost of 20.
    • Retransmit-interval of 10.
    • Transmit-delay of 2.

Example 2 Code

  1. Configure the interface addresses.
    1. Router A interfaces:

      switch-A(config)#interface vlan 16
      switch-A(config-if-vl16)#ip address 10.119.254.2/24
      switch-A(config-if-vl16)#interface vlan 20
      switch-A(config-if-vl20)#ip address 10.119.251.1/24
    2. Router B interfaces:

      switch-B(config)#interface vlan 15
      switch-B(config-if-vl15)#ip address 10.42.110.1/24
      switch-B(config-if-vl15)#interface vlan 16
      switch-B(config-if-vl16)#ip address 10.119.254.1/24
    3. Router C interfaces:

      switch-C(config)#interface vlan 20
      switch-C(config-if-vl20)#ip address 10.119.251.2/24
      switch-C(config-if-vl20)#interface vlan 21
      switch-C(config-if-vl21)#ip address 10.56.0.1/24
  2. Configure the interface OSPFv2 parameters.
    1. Router A interfaces:

      switch-A(config-if-vl20)#interface vlan 16
      switch-A(config-if-vl16)#ip ospf cost 10
      switch-A(config-if-vl16)#interface vlan 20
      switch-A(config-if-vl20)#ip ospf cost 20
      switch-A(config-if-vl20)#ip ospf retransmit-interval 10
      switch-A(config-if-vl20)#ip ospf transmit-delay 2
    2. Router B interfaces:

      switch-B(config-if-vl16)#interface vlan 15
      switch-B(config-if-vl15)#ip ospf authentication-key abcdefgh
      switch-B(config-if-vl15)#ip ospf cost 10
      switch-B(config-if-vl15)#interface vlan 16
      switch-B(config-if-vl16)#ip ospf authentication-key ijklmnop
      switch-B(config-if-vl16)#ip ospf cost 20
      switch-B(config-if-vl16)#ip ospf retransmit-interval 10
      switch-B(config-if-vl16)#ip ospf transmit-delay 2
      switch-B(config-if-vl16)#ip ospf priority 6
    3. Router C interfaces:

      switch-C(config-if-vl21)#interface vlan 20
      switch-C(config-if-vl20)#ip ospf authentication-key ijklmnop
      switch-C(config-if-vl20)#ip ospf cost 20
      switch-C(config-if-vl20)#ip ospf retransmit-interval 10
      switch-C(config-if-vl20)#ip ospf transmit-delay 2
      switch-C(config-if-vl20)#ip ospf priority 4
      switch-C(config-if-vl20)#interface vlan 21
      switch-C(config-if-vl21)#ip ospf authentication-key ijklmnop
      switch-C(config-if-vl21)#ip ospf cost 20
      switch-C(config-if-vl21)#ip ospf dead-interval 80
  3. Attach the network segments to the areas.
    1. Router A interfaces:

      switch-A(config-if-vl20)#router ospf 1
      switch-A(config-router-ospf)#router-id 10.24.1.1
      switch-A(config-router-ospf)#network 10.119.254.0/24 area 0
      switch-A(config-router-ospf)#network 10.119.251.0/24 area 0
      switch-A(config-router-ospf)#area 0 range 10.119.251.0 0.0.7.255
    2. Router B interfaces:

      switch-B(config-if-vl16)#router ospf 1
      switch-B(config-router-ospf)#router-id 10.24.1.2
      switch-B(config-router-ospf)#area 10.42.110.0 stub
      switch-B(config-router-ospf)#network 10.42.110.0/24 area 10.42.110.0
      switch-B(config-router-ospf)#network 10.119.254.0/24 area 0
    3. Router C interfaces:

      switch-C(config-if-vl21)#router ospf 1
      switch-C(config-router-ospf)#router-id 10.24.1.3
      switch-C(config-router-ospf)#area 10.56.0.0 stub 0
      switch-C(config-router-ospf)#network 10.119.251.0/24 area 0
      switch-C(config-router-ospf)#network 10.56.0.0/24 area 36.56.0.0

OSPFv2 Configuration Example 3

The AS in example 3 contains two areas that connect through one ABR.

  • Area 0: Backbone area contains two internal routers that connect three subnets, one ASBR, and one ABR that connects to Area 1.
  • Area 1: NSSA contains one internal router, one ASBR, and one ABR that connects to the backbone.

Example 3 Topology

OSPFv2 Example 3 displays the Example 3 topology. One ABR connects area 0 and area 1. Router C is an ABR that connects the areas. Router A is an internal router that connects two subnets in area 1. Router D and Router E are internal routers that connect subnets in area 0. Router B and Router F are ASBRs that connect static routes outside the AS to area 1 and area 0, respectively.

Figure 5. OSPFv2 Example 3
Area 0 ABR Configuration

ABR Router C connects one area 0 subnet to an area 1 subnet.

  • Router C: The subnet 10.10.2.0/24 is accessed through vlan 11.
  • Authentication is not configured on the interfaces.
  • All interface OSPFv2 parameters are set to their default values.
Area 0 IR Configuration

Area 0 contains two internal routers, each of which connects two of the three subnets in the area.

  • Router D: The subnet 10.10.2.0/24 is accessed through vlan 11.
  • Router D: The subnet 10.10.3.0/24 is accessed through vlan 12.
  • Router E: The subnet 10.10.3.0/24 is accessed through vlan 12.
  • Router E: The subnet 10.10.4.0/24 is accessed through vlan 13.
  • All interface OSPFv2 parameters are set to their default values.
Area 0 ASBR Configuration

ASBR Router F connects one area 0 subnet to an external subnet.

  • Router F: The subnet 10.10.4.0/24 is accessed through vlan 13.
  • Router F: The subnet 12.15.1.0/24 is accessed through vlan 14.
  • All interface OSPFv2 parameters are set to their default values.
Area 1 ABR Configuration

ABR Router C connects one area 0 subnet to area 1.

  • Router C: The subnet 10.10.1.0/24 is accessed through vlan 10.
  • Authentication is not configured on the interface.
  • All interface OSPFv2 parameters are set to their default values.
Area 1 IR Configuration

Area 1 contains one internal router that connects two subnets in the area.

  • Router A: The subnet 10.10.1.0/24 is accessed through vlan 10.
  • Router A: The subnet 10.10.5.0/24 is accessed through vlan 9.
  • All interface OSPFv2 parameters are set to their default values.
Area 1 ASBR Configuration

ASBR Router B connects one area 1 subnet to an external subnet.

  • Router B: The subnet 10.10.1.0/24 is accessed through vlan 10.
  • Router B: The subnet 16.29.1.0/24 is accessed through vlan 15.
  • All interface OSPFv2 parameters are set to their default values.

Example 3 Code

  1. Configure the interfaces.
    1. Router A interfaces:

      switch-A(config)#interface vlan 10
      switch-A(config-if-vl10)#ip address 10.10.1.1/24
      switch-A(config-if-vl10)#interface vlan 9
      switch-A(config-if-vl11)#ip address 10.10.5.1/24
    2. Router B interfaces:

      switch-B(config)#interface vlan 10
      switch-B(config-if-vl10)#ip address 10.10.1.2/24
      switch-B(config-if-vl10)#interface vlan 15
      switch-B(config-if-vl18)#ip address 16.29.1.1/24
    3. Router C interfaces:

      switch-C(config)#interface vlan 10
      switch-C(config-if-vl10)#ip address 10.10.1.3/24
      switch-C(config-if-vl10)#interface vlan 11
      switch-C(config-if-vl11)#ip address 10.10.2.2/24
    4. Router D interfaces:

      switch-D(config)#interface vlan 11
      switch-D(config-if-vl11)#ip address 10.10.2.1/24
      switch-D(config)#interface vlan 12
      switch-D(config-if-vl12)#ip address 10.10.3.1/24
    5. Router E interfaces:

      switch-E(config)#interface vlan 12
      switch-E(config-if-vl12)#ip address 10.10.3.2/24
      switch-E(config)#interface vlan 13
      switch-E(config-if-vl13)#ip address 10.10.4.1/24
    6. Router F interfaces:

      switch-F(config)#interface vlan 13
      switch-F(config-if-vl13)#ip address 10.10.4.2/24
      switch-F(config)#interface vlan 14
      switch-F(config-if-vl14)#ip address 12.15.1.1/24
  2. Attach the network segments to the areas.
    1. Router A interfaces:

      switch-A(config-if-vl10)#router ospf 1
      switch-A(config-router-ospf)#router-id 170.21.0.1
      switch-A(config-router-ospf)#area 1 NSSA
      switch-A(config-router-ospf)#network 10.10.1.0/24 area 1
    2. Router B interfaces:

      switch-B(config-if-vl10)#router ospf 1
      switch-B(config-router-ospf)#router-id 170.21.0.2
      switch-B(config-router-ospf)#area 1 NSSA
      switch-B(config-router-ospf)#network 10.10.1.0/24 area 1
    3. Router C interfaces:

      switch-C(config-if-vl11)#router ospf 1
      switch-C(config-router-ospf)#router-id 170.21.0.3
      switch-C(config-router-ospf)#area 1 NSSA
      switch-C(config-router-ospf)#network 10.10.1.0/24 area 1
      switch-C(config-router-ospf)#network 10.10.2.0/24 area 0
    4. Router D interfaces:

      switch-D(config-if-vl12)#router ospf 1
      switch-D(config-router-ospf)#router-id 170.21.0.4
      switch-D(config-router-ospf)#network 10.10.2.0/24 area 0
      switch-D(config-router-ospf)#network 10.10.3.0/24 area 0
    5. Router E interfaces:

      switch-E(config-if-vl13)#router ospf 1
      switch-E(config-router-ospf)#router-id 170.21.0.5
      switch-E(config-router-ospf)#network 10.10.3.0/24 area 0
      switch-E(config-router-ospf)#network 10.10.4.0/24 area 0
    6. Router F interfaces:

      switch-F(config-if-vl14)#router ospf 1
      switch-F(config-router-ospf)#router-id 170.21.0.6
      switch-F(config-router-ospf)#network 10.10.4.0/24 area 0
      switch-F(config-router-ospf)#redistribute static

OSPFv2 Commands

Global Configuration Mode

Interface Configuration Mode

Router-OSPFv2 Configuration Mode

Display and Clear Commands

auto-cost reference-bandwidth (OSPFv2)

The auto-cost reference-bandwidth command is a factor in the formula that calculates the default OSPFv2 cost for Ethernet interfaces.

OSPFv2-cost = (auto-cost value * 1 Mbps) / interface bandwidth

The switch uses a minimum OSPFv2-cost of one. The switch rounds down all non-integer results.

On a 10G Ethernet interface:

  • if auto-cost = 100, then OSPFv2-cost = 100 Mbps / 10 Gbps = 0.01, and the default cost is set to 1.
  • if auto-cost = 59000, then OSPFv2-cost = 59000 Mbps / 10 Gbps = 5.9, and the default cost is set to 5.

The no auto-cost reference-bandwidth and default auto-cost reference-bandwidth command removes the auto-cost reference-bandwidth command from running-config. When this parameter is not set, the default cost for Ethernet interfaces is the default ip ospf cost value of 10.

Command Mode

Router-OSPF Configuration

Command Syntax

auto-cost reference-bandwidth rate

no auto-cost reference-bandwidth rate

default auto-cost reference-bandwidth rate

Parameter

rate Values range from 1 to 4294967 . Default is 100.

Example

To configure a default cost of 20 on 10G Ethernet interfaces:

  1. Calculate the required auto-cost value:
    auto-cost = (OSPFv2-cost*interface bandwidth)/1 Mbps = (20*10000 Mbps) / 1 Mbps = 200000
  2. Configure this value as the auto-cost reference-bandwidth.
    switch(config)#router ospf 6
    switch(config-router-ospf)#auto-cost reference-bandwidth 200000
    switch(config-router-ospf)#

adjacency exchange-start threshold (OSPFv2)

The adjacency exchange-start threshold command sets the exchange-start options for an OSPF instance.

The no adjacency exchange-start threshold and default adjacency exchange-start threshold command resets the default by removing the corresponding a adjacency exchange-start threshold command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

default adjacency exchange-start threshold

adjacency exchange-start threshold peers

no adjacency exchange-start threshold

Parameters

peers Value ranges from 1 4294967295. Default value is 10.

Example

This command sets the adjacency exchange start threshold to 20045623.
switch(config)#router ospf 6
switch(config-router-ospf)#adjacency exchange-start threshold 20045623
switch(config-router-ospf)#

area default-cost (OSPFv2)

The area default-cost command specifies the cost for the default summary routes sent into a specified area. The default-cost is set to 10.

The no area default-cost and default area default-cost command resets the default-cost value of the specified area to 10 by removing the corresponding area default-cost command from running-config. The no area (OSPFv2) command removes all area commands for the specified area from running-config, including the area default-cost command.

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id default-cost def_cost

no area area_id default-cost def_cost

default area area_id default-cost def_cost

Parameters

  • area_id Area number. <0 to 4294967295> or <0.0.0.0 to 255.255.255.255> running-config stores value in dotted decimal notation.
  • def_cost Value ranges from 1 to 65535. Default value is 10.

Example

This command configures a cost of 15 for default summary routes that an ABR sends into area 23.
switch(config)#router ospf 6
switch(config-router-ospf)#area 23 default-cost 15
switch(config-router-ospf)#

area filter (OSPFv2)

The area filter command prevents an area from receiving Type 3 Summary LSAs from a specified subnet.

The no area filter and default area filter commands remove the specified area filter command from running-config. The no area command (see no area (OSPFv2) removes all area commands for the specified area from running-config, including area filter commands.

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id filter net_addr

no area area_id filter net_addr

default area area_id filter net_addr

Parameters

  • area_id Area number. <0 to 4294967295> or <0.0.0.0 to 255.255.255.255> running-config stores value in dotted decimal notation.
  • net_addr Network IP address. Entry formats include address-prefix (CIDR) and address-mask. running-config stores value in CIDR notation.

Example

This command prevents the switch from entering Type 3 LSAs originating from the 10.1.1.0/24 subnet into its area 2 LSDB.
switch(config)#router ospf 6
switch(config-router-ospf)#area 2 filter 10.1.1.0/24
switch(config-router-ospf)#

area not-so-stubby lsa type-7 convert type-5 (OSPFv2)

The area not-so-stubby lsa type-7 convert type-5 command configures the switch to always translate Type-7 link-state advertisement (LSAs) to Type-5 LSAs.

The no area not-so-stubby lsa type-7 convert type-5 and no area not-so-stubby lsa type-7 convert type-5 commands allow LSAs to be translated dynamically by removing the no area not-so-stubby lsa type-7 convert type-5 command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id not-so-stubby lsa type-7 convert type-5

no area area_id not-so-stubby lsa type-7 convert type-5

default area area_id not-so-stubby lsa type-7 convert type-5

Parameters

  • area_id Area number.
    • Valid formats: integer <1 to 4294967295> or dotted decimal <0.0.0.1 to 255.255.255.255>
    • Area 0 (or 0.0.0.0) is not configurable; it is always normal.
    • running-config stores value in dotted decimal notation.

Example

This command configures the switch to always translate Type-7 link-state advertisement (LSAs) to Type-5 LSAs.
switch(config-router-ospf)#area 3 not-so-stubby lsa type-7 convert type-5
switch(config-router-ospf)#

area nssa (OSPFv2)

The area nssa command configures an OSPFv2 area as a not-so-stubby area (NSSA). All routers in an AS must specify the same area type for identically numbered areas.

NSSA ASBRs advertise external LSAs that are part of the area, but do not advertise external LSAs from other areas.

Areas are normal by default; area type configuration is required only for stub NSSA areas. Area 0 is always a normal area and cannot be configured through this command.

The no area nssa command configures the specified area as a normal area by removing the specified area nssa command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id nssa [TYPE]

no area area_id nssa [TYPE]

default area area_id nssa [TYPE]

Parameters

  • area_id All parameters except area_id can be placed in any order.
    • Valid formats: integer <1 to 4294967295> or dotted decimal <0.0.0.1 to 255.255.255.255>
    • Area 0 (or 0.0.0.0) is not configurable; it is always normal.
    • running-configstores value in dotted decimal notation.
  • TYPE Area type. Values include:
    • <no parameter>
    • nssa-only

Example

This command configures area 3 as a NSSA area.
switch(config-router-ospf)#area 3 nssa nssa-only
switch(config-router-ospf)#

area nssa default-information-originate (OSPFv2)

The default area nssa default-information-originate command sets default route origination for the NSSA, allowing the redistribute policy to advertise a default route if one is present. The resulting OSPF behavior depends on the presence of an installed static default route and on whether static routes are redistributed in OSPF (using the redistribute (OSPFv2) command). The no area nssa default-information-originate command disables advertisement of the default route for the NSSA regardless of the redistribute policy. See Advertisement of Default Route for details.

Areas are normal by default; area type configuration is required only for stub and NSSA areas. Area 0 is always a normal area and cannot be configured through this command.

Default route origination is configured differently for different area types and supports three area types:

  • Normal areas: advertisement of the default route is configured for all normal areas using the default-information originate (OSPFv2) command.
  • Stub areas: the default route is automatically advertised in stub areas and cannot be configured.
  • Not So Stubby Areas (NSSAs): advertisement of the default route is configured per area using the area nssa default-information-originate (OSPFv2) or area nssa no-summary (OSPFv2) command.
    Table 1. Advertisement of Default Route

    Static Default Route Installed

    Redistribute Static

    Command Form

    Advertise in ABR

    Advertise in ASBR

    no

    no

    default or no

    no

    no

    no

    no

    standard

    yes

    no

    no

    yes

    default

    yes

    yes

    no

    yes

    no

    no

    no

    no

    yes

    standard

    yes

    no

    yes

    no

    default or no

    no

    no

    yes

    no

    standard

    yes

    yes

    yes

    yes

    default

    yes

    yes

    yes

    yes

    no

    no

    no

    yes

    yes

    standard

    yes

    yes

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id nssa default-information-originate [VALUE][TYPE][EXCL]

no area area_id nssa default-information-originate

default area area_id nssa default-information-originate

Parameters

  • area_id All parameters except area_id can be placed in any order.
    • Valid formats: integer <1 to 4294967295> or dotted decimal <0.0.0.1 to 255.255.255.255>
    • Area 0 (or 0.0.0.0) is not configurable; it is always normal.
    • running-configstores value in dotted decimal notation.
  • VALUE Values include:
    • <no parameter> Default value of 1.
    • metric <1-65535>
  • TYPE Values include:
    • <no parameter>.
    • metric-type <1-2>
  • EXCL Values include:
    • <no parameter>.
    • nssa-only

Example

This command configures area 3 as an NSSA and generates a type 7 default LSA within the NSSA.
switch(config-router-ospf)#area 3 nssa default-information-originate nssa-only
switch(config-router-ospf)#

area nssa no-summary (OSPFv2)

The area nssa no-summary command configures the switch stop importing type-3 summary LSAs into the not-so-stubby area and sets the default summary route into the NSSA in order to reach the inter-area prefixes.

The no area nssa no-summary anddefault area nssa no-summary commands allow type-3 summary LSAs into the NSSA area.

The no area nssa and default area nssa commands configure the specified area as a normal area.

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id nssa no-summary

no area area_id nssa no-summary

default area area_id nssa no-summary

Parameters

  • area_id Area number.
    • Valid formats: integer <1 to 4294967295> or dotted decimal <0.0.0.1 to 255.255.255.255>
    • Area 0 (or 0.0.0.0) is not configurable; it is always normal.
    • running-config stores value in dotted decimal notation.

Examples

  • This command directs the device not to import type-3 summary LSAs into the NSSA area
    switch(config)#router ospf 6
    switch(config-router-ospf)#area 1.1.1.1 nssa no-summary 
    switch(config-router-ospf)#
  • This command directs the device to import type-3 summary LSAs into the NSSA area.

    switch(config)#router ospf 6
    switch(config-router-ospf)#no area 1.1.1.1 nssa no-summary 
    switch(config-router-ospf)#

area range (OSPFv2)

The area range command configures OSPF area border routers (ABRs) to consolidate or summarize routes, to set the cost setting routes, and to suppress summary route advertisements.

The no area (OSPFv2) command removes all area commands for the specified area from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id range net_addr [ADVERTISE_SETTING][COST_SETTING]

no area area_id range net_addr [ADVERTISE_SETTING][COST_SETTING]

default area area_id range net_addr [ADVERTISE_SETTING][COST_SETTING]

Parameters

  • area_id Area number. <0 to 4294967295> or <0.0.0.0 to 255.255.255.255> running-config stores value in dotted decimal notation.
  • net_addr
  • ADVERTISE_SETTING Values include
    • <no parameter>
    • advertise
    • not-advertise
  • Values include
    • <no parameter>
    • cost range_cost Value ranges from 1 to 65535.

Examples

  • The network area command assigns two subnets to an area. The area range command summarizes the addresses, which the ABR advertises in a single LSA.
    switch(config)#router ospf 6
    switch(config-router-ospf)#network 10.1.25.80 0.0.0.240 area 5
    switch(config-router-ospf)#network 10.1.25.112 0.0.0.240 area 5
    switch(config-router-ospf)#area 5 range 10.1.25.64 0.0.0.192
    switch(config-router-ospf)#
  • The network area command assigns a subnet to an area, followed by an area range command that suppresses the advertisement of that subnet.

    switch(config-router-ospf)#network 10.12.31.0/24 area 5
    switch(config-router-ospf)#area 5 range 10.12.31.0/24 not-advertise
    switch(config-router-ospf)#

area stub (OSPFv2)

The area stub command sets the area type of an OSPF area to stub. All devices in an AS must specify the same area type for identically numbered areas.

The no area stub command remove the specified stub area from the OSPFv2 instance by deleting all area stub commands from running-config for the specified area.

The no area stub command configure the specified area as a normal area.

Command Mode

Router-OSPF Configuration

Command Syntax

area area_id stub [summarize]

no area area_id stub [summarize]

default area area_id stub [summarize]

Parameters

  • area_id Area number.
    • Valid formats: integer <1 to 4294967295> or dotted decimal <0.0.0.1 to 255.255.255.255>
    • Area 0 (or 0.0.0.0) is not configurable; it is always normal.
    • running-config stores value in dotted decimal notation.
  • summarize Area type. Values include:
    • <no parameter>
    • no-summary

Examples

  • These commands configure area 45 as a stub area.
    switch(config)#router ospf 3
    switch(config-router-ospf)#area 45 stub
    switch(config-router-ospf)#
  • This command configures area 10.92.148.17 as a stub area.
    switch(config-router-ospf)#area 10.92.148.17 stub
    switch(config-router-ospf)#

clear ip ospf neighbor

The clear ip ospf command clears the neighbors statistics per interface.

Command Mode

Privileged EXEC

Command Syntax

clear ip ospf [PROCESS_ID] neighbor [LOCATION][VRF_INSTANCE]

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>
  • LOCATIONIP Address or interface peer group name. Values include:
    • * clears all OSPF IPv4 neighbors.
    • ipv4_addr
    • ethernet e_num
    • loopback l_num
    • port-channel p_num
    • vlan v_num
  • VRF_INSTANCE Specifies the VRF instance.
    • vrf vrf_name configures the vrf_name instance.
Examples
  • This command resets all OSPF neighbor statistics.
    switch#clear ip ospf neighbor *
    switch#
  • This command resets the OSPF neighbor statistics for the specified Ethernet 3 interface.
    switch#clear ip ospf neighbor ethernet 3
    switch#

compatible (OSPFv2)

The compatible command allows the selective disabling of compatibility with RFC 2328.

The no compatible and default compatible commands reverts OSPF to RFC 2328 compatible and removes the compatible statement from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

compatible rfc1583

no compatible rfc1583

default compatible rfc1583

Example

  • This command sets the OSPF compatibility list with RFC 1583.
    switch(config)#router ospf 6
    switch(config-router-ospf)#compatible rfc1583
    switch(config-router-ospf)#
  • This command disables RFC 1583 compatibility.
    switch(config)#router ospf 6
    switch(config-router-ospf)# no compatible rfc1583
    switch(config-router-ospf)#

default-information originate (OSPFv2)

The default-information originate command enables default route origination for normal areas. The user user may configure the metric value and metric type used in LSAs. The always option will cause the ASBR to create and advertise a default route whether or not one is configured.

The no default-information originate command prevents the advertisement of the default route. The default default-information originate command enables default route origination with default values (metric type 2, metric=1).

Command Mode

Router-OSPF Configuration

Command Syntax

default-information originate [FORCE][VALUE][TYPE][MAP]

no default-information originate

default default-information originate

Parameters

All parameters can be placed in any order.

  • FORCE Advertisement forcing option. Values include:
    • <no parameter>
    • always
  • VALUE Values include:
    • <no parameter>
    • metric <1-65535>
  • TYPE Values include:
    • <no parameter>
    • metric-type <1-2>
  • MAP Sets attributes in the LSA based on a route map. Values include:
    • <no parameter>
    • route-map map_name.

Examples

  • These commands will always advertise the OSPFv2 default route regardless of whether the switch has a default route configured.
    switch(config)#router ospf 1
    switch((config-router-ospf)#default-information originate always
    switch(config-router-ospf)#show active
    router ospf 1
     default-information originate always
  • These commands advertise a default route with a metric of 100 and an external metric type of 1 if a default route is configured.
    switch(config)#router ospf 1
    switch((config-router-ospf)#default-information originate metric 100 metric-type 1

distance ospf (OSPFv2)

The distance ospf intra-area command specifies the administrative distance for routes in a single OSPFv2 area. The default administrative distance for intra-area, inter-area and external routes is 110.

The no distance ospf intra-area and default distance ospf intra-area commands remove the distance ospf intra-area command from running-config, returning the OSPFv2 administrative distance settings to the default value of 110.

Command Mode

Router-OSPF Configuration

Command Syntax

distance ospf AREA_TYPE

no distance ospf AREA_TYPE

default distance ospf AREA_TYPE

Parameters

  • AREA_TYPE Specifies routes for which administrative distance is to be set. Values include:
    • external.
    • inter-area.
    • intra-area.
  • distance Values range from 1 to 255. Default value is 110 for all types.

Example

This command configures a distance of 85 for all OSPFv2 intra-area routes on the switch.
switch(config)#router ospf 6
switch(config-router-ospf)#distance ospf intra-area 85
switch(config-router-ospf)#

distribute-list in

A distribute list uses a route map or prefix list to filter specific routes from incoming OSPF LSAs. Filtering occurs after SPF calculation. The filtered routes are not installed on the switch, but are still included in LSAs sent by the switch. The distribute-list in command creates a distribute list in the configuration mode OSPF instance.

If a prefix list is used, destination prefixes that do not match the prefix list will not be installed. If a route map is used, routes may be filtered based on address, next hop, or metric. OSPF external routes may also be filtered by metric type or tag.

The no distribute-list in and default distribute-list in commands remove the distribute-list in command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

distribute-list {prefix-list | route-map} list_name in

no distribute-list {prefix-list | route-map}

default distribute-list {prefix-list | route-map}

Parameters

  • prefix-list Specifies a prefix-list as the filter.
  • route-map Specifies a route-map as the filter.
  • list_name The name of the prefix-list or route-map used to filter routes from incoming LSAs.

Related Commands

area filter (OSPFv2)

redistribute (OSPFv2)

Example

These commands configure a prefix list named dist_list1 in OSPF instance 5 to filter certain routes from incoming OSPF LSAs.
switch(config)#router ospf 5
switch(config-router-ospf)#distribute-list prefix-list dist_list1 in
switch(config-router-ospf)#

dn-bit-ignore (OSPFv2)

The dn-bit-ignore command results in the DN bit in Type 3 Summary LSAs to be ignored during the shortest path first (SPF) calculations.

The no dn-bit-ignore and default dn-bit-ignore commands result in the DN bit in Type 3 Summary LSAs to not be ignored during SPF calculations.

Command Mode

Router-OSPF Configuration

Command Syntax

dn-bit-ignore

no dn-bit-ignore

default dn-bit-ignore

Examples

  • This command ignores the DN bit.
    switch(config)#router ospf 6
    switch(config-router-ospf)#dn-bit-ignore
    switch(config-router-ospf)#
  • This command causes the DN bit not to be ignored.

    switch(config)#router ospf 6
    switch(config-router-ospf)#no dn-bit-ignore
    switch(config-router-ospf)#

ip ospf area

The ip ospf area command enables OSPFv2 on an interface and associates the area to the interface.

The no ip ospf area and default ip ospf area commands disable OSPFv2 on the configuration mode interface and remove the configured area from the system.

Note: The per interface configuration has precedence over the OSPF Configuration mode. In other words, the area configured by the ip ospf area command has precedence over the area configured by the network area command.

Command Mode

Interface-Ethernet Configuration

Interface-Loopback Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf area area_id

no ip ospf area area_id

default ip ospf area area_id

Parameters

area_id The area ID. The valid values are 0 to 4294967295 or a decimal range between 0.0.0.0 and 255.255.255.255.

Example

These commands enable OSPFv2 on the et2 interface and associates area identifier 1.1.1.1 to the interface.
switch(config)#Interface ethernet 2
switch(config-if-Et2)# ip address 1.0.0.1/24
switch(config-if-Et2)# ip ospf area 1.1.1.1
router ospf 1

ip ospf authentication

The ip ospf authentication command enables OSPFv2 authentication for the configuration mode interface..

The no ip ospf authentication and default ip ospf authentication commands disable OSPFv2 authentication on the configuration mode interface by removing the corresponding ip ospf authentication command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf authentication [METHOD]

no ip ospf authentication

default ip ospf authentication

Parameters

  • METHOD OSPFv2 authentication method. Options include:
    • <no parameter>
    • message-digest

Examples

  • This command enables simple authentication on vlan 12.
    switch(config)#interface vlan 12
    switch(config-if-vl12)#ip ospf authentication
    switch(config-if-vl12)#
  • This command enables message-digest authentication on vlan 12.
    switch(config-if-vl12)#ip ospf authentication message-digest
    switch(config-if-vl12)#

ip ospf authentication-key

The ip ospf authentication-key command configures the OSPFv2 authentication password for the configuration mode interface.

The no ip ospf authentication-key and default ip ospf authentication-key commands removes the OSPFv2 authentication password from the configuration mode interface by removing the corresponding ip ospf authentication-key command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf authentication-key [ENCRYPT_TYPE] key_text

no ip ospf authentication-key

default ip ospf authentication-key

Parameters

  • ENCRYPT_TYPE Encryption level of the key_text parameter. Values include:
    • <no parameter> the key_text is in clear text.
    • 0 key_text is in clear text. Equivalent to <no parameter>.
    • 7 key_text is MD5 encrypted.
  • key_text the authentication-key password.

Example

This command specifies a password in clear text.
switch(config)#interface vlan 12
switch(config-if-Vl12)#ip ospf authentication-key 0 code123
switch(config-if-Vl12)#show active
interface vlan12
 ip ospf authentication-key 7 baYllFzVbcx4yHq1IhmMdw==
switch(config-if-Vl12)#

The running-config stores the password as an encrypted string.

ip ospf cost

The ip ospf cost command configures the OSPFv2 cost for the configuration mode interface. The default cost depends on the interface type:

The no ip ospf cost and default ip ospf cost commands restore the default OSPFv2 cost for the configuration mode interface by removing the corresponding ip ospf cost command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Loopback Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf cost interface_cost

no ip ospf cost

default ip ospf cost

Parameters

interface_cost Value ranges from 1 to 65535; default is 10.

Example

This command configures a cost of 15 for vlan 2.
switch(config)#interface vlan 2
switch(config-if-Vl2)#ip ospf cost 15
switch(config-if-Vl2)#

ip ospf dead-interval

The ip ospf dead-interval command configures the dead interval for the configuration mode interface.

The no ip ospf dead-interval and default ip ospf dead-interval commands restore the default dead interval of 40 seconds on the configuration mode interface by removing the corresponding ip ospf dead-interval command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf dead-interval time

no ip ospf dead-interval

default ip ospf dead-interval

Parameters

time Value ranges from 1 to 8192; default is 40.

Example

This command configures a dead interval of 120 seconds for vlan 4.
switch(config)#interface vlan 4
switch(config-if-Vl4)#ip ospf dead-interval 120
switch(config-if-Vl4)#

ip ospf disabled

The ip ospf disabled command disables OSPFv2 on the configuration mode interface without disrupting the OSPFv2 configuration. When OSPFv2 is enabled on the switch, the it is also enabled by default on all interfaces.

The OSPFv2 instance is disabled on the entire switch with the shutdown (OSPFv2) command.

The no ip ospf disabled and default ip ospf disabled commands enable OSPFv2 on the configuration mode interface by removing the corresponding ip ospf disabled command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf disabled

no ip ospf disabled

default ip ospf disabled

Examples

  • This command shuts down OSPFv2 activity on vlan 5.
    switch(config)#interface vlan 5
    switch(config-if-Vl5)#ip ospf disabled
    switch(config-if-Vl5)#
  • This command resumes OSPFv2 activity on vlan 5.
    switch(config-if-Vl5)#no ip ospf disabled
    switch(config-if-Vl5)#

ip ospf hello-interval

The ip ospf hello-interval command configures the OSPFv2 hello interval for the configuration mode interface.

The same hello interval should be specified for Each OSPFv2 neighbor, and should not be longer than any neighbors dead interval.

The no ip ospf hello-interval and default ip ospf hello-interval commands restore the default hello interval of 10 seconds on the configuration mode interface by removing the ip ospf hello-interval command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf hello-interval time

no ip ospf hello-interval

default ip ospf hello-interval

Parameter

time Hello interval (seconds). Values range from 1 to 8192; default is 10.

Example

This command configures a hello interval of 30 seconds for vlan 2.
switch(config)#interface vlan 2
switch(config-if-Vl2)#ip ospf hello-interval 30
switch(config-if-Vl2)#

ip ospf message-digest-key

The ip ospf message-digest-key command configures a message digest authentication key for the configuration mode interface.

The no ip ospf message-digest-key and default ip ospf message-digest-key commands remove the message digest authentication key for the specified key ID on the configuration mode interface by deleting the corresponding ip ospf message-digest-key command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf message-digest-key key_id md5 ENCRYPT_TYPE key_text

no ip ospf message-digest-key key_id

default ip ospf message-digest-key key_id

Parameters

  • key_id Key ID number. Value ranges from 1 to 255.
  • ENCRYPT_TYPE Encryption level of the key_text parameters. Values include:
    • <no parameter>
    • 0 key_text
    • 7 key_text
  • key_text message key (password).

Example

This command configures code123 as the MD5 key with a corresponding key ID of 23.
switch(config)#interface vlan 12
switch(config-if-vl12)#ip ospf message-digest-key 23 md5 0 code123
switch(config-if-vl12)#

The running-config stores the password as an encrypted string.

ip ospf network point-to-point

The ip ospf network point-to-point command sets the configuration mode interface as a point-to-point link. By default, interfaces are configured as broadcast links.

The no ip ospf network and default ip ospf network commands set the configuration mode interface as a broadcast link by removing the corresponding ip ospf networkcommand from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf network point-to-point

no ip ospf network

default ip ospf network

Examples

  • These commands configure Ethernet interface 10 as a point-to-point link.
    switch(config)#interface ethernet 10
    switch(config-if-Etl0)#ip ospf network point-to-point
    switch(config-if-Etl0)#
  • This command restores Ethernet interface 10 as a broadcast link.
    switch(config-if-Etl0)#no ip ospf network
    switch(config-if-Etl0)#

ip ospf priority

The ip ospf priority command configures OSPFv2 router priority for the configuration mode interface..

The no ip ospf priority and default ip ospf priority commands restore the default priority (1) on the configuration mode interface by removing the corresponding ip ospf priority command from running-config.

Command Mode

Interface-Ethernet Configuration Interface-Port-Channel Configuration Interface-vlan Configuration

Command Syntax

ip ospf priority priority_level

no ip ospf priority

default ip ospf priority

Parameters

priority_level priority level. Value ranges from 0 to 255. Default value is 1.

Examples

  • This command configures a router priority of 15 for vlan 8.
    switch(config)#interface vlan 8
    switch(config-if-Vl8)#ip ospf priority 15
    switch(config-if-Vl8)#
  • This command restores the router priority of 1 for vlan 7.
    switch(config)#interface vlan 7
    switch(config-if-Vl7)#no ip ospf priority
    switch(config-if-Vl7)#

ip ospf retransmit-interval

The ip ospf retransmit-interval command configures the link state advertisement retransmission interval for the interface.

The no ip ospf retransmit-interval and default ip ospf retransmit-interval commands restore the default retransmission interval of 5 seconds on the configuration mode interface by removing the corresponding ip ospf retransmit-interval command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf retransmit-interval period

no ip ospf retransmit-interval

default ip ospf retransmit-interval

Parameters

period Retransmission interval (seconds). Value ranges from 1 to 8192; default is 5.

Example

This command configures a retransmission interval of 15 seconds for vlan 3.
switch(config)#interface vlan 3
switch(config-if-Vl3)#ip ospf retransmit-interval 15
switch(config-if-Vl3)#

ip ospf router-id output-format hostnames

The ip ospf router-id output-format hostnames command causes the switch to display DNS names in place of numeric OSPFv2 router IDs in all OSPFv2 show commands, including:

The no ip ospf router-id output-format hostnames and default ip ospf router-id output-format hostnames commands remove the ip ospf router-id output-format hostnames command from running-config, restoring the default behavior of displaying OSPFv2 router IDs by their numeric value.

Command Mode

Global Configuration

Command Syntax

ip ospf router-id output-format hostnames

no ip ospf router-id output-format hostnames

default ip ospf router-id output-format hostnames

Example

This command programs the switch to display OSPFv2 router IDs by the corresponding DNS name in subsequent show commands.

switch(config)#ip ospf router-id output-format hostnames
switch(config)#

ip ospf transmit-delay

The ip ospf transmit-delay command configures the transmission delay for OSPFv2 packets over the configuration mode interface.

The no ip ospf transmit-delay and default ip ospf transmit-delay commands restore the default transmission delay (one second) on the configuration mode interface by removing the corresponding ip ospf transmit-delay command from running-config.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-vlan Configuration

Command Syntax

ip ospf transmit-delay trans

no ip ospf transmit-delay

default ip ospf transmit-delay

Parameters

trans LSA transmission delay (seconds). Value ranges from 1 to 8192; default is 1.

Example

This command configures a transmission delay of 5 seconds for vlan 6.
switch(config)#interface vlan 6
switch(config-if-Vl6)#ip ospf transmit-delay 5
switch(config-if-Vl6)#

log-adjacency-changes (OSPFv2)

The log-adjacency-changes command enables syslog messages to be sent when it detects OSPFv2 link state changes or when it detects that a neighbor has gone up or down. Log message sending is enabled by default.

The default log-adjacency-changes command restores the default state by removing the log-adjacency-changes statement from running-config.

The default option (sending a message only when a neighbor goes up or down) is active when running-config does not contain any form of the command. Entering the command in any form replaces the previous command state in running-config.

The no log-adjacency-changes disables link state change syslog reporting.

The default log-adjacency-changes command restores the default state by removing the log-adjacency-changes detail or no log-adjacency-changes statement from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

log-adjacency-changes detail

no log-adjacency-changes

default log-adjacency-changes

Examples

  • This command configures the switch to send a syslog message when a neighbor goes up or down.
    switch(config)#router ospf 6
    switch(config-router-ospf)#log-adjacency-changes
    switch(config-router-ospf)#
    • After entering the command, show active does not display a log-adjacency-changes statement.
      switch(config-router-ospf)#show activerouter ospf 1
      switch(config-router-ospf)#
  • This command configures the switch to send a syslog message when it detects any link state change.
    switch(config-router-ospf)#log-adjacency-changes detail
    switch(config-router-ospf)#
    • After entering the command, show active displays a log-adjacency-changes detail command.
      switch(config-router-ospf)#show active router ospf 1
       log-adjacency-changes detail
      switch(config-router-ospf)#

maximum-paths (OSPFv2)

The maximum-paths command controls the number of parallel routes that OSPFv2 supports. The default maximum is 16 paths.

The no maximum-paths and default maximum-paths commands restore the maximum number of parallel routes that OSPFv2 supports on the switch to the default value of 16 by placing the maximum-paths 16 statement in running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

maximum-paths paths

no maximum-paths

default maximum-paths

Parameters

  • paths Maximum number of parallel routes.

Value ranges from 1 to the number of interfaces available per ECMP group, which is platform dependent.

  • Arad: Value ranges from 1 to 128. Default value is 128.

    • FM6000: Value ranges from 1 to 32. Default value is 32.
    • PetraA: Value ranges from 1 to 16. Default value is 16.
    • Trident: Value ranges from 1 to 32. Default value is 32.
    • Trident II: Value ranges from 1 to 128. Default value is 128.

Example

This command configures the maximum number of OSPFv2 parallel paths to 12.
switch(config)#router ospf 6
switch(config-router-ospf)#maximum-paths 12
switch(config-router-ospf)#

max-lsa (OSPFv2)

The max-lsa command specifies the maximum number of LSAs allowed in the LSDB. Setting the limit to zero removes the LSDB restriction and disables LSA overload actions. Actions triggered by LSDB overload conditions include:

  • Warning: the switch logs OSPF MAXLSAWARNING if the LSDB contains a specified percentage of the LSA maximum.
  • Temporary shutdown: when the LSDB exceeds the LSA maximum, OSPFv2 is disabled and does not accept or acknowledge new LSAs. The switch re-starts OSPFv2 after a specified period (the default is five minutes).
  • Permanent shutdown: the switch permanently disables OSPFv2 after performing a specified number of temporary shutdowns (the default is five). This state usually indicates the need to resolve a network condition that consistently generates excessive LSA packets.

The no max-lsa and default max-lsa commands restore all LSA overload parameters to their default settings.

Note: if OSPFv2 has entered permanent shutdown, it can also be restarted by increasing the LSA limit to a value larger than the number of LSAs in the database. Setting the max-LSA value to zero will also restart OSPFv2, and will disable overload protection.

Command Mode

Router-OSPF Configuration

Command Syntax

max-lsa lsa_num [WARNING] [IGNORE_TIME] [IGNORE_COUNT] [RESET]

no max-lsa

default max-lsa

Parameters

  • lsa_num Maximum number of LSAs. Value ranges from 0 to 100,000.
    • 0 Disables overload protection.
    • 1 to 100000 Specifies maximum value; default value is 12,000.
  • WARNING Warning threshold, as a percentage of the maximum number of LSAs (% of lsa_num).
    • <no parameter> Default of 75%.
    • percent Ranges from 25 to 99.
  • IGNORE_TIME Temporary shutdown period (minutes). Options include:
    • <no parameter> Default value of 5 minutes.
    • ignore-time period Value ranges from 1 to 60.
  • IGNORE_COUNT Number of temporary shutdowns required to trigger a permanent shutdown.
    • <no parameter> Default value of 5.
    • ignore-count episodes Ranges from 1 to 20.
  • RESET Period of not exceeding LSA limit required to reset temporary shutdown counter to zero.
    • <no parameter> Default value of 5 minutes
    • reset-time r_period Ranges from 1 to 60.

Example

This command defines an LSA limit of 8,000 and other parameters.
switch(config-router-ospf)#max-lsa 8000 40 ignore-time 6 ignore-count 3 reset-time 20
switch(config-router-ospf)#

max-metric router-lsa (OSPFv2)

The max-metric router-lsa command configures OSPF to include the maximum value in LSA metric fields to keep other network devices from using the switch as a preferred intermediate SPF hop.

The no max-metric router-lsa and default max-metric router-lsa commands disable the advertisement of a maximum metric.

Command Mode

Router-OSPF Configuration

Command Syntax

max-metric router-lsa[EXTERNAL][STUB][STARTUP][SUMMARY]

no max-metric router-lsa [EXTERNAL][STUB][STARTUP][SUMMARY]

default max-metric router-lsa [EXTERNAL][STUB][STARTUP][SUMMARY]

Parameters

All parameters can be placed in any order.

  • EXTERNAL Advertised metric value. Values include:
    • <no parameter> Default value of 1.
    • external-lsa <1 to 16777215>Default value is 0xFF0000.
  • STUB Advertised metric type. Values include:
    • <no parameter> Default value of 2.
    • include-stub
  • STARTUP Limit scope of LSAs. Values include:
    • <no parameter>
    • on-startup
    • on-startup wait-for-bgp
    • on-startup <5 to 86400>

wait-for-bgp or an on-start time value is not included in no and default commands.

  • SUMMARY Advertised metric value. Values include:
    • <no parameter>
    • summary-lsa
    • summary-lsa <1 to 16777215>

Example

This command configures OSPF to to include the maximum value in LSA metric fields until BGP has converged:
switch(config-router-ospf)#max-metric router-lsa on-startup wait-for-bgp
switch(config-router-ospf)#

network area (OSPFv2)

The network area command assigns the specified IPv4 subnet to an OSPFv2 area.

The no network area and default network area commands delete the specified network area assignment by removing the corresponding network area command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

network ipv4_subnet area area_id

no network ipv4_subnet area area_id

default network ipv4_subnet area area_id

Parameters

  • ipv4_subnet IPv4 subnet. Entry formats include address-prefix (CIDR) or address-wildcard mask. running-config stores value in CIDR notation.
  • area_id Area number. <0 to 4294967295> or <0.0.0.0 to 255.255.255.255> running-config stores value in dotted decimal notation.

Example

These equivalent commands each assign the subnet 10.1.10.0/24 to area 0.
switch(config-router-ospf)#network 10.1.10.0 0.0.0.255 area 0
switch(config-router-ospf)#
switch(config-router-ospf)#network 10.1.10.0/24 area 0
switch(config-router-ospf)#

no area (OSPFv2)

The no area <type> command removes the corresponding area <type> command from running-config:

  • no/default area not-so-stubby lsa type-7 convert type-5 commands remove the translate type7 always parameter without changing the area type.
  • no/default area nssa , no/default area stub, and no/default area stub no-summary commands restore the areas type tonormal. OSPFv2 Commands
  • no/default area default-information-originate command removes all area commands for the specified area from running-config
  • no/default area command removes all area commands for the specified area from running-config
  • no/default area command removes all area commands for the specified area from running-config

Command Mode

Router-OSPF Configuration

Command Syntax

no area area_id [TYPE]

default area area_id [TYPE]

Parameters

  • area_id area number.
    • Valid formats: integer <1 to 4294967295> or dotted decimal <0.0.0.1 to 255.255.255.255>
    • Area 0 (or 0.0.0.0) is not configurable; it is always normal.
    • Running-config stores value in dotted decimal notation.
  • TYPE Area type. Values include:
    • nssa
    • nssa translate type7 always
    • stub
    • stub no-summary

Examples

  • These commands remove area 1 from the running configuration.
    switch(config)#router ospf 6
    switch(config-router-ospf)#no area 1
    switch(config-router-ospf)#
  • These commands remove area 10.92.148.17 as an NSSA.
    switch(config-router-ospf)#no area 10.92.148.17 nssa
    switch(config-router-ospf)#

passive-interface default (OSPFv2)

The passive-interface default command configures all interfaces as OSPFv2 passive by default. The switch advertises the passive interface as part of the router LSA.

The passive-interface <interface> (OSPFv2) configures the OSPFv2 active-passive status for a specific interface:

  • When passive-interface default is not set, all interfaces are OSPFv2 active by default and passive interfaces are denoted by passive-interface <interface> statements in running-config.
  • When passive-interface default is set, all interfaces are OSPFv2 passive by default and active interfaces are denoted by no passive-interface <interface> statements in running-config.

The no passive-interface and default passive-interface commands configures all interfaces as OSPFv2 active by default by removing the passive-interface default statement from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

passive-interface default

no passive-interface default

default passive-interface default

Examples

  • This command configures the default interface setting as OSPFv2 passive. This command also removes all passive-interface <interface> statements from running-config.
    switch(config)#router ospf 6
    switch(config-router-ospf)#passive-interface default
    switch(config-router-ospf)#
  • This command configures the default interface setting as OSPFv2 active. This command also removes all no passive-interface <interface> statements from running-config.
    switch(config-router-ospf)#no passive-interface default
    switch(config-router-ospf)#

passive-interface <interface> (OSPFv2)

The passive-interface command disables OSPFv2 on an interface range. The switch advertises the passive interface as part of the LSA.

The default OSPFv2 interface activity is configured by the passive-interface default (OSPFv2) command:

  • When passive-interface default is not set, all interfaces are OSPFv2 active by default and passive interfaces are denoted by passive-interface <interface> statements in running-config.
  • When passive-interface default is set, all interfaces are OSPFv2 passive by default and active interfaces are denoted by no passive-interface <interface> statements in running-config.

The no passive-interface command enables OSPFv2 on the specified interface range. The default passive-interface command sets the interface to the default interface activity setting by removing the corresponding passive-interface or no passive-interface statement from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

passive-interface INTERFACE_NAME

no passive-interface INTERFACE_NAME

default passive-interface INTERFACE_NAME

Parameters

  • INTERFACE_NAME Interface to be configured. Options include:
    • ethernet e_range
    • port-channel p_range
    • vlan v_range
    • vxlan vx_range

Examples

  • These commands configure Ethernet interfaces 2 through 5 as passive interfaces.
    switch(config)#router ospf 6
    switch(config-router-ospf)#passive-interface ethernet 2-5
    switch(config-router-ospf)#
  • This command configures vlan interfaces 50-54, 61, 68, and 102-120 as passive interfaces.
    switch(config-router-ospf)#passive-interface vlan 50-54,61,68,102-120
    switch(config-router-ospf)#
  • This command configures vlan 2 as an active interface.
    switch(config-router-ospf)#no passive-interface vlan 2
    switch(config-router-ospf)#

point-to-point routes (OSPFv2)

The point-to-point routes command enables the switch to maintain a local routing information base (RIB) to store information it learns from its neighbors.

The no point-to-point routes and default point-to-point routes commands program the switch to include point-to-point links in its RIB by removing the point-to-point routes command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

point-to-point routes

no point-to-point routes

default point-to-point routes

Examples

  • This command configures the switch to optimize the local RIB by not including point-to-point routes.
    switch(config)#router ospf 6
    switch(config-router-ospf)#no point-to-point routes
    switch(config-router-ospf)#
  • This command configures the switch to include point-to-point routes.
    switch(config-router-ospf)#point-to-point routes
    switch(config-router-ospf)#

redistribute (OSPFv2)

The redistribute command enables the advertising of all specified routes on the switch into the OSPFv2 domain as external routes.

The no redistribute and default redistribute commands remove the corresponding redistribute command from running-config, disabling route redistribution for the specified route type.

Command Mode

Router-OSPF Configuration

Command Syntax

redistribute ROUTE_TYPE [ROUTE_MAP]

no redistribute ROUTE_TYPE [ROUTE_MAP]

default redistribute ROUTE_TYPE [ROUTE_MAP]

Parameters

  • ROUTE_TYPE Source from which routes are redistributed. Options include:
    • connected routes that are established when IPv4 is enabled on an interface.
    • BGP routes from a BGP domain.
    • RIP routes from a RIP domain.
    • static IP static routes.
  • ROUTE_MAP Route map that determines the routes that are redistributed. Options include:
    • <no parameter >
    • route-map map_name

Examples

  • The redistribute static command starts the advertising of static routes as OSPFv2 external routes.
    switch(config)#router ospf 6
    switch(config-router-ospf)#redistribute static
    switch(config-router-ospf)#
  • The no redistribute bgp command stops the advertising of BGP routes as OSPFv2 external routes.

    switch(config-router-ospf)#no redistribute bgp
    switch(config-router-ospf)#

router ospf

The router ospf command places the switch in router-ospf configuration mode. The switch will create a process ID for the new instance if one does not already exist. The exit command returns the switch to global configuration mode.

The show ip ospf command displays the process ID of the OSPFv2 instances configured on the switch.

The no router ospf and default router ospfcommands delete the specified OSPFv2 instance.

Router-ospf configuration mode is not a group change mode; running-config is changed immediately upon entering commands. Exiting router-ospf configuration mode does not affect running-config. The exit command returns the switch to global configuration mode.

Refer to Router-OSPFv2 Configuration Mode for a list of commands available in router-ospf configuration mode.

Command Mode

Global Configuration

Command Syntax

router ospf process_id [VRF_INSTANCE]

no router ospf process_id [VRF_INSTANCE]

default router ospf process_id [VRF_INSTANCE]

Parameters

  • process_id OSPFv2 process ID. Values range from 1 to 65535.
  • VRF_INSTANCE
    • <no parameter> Configures the default VRF instance.
    • vrf vrf_name Configures the vrf_name instance.

Examples

  • This command creates an OSPFv2 instance with process ID 145 in the main VRF.
    switch(config)#router ospf 145
    switch(config-router-ospf)#
  • This command deletes the specified OSPFv2 instance.
    switch(config)#no router ospf 145
    switch(config)#

router-id (OSPFv2)

The router-id command assigns a router ID for an OSPFv2 instance. This number uniquely identifies the router within an Autonomous System. Status commands use the router ID to identify the switch.

The switch sets the router ID to the first available alternative in the following list:

  1. The router-id command.
  2. The loopback IP address, if a loopback interface is configured on the switch.
  3. The highest IP address present on the router.
    Note: When configuring VXLAN on an MLAG, always manually configure the OSPFv2 router ID to prevent the switch from using the common VTEP IP address as the router ID.

The no router-id and default router-id commands remove the router ID command from running-config; the switch uses the loopback or highest address as the router ID.

Command Mode

Router-OSPF Configuration

Command Syntax

router-id [identifier]

no router-id [identifier]

default router-id [identifier]

Parameters

identifier Value ranges from 0.0.0.0 to 255.255.255.255.

Example

This command assigns 10.5.4.2 as the router ID for the OSPFv2 instance.

switch(config)#router ospf 6
switch(config-router-ospf)#router-id 10.5.4.2
switch(config-router-ospf)#

show ip ospf border-routers

The show ip ospf border-routers command displays the internal OSPFv2 routing table entries to area border routers (ABRs) and autonomous system boundary routers (ASBRs) for each of the OSPFv2 areas.

Command Mode

EXEC

Command Syntax

show ip ospf border-routers [VRF_INSTANCE]

Parameters

  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.

Example

This command displays the ABRs and ASBRs.
switch#show ip ospf border-routers
OSPF Process 10.17.0.42, VRF default

Router ID AreaType
10.17.0.10.0.0.0 ASBR
switch>

show ip ospf database database-summary

The show ip ospf database database-summary command displays the number of link state advertisements in the OSPFv2 database.

Command Mode

EXEC

Command Syntax

show ip ospf [AREA] database database-summary [VRF_INSTANCE]

Parameters

  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.
  • AREA areas for which command displays data. Specifying an individual area requires entering the process ID where the area is located. Options include:
    • <no parameter>
    • process_id
    • process_id area_id
    • process_id input range: <1 to 65535>
    • area_id input range: <0 to 4294967295> or <0.0.0.0 to 255.255.255.255>

Example

This command displays the LSDB content summary for area 0.
switch#show ip ospf 1 0 database database-summary

LSA TypeCount
Router18
Network 21
Summary Net 59
Summary ASBR4
Type-7 Ext0
Opaque Area 0
Type-5 Ext4238
Opaque AS 0
Total 4340

switch>

show ip ospf database <link state list>

The show ip ospf database <link state list> command displays the OSPFv2 link state advertisements that originate on a specified switch.

Command Mode

EXEC

Command Syntax

show ip ospf [AREA] database [ROUTER] [VRF_INSTANCE]

Parameters

  • AREA Areas for which command displays data. Specifying an individual area requires entering the process ID where the area is located. Options include:
    • <no parameter>
    • process_id
    • process_id area_id
    • process_id value ranges from 1 to 65535.
    • area_id is entered in decimal or dotted decimal notation.
  • ROUTER Router or switch for which the command provides data. Options include:
    • <no parameter>
    • adv-router [a.b.c.d]
    • self-originate
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.

Example

This command displays OSPFv2 LSAs that originate at the router with a router ID of 10.26.0.31.
switch#show ip ospf database adv-router 10.26.0.31

OSPF Router with ID(10.26.0.23) (Process ID 1) (VRF default)

10.26.0.3110.26.0.319180x80002b4a0x13153

Type-5 AS External Link States

Link IDADV RouterAgeSeq#Checksum
10.24.238.23810.26.0.316780x800003d20x8acf0
10.24.238.24410.26.0.316780x800003d20x4e060
10.24.238.22410.26.0.316780x800003d20x17510
<-------OUTPUT OMITTED FROM EXAMPLE-------->

Type 11 Opaque LSDB

TypeLink IDADV RouterAgeSeq# Checksum
switch>

show ip ospf database <link-state details>

The show ip ospf database <link-state details> command displays details of the specified link state advertisements.

Command Mode

EXEC

Command Syntax

show ip ospf [AREA] database LINKSTATE_TYPE linkstate_id [ROUTER] [VRF_INSTANCE]

Parameters

  • AREA Areas for which command displays data. Specifying an individual area requires entering the process ID where the area is located. Options include:
    • <no parameter>
    • process_id
    • process_id area_id
    • process_id input range: <1 to 65535>
    • area_id input range: <0 to 4294967295> or <0.0.0.0 to 255.255.255.255>
  • LINKSTATE_TYPE Link state types. Parameter options include:
    • detail Displays all link states.
    • router
    • network
    • summary
    • asbr-summary
    • external
    • nssa-external
    • opaque-link
    • opaque-area
    • opaque-as
  • linkstate_id Network segment described by the LSA (dotted decimal notation).

Value depends on the LSA type.

  • ROUTER Router or switch for which the command provides data. Options include:
    • <no parameter>
    • adv-router [a.b.c.d]
    • self-originate
  • VRF_INSTANCE Parameter has no effect; this command displays information about the specified process and area regardless of VRF.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.

Examples

  • This command displays the router link states contained in the area 2 LSDB.
    switch#show ip ospf 1 2 database router
    
    OSPF Router with ID(10.168.103.1) (Process ID 1) (VRF default)
    
    Router Link States (Area 0.0.0.2)
    
    LS age: 00:02:16
    Options: (E DC)
    LS Type: Router Links
    Link State ID: 10.168.103.1
    Advertising Router: 10.168.103.1
    LS Seq Number: 80000032
    Checksum: 0x1B60
    Length: 36
    Number of Links: 1
    
    Link connected to: a Transit Network
    (Link ID) Designated Router address: 10.168.2.1
    (Link Data) Router Interface address: 10.168.2.1
    Number of TOS metrics: 0
    TOS 0 Metrics: 10
    
    
    LS age: 00:02:12
    Options: (E DC)
    LS Type: Router Links
    Link State ID: 10.168.104.2
    Advertising Router: 10.168.104.2
    LS Seq Number: 80000067
    Checksum: 0xA29C
    Length: 36
    Number of Links: 1
    
    Link connected to: a Transit Network
    (Link ID) Designated Router address: 10.168.2.1
    (Link Data) Router Interface address: 10.168.2.2
    Number of TOS metrics: 0
    TOS 0 Metrics: 10
    switch>
    
  • This command displays link state database (LSDB) contents for area 2.
    switch#show ip ospf 1 2 database
    
    OSPF Router with ID(10.168.103.1)(Process ID 1) (VRF default)
    
    Router Link States (Area 0.0.0.2)
    
    Link IDADV RouterAgeSeq#Checksum Link count
    10.168.103.110.168.103.100:29:080x80000031 0x001D5F 1
    10.168.104.210.168.104.200:29:090x80000066 0x00A49B 1
    
    Net Link States (Area 0.0.0.2)
    
    Link IDADV RouterAgeSeq#Checksum
    10.168.2.110.168.103.100:29:080x80000001 0x00B89D
    
    Summary Net Link States (Area 0.0.0.2)
    
    Link IDADV RouterAgeSeq#Checksum
    10.168.0.010.168.103.100:13:200x80000028 0x0008C8
    10.168.0.010.168.104.200:09:160x80000054 0x00A2FF
    10.168.3.010.168.104.200:24:160x80000004 0x00865F
    10.168.3.010.168.103.100:24:200x80000004 0x002FC2
    10.168.103.010.168.103.100:14:200x80000028 0x0096D2
    10.168.103.010.168.104.200:13:160x80000004 0x00364B
    10.168.104.010.168.104.200:08:160x80000055 0x002415
    10.168.104.010.168.103.100:13:200x80000028 0x00EF6E
    switch>

show ip ospf interface brief

The show ip ospf interface brief command displays a summary of OSPFv2 information.

Command Mode

EXEC

Command Syntax

show ip ospf [PROCESS_ID] interface brief [VRF_INSTANCE]

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_namedisplays information from the specified VRF.

Related Command

show ip ospf interface

Example

This command displays a summary of interface information for the switch.
switch#show ip ospf interface brief
InterfacePIDAreaIP AddressCostStateNbrs
Loopback010.0.0.010.168.103.1/2410DR0
vlan110.0.0.010.168.0.1/2410BDR1
vlan210.0.0.210.168.2.1/2410BDR1
vlan310.0.0.310.168.3.1/2410DR0
switch>

show ip ospf interface

The show ip ospf interface command displays interface information that is related to OSPFv2.

Command Mode

EXEC

Command Syntax

show ip ospf [PROCESS_ID] interface [INTERFACE_NAME][VRF_INSTANCE]

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>
  • INTERFACE_NAME Interface type and number. Values include
    • <no parameter>
    • ethernet e_num
    • loopback l_num
    • port-channel p_num
    • vlan v_num
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_namedisplays information from the specified VRF.

Related Command

show ip ospf interface brief

Example

This command displays complete OSPFv2 information for vlan 1.
switch#show ip ospf interface vlan 1
vlan1 is up, line protocol is up (connected)
Internet Address 10.168.0.1/24, VRF default, Area 0.0.0.0
Process ID 1, Router ID 10.168.103.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router is 10.168.104.2
Backup Designated router is 10.168.103.1
Timer intervals configured, Hello 10, Dead 40, Retransmit 5
Neighbor Count is 1
MTU is 1500
switch>

show ip ospf lsa-log

The show ip ospf lsa-log command displays log entries when LSA update messages are sent or received for OSPF.

Command Mode

EXEC

Command Syntax

show ip ospf [PROCESS_ID] ospf-log

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>

Example

This command displays log entries when LSA update messages are sent or received for OSPF.
switch#show ip ospf lsa-log
OSPF Process 3.3.3.3, LSA Throttling Log:
[04:21:09] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 2000 msecs
[04:21:08] type 1: 3.3.3.3/32 [3.3.3.3], event 2, backoff restarted, new hold value 900 msecs
[04:21:00] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 3000 msecs
[04:21:00] type 1: 3.3.3.3/32 [3.3.3.3], event 4, maxwait value changed, new hold value 3000 msecs
/* Here the maxwait value was changed to 3000 from earlier 32000, this is not part of the log */
[04:20:42] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 32000 msecs
[04:20:10] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 32000 msecs
[04:19:54] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 16000 msecs
[04:19:46] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 8000 msecs
[04:19:42] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 4000 msecs
[04:19:40] type 1: 3.3.3.3/32 [3.3.3.3], event 1, backed off, new hold value 2000 msecs
[04:19:39] type 1: 3.3.3.3/32 [3.3.3.3], event 2, backoff restarted, new hold value 900 msecs
[04:19:22] type 1: 4.4.4.4/32 [4.4.4.4], event 3, discarded, was early by 995 msecs
[04:19:22] type 1: 3.3.3.3/32 [3.3.3.3], event 0, backoff started, new hold value 1000 msecs
switch#

show ip ospf neighbor adjacency-changes

The show ip ospf neighbor adjacency-changes command displays the OSPFv2 neighbor adjacency change log for specified interfaces.

Command Mode

EXEC

Command Syntax

show ip ospf neighbor [INTERFACE_NAME][NEIGHBOR] adjacency-changes [VRF_INSTANCE]

Parameters

  • INTERFACE_NAME Interface type and number. Values include:
    • <no parameter>
    • ethernet e_num
    • loopback l_num
    • port-channel p_num
    • vlan v_num
  • NEIGHBOR OSPFv2 neighbor. Options include:
    • <no parameter>
    • ipv4_addr
    • host_name
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.

Example

This command displays the adjacency changes to vlan 2.
switch#show ip ospf neighbor vlan 2 adjacency-changes
[08-04 08:55:32] 10.168.104.2, interface vlan2 adjacency established
[08-04 09:58:51] 10.168.104.2, interface vlan2 adjacency dropped: interface went 
down
[08-04 09:58:58] 10.168.104.2, interface vlan2 adjacency established
[08-04 09:59:34] 10.168.104.2, interface vlan2 adjacency dropped: interface went 
down
[08-04 09:59:42] 10.168.104.2, interface vlan2 adjacency established
[08-04 10:01:40] 10.168.104.2, interface vlan2 adjacency dropped: nbr did not 
list our router ID
[08-04 10:01:46] 10.168.104.2, interface vlan2 adjacency established
switch>

show ip ospf neighbor state

The show ip ospf neighbor state command displays the state information on OSPF neighbors on a per-interface basis.

Command Mode

EXEC

Command Syntax

show ip ospf neighbor state STATE_NAME [VRF_INSTANCE]

Parameters

  • STATE_NAME Output filtered by the devices OSPF state. Options include valid OSPF states:
    • 2-ways
    • attempt
    • down
    • exch-start
    • exchange
    • full
    • graceful-restart
    • init
    • loading
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.

Example

This command displays OSPF information for neighboring routers that are fully adjacent.
switch#show ip ospf neighbor state full
Neighbor ID VRFPri StateDead Time AddressInterface
Test1 default1 FULL/BDR 00:00:3510.17.254.105vlan3912
Test2 default1 FULL/BDR 00:00:3610.17.254.29 vlan3910
Test3 default1 FULL/DR00:00:3510.25.0.1vlan101
Test4 default1 FULL/DROTHER 00:00:3610.17.254.67 vlan3908
Test5 default1 FULL/DROTHER 00:00:3610.17.254.68 vlan3908
Test6 default1 FULL/BDR 00:00:3210.17.254.66 vlan3908
Test7 default1 FULL/DROTHER 00:00:3410.17.36.4 vlan3036
Test8 default1 FULL/BDR 00:00:3510.17.36.3 vlan3036
Test9 default1 FULL/DROTHER 00:00:3110.17.254.13 vlan3902
Test10default1 FULL/BDR 00:00:3710.17.254.11 vlan3902
Test11default1 FULL/DROTHER 00:00:3310.17.254.163vlan3925
Test12default1 FULL/DR00:00:3710.17.254.161vlan3925
Test13default1 FULL/DROTHER 00:00:3110.17.254.154vlan3923
Test14default1 FULL/BDR 00:00:3910.17.254.156vlan3923
Test15default1 FULL/DROTHER 00:00:3310.17.254.35 vlan3911
Test16default1 FULL/DR00:00:3410.17.254.33 vlan3911
Test17default1 FULL/DR00:00:3610.17.254.138Ethernet12
Test18default1 FULL/DR00:00:3710.17.254.2vlan3901
switch>

show ip ospf neighbor summary

The show ip ospf neighbor summary command displays a single line of summary information for each OSPFv2 neighbor.

Command Mode

EXEC

Command Syntax

show ip ospf [PROCESS_ID] neighbor summary [VRF_INSTANCE]

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.

Example

This command displays the summary information for the OSPFv2 neighbors.
switch#show ip ospf neighbor summary
OSPF Router with (Process ID 1) (VRF default)
0 neighbors are in state DOWN
0 neighbors are in state GRACEFUL RESTART
2 neighbors are in state INIT
0 neighbors are in state LOADING
0 neighbors are in state ATTEMPT
18 neighbors are in state FULL
0 neighbors are in state EXCHANGE
0 neighbors are in state 2 WAYS
0 neighbors are in state EXCH START
switch>

show ip ospf neighbor

The show ip ospf neighbor command displays OSPFv2 neighbor information for specified interfaces.

Command Mode

EXEC

Command Syntax

show ip ospf [PROCESS_ID] neighbor [INTERFACE_NAME] [NEIGHBOR] [DATA] [VRF_INSTANCE]

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>
  • INTERFACE_NAME Interface type and number. Values include:
    • <no parameter>
    • ethernet e_num
    • loopback l_num
    • port-channel p_num
    • vlan v_num
  • NEIGHBOR OSPFv2 neighbor. Options include:
    • <no parameter>
    • ipv4_addr
  • DATA Type of information the command displays. Values include:
    • <no parameter>
    • detail
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_namedisplays information from the specified VRF.

Examples

  • This command displays the switchs neighbors.
    switch#show ip ospf neighbor
    Neighbor IDVRFPriStateDead TimeAddressInterface
    10.168.104.2default1FULL/DR00:00:3510.168.0.2vlan1
    10.168.104.2default8FULL/BDR00:00:3110.168.2.2vlan2
    switch>
  • This command displays details about the neighbors to vlan 2.
    switch#show ip ospf neighbor vlan 2 detail
    Neighbor 10.168.104.2, VRF default, interface address 10.168.2.2
    In the area 0.0.0.2 via interface vlan2
    Neighbor priority is 8, State is FULL, 13 state changes
    Adjacency was established 000:01:25:48 ago
    DR is 10.168.2.1 BDR is 10.168.2.2
    Options is E
    Dead timer due in 00:00:34
    switch>

show ip ospf request queue

The show ip ospf request queue command displays a list of all OSPFv2 link state advertisements (LSAs) requested by a router.

Command Mode

EXEC

Command Syntax

show ip ospf request queue [VRF_INSTANCE]

Parameters

VRF_INSTANCE Specifies the VRF instance.

  • <no parameter> displays information from all VRFs, or from context-active VRF if set.
  • vrf vrf_name displays information from the specified VRF.

Example

This command displays an LSA request list.
switch#show ip ospf request queue
Neighbor 10.168.104.2 vrf default interface: 10.168.0.2 address vlan1
Type LS ID ADV RTR Seq No Age Checksum
Neighbor 10.168.104.2 vrf default interface: 10.168.2.2 address vlan2
Type LS ID ADV RTR Seq No Age Checksum
switch>

show ip ospf retransmission queue

The show ip ospf retransmission queue command displays a list of all OSPFv2 link state advertisements (LSAs) waiting to be re-sent.

Command Mode

EXEC

Command Syntax

show ip ospf retransmission queue [VRF_INSTANCE]

Parameters

  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> displays information from all VRFs, or from context-active VRF if set.
    • vrf vrf_name displays information from the specified VRF.

Example

This command displays an empty retransmission list.
switch#show ip ospf retransmission queue
Neighbor 10.168.104.2 vrf default interface vlan1 address 10.168.0.2
LSA retransmission not currently scheduled. Queue length is 0

TypeLink IDADV RouterAgeSeq# Checksum
Neighbor 10.168.104.2 vrf default interface vlan2 address 10.168.2.2
LSA retransmission not currently scheduled. Queue length is 0

TypeLink IDADV RouterAgeSeq# Checksum
switch>

show ip ospf spf-log

The show ip ospf spf-log command displays when and how long the switch took to run a full SPF calculation for OSPF.

Command Mode

EXEC

Command Syntax

show ip ospf [PROCESS_ID] ospf-log

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>

Example

This command displays the SPF information for OSPF.
switch#show ip ospf spf-log
OSPF Process 172.26.0.22
WhenDuration(msec)
13:01:341.482
13:01:291.547
13:01:241.893
13:00:501.459
13:00:451.473
13:00:402.603
11:01:491.561
11:01:401.463
11:01:351.467
11:01:301.434
11:00:541.456
11:00:491.472
11:00:441.582
15:01:491.575
15:01:441.470
15:01:391.679
15:01:341.601
15:00:571.454
15:00:521.446
15:00:471.603
switch>

show ip ospf

The show ip ospf command displays OSPFv2 routing information

Command Mode

EXEC

Command Syntax

show ip ospf [PROCESS_ID][VRF_INSTANCE]

Parameters

  • PROCESS_ID OSPFv2 process ID. Values include:
    • <no parameter>
    • <1 to 65535>
  • VRF_INSTANCE Specifies the VRF instance.
    • <no parameter> configures the default VRF instance.
    • vrf vrf_name configures the vrf_name instance.

Example

This command displays configuration parameters, operational statistics, status of the OSPFv2 instance, and a brief description of the areas on the switch.
switch#show ip ospf
Routing Process "ospf 1" with ID 10.168.103.1 VRF default
Supports opaque LSA
Maximum number of LSA allowed 12000
Threshold for warning message 75%
Ignore-time 5 minutes, reset-time 5 minutes
Ignore-count allowed 5, current 0
It is an area border router
Hold time between two consecutive SPFs 5000 msecs
SPF algorithm last executed 00:00:09 ago
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of LSA 27.
Number of areas in this router is 3. 3 normal 0 stub 0 nssa
Area BACKBONE(0.0.0.0)
Number of interfaces in this area is 2
It is a normal area
Area has no authentication
SPF algorithm executed 153 times
Number of LSA 8. Checksum Sum 0x03e13a
Number of opaque link LSA 0. Checksum Sum 0x000000
Area 0.0.0.2
Number of interfaces in this area is 1
It is a normal area
Area has no authentication
SPF algorithm executed 153 times
Number of LSA 11. Checksum Sum 0x054e57
Number of opaque link LSA 0. Checksum Sum 0x000000
Area 0.0.0.3
Number of interfaces in this area is 1
It is a normal area
Area has no authentication
SPF algorithm executed 5 times
Number of LSA 6. Checksum Sum 0x02a401
Number of opaque link LSA 0. Checksum Sum 0x000000

shutdown (OSPFv2)

The shutdown command disables OSPFv2 on the switch. OSPFv2 is disabled on individual interfaces with the shutdown (OSPFv2) command.

The no shutdown and default shutdown commands enable the OSPFv2 instance by removing the shutdown statement from the OSPF block in running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

shutdown

no shutdown

default shutdown

Examples

  • This command disables OSPFv2 activity on the switch.
    switch(config)#router ospf 6
    switch(config-router-ospf)#shutdown
    switch(config-router-ospf)#
  • This command resumes OSPFv2 activity on the switch.
    switch(config-router-ospf)#no shutdown
    switch(config-router-ospf)#

summary-address

The summary-address command allows aggregation of external routes advertised by an OSPF ASBR. It is used to aggregate AS External and NSSA External LSAs.

Thedefault summary-address andno summary-address commands delete the current summary-address configurations.

Command Mode

Router Configuration Mode

Command Syntax

summary-address {ip_address subnet_mask | ip_prefix} [attribute_map WORD | not_advertise | tag]

default summary-address {ip_address summary_mask | ip_prefix}

no summary-address {ip_address summary_mask | ip_prefix}

Parameters

  • ip_address subnet_mask IPv4 subnet in dotted decimal notation.
  • ip_prefix IPv4 subnet in CIDR notation.
  • attribute_map WORD allows using a route-map to set the attributes to be advertised in the LSA. Options include:
    • set metric
    • set metric-type
    • set tag
  • not_advertise suppresses the advertisement of contributing external prefixes by the router
  • tag allows setting the tag in the advertised external LSA. The tag value ranges from 0 to 4294967295. The default value is zero.

Guidelines

This feature reduces the size of External LSDB in OSPF, does not impact inter area and intra area LSAs. This command installs a Null0 route in FIB when at least one contributor is present.

Restriction

Only OSPF redistributed routes are aggregated.

Example

This command advertises an external LSA for 50.0.0.0/16 prefix if at least one BGP contributing route is present which falls in the subnet 50.0.0.0/16.

Note: The show commands display aggregation of BGP prefixes 50.0.0.0/24 and 50.0.1.0/24 into one OSPF AS External LSA for 50.0.0.0/16 prefix. A route-map is to set metric and tag for the advertised LSA.
switch(config)#router ospf 5
switch(config-router-ospf)#redistribute bgp
switch(config-router-ospf)#summary-address 50.0.0.0/16 attribute-map BGP_AGGR
switch(config-router-ospf)#exit
switch(config)#show ip route bgp

VRF: default
Codes: C - connected, S - static, K - kernel,
 O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1,
 E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
 N2 - OSPF NSSA external type2, B I - iBGP, B E - eBGP,
 R - RIP, I L1 - IS-IS level 1, I L2 - IS-IS level 2,
 O3 - OSPFv3, A B - BGP Aggregate, A O - OSPF Summary,
 NG - Nexthop Group Static Route, V - VXLAN Control Service,
 DH - DHCP client installed default route, M - Martian,
 DP - Dynamic Policy Route

 B E50.0.0.0/24 [200/0] via 3.0.0.12, Ethernet3
 B E50.0.1.0/24 [200/0] via 3.0.0.12, Ethernet3
switch(config)#show running-config
...
route-map BGP_AGGR permit 10
 set metric 42
 set tag 19
...
router ospf 1
 router-id 1.0.0.10
 redistribute bgp
 max-lsa 12000
 summary-address 50.0.0.0/16 attribute-map BGP_AGGR

switch(config)#show ip ospf database external

OSPF Router with ID(1.0.0.10) (Process ID 1) (VRF default)


 Type-5 AS External Link States

LS Age: 9
Options: (E DC)
LS Type: AS External Links
Link State ID: 50.0.0.0
Advertising Router: 1.0.0.10
LS Seq Number: 0x80000001
Checksum: 0x2c0c
Length: 36
Network Mask: 255.255.0.0
Metric Type: 2
Metric: 42
Forwarding Address: 0.0.0.0
External Route Tag: 19

switch(config)#show ip route aggregate

VRF: default
Codes: C - connected, S - static, K - kernel,
 O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1,
 E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
 N2 - OSPF NSSA external type2, B I - iBGP, B E - eBGP,
 R - RIP, I L1 - IS-IS level 1, I L2 - IS-IS level 2,
 O3 - OSPFv3, A B - BGP Aggregate, A O - OSPF Summary,
 NG - Nexthop Group Static Route, V - VXLAN Control Service,
 DH - DHCP client installed default route, M - Martian,
 DP - Dynamic Policy Route

 A O50.0.0.0/16 is directly connected, Null0

timers lsa rx min interval (OSPFv2)

The timers lsa rx min interval command sets the minimum interval for acceptance of identical link-state advertisements (LSAs) from OSPFv2 neighbors.

The no timers lsa rx min interval and default timers lsa rx min interval commands restore the minimum interval to the default of one second by removing the timers lsa rx min interval command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

timers lsa rx min interval lsa_time

no timers lsa rx min interval

default timers lsa rx min interval

Parameter

lsa_time Minimum time (in milliseconds) after which the switch will accept an identical LSA from OSPFv2 neighbors. Default is 1000 (1 second).

Example

This command sets the minimum LSA arrival interval to ten milliseconds.
switch(config)#router ospf 6
switch(config-router-ospf)#timers lsa rx min interval 10
switch(config-router-ospf)#

timers lsa tx delay initial (OSPFv2)

The timers lsa tx delay initial command sets the rate-limiting values for OSPF link-state advertisement generation.

The no timers lsa tx delay initial and default imers throttle lsa all commands restore the defaults by removing the timers lsa tx delay initial command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

timers lsa tx delay initial initial_delay min_hold max_wait

no timers lsa tx delay initial

default timers lsa tx delay initial

Parameters

  • initial_delay Value ranges from 0 to 600000 (ms). Default is 1000.
  • min_hold Value ranges from 0 to 600000 (ms). Default is 5000.
  • max_wait Value ranges from 0 to 600000 (ms). Default is 5000.

Example

This command sets the rate-limiting values for OSPF link-state advertisemen to 10 milliseconds.
switch(config)#router ospf 6
switch(config-router-ospf)#timers lsa tx delay initial 10
switch(config-router-ospf)#

timers spf delay initial (OSPFv2)

The purpose of SPF throttling is to delay shortest path first (SPF) calculations when network topology is changing rapidly. The timers spf delay initial command controls the intervals at which the switch will perform SPF calculations. The command sets three values:

  • Initial delay: how long the switch waits to perform an SPF calculation after a topology change in a network that has been stable throughout the hold interval. Because a topology change often causes several link state updates to be sent, the initial delay is configured to allow the network to settle before the switch performs an SPF calculation. If an additional topology change occurs during the initial interval, the SPF calculation still takes place after the expiration of the initial delay period and no other change is made to the throttle timers.
  • Hold interval: this is an additional wait timer which scales to slow SPF calculations during periods of network instability. If a network change occurs during the hold period, an SPF calculation is scheduled to occur at the expiration of the hold interval. Subsequent hold intervals are doubled if further topology changes occur during a hold interval until either the hold interval reaches its configured maximum or no topology change occurs during the interval. If the next topology change occurs after the expiration of the hold interval, the hold interval is reset to its configured value and the SPF calculation is scheduled to take place after the initial delay.
  • Maximum interval: the maximum time the switch will wait after a topology change before performing an SPF calculation.

The no timers spf delay initial and default timers spf delay initial commands restore the default OSPFv2 SPF calculation intervals by removing the timers spf delay initial command from running-config.

Command Mode

Router-OSPF Configuration

Command Syntax

timers spf delay initial initial_delay hold_interval max_interval

no timers spf

default timers spf

Parameters

  • initial_delay Initial delay between a topology change and SPF calculation. Value ranges from 0 to 65535000 (ms). Default is 0 (ms).
  • hold_interval Additional wait time after SPF calculation to allow the network to settle. If a topology change occurs during the hold interval, another SPF calculation is scheduled to occur after the hold interval expires. The next hold interval is doubled if topology changes occur during the hold interval. If doubling exceeds the maximum value, the maximum value is used instead. Value ranges from 0 to 65535000 (ms). Default is 5000 (ms).
  • max_interval Maximum hold interval before the switch will perform an SPF calculation. Value ranges from 0 to 65535000 (ms). Default is 5000 (ms).

Example

These commands set the SPF timers on the switch.
switch(config)#router ospf 6
switch(config-router-ospf)#timers spf 5 100 20000
switch(config-router-ospf)#