Dell Networking SONiC: Open Shortest Path First (OSPF)

Summary: This article explains about Open Shortest Path First (OSPF) in Dell Networking SONiC. This article uses a switch running Dell SONiC 4.1.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

 
Prerequisites
Standard interface naming is used to demonstrate the Concepts. See Dell article 202172 Dell Networking S-Series: Basic Interface Configuration - SONiC 4.0 for more information regarding interface naming

Index

 

Open Shortest Path First
Enable OSPFv2
Enable OSPF on Interfaces
Configure OSPF router ID
Configure OSPF area level authentication type
Configure OSPF interface level authentication type and keys​
Configure OSPF passive interfaces
Configure OSPF virtual links
Configure OSPF area shortcuts
Configure OSPF RFC compatibility
Configure OSPF adjacency logging
Configure OSPF LSA timers
Configure OSPF SPF throttle timers
Configure OSPF max-metric advertising
Configure OSPF route distances
Configure OSPF auto cost reference bandwidth
Configure OSPF stub area and its parameters
Configure OSPF inter area summary route filters
Configure OSPF route redistribution
Configure OSPF default route origination

Configure OSPF interface parameters
OSPF operational data display commands
OSPFv2 graceful restart​​​​​​

 

Open Shortest Path First

 

Open Shortest Path First Protocol (OSPF) is a link state interior gateway routing protocol (IGRP) as described in RFC2328.

OSPF describes link-state information in a message known as a Link State Advertisement (LSA), which is then propagated through to all other routers in a link-state routing domain, by a process called flooding. Each OSPF router thus builds up a Link State Database (LSDB) of all the link-state messages. From this collection of LSAs in the LSDB, each router can then calculate the shortest path to any other router, based on some common metric, by using Edgar Djikstras Shortest Path First algorithm.

Enterprise SONiC uses FRR packages for running routing protocols. OSPFv2 is also adapted from a customized FRR software package. The OPSFv2 routing daemon resides within the BGP docker container along with other routing protocol daemons, such as BGP, static route.

OSPFv2 capabilities supported:

  • OSPF configuration on Ethernet, loopback, VLAN, and port-channel IPv4 interfaces
  • OSPFv2 configuration on default and user-defined VRFs
  • Multiple OSPF areas and stub areas
  • Type-1 to Type-5 LSAs 
  • Virtual links and Passive interfaces
  • BFD on OSPF interface sessions
  • Plain text and message digest (MD) password encryption
  • Type-3 Summary LSA prefix filtering and substitution
  • Route redistribution into OSPFv2, from route type BGP, static, connected, kernel, and default-route
  • Route-map based filtering in route redistribution
  • OSPF ECMP routes
  • 50K external route and 5K internal route prefix
 

Enable OSPFv2

Enable OSPFv2 by configuring an OSPF router within a VRF. Use this command to configure OSPFv2 within a VRF. Configuring OSPF changes the mode to OSPF router configuration mode.

To enable OSPF globally, default vrf:
 

DELLSONiC(conf)# router ospf

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(conf)# router ospf


Or enable OSPF, non-default vrf:
 

DELLSONiC(conf)# router ospf vrf Vrf-name
 
  • Vrf-name - VRF name string
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(conf)# router ospf vrf Vrf-blue


View the OSPF router details:
 

DELLSONiC# show ip ospf
VRF Name: default
 OSPF Routing Process, Router ID: 10.10.201.1
 Supports only single TOS (TOS0) routes
 This implementation conforms to RFC2328
 RFC1583Compatibility flag is disabled
 OpaqueCapability flag is disabled
 Graceful-Restart is disabled
 Initial SPF scheduling delay 0 millisec(s)
 Minimum hold time between consecutive SPFs 50 millisec(s)
 Maximum hold time between consecutive SPFs 5000 millisec(s)
 Hold time multiplier is currently 1
 SPF algorithm last executed 1d2h7m51s ago
 Last SPF duration 23 usecs
 SPF timer is inactive
 LSA minimum interval 5000 msecs
 LSA minimum arrival 1000 msecs
 Write Multiplier set to 20
 Refresh timer 10 secs
 Maximum multiple paths(ECMP) supported  256
 Number of external LSA 0. Checksum Sum 0x00000000
 Number of opaque AS LSA 0. Checksum Sum 0x00000000
 Number of areas attached to this router: 1
Area ID: 0.0.0.0 (Backbone)
   Number of interfaces in this area: Total: 1 , Active: 1
   Number of fully adjacent neighbors in this area: 1
   Area has no authentication
   SPF algorithm executed 4 times
   Number of LSA 3
   Number of router LSA 2. Checksum Sum 0x0000ec6e
   Number of network LSA 1. Checksum Sum 0x00001a25
   Number of summary LSA 0. Checksum Sum 0x00000000
   Number of ASBR summary LSA 0. Checksum Sum 0x00000000
   Number of NSSA LSA 0. Checksum Sum 0x00000000
   Number of opaque link LSA 0. Checksum Sum 0x00000000
   Number of opaque area LSA 0. Checksum Sum 0x00000000 DELLSONiC# show ip ospf vrf Vrf-Blue
VRF Name: Vrf-Blue
 OSPF Routing Process, Router ID: 0.0.0.0
 Supports only single TOS (TOS0) routes
 This implementation conforms to RFC2328
 RFC1583Compatibility flag is disabled
 OpaqueCapability flag is disabled
{output truncated}


Enable OSPF on Interfaces


Before enabling OSPF on an interface, configure an IPv4 interface with an IP address on it and bind the interface to the required VRF. To enable OSPF on an IPv4 interface, you must associate an OSPF Area-ID with the interface. OSPF can be enabled on Ethernet, VLAN, Port Channel, and Loopback interfaces.

Enable OSPF sessions between two OSPF routers by enabling OSPF on the interfaces connecting them. Such connecting interfaces shall reside within the VRF where the OSPF router is configured and shall belong to the same Area-ID.

Use the interface mode command to enable or disable OSPF on an IPv4 interface. Area ID can be any 32-bit unsigned integer number, in decimal format, or dotted Ipv4 like format.

Enable OSPF on an interface using these two configuration types:

By configuring OSPF area under interface configuration mode:
 
DELLSONiC(config-if-Vlan100)# ip ospf area area-id
 
  • area-id - OSPF area ID in decimal or dotted format - A.B.C.D or 0..4294967295


Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Vlan 100
DELLSONiC(config-if-Vlan100)# ip ospf area 0
or
DELLSONiC(config-if-Vlan100)# ip ospf area 0.0.0.0

By binding or associating the network address of an interface to an OSPF area under OSPFv2 router configuration mode:
 
NOTE: When using network command to associate an interface to an OSPF area, IPv4 address Prefix length in interface command must be equal or bigger (that is, smaller network) than prefix length in network statement.
 
DELLSONiC(config-router-ospf)# network network-prefix area area-id
 
  • network-prefix - A.B.C.D/mask
  • area-id - OSPF area ID in decimal or dotted format - A.B.C.D or 0..4294967295

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# network 10.10.150.0/24 area 0.0.0.0
or
DELLSONiC(config-router-ospf)# network 10.10.150.0/24 area 0

Within a VRF, user shall either use one of the above config types, that is, both config type configurations are not allowed at a time within a VRF.
 

Example:

 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Vlan 100
DELLSONiC(config-if-Vlan100)# ip vrf forwarding Vrf-Blue
DELLSONiC(config-if-Vlan100)# ip ospf area 0
or
DELLSONiC(config-if-Vlan100)# ip ospf area 0.0.0.0  
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf vrf Vrf-Blue
DELLSONiC(config-router-ospf)# network 10.10.150.0/24 area 0.0.0.0
DELLSONiC(config-router-ospf)# network 10.10.150.0/24 area 0


View the OSPF sessions

 
DELLSONiC# show ip ospf neighbor

Neighbor ID  Pri      State        Dead Time         Address             Interface                     RXmtL RqstL DBsmL            
10.10.150.2   1      Full/DR       32.346s         10.10.150.2        Vlan100:10.10.150.1                0     0     0


Configure OSPF router ID


Configure OSPFv2 Router Identifier explicitly for every OSPF router within a VRF. Router ID configuration is optional. If you configure a router ID, the software chooses that router ID as the OSPF router ID.
Whenever router ID is not configured, router ID selection happens as per below preference.
  • Most recently used router id value; (this can happen when user unconfigures router ID).
  • FRR recommended value of Router Id. FRR chooses router id in below order.
    1. FRR global mode configured router id value, if any.
    2. Highest IPv4 address value among SONiC physical and Loopback interface IPv4 addresses.
Use this router mode command to configure or unconfigure OSPF router ID. Router ID can be any 32-bit unsigned integer number, in decimal format, or dotted Ipv4 like format. OSPF router ID must be unique within the entire OSPF domain.

To configure:
 
DELLSONiC(config-router-ospf)# ospf router-id router-id

To remove:
 
DELLSONiC(config-router-ospf)# no ospf router-id router-id
 
  • router-id - OSPF router ID in decimal or dotted format

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# ospf router-id 1.1.1.1


Configure OSPF area level authentication type


You can configure OSPFv2 authentication type per area. When authentication is configured, all interfaces that are configured within that area use the configured authentication type. If there is any interface mode authentication type configured then that interface mode authentication type takes precedence over area level config.

Authentication type is none, when it is not configured by user. User can enable plain text authentication type or Message Digest type authentication. Whenever authentication type is configured for an area, user shall configure corresponding authentication keys (passwords) at all the OSPF interfaces belonging to that area.

Use this router mode command to configure or unconfigure OSPF authentication for an area.

To configure:
 
DELLSONiC(config-router-ospf)# area area-id authentication [message-digest]

To remove:
 
DELLSONiC(config-router-ospf)# no area area-id authentication [message-digest]
 
  • area-id - OSPF area ID in decimal or dotted format - A.B.C.D or 0..4294967295
 
Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# area 0 authentication
or
DELLSONiC(config-router-ospf)# area 0 authentication message-digest


Configure OSPF interface level authentication type and keys


Configure the OSPFv2 authentication type and authentication keys or passwords for individual OSPF interfaces. When it is not configured by user, authentication type is none. User can enable plain text authentication type or Message Digest type authentication. Whenever authentication type is configured for an interface, user shall configure corresponding authentication keys (passwords) for that OSPF interface.

Plain text authentication can be up to eight characters long. Message Digest (MD5) authentication key can be up to 16 character long. MD5 authentication type can accept up to 255 authentication keys per interface and interface IP. Every MD5 authentication key is uniquely identified by an authentication key-id with value range in 1 and 255. Authentication Keys are saved in an encrypted form.

Use this interface mode command to configure or unconfigure OSPF message authentications.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf authentication [null | message-digest] [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# ip ospf authentication-key key [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# ip ospf message-digest-key key-id md5 key [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf authentication [null | message-digest] [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# no ip ospf authentication-key [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# no ip ospf message-digest-key key-id md5 [if-ip-addr]
 
  • key - Authentication key password (string up to 8 or 16 characters)
  • key-id - MD5 authentication key Identifier (1 to 255)
  • if-ip-addr - Interface IP address - A.B.C.D

  Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth 1/47
DELLSONiC(config-if-Eth1/47)# ip ospf authentication
DELLSONiC(config-if-Eth1/47)# ip ospf authentication-key dellospfpswrd

DELLSONiC(config-if-Eth1/47)# ip ospf authentication 10.10.3.2
DELLSONiC(config-if-Eth1/47)# ip ospf authentication-key dellospfpswrd 10.10.3.2

DELLSONiC(config-if-Eth1/47)# ip ospf authentication message-digest
DELLSONiC(config-if-Eth1/47)# ip ospf message-digest-key 1 md5 dellospfpswrd
DELLSONiC(config-if-Eth1/47)# ip ospf message-digest-key 2 md5 dellospfpswrd

DELLSONiC(config-if-Eth1/47)# ip ospf authentication null


Configure OSPF passive interfaces


Configure OSPFv2 passive interfaces using router mode configurations. On a passive interface, OSPF does not trigger OSPF hello or initiate OSPF sessions. Passive interfaces are advertised as a stub link in the router-LSA. To configure all OSPF interfaces as passive interfaces by default, enter the passive-interface default option. To reactivate all or specified interfaces, use the no passive-interface command.

To configure:
 
DELLSONiC(config-router-ospf)# passive-interface {default | Eth | Loopback | PortChannel | Vlan } [if-ip-addr]

To remove:
 
DELLSONiC(config-router-ospf)# no passive-interface {default | Eth | Loopback | PortChannel | Vlan } [if-ip-addr]
 
  • Eth | Loopback | PortChannel | Vlan - Interface name
  • if-ip-addr - Interface IP address - A.B.C.D

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# passive-interface default
DELLSONiC(config-router-ospf)# no passive-interface Eth 1/47


Configure OSPF virtual links


OSPFv2 Virtual links are used to connect backbone routers across a nonbackbone area. The area through which the virtual link is configured, known as transit area, must have full routing information. The transit area cannot be a stub area. You must configure virtual links on both end backbone routers.

Configure virtual links using OSPF router mode configurations as below. Single virtual link command provides options to configure all parameters that are related to the Virtual link. Virtual links can have clear text password, message-digest based passwords or no password configured at all. When clear text and message digest password is configured, corresponding authentication-key or message-digest-key parameters must be configured. Authentication key (password) is saved in encrypted form in configurations. User shall always provide actual password while configuring authentication keys.

To configure:
 
DELLSONiC(config-router-ospf)# area area-id virtual-link remote-id [ authentication [ null | message-digest ] | authentication-key key | message-digest-key key-id md5 key | dead-interval time-value | hello-interval time-value | retransmit-interval time-value | transmit-delay time-value ]

To remove:
 
DELLSONiC(config-router-ospf)# no area area-id virtual-link remote-id [ authentication [ null | message-digest ] | authentication-key key | message-digest-key key-id md5 key | dead-interval time-value | hello-interval time-value | retransmit-interval time-value | transmit-delay time-value ]
 
  • area-id - OSPF area ID in decimal or dotted format - A.B.C.D or 0..4294967295
  • remote-id - Remote router ID in dotted format - A.B.C.D
  • key - Authentication key password (string up to 8 or 16 characters)
  • key-id - MD5 authentication key identifier (1 to 255)
  • time-value - Time interval value in seconds (1 to 65535)
Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9

DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 authentication
DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 authentication-key dellospfpswrd

DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 authentication
message-digest
DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9
message-digest-key 19 md5 dellospfpswrd

DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 authentication null

DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 dead-interval 60
DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 hello-interval 20
DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 retransmit-interval 15
DELLSONiC(config-router-ospf)# area 19 virtual-link 1.1.1.9 transmit-delay 10


Configure OSPF ABR type


OSPF router ABR can be of type Cisco, IBM, shortcut or standard. The "Cisco" and "IBM" types are equivalent. The OSPF standard for ABR behavior does not allow an ABR to consider routes through nonbackbone areas when its links to the backbone are down, even when there are other ABRs in attached nonbackbone areas which still can reach the backbone - this restriction exists primarily to ensure routing-loops are avoided.

With the "Cisco" or "IBM" ABR type, the default in this release, this restriction is lifted, allowing an ABR to consider summaries learned from other ABRs through nonbackbone areas, and hence route through nonbackbone areas as a last resort when, and only when, backbone links are down.

The ospf abr-type command is used to configure or unconfigure ABR type as below.

To configure:
 
DELLSONiC(config-router-ospf)# ospf abr-type [ cisco | ibm | shortcut | standard ]

To remove:
 
DELLSONiC(config-router-ospf)# no ospf abr-type [ cisco | ibm | shortcut | standard ]

Example:

 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# ospf abr-type standard


Configure OSPF area shortcuts


OSPF Backbone area is responsible for routing distribution between nonbackbone areas. Backbone area should be contiguous, but it does not always imply a physical adjacency. You can achieve backbone area router connections using virtual connections.

By configuring the shortcut type, you can enable or disable shortcut routes to backbone area. When the shortcut type is default then the area is used for shortcutting only if ABR does not have a link to the backbone area or this link was lost. When shortcut type is 'enable' then the area is used for shortcutting every time the route that goes through it is cheaper. When shortcut type is 'disable' then the area is never used by ABR for routes shortcutting.

Configure or unconfigure OSPFv2 area shortcut types under OSPF router configuration mode.

To configure:
 
DELLSONiC(config-router-ospf)# area area-id shortcut {default | enable | disable}

To remove:
 
DELLSONiC(config-router-ospf)# no area area-id shortcut

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# area 1 shortcut enable


Configure OSPF RFC compatibility


OSPFv2 RFC2328, the successor to RFC1583, suggests according to section G.2 (changes) in section 16.4 a change to the path preference algorithm that prevents possible routing loops that were possible in the old version of OSPFv2. More specifically it demands that interarea paths and intra-area backbone path are now of equal preference but still both preferred to external paths.

To configure:
 
DELLSONiC(config-router-ospf)# compatible rfc1583

To remove:
 
DELLSONiC(config-router-ospf)# no compatible rfc1583

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# compatible rfc1583


Configure OSPF adjacency logging


Enable OSPFv2 adjacency state logs by configuring adjacency logs. With the optional detail argument, all changes in adjacency status are shown.

To configure:
 
DELLSONiC(config-router-ospf)# log-adjacency-changes [detail]

To remove:
 
DELLSONiC(config-router-ospf)# no log-adjacency-changes

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# log-adjacency-changes detail
 

Configure OSPF LSA timers


Configure OSPFv2 LSA refresh interval, minimum interval, and throttle timer:

To configure:
 
DELLSONiC(config-router-ospf)# refresh timer refresh-time
DELLSONiC(config-router-ospf)#  timers lsa min-arrival min-arr-time
DELLSONiC(config-router-ospf)#  timers throttle lsa all throttle-time

To remove:
 
DELLSONiC(config-router-ospf)# no refresh timer
DELLSONiC(config-router-ospf)# no timers lsa min-arrival
DELLSONiC(config-router-ospf)# no timers throttle lsa all
 
  • refresh-time - Refresh time (10 to 1800 seconds)
  • min-arr-time - Minimum arrival time (0 to 600000 milliseconds)
  • throttle-time - Throttle time (0 to 5000 milliseconds)
Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)#  refresh timer 40
DELLSONiC(config-router-ospf)#  timers lsa min-arrival 30
DELLSONiC(config-router-ospf)#  timers throttle lsa all 150


Configure OSPF SPF throttle timers


OSPFv2 SPF algorithm throttle timers set initial-delay, the initial-hold-time and the maximum-hold-time between when SPF is calculated and the event which triggered the calculation. The times are specified in milliseconds and must be in the range of 0 to 600000 milliseconds.

The initial-delay specifies the minimum amount of time to delay SPF calculation. Hence it affects how long SPF calculation is delayed after an event which occurs outside of the hold-time of any previous SPF calculation, and also serves as a minimum hold-time.

Consecutive SPF calculations is always separated by at least 'hold-time' milliseconds. The hold-time is adaptive and initially is set to the initial-hold-time configured with the throttle command. Events which occur within the hold-time of the previous SPF calculation causes the hold-time to be increased by initial-hold-time, bounded by the maximum-hold-time configured with throttle command. If the adaptive hold-time elapses without any SPF-triggering event occurring then the current hold-time is reset to the initial-hold-time. You can view the current hold-time using the show ip ospf command, where it is expressed as
a multiplier of the initial-hold-time.

To configure:
 
DELLSONiC(config-router-ospf)# timers throttle spf initial-delay initial-hold-time max-hold-time

To remove:
 
DELLSONiC(config-router-ospf)# no timers throttle spf
 
  • initial-delay — Time value (0 to 600000 milliseconds)
  • initial-hold-time — Time value (0 to 600000 milliseconds)
  • max-hold-time — Time value (0 to 600000 milliseconds)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# timers throttle spf 200 400 10000

In the above example, the initial-delay is set to 200ms, the initial-hold-time is set to 400ms and the maximum-hold-time to 10s. Hence there is always at least 200ms between an event (which requires SPF calculation) and the SPF calculation. Further consecutive SPF calculations are always separated by between 400ms to 10s, the hold-time increases by 400ms each time an SPF-triggering-event occurs within the hold-time of the previous SPF calculation.


Configure OSPF max-metric advertising


OSPFv2, per RFC 313, describes its transit links in its router-LSA as having infinite distance (max-metric) so that other routers avoid calculating transit paths through the router while still being able to reach networks through the router.
This support may be enabled administratively (that is, indefinitely) or conditionally. Conditional enabling of max-metric router LSAs can be for a period of seconds after start-up.

Enabling this for a period after start-up allows OSPF to converge fully first without affecting any existing routes used by other routers, while still allowing any connected stub links and/or redistributed routes to be reachable.

Enabling this feature administratively allows for administrative intervention for whatever reason, for an indefinite period of time. Note that if the configuration is saved then this administrative form of the stub-router command is also saved. If system or docker is restarted later, the command then takes effect until it is manually unconfigured.

To configure:
 
DELLSONiC(config-router-ospf)# max-metric router-lsa administrative
DELLSONiC(config-router-ospf)#  max-metric router-lsa on-startup time-value

To remove:
 
DELLSONiC(config-router-ospf)# no max-metric router-lsa administrative
DELLSONiC(config-router-ospf)#  no max-metric router-lsa on-startup
 
  • time-value - Time value (5 to 86400 seconds)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# max-metric router-lsa administrative
DELLSONiC(config-router-ospf)# max-metric router-lsa on-startup 60
 

Configure OSPF route distances


Assign OSPFv2 calculated routes with user configured routing distances within a router. You can configure the distance value on all OSPFv2 generated routes. Distance value configurations can also be done based on the source of OSPF route, like intra-area route, interarea route and external route with respect to current router.

To configure:
 
DELLSONiC(config-router-ospf)# distance distance-value
DELLSONiC(config-router-ospf)# distance ospf intra-area distance-value
DELLSONiC(config-router-ospf)# distance ospf inter-area distance-value
DELLSONiC(config-router-ospf)# distance ospf external distance-value

To remove:
 
DELLSONiC(config-router-ospf)# no distance
DELLSONiC(config-router-ospf)# no distance ospf intra-area
DELLSONiC(config-router-ospf)# no distance ospf inter-area
DELLSONiC(config-router-ospf)# no distance ospf external
 
  • distance-value - Distance value for all type of routes (1…255)
Example:
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# distance 25
DELLSONiC(config-router-ospf)# distance ospf intra-area 30
DELLSONiC(config-router-ospf)# distance ospf inter-area 30
DELLSONiC(config-router-ospf)# distance ospf external 60


Configure OSPF auto cost reference bandwidth


OSPFv2 calculates route costs based on OSPF interface costs. Interface costs can either be manually configured or calculated automatically. Manually configured interface cost takes precedence over auto calculated interface cost.

Interface cost auto calculation is by considering a reference bandwidth and interface/link bandwidth. Cost of reference bandwidth is considered to be having cost 1. Default reference bandwidth is 100 Gigabytes. Link bandwidth is chosen in the preference order of configured link bandwidth or link actual speed or default link bandwidth (10G). Link cost is calculated as below.

Link cost = (Reference bandwidth) / (Link bandwidth + 0.5)

Calculated link cost can be of less than 1, in such a case it is always rounded to link cost 1.

To configure:
 
DELLSONiC(config-router-ospf)# auto-cost reference-bandwidth ref-bandwidth

To remove:
 
DELLSONiC(config-router-ospf)# no auto-cost reference-bandwidth
 
  • ref-bandwidth - Reference bandwidth (1 to 4294967 megabits)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# auto-cost reference-bandwidth 10000


Configure OSPF stub area and its parameters


Configure the OSPFv2 area as a stub area with or without summary routes. Stub area is an area where no router originates routes external to OSPF. Thus, this is an area where all external routes are considered reachable through ABRs. Hence, ABRs for such an area do not need to pass AS-External LSAs or ASBR-Summary LSAs into the area. They need to pass only the Network-Summary LSAs into such an area, along with a default-route summary. No summary stub area prevents the ABR from even injecting interarea summaries into the specified stub area.

To configure:
 
DELLSONiC(config-router-ospf)# area area-id stub [no-summary]
DELLSONiC(config-router-ospf)# area area-id default-cost cost-value

To remove:
 
DELLSONiC(config-router-ospf)# no area area-id stub [no-summary]
DELLSONiC(config-router-ospf)# no area area-id default-cost
 
  • area-id - OSPF area ID in decimal or dotted format - A.B.C.D or 0..4294967295
  • Cost-value - Default cost (0 to 16777215)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# area 1 stub
DELLSONiC(config-router-ospf)# area 2 stub no-summary
DELLSONiC(config-router-ospf)# area 2 default-cost 30
 

Configure OSPF inter area summary route filters


Manage the OSPFv2 inter area Summary LSA route propagation at an ABR using prefix lists and range lists.

Use the in prefix list to filter out incoming routes into an area at an ABR. Similarly use the out prefix list to filter out outgoing routes from an area.

Range lists can also be used to manage advertising of prefixes from an area. Using range lists it is possible to modify the prefix as well as cost or the route prefix to be advertised. This option summarizes intra area paths from specified area into one Type-3 summary-LSA announced to other areas. You can use this configuration only in ABR and you can summarize only router-LSAs and network-LSAs.

To configure:
 
DELLSONiC(config-router-ospf)# area area-id filter-list prefix prefix-list in
DELLSONiC(config-router-ospf)# area area-id filter-list prefix prefix-list out
DELLSONiC(config-router-ospf)# area area-id range ip-prefix
DELLSONiC(config-router-ospf)# area area-id range ip-prefix not-advertise
DELLSONiC(config-router-ospf)# area area-id range ip-prefix cost cost-value
DELLSONiC(config-router-ospf)# area area-id range ip-prefix advertise cost cost-value
DELLSONiC(config-router-ospf)# area area-id range ip-prefix substitute sub-ip-prefix

To remove:
 
DELLSONiC(config-router-ospf)# no area area-id filter-list prefix in
DELLSONiC(config-router-ospf)# no area area-id filter-list prefix out
DELLSONiC(config-router-ospf)# no area area-id range ip-prefix
DELLSONiC(config-router-ospf)# no area area-id range ip-prefix not-advertise
DELLSONiC(config-router-ospf)# no area area-id range ip-prefix cost
DELLSONiC(config-router-ospf)# no area area-id range ip-prefix advertise cost
DELLSONiC(config-router-ospf)# no area area-id range ip-prefix substitute
 
  • area-id - OSPF area ID in decimal or dotted format - A.B.C.D or 0..4294967295
  • prefix-list - IPv4 prefix list name
  • ip-prefix - Summary route address range prefix - A.B.C.D/mask 
  • cost-value - Cost value  - <0..16777215> 
  • sub-ip-prefix - Address prefix  - A.B.C.D/mask 

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# area 0 filter-list prefix arealistin in
DELLSONiC(config-router-ospf)# area 0 filter-list prefix arealistout out
 

Configure OSPF route redistribution


OSPFv2 can redistribute external routes into OSPF routing domain. Redistribute BGP routes, Static routes, connected routes, and kernel routes into OSPF routing domain. Manage route redistribution using route maps in addition to explicitly specified cost and metric type.

To configure:
 
DELLSONiC(config-router-ospf)# redistribute {kernel | connected | static| bgp} [metric metric-value| metric-type metric-type-value | route-map rmap-name}
DELLSONiC(config-router-ospf)# default-metric metric-value

To remove:
 
DELLSONiC(config-router-ospf)# no redistribute {kernel | connected | static | bgp} [metric | metric-type | route-map}
DELLSONiC(config-router-ospf)# no default-metric
 
  • metric-value - Route cost to applied on route (0 to 16777214)
  • metric-type-value - Metric type (1 and 2)
  • rmap-name - Name of the route map to be applied on routes

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# redistribute bgp
DELLSONiC(config-router-ospf)# redistribute static metric 20 metric-type 1
DELLSONiC(config-router-ospf)# redistribute bgp route-map ospf-rmap
DELLSONiC(config-router-ospf)# redistribute bgp metric 20 metric-type 1 route-map ospfrmap
DELLSONiC(config-router-ospf)# default-metric 30
 

Configure OSPF default route origination


Default routes can be originated into OSPF routing domain. This option originates an AS-External LSA describing a default route into all external-routing capable areas, of the specified metric and metric type. If the 'always' option is specified then the default route is always advertised, even when there is no default route present in the routing table.

To configure:
 
DELLSONiC(config-router-ospf)# default-information originate [{ always | metric metric-value| metric-type metric-type-value | route-map rmap-name }]

To remove:
 
DELLSONiC(config-router-ospf)# no default-information originate [{ always | metric | metric-type | route-map }]
 
  • metric-value - Route cost to applied on route (0 to 16777214)
  • metric-type-value - Metric type (1 and 2)
  • rmap-name - Name of the route map to be applied on routes

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# router ospf
DELLSONiC(config-router-ospf)# default-information originate
DELLSONiC(config-router-ospf)# default-information originate always
DELLSONiC(config-router-ospf)# default-information originate route-map ospf-rmap
DELLSONiC(config-router-ospf)# default-information originate metric 20 metric-type 1 route-map ospfrmap
 

Configure OSPF interface parameters


Configure OSPF interface parameters under SONiC interface configuration mode. Interface configuration includes:
  • Area association to an interface
  • Interface type, MTU
  • Message Authentication parameters
  • Session timer interval parameters
  • BFD

Interface parameters can also be associated with a specific interface address of the interface by specifying the interface IPv4 address. When interface address is specified, such a configuration parameter is applicable to only the OSPF session associated with the corresponding interface address.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf area area-id [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf area area-id [if-ip-addr]
 
  • area-id - OSPF area ID in decimal or dotted format - A.B.C.D or 0..4294967295
  • if-ip-addr - Interface IP address

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# int Eth 1/47
DELLSONiC(config-if-Eth1/47)# ip ospf area 10
DELLSONiC(config-if-Eth1/47)# ip ospf area 0.0.0.0 10.3.1.2

Configure the OSPFv2 interface network type under OSPF interface configuration mode. OSPF interface network is of network type broadcast by default.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf network {broadcast | point-to-point}

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf network {broadcast | point-to-point}

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# int Eth 1/47
DELLSONiC(config-if-Eth1/47)# ip ospf network broadcast

DELLSONiC(config)# int Eth 1/8
DELLSONiC(config-if-Eth1/8)# ip ospf network point-to-point

Configure the OSPFv2 interface session priority parameters under OSPF interface configuration mode. The router with the highest priority is more eligible to become Designated Router. Setting the value to 0, makes the router ineligible to become Designated Router. The default value is 1.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf priority priority-value [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf priority [if-ip-addr]
 
  • priority-value - Session priority (0 to 255)
  • if-ip-addr - Interface IP address

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# int Eth 1/47
DELLSONiC(config-if-Eth1/47)# ip ospf priority 10

Configure OSPFv2 interface session authentication parameters under OSPF interface configuration mode:

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf authentication [null | message-digest] [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# ip ospf authentication-key key [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# ip ospf message-digest-key key-id md5 key [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf authentication [null | message-digest] [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# no ip ospf authentication-key [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# no ip ospf message-digest-key key-id md5 [if-ip-addr]
 
  • if-ip-addr - Interface IPv4 address
  • key - Authentication key password (up to 8 or 16 characters)
  • key-id - MD5 authentication key Identifier (1 to 255)
  • if-ip-addr - Interface IP address

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf authentication
DELLSONiC(config-if-Eth1/1)# ip ospf authentication-key ospfpswd

DELLSONiC(config)# interface Eth1/2
DELLSONiC(config-if-Eth1/2)# ip ospf authentication 10.10.3.2
DELLSONiC(config-if-Eth1/2)# ip ospf authentication-key ospfpswd 10.10.3.2

DELLSONiC(config)# interface Eth1/3
DELLSONiC(config-if-Eth1/3)# ip ospf authentication message-digest
DELLSONiC(config-if-Eth1/3)# ip ospf message-digest-key 1 md5 ospfpswd1
DELLSONiC(config-if-Eth1/3)# ip ospf message-digest-key 2 md5 ospfpswd2
DELLSONiC(config-if-Eth1/3)# ip ospf message-digest-key 9 md5 ospfpswd9

DELLSONiC(config)# interface Eth1/4
DELLSONiC(config-if-Eth1/4)# ip ospf authentication null

Configure the OSPFv2 interface session BFD under OSPF interface configuration mode. OSPF interface BFD is disabled by default.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf bfd

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf bfd

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf bfd

Configure the OSPFv2 interface cost under OSPF interface configuration mode. The cost value is set to router-LSA's metric field and used for SPF calculation.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf cost cost-value [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf cost [if-ip-addr]
 
  • if-ip-addr - Interface IP address
  • cost-value - Interface cost (1 to 65535)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf cost 50

Configure OSPFv2 interface session MTU ignore under OSPF interface configuration mode. MTU is not ignored by default. MTU values of OSPF session interface ends shall match if MTU ignore is nor configured. Configuring MTU ignore does not guarantee the session establishment when there are large number of OSPF routes prefixes are present and router LSA message cannot accommodate them within the MTU size.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf mtu-ignore [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf mtu-ignore [if-ip-addr]
 
  • if-ip-addr - Interface IP address

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf mtu-ignore

Configure the OSPFv2 interface session hello timers under OSPF interface configuration mode. When configured, Hello packet is sent every timer value seconds on the specified interface. This value must be the same for all routers attached to a common network. The default value is 10 seconds.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf hello-interval time-interval [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf hello-interval [if-ip-addr]
 
  • if-ip-addr - Interface IP address
  • time-interval - Timer values (1 to 65535 seconds)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf hello-interval 15

Configure the OSPFv2 interface session transmit delay timers under OSPF interface configuration mode. When configured, LSAs' age should be incremented by this value when transmitting. The default value is 1 second.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf transmit-delay time-interval [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf transmit-delay [if-ip-addr]
 
  • if-ip-addr - Interface IP address
  • time-interval - Timer value (1 to 65535 seconds)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf transmit-delay 20

Configure OSPFv2 interface session retransmit interval timers under OSPF interface configuration mode. This value is used when retransmitting Database Description and Link State Request packets. The default value is 5 seconds.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf retransmit-interval time-interval [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf retransmit-interval [if-ip-addr]
 
  • if-ip-addr - Interface IP address
  • time-interval - Timer value (2 to 65535 seconds)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf retransmit-interval 25

Configure the OSPFv2 interface dead interval under OSPF interface configuration mode. OSPF Router Dead Interval timer value is used for session wait or inactivity Timer. This value must be the same for all routers attached to a common network. The default value is 40 seconds. If 'minimal' is specified instead of explicit wait time, then the dead-interval is set to 1 second and one must specify a hello-multiplier. The hello-multiplier specifies how many Hellos to send per second. The multiplier value can be from 1 (every 500ms) to 10 (every 50ms). Thus one can have 1s convergence time for OSPF. If this form is specified, then the hello-interval advertised in Hello packets is set to 0 and the hello-interval on received Hello packets is not checked, thus the hello-multiplier need NOT be the same across multiple routers on a common link.

To configure:
 
DELLSONiC(config-if-Eth1/47)# ip ospf dead-interval time-interval [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# ip ospf dead-interval minimal hello-multiplier multiplier [if-ip-addr]

To remove:
 
DELLSONiC(config-if-Eth1/47)# no ip ospf dead-interval [if-ip-addr]
DELLSONiC(config-if-Eth1/47)# no ip ospf dead-interval minimal hello-multiplier [if-ip-addr]
 
  • if-ip-addr - Interface IP address
  • time-interval - Timer value (1 to 65535 seconds)
  • multiplier - Dead interval hello multiplier value (1 to 10 seconds)

Example:
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure terminal
DELLSONiC(config)# interface Eth1/1
DELLSONiC(config-if-Eth1/1)# ip ospf dead-interval 60
DELLSONiC(config-if-Eth1/1)# ip ospf dead-interval minimal hello-multiplier 4
 

OSPF operational data display commands


SONiC provides display command to show the operational status of OSPF router, OSPF sessions and OSPF interfaces.
 

View the OSPF router information

 
show ip ospf [vrf vrf-name]
 
  • vrf-name - VRF name

Example:

 
DELLSONiC# show ip ospf
OSPF Routing Process, Router ID: 1.1.1.1
 Supports only single TOS (TOS0) routes
 This implementation conforms to RFC2328
 RFC1583Compatibility flag is enabled
 OpaqueCapability flag is disabled
 Initial SPF scheduling delay 0 millisec(s)
 Minimum hold time between consecutive SPFs 50 millisec(s)
 Maximum hold time between consecutive SPFs 5000 millisec(s)
 Hold time multiplier is currently 1
 time is 92031756
 SPF algorithm last executed 1065d4h22m ago
 Last SPF duration 0.0s
 SPF timer is inactive
 LSA minimum interval 5000 msecs
 LSA minimum arrival 1000 msecs
 Write Multiplier set to 20
 Refresh timer 10 secs
 Number of external LSA 0. Checksum Sum 0x0
 Number of opaque AS LSA 0. Checksum Sum 0x0
 Number of areas attached to this router: 2
 Area ID: 0.0.0.0 (Backbone)
 Number of interfaces in this area: Total: 1 , Active: 1
 Number of fully adjacent neighbors in this area: 1
 Area has no authentication
 SPF algorithm executed 8 times
 Number of LSA 3
 Number of router LSA 2. Checksum Sum 0x40f64b4000000000
 Number of network LSA 1. Checksum Sum 0x40d5adc000000000
 Number of summary LSA 0. Checksum Sum 0x0
 Number of ASBR summary LSA 0. Checksum Sum 0x0
 Number of NSSA LSA 0. Checksum Sum 0x0
 Number of opaque link LSA . Checksum Sum 0x
 Number of opaque area LSA 0. Checksum Sum 0x0
 Area ID: 0.0.0.1
 Number of interfaces in this area: Total: 1 , Active: 1
 Number of fully adjacent neighbors in this area: 0
 Area has no authentication
 SPF algorithm executed 1 times
 Number of LSA 2
 Number of router LSA 0. Checksum Sum 0x0
 Number of network LSA 0. Checksum Sum 0x0
 Number of summary LSA 2. Checksum Sum 0x40f1f61000000000
 Number of ASBR summary LSA 0. Checksum Sum 0x0
 Number of NSSA LSA 0. Checksum Sum 0x0
 Number of opaque link LSA . Checksum Sum 0x
 Number of opaque area LSA 0. Checksum Sum 0x0


View the OSPF neighbor information

 
show ip ospf [vrf vrf-name ] neighbor [detail | if-name | nbr-ip ]
 
  • vrf-name - VRF name
  • if-name - OSPF interface name
  • nbr-ip - Neighbor router ID

Example:
 
DELLSONiC# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface RXmtL
RqstL DBsmL
10.59.142.247 1 Full/Backup 37.343s 64.1.1.2 Eth 1/2:64.1.1.1 0
 0 0
DELLSONiC# show ip ospf neighbor Eth1/3 | no-more
Neighbor ID Pri State Dead Time Address Interface RXmtL
RqstL DBsmL
2.2.2.2 1 Full/Backup 38.245s 64.1.1.2 Eth 1/4:64.1.1.1 0
 0 0
DELLSONiC# show ip ospf neighbor detail
Neighbor 10.59.142.247, interface address 64.1.1.2
 In the area 0.0.0.0 via interface Eth 1/2
 Neighbor priority is 1, State is Full, 6 state changes
 Most recent state change statistics:
 Progressive change 7h3m25s ago
 DR is 64.1.1.1, BDR is 64.1.1.2
 Options 2 *|-|-|-|-|-|E|-
 Dead timer due in 30.687s
 Database Summary List 0
 Link State Request List 0
 Link State Retransmission List 0
 Thread Inactivity Timer on
 Thread Database Description Retransmission off
 Thread Link State Request Retransmission on
 Thread Link State Update Retransmission on


Leaf1# show ip ospf neighbor 2.2.2.2
 Neighbor 2.2.2.2, interface address 64.1.1.2
 In the area 0.0.0.0 via interface Eth 1/2
 Neighbor priority is 1, State is Full, 5 state changes
 Most recent state change statistics:
 Progressive change 0h1m11s ago
 DR is 64.1.1.1, BDR is 64.1.1.2
 Options 2 *|-|-|-|-|-|E|-
 Dead timer due in 33.203s
 Database Summary List 0
 Link State Request List 0
 Link State Retransmission List 0
 Thread Inactivity Timer on
 Thread Database Description Retransmision off
 Thread Link State Request Retransmission on
 Thread Link State Update Retransmission on


View the OSPF interface information

 
show ip ospf interface [if-name | traffic ]
 
  • if-name - OSPF interface name

Example:
 
DELLSONiC# show ip ospf interface
VRF Name: default
Eth 1/2 is up
 ifindex 128, MTU 9100 bytes, BW 25000 Mbit UP,BROADCAST,RUNNING,MULTICAST
 Internet Address 64.1.1.1/24, Broadcast 64.1.1.255, Area 0.0.0.0
 MTU mismatch detection: enabled
 Router ID 10.59.143.131, Network Type BROADCAST, Cost: 4
 Transmit Delay is 1 sec, State DR, Priority 1
 Backup Designated Router (ID) 10.59.142.247, Interface Address 64.1.1.2
 Saved Network-LSA sequence number 0x8000000f
 Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
 Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
 Hello due in 9.023s
 Neighbor Count is 1, Adjacent neighbor count is 1


DELLSONiC# show ip ospf interface Eth 1/3
VRF Name: default
Eth 1/4 is up
 ifindex 926, MTU 9100 bytes, BW 25000 Mbit UP,BROADCAST,RUNNING,MULTICAST
 Internet Address 65.1.1.1/24, Broadcast 65.1.1.255, Area 0.0.0.1
 MTU mismatch detection: enabled
 Router ID 1.1.1.1, Network Type BROADCAST, Cost: 4
 Transmit Delay is 1 sec, State DR, Priority 1
 Backup Designated Router (ID) 2.2.2.2, Interface Address 65.1.1.2
 Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
 Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
 Hello due in 7.957s
 Neighbor Count is 1, Adjacent neighbor count is 1


DELLSONiC# show ip ospf interface traffic
Interface HELLO DB-Desc LS-Req LS-Update LS-Ack
 Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx
-----------------------------------------------------------------------------------------
---
Eth 1/2 2563/2563 3/3 1/1 17/30 29/16
Leaf1# show ip ospf interface traffic Eth1/3
Interface HELLO DB-Desc LS-Req LS-Update LS-Ack
 Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx
-----------------------------------------------------------------------------------------

Eth1/3 19/22 2/3 1/1 3/3 2/2
 

View the OSPF Database information

 
show ip ospf [vrf vrf-name ] database [asbr-summary | external | network | router | summary | opaque-link]
 
  • vrf-name — VRF name

Example:
 
DELLSONiC# show ip ospf database
VRF Name: default
 OSPF Router with ID (5.5.5.5)
 Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Link count
3.3.3.3 3.3.3.3 988 0x80000003 0x04ec 1
5.5.5.5 5.5.5.5 988 0x80000008 0x6f6b 1
 Net Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
10.10.10.2 5.5.5.5 988 0x80000002 0xcc38
 Link-Local Opaque-LSA (Area 0.0.0.0)
Opaque-Type/Id ADV Router Age Seq# CkSum
3.0.0.0 3.3.3.3 89 0x80000001 0x4a24
DELLSONiC# show ip ospf database network
VRF Name: default
 OSPF Router with ID (10.59.143.131)
 Net Link States (Area 0.0.0.0)
 LS age: 1602
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x3
 LS Type: network-LSA
 Link State ID: 64.1.1.1 (address of Designated Router)
 Advertising Router: 10.59.143.131
 LS Seq Number: 8000000f
 Checksum: 0x1c70
 Length: 32
 Network Mask: /24
 Attached Router: 10.59.142.247
 Attached Router: 10.59.143.131

DELLSONiC# show ip ospf database summary
VRF Name: default
 OSPF Router with ID (1.1.1.1)
 Summary Link States (Area 0.0.0.0)
 LS age: 468
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x11
 LS Type: summary-LSA
 Link State ID: 65.1.1.0 (summary Network Number)
 Advertising Router: 1.1.1.1
 LS Seq Number: 80000001
 Checksum: 0x0e04
 Length: 28
 Network Mask: /24
 TOS: 0 Metric: 4
 LS age: 429
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x6
 LS Type: summary-LSA
 Link State ID: 65.1.1.0 (summary Network Number)
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000002
 Checksum: 0xed1f
 Length: 28
 Network Mask: /24
 TOS: 0 Metric: 4
 Summary Link States (Area 0.0.0.1)
 LS age: 468
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x11
 LS Type: summary-LSA
 Link State ID: 64.1.1.0 (summary Network Number)
 Advertising Router: 1.1.1.1
 LS Seq Number: 80000001
 Checksum: 0x1bf7
 Length: 28
 Network Mask: /24
 TOS: 0 Metric: 4
 LS age: 429
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x6
 LS Type: summary-LSA
 Link State ID: 64.1.1.0 (summary Network Number)
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000002
 Checksum: 0xfa13
 Length: 28
 Network Mask: /24
 TOS: 0 Metric: 4

DELLSONiC# show ip ospf database asbr-summary
VRF Name: default
 OSPF Router with ID (1.1.1.1)
 ASBR-Summary Link States (Area 0.0.0.0)
 LS age: 38
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Type: summary-LSA
 Link State ID: 2.2.2.2 (AS Boundary Router address)
 Advertising Router: 1.1.1.1
 LS Seq Number: 80000001
 Checksum: 0x0b41
 Length: 28
 Network Mask: /0
 TOS: 0 Metric: 4

DELLSONiC# show ip ospf database external
VRF Name: default
 OSPF Router with ID (1.1.1.1)
 AS External Link States
LS age: 52
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x6
 LS Type: AS-external-LSA
 Link State ID: 25.1.1.1 (External Network Number)
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000001
 Checksum: 0x0892
 Length: 36
 Network Mask: /32
 Metric Type: 2 (Larger than any link state path)
 TOS: 0
 Metric: 20
 Forward Address: 0.0.0.0
 External Route Tag: 0

DELLSONiC# show ip ospf database self-originate
VRF Name: default
 OSPF Router with ID (1.1.1.1)
 Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Link count
1.1.1.1 1.1.1.1 777 0x80000004 0x7b42 1
 Net Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
64.1.1.1 1.1.1.1 777 0x80000001 0x8581
 Summary Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Route
65.1.1.0 1.1.1.1 816 0x80000001 0x0e04 65.1.1.0/24
 ASBR-Summary Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
2.2.2.2 1.1.1.1 360 0x80000001 0x0b41
 Router Link States (Area 0.0.0.1)
Link ID ADV Router Age Seq# CkSum Link count
1.1.1.1 1.1.1.1 776 0x80000004 0x8d2e 1
 Net Link States (Area 0.0.0.1)
Link ID ADV Router Age Seq# CkSum
65.1.1.1 1.1.1.1 776 0x80000001 0x788d
 Summary Link States (Area 0.0.0.1)
Link ID ADV Router Age Seq# CkSum Route
64.1.1.0 1.1.1.1 816 0x80000001 0x1bf7 64.1.1.0/24

DELLSONiC# show ip ospf database network adv-router 1.1.1.1
VRF Name: default
 OSPF Router with ID (1.1.1.1)
 Net Link States (Area 0.0.0.0)
 LS age: 886
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x3
 LS Type: network-LSA
 Link State ID: 64.1.1.1 (address of Designated Router)
 Advertising Router: 1.1.1.1
 LS Seq Number: 80000001
Checksum: 0x8581
 Length: 32
 Network Mask: /24
 Attached Router: 1.1.1.1
 Attached Router: 2.2.2.2
 Net Link States (Area 0.0.0.1)
 LS age: 886
 Options: 0x2 : *|-|-|-|-|-|E|-
 LS Flags: 0x3
 LS Type: network-LSA
 Link State ID: 65.1.1.1 (address of Designated Router)
 Advertising Router: 1.1.1.1
 LS Seq Number: 80000001
 Checksum: 0x788d
 Length: 32
 Network Mask: /24
 Attached Router: 1.1.1.1
 Attached Router: 2.2.2.2
DELLSONiC# show ip ospf database opaque-link
VRF Name: default
 OSPF Router with ID (5.5.5.5)
 Link-Local Opaque-LSA (Area 0.0.0.0)
 LS age: 94
 Options: 0x66 : *|O|-|-|-|-|E|-
 LS Flags: 0x6
 LS Type: Link-Local Opaque-LSA
 Link State ID: 3.0.0.0 (Link-Local Opaque-Type/ID)
 Advertising Router: 3.3.3.3
 LS Seq Number: 80000001
 Checksum: 0x4a24
 Length: 44


View the OSPF route information

 
show ip ospf [ vrf vrf-name ] route
 
  • vrf-name - VRF name

Example:

 
DELLSONiC# show ip ospf vrf Vrf1 route | no-more
VRF Name: Vrf1
============ OSPF network routing table ============
N 101.1.1.0/24 [10] area: 0.0.0.0
 directly attached to Vlan101
============ OSPF router routing table =============
============ OSPF external routing table ===========
 

OSPFv2 graceful restart


When routers that are participating in OSPF are restarted, there is a period of traffic loss until the routers come back online and relearn the routes.

RFC 3623 specifies the Graceful Restart enhancement to OSPF as follows:
  • The router attempting a graceful restart originates link-local Opaque-LSAs (Grace-LSAs), announcing its intention to perform a graceful restart within a specified amount of time or grace period.
  • During the grace period, the neighbors continue to announce the restarting router in their LSAs as if it were fully adjacent (that is, OSPF neighbor state Full), but only if the network topology remains static (that is, the contents of the LSAs in the link-state database having LS types 1 to 5, and 7 remain unchanged, and periodic refreshes are allowed).

Graceful restart allows the restarting router to inform its neighbors that it is going to restart. As the neighbors are informed of the condition, they continue forwarding traffic to the restarting node. As the forwarding table of the restarting node is preserved during graceful restart, traffic loss is avoided.


Planned outages


Enterprise SONiC supports OSPF graceful restart only for planned outages.

Graceful restart is enabled for OSPF instances. System warm restart is triggered using the warm-reboot command.


Restarting and helper nodes


With graceful restart, there are two types of devices that participate in the OSPF network. They are restarting and helper nodes.

The restarting node is the device that gracefully restarts without having a traffic loss. When the restarting node performs a graceful restart, it floods link-local opaque LSAs ( grace-LSAs) on all OSPF interfaces. These grace LSAs inform the helper router that the neighbor intends to restart.

Helper nodes help the restarting node so that there is no traffic loss. A helper node monitors the network for topology changes. If there is no change in the network, the helper continues to advertise its LSAs as if the restarting node had remained in continuous OSPF operation. The helper LSAs continue to list an adjacency to the restarting node over network segment, regardless of the synchronization state of the restarting node.


Configure OSPFv2 graceful restart


To configure graceful restart, follow these steps:

1. Enable graceful restart.
 
DELLSONiC(config-router-ospf)# graceful-restart [grace-period grace-period]
 
  • grace-period - The grace period before which the neighbors or helpers deem the restarting node dead. The range is from 1 to 1800 seconds. The default grace period is 120 seconds

2. Configure OSPFv2 opaque capability to help the restarting router to initiate grace LSAs.
 
DELLSONiC (config-router-ospf)# capability opaque

3. Configure OSPFv2 graceful restart helper on the system for all or a specific router ID. Do this on all nodes that you are using to help the restarting router.
 
DELLSONiC (config-router-ospf)# graceful-restart helper enable [router-id]
 
  • router-id — Configure graceful restart helper support for a specific neighbor using the router ID.

4. (Optional) Configure the grace time on the helper node. This configuration determines the time period for the helper to support graceful restart.
 
DELLSONiC (config-router-ospf)# graceful-restart helper supported-grace-time grace-time
 
  • grace-time — Configure the grace time. The range is from 10 to 1800 seconds. The default value is 120 seconds.

5. (Optional) Configure strict LSA checking on the helper node. If this command is configured, the helper cancels graceful restart when an LSA change occurs, which affects the restarting router. By default, strict LSA checking is enabled.
 
DELLSONiC (config-router-ospf)# graceful-restart helper strict-lsa-checking

6. (Optional) Configure helper support for only planned restarts.
 
DELLSONiC (config-router-ospf)# graceful-restart helper planned-only
 

View OSPFv2 graceful restart information


Use the following commands to view graceful restart helper information.

View general OSPF information including if graceful restart and opaque capability are enabled.
 
sonic# show ip ospf
VRF Name: default
OSPF Routing Process, Router ID: 1.1.1.2
Supports only single TOS (TOS0) routes
This implementation conforms to RFC2328
RFC1583Compatibility flag is disabled
OpaqueCapability flag is enabled
Graceful-Restart is enabled
Stub router advertisement is configured
 Enabled for 600s after start-up
Initial SPF scheduling delay 0 millisec(s)
Minimum hold time between consecutive SPFs 50 millisec(s)
Maximum hold time between consecutive SPFs 5000 millisec(s)
Hold time multiplier is currently 1
SPF algorithm last executed 19h39m37s ago
Last SPF duration 72320 usecs
SPF timer is inactive
LSA minimum interval 5000 msecs
LSA minimum arrival 0 msecs
Write Multiplier set to 20
Refresh timer 10 secs
Maximum multiple paths(ECMP) supported 256
Number of external LSA 0. Checksum Sum 0x00000000
Number of opaque AS LSA 0. Checksum Sum 0x00000000
Number of areas attached to this router: 1
Area ID: 0.0.0.0 (Backbone)
 Number of interfaces in this area: Total: 224 , Active: 224
 Number of fully adjacent neighbors in this area: 32
 Area has simple password authentication
 SPF algorithm executed 247 times
 Number of LSA 6068
 Number of router LSA 6. Checksum Sum 0x00020692
 Number of network LSA 62. Checksum Sum 0x001ab353
 Number of summary LSA 6000. Checksum Sum 0x0bc36229
 Number of ASBR summary LSA 0. Checksum Sum 0x00000000
 Number of NSSA LSA 0. Checksum Sum 0x00000000
 Number of opaque link LSA 0. Checksum Sum 0x00000000
 Number of opaque area LSA 0. Checksum Sum 0x00000000

View the OSPF neighbor information and details about graceful restart helper.
 
sonic# show ip ospf neighbor detail
Neighbor 13.13.13.13, interface address 192.168.10.1
 In the area 0.0.0.0 via interface Ethernet64
 Neighbor priority is 1, State is Full, 6 state changes
 Most recent state change statistics:
 Progressive change 17h32m19s ago
 DR is 192.168.10.1, BDR is 192.168.10.2
 Options 66 *|O|-|-|-|-|E|-
 Dead timer due in 0.717s
 Database Summary List 0
 Link State Request List 0
  Link State Retransmission List 0
 Thread Inactivity Timer on
 Thread Database Description Retransmision off
 Thread Link State Request Retransmission on
 Thread Link State Update Retransmission on
 Graceful restart Helper info:
 Graceful Restart HELPER Status: Inprogress
 Graceful Restart grace period time: 250 (seconds).
 Graceful Restart reason: Software restart

View OSPF graceful restart helper information.
 
sonic# show ip ospf graceful-restart helper
 VRF Name: default
 OSPF Router with ID (14.14.14.14)
 Graceful restart helper support enabled.
 Strict LSA check is enabled.
 Helper supported for planned restarts only.
 Supported Graceful restart interval: 1600(in seconds).
 Enable Router List:
 ['13.13.13.13']

View OSPF detailed graceful restart helper information.
 
sonic# show ip ospf graceful-restart helper detail
 VRF Name: default
 OSPF Router with ID (14.14.14.14)
 Graceful restart helper support enabled.
 Strict LSA check is enabled.
 Helper supported for planned restarts only.
 Supported Graceful restart interval: 1600(in seconds).
 Enable Router List:
 ['13.13.13.13']
 Number of Active neighbours in graceful restart: 4
 Neighbour 1:
 Address: 192.168.10.1
 Routerid: 13.13.13.13
 Received Grace period: 250(in seconds).
 Actual Grace period: 250(in seconds).
 Remaining GraceTime: 245(in seconds).
 Graceful Restart reason: Software restart.
 Neighbour 2:
 Address: 192.168.20.1
 Routerid: 13.13.13.13
 Received Grace period: 250(in seconds).
 Actual Grace period: 250(in seconds).
 Remaining GraceTime: 245(in seconds).
 Graceful Restart reason: Software restart.
 Neighbour 3:
 Address: 192.168.30.1
 Routerid: 13.13.13.13
 Received Grace period: 250(in seconds).
 Actual Grace period: 250(in seconds).
 Remaining GraceTime: 245(in seconds).
 Graceful Restart reason: Software restart.
 Neighbour 4:
 Address: 192.168.40.1
 Routerid: 13.13.13.13
 Received Grace period: 250(in seconds).
 Actual Grace period: 250(in seconds).
 Remaining GraceTime: 245(in seconds).
 Graceful Restart reason: Software restart.

Affected Products

Enterprise SONiC Distribution, PowerSwitch N3000 Series, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON
Article Properties
Article Number: 000218990
Article Type: How To
Last Modified: 29 Feb 2024
Version:  1
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.