OSPF Operational Commands

OSPF Show Commands

OSPF ABR

Displays the OSPF Area Border Router (ABR) information.

Syntax:

show ospf abr

Example: OSPF ABR information

supervisor@rtbrick>SPINE01: cfg> show ospf abr
Instance: default, Area: 198.51.100.0
  Node ID         Cost     Advertising Router    Flags       Interface      Nexthop
  198.51.100.20   10000    198.51.100.20        -|-|-|B      ifl-0/0/0/1    198.51.100.27
  198.51.100.30    20000   198.51.100.30        -|-|-|B      ifl-0/0/0/1    198.51.100.27
  198.51.100.40    55000   198.51.100.40        -|-|-|B      ifl-0/0/0/1    198.51.100.27
  198.51.100.50    55000   198.51.100.50        -|-|-|B      ifl-0/0/0/1    198.51.100.27

OSPF ASBR

Displays Autonomous System Border Router information.

Syntax:

show ospf asbr

Example: OSPF ASBR information

supervisor@rtbrick>SPINE01: cfg> show ospf asbr
Instance: default, Area:
  Node ID         Cost     Advertising Router  Flags     Interface         Nexthop
  198.51.100.32    40000    198.51.100.20                ifl-0/0/0/1      198.51.100.27

OSPF LSA Request List

Displays the list of all link-state advertisements (LSAs) requests which have been sent or received by a router.

Syntax:

show ospf request-list <options>

Option Description

in

Displays the list of all link-state advertisement (LSA) requests which have been received from other routers.

out

Displays the list of all link-state advertisement (LSA) requests which have been sent or transmitted from the router.

detail

Provides detailed information.

Example 1: OSPF LSA requests sent to a neighbor

supervisor@rtbrick>SPINE01: op> show ospf request-list out
Instance: default
  Type            Link State ID   Advertising Router     Age      Sequence      Checksum
  Summary-Network 1.0.128.0       198.51.100.23           99      0x80000001     0x23ed
  Summary-Network 1.0.129.0       198.51.100.23           99      0x80000001     0x18f7
  Summary-Network 1.0.130.0       198.51.100.23           99      0x80000001     0xd02

Example 2: Detailed information for OSPF LSA requests sent to a neighbor

supervisor@rtbrick>SPINE01: op> show ospf request-list out detail
Instance: default, LSAs
  LSA ID: 1.0.128.0
    Advertised router : 198.51.100.23
    LSA type          : Summary-Network
    LSA age           : 179
    Sequence number   : 0x80000001
    Length            : 0
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0x23ed
    Interface         : ifl-0/1/26/10
    Router ID         : 198.51.100.42
    Neighbor Address  : 198.51.100.91
  LSA ID: 1.0.129.0
    Advertised router : 198.51.100.23
    LSA type          : Summary-Network
    LSA age           : 179
    Sequence number   : 0x80000001
    Length            : 0
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0x18f7
    Interface         : ifl-0/1/26/10
    Router ID         : 198.51.100.42
    Neighbor Address  : 198.51.100.91
  LSA ID: 1.0.130.0
    Advertised router : 198.51.100.23
    LSA type          : Summary-Network
    LSA age           : 179
    Sequence number   : 0x80000001
    Length            : 0
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0xd02
    Interface         : ifl-0/1/26/10
    Router ID         : 198.51.100.42
    Neighbor Address  : 198.51.100.91

Example 3: OSPF LSA requests which have been received.

supervisor@rtbrick>SPINE01: op> show ospf request-list in
Instance: default
  Type            Link State ID   Advertising Router      Age      Sequence       Checksum
  Summary-Network 1.48.201.0      198.51.100.23           159      0x80000001     0x4c23
  Summary-Network 1.48.202.0      198.51.100.23           159      0x80000001     0x412d
  Summary-Network 1.48.203.0      198.51.100.23           159      0x80000001     0x3637

Example 4: Detailed information for OSPF LSA requests which have been received.

supervisor@rtbrick>SPINE01: op> show ospf request-list in detail
Instance: default, LSAs
  LSA ID: 1.48.201.0
    Advertised router : 198.51.100.23
    LSA type          : Summary-Network
    LSA age           : 164
    Sequence number   : 0x80000001
    Length            : 28
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0x4c23
    Interface         : ifl-0/0/29/10
    Router ID         : 198.51.100.23
    Neighbor Address  : 198.51.100.16
  LSA ID: 1.48.202.0
    Advertised router : 198.51.100.23
    LSA type          : Summary-Network
    LSA age           : 164
    Sequence number   : 0x80000001
    Length            : 28
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0x412d
    Interface         : ifl-0/0/29/10
    Router ID         : 198.51.100.23
    Neighbor Address  : 198.51.100.16
  LSA ID: 1.48.203.0
    Advertised router : 198.51.100.23
    LSA type          : Summary-Network
    LSA age           : 164
    Sequence number   : 0x80000001
    Length            : 28
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0x3637
    Interface         : ifl-0/0/29/10
    Router ID         : 198.51.100.23
    Neighbor Address  : 198.51.100.16

OSPF Retransmission List

Displays the list of all LSAs waiting to be re-sent or re-transmitted from the router.

Syntax:

show ospf retransmit-list <option>

Option Description

detail

Provides detailed information of all LSAs waiting to be re-sent.

Example: OSPF LSA requests waiting to be retransmitted.

supervisor@rtbrick>SPINE01: op> show ospf retransmit-list
Instance: default
  Type            Link State ID   Advertising Router     Age      Sequence      Checksum
  Summary-Network 1.0.128.0       198.51.100.23           99      0x80000001     0x23ed
  Summary-Network 1.0.129.0       198.51.100.23           99      0x80000001     0x18f7
  Summary-Network 1.0.130.0       198.51.100.23           99      0x80000001     0xd02

OSPF Summary

Displays the OSPF protocol summary information.

Syntax:

show ospf summary <options>

Option Description

-

Without any option, the command displays the information for all instances.

instance <instance-name>

OSPF summary information for the given instance.

Example: OSPF summary for the default instance

supervisor@rtbrick>SPINE01: op> show ospf summary
Instance: default
  General information
    Router ID: 198.51.100.15, Flags: -|-|-|-|-
    Flood interval: 1000, Area count: 1,
    Opaque capability: False
    Segment routing capability: False
    Instance Lsa Checksum: 0x3c6fc6
  Area: 198.51.100.0
    Area Lsa Checksum: 0x39a32e
    Interface count: 7
    Interface: ifl-0/0/0/1
      Address: 198.51.100.85, Cost: 10000, State: Backup
      Type: broadcast, MTU: 1500, Priority: 1
      Designated Router: 198.51.100.27, Backup Designated Router: 198.51.100.85
      Timers
        Hello interval: 10 sec, Dead interval: 40 sec
    Interface: ifl-0/0/0/100
      Address: 12.1.0.1, Cost: 20000, State: P2P
      Type: p2p, MTU: 1500, Priority: 1
      Designated Router: 198.51.100.0, Backup Designated Router: 198.51.100.0
      Timers
        Hello interval: 10 sec, Dead interval: 40 sec
    Interface: lo-0/0/0/1
      Address: 198.51.100.15, Cost: 10000, State: P2P
      Type: p2p, MTU: 1500, Priority: 1
      Designated Router: 198.51.100.0, Backup Designated Router: 198.51.100.0
      Timers
        Hello interval: 10 sec, Dead interval: 40 sec

OSPF Interface

Displays OSPF interface information.

Syntax:

show ospf interface <options>

Option Description

-

Without any option, the command displays the interface information for all instances.

detail

Displays the detailed interface information.

interface-name <interface-name> <detail>

Displays detailed information for the specified interface.

instance <instance-name>

OSPF interface information for the given instance.

instance <instance-name> <detail>

Displays detailed information for the given instance.

instance <instance-name> <interface-name>

Displays information for a specified interface for a given instance.

Example 1: OSPF interface information for the default instance

supervisor@rtbrick>SPINE01: op> show ospf interface
Instance: default
Interface     Area           IP Address     State    Type      Cost   Priority DR          BDR              MTU
ifl-0/0/0/1   198.51.100.0   198.51.100.85  Backup   broadcast  10000  1    198.51.100.27 198.51.100.85     1500
ifl-0/0/0/100 198.51.100.0   198.51.100.77  P2P      p2p        20000  1    198.51.100.0  198.51.100.0      1500
lo-0/0/0/1    198.51.100.0   198.51.100.15  P2P      p2p        10000  1    198.51.100.0  198.51.100.0      1500

Example 2: OSPF interface detailed information

supervisor@rtbrick>SPINE01: cfg> show ospf interface ifl-0/0/1/100 detail
Instance: default
  Interface: ifl-0/0/1/100, Area: 198.51.100.0
    State            : Backup                   Type                    : broadcast
    Primary IPv4     : 198.51.100.44                 Router Priority         : 1
    Designated Router: 198.51.100.49                 Backup Designated Router: 198.51.100.44
    Metric           : 30000                    IPv4 MTU                : 1500
    Hello Interval   : 10                       Router Dead Interval    : 40
    Wait Timer       : 40                       Auth Type               : none
    Capabilities     : *|-|-|-|-|-|E|*
    Received messages:                          Sent messages:
      Hello               : 6641                  Hello               : 6642
      Data descriptor     : 247                   Data descriptor     : 248
      LS request          : 0                     LS request          : 1
      LS update           : 59459                 LS update           : 117118
      LS acknowledgement  : 1292                  LS acknowledgement  : 1305

OSPF Neighbor

Displays OSPF neighbor information.

Syntax:

show ospf neighbor <options>

Option Description

-

Without any option, the command displays the neighbor information for all instances.

instance <instance-name>

OSPF neighbor information for the given instance.

detail

Displays the detailed neighbor information.

interface <interface-name>

Displays the neighbor information for a specified interface.

instance <instance-name> detail

Displays detailed OSPF neighbor information for the given instance.

instance <instance-name> interface <interface-name>

Displays OSPF neighbor information for the specified interface for the given instance.

instance <instance-name> interface <interface-name> detail

Displays detailed OSPF neighbor information for the specified interface for the given instance.

interface <interface-name> detail

Displays detailed neighbor information for a specified interface.

Example: OSPF neighbor information for the default instance

supervisor@rtbrick>SPINE01: op> show ospf neighbor
Instance: default
Address        Interface    Router ID      Area         State  Priority  DR        BDR            Uptime          Expires
198.51.100.27 ifl-0/0/0/1   198.51.100.20  198.51.100.0  Full  1   198.51.100.27  198.51.100.85  0d:01h:31m:57s  38 Seconds
198.51.100.4  ifl-0/0/0/100 198.51.100.20  198.51.100.0  Full  1   198.51.100.0   198.51.100.0   0d:01h:32m:36s  39 Seconds

OSPF Database

Displays information from OSPF link-state database that contains data about link-state advertisements (LSAs).

Syntax:

show ospf database <options>

Option Description

advertising-router <router-id>

Displays LSDB information for the specified advertising router.

advertising-router <router-id> detail

Displays the detailed LSDB information for the specified advertising router.

advertising-router <router-id> ls-id <ls-id>

Displays the LSDB information for the specified link-state ID for the advertising router.

advertising-router <router-id> ls-type external

Displays the LSDB information for the specified LSA type for the advertising router. Link-state advertisement type includes external, network, router, and summary.

detail

Displays detailed information from LSDB.

instance <instance-name>

Displays OSPF database information for the given instance.

ls-id <ls-id>

OSPF database information for a specific link-state identifier.

ls-type <type>

OSPF database information for the specified link-state type. Link-state advertisement type includes external, network, router and summary.

area <area-id>

Displays database information for the specified OSPF area.

area <area-id> advertising-router <router-id>

Displays LSDB information for the specified advertising router for a specified OSPF area.

area <area-id> detail

Displays detailed LSDB information for the specified OSPF area.

area <area-id> ls-id <ls-id>

Displays LSDB information for the specified link-state identifier for the specified OSPF area.

area <area-id> ls-type <type>

Displays LSDB information for the specified link-state type for the specified OSPF area. Link-state advertisement type includes external, network, router and summary.

instance <instance-name> advertising router <router-id>

Displays LSDB information for the specified advertising router for the given instance.

instance <instance-name> area <area-id>

Displays LSDB information for the specified area for the given instance.

instance <instance-name> ls-id <ls-id>

Displays LSDB information for the specified link-state identifier for the given instance.

instance <instance-name> ls-type <type>

Displays LSDB information for the specified type of the given instance. Link-state advertisement type includes external, network, router and summary.

Example 1: OSPF database information for the default instance

supervisor@rtbrick>SPINE01: cfg> show ospf database
Instance: default, Area: 198.51.100.0
  Type            Link State ID   Advertising Router   Age     Sequence     Checksum     Cost   Link Count
  Router          198.51.100.15   198.51.100.15         71      0x80000009     0x7cb6        -      4
  Router          198.51.100.20   198.51.100.20         57      0x8000000a     0x2f7d        -      4
  Network         198.51.100.27   198.51.100.20         329     0x80000004     0x7e5c        -      2
  Summary-Network 198.51.100.65   198.51.100.20         374     0x80000004     0xbc36    15000      -
  Summary-Network 198.51.100.22   198.51.100.20         374     0x80000004     0x7aae    10000      -
  Summary-Asbr    198.51.100.32   198.51.100.20         324     0x80000004     0xe7aa    30000      -
Instance: default
  Type            Link State ID   Advertising Router    Age      Sequence     Checksum    Cost    Link Count
  External        198.50.100.53   198.51.100.32         374      0x80000004    0xba29     16777214   -

Example 2: OSPF database detailed information

supervisor@rtbrick>SPINE01: cfg> show ospf database detail
Instance: default, Area: 198.51.100.0 LSAs
  LSA ID: 198.51.100.15
    Advertised router : 198.51.100.15
    LSA type          : Router
    LSA age           : 417
    Sequence number   : 0x80000009
    Length            : 72
    Options           : *|-|-|-|-|-|E|*
    Checksum          : 0x7cb6
    Flags             : -|-|-|-
    Number of links   : 4
      Link ID: 198.51.100.27
        Link Data       : 198.51.100.85
        Type            : Transit
        Type of service : 0
        Metric          : 10000
      Link ID: 198.51.100.20
        Link Data       : 12.1.0.1
        Type            : P2P
        Type of service : 0
        Metric          : 20000
      Link ID: 12.1.0.0
        Link Data       : 255.255.255.0
        Type            : Stub
        Type of service : 0
        Metric          : 10000
      Link ID: 198.51.100.15
        Link Data       : 255.255.255.255
        Type            : Stub
        Type of service : 0
        Metric          : 10000
  LSA ID: 198.51.100.20
    Advertised router : 198.51.100.20
    LSA type          : Router
    LSA age           : 25
    Sequence number   : 0x8000000a
    Length            : 72
    Options           : *|-|-|-|-|-|E|*
    Checksum          : 0x2f7d
    Flags             : -|-|-|B
    Number of links   : 4
      Link ID: 198.51.100.27
        Link Data       : 198.51.100.27
        Type            : Transit
        Type of service : 0
        Metric          : 10000
      Link ID: 198.51.100.15
        Link Data       : 198.51.100.4
        Type            : P2P
        Type of service : 0
        Metric          : 20000
      Link ID: 12.1.0.0
        Link Data       : 255.255.255.0
        Type            : Stub
        Type of service : 0
        Metric          : 20000
      Link ID: 198.51.100.20
        Link Data       : 255.255.255.255
        Type            : Stub
        Type of service : 0
        Metric          : 10000
  LSA ID: 198.51.100.27
    Advertised router : 198.51.100.20
    LSA type          : Network
    LSA age           : 776
    Sequence number   : 0x80000004
    Length            : 32
    Options           : *|-|-|-|-|-|E|*
    Checksum          : 0x7e5c
    Mask              : 255.255.255.0
  LSA ID: 24.0.1.0
    Advertised router : 198.51.100.20
    LSA type          : Summary-Network
    LSA age           : 821
    Sequence number   : 0x80000004
    Length            : 28
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0xbc36
    Mask              : 255.255.255.0
    Metric            : 15000
  LSA ID: 198.51.100.22
    Advertised router : 198.51.100.20
    LSA type          : Summary-Network
    LSA age           : 821
    Sequence number   : 0x80000004
    Length            : 28
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0x7aae
    Mask              : 255.255.255.255
    Metric            : 10000
  LSA ID: 198.51.100.32
    Advertised router : 198.51.100.20
    LSA type          : Summary-Asbr
    LSA age           : 771
    Sequence number   : 0x80000004
    Length            : 28
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0xe7aa
    Mask              : 255.255.255.255
    Metric            : 30000
Instance: default, Area:  LSAs
  LSA ID: 198.50.100.53
    Advertised router : 198.51.100.32
    LSA type          : External
    LSA age           : 821
    Sequence number   : 0x80000004
    Length            : 36
    Options           : *|-|-|-|-|-|-|*
    Checksum          : 0xba29
    Mask              : 255.255.255.0
    Metric            : 16777214
    Metric Type       : EXTERNAL_TYPE_1
    Forwarding Address: 198.51.100.0
    Route Tag         : 0

Example 3: OSPF database for an advertising router

supervisor@rtbrick>SPINE01: cfg> show ospf database advertising-router 198.51.100.15
Instance: default, Area: 198.51.100.0
  Type       Link State ID   Advertising Router   Age    Sequence   Checksum     Cost  Link Count
  Router     198.51.100.15    198.51.100.15         690    0x80000009 0x7cb6        -          4

OSPF SPF Result

Displays SPF results.

Syntax:

show ospf spf result <options>

Option Description

-

Without any option, the command displays the SPF result of all instances.

area <area-id>

Displays SPF result for the specified area.

instance <instance-name>

Name of the instance

node-id <node-id>

Displays SPF result for the specified node identifier.

area <area-id> <node-id>

Displays SPF result for the specified node identifier for a specified area.

instance <instance-name> area <area-id>

Displays SPF result for the specified area for a given instance.

instance <instance-name> node-id <node-id>

Displays SPF result for the specified node identifier for a given instance.

Example 1: OSPF SPF Result for the default instance

supervisor@rtbrick>SPINE01: op> show ospf spf result
Instance: default, Area: 198.51.100.0
Node ID       Type     Cost     Advertising Router  Flags      Neighbor Node     Interface      Nexthop
198.51.100.27 NETWORK  10000    198.51.100.20       -|-|-|-    -                 local          -
198.51.100.15 ROUTER   0        198.51.100.15       -|-|-|-    -                 local          -
198.51.100.20 ROUTER   10000    198.51.100.20       -|-|-|B    198.51.100.20     ifl-0/0/0/1    198.51.100.27
                                                               198.51.100.20     ifl-0/0/0/100  198.51.100.4

Example 2: OSPF SPF Result for the specified node identifier for the given area

supervisor@rtbrick>SPINE01: op> show ospf spf result area 198.51.100.0 node-id 198.51.100.27
Instance: default, Area: 198.51.100.0
Node ID        Type      Cost     Advertising Router    Flags     Neighbor Node    Interface    Nexthop
198.51.100.27  NETWORK   10000    198.51.100.20         -|-|-|-    -               local        -

OSPF Route

Displays OSPF routing table information.

Syntax:

show ospf route <options>

Option Description

-

Without any option, the command displays the OSPF route information for all instances.

instance <instance-name>

OSPF route information for the given instance.

instance <instance-name> <afi>

Displays OSPF route information for the specified address family and instance. The supported AFI value is IPv4.

instance <instance-name> AFI <ipv4> <unicast | labeled-unicast>

Displays OSPF route information for the specified SAFI for a specified address family.

instance <instance-name> label <label>

Displays OSPF route information for the specified label and instance.

instance <instance-name> mpls unicast label <label> | type <type>

Displays OSPF route information for the specified MPLS unicast label or type for the instance.

prefix <ip>

Displays OSPF route information for the specified match prefix.

type

Displays information for OSPF route type. The route types include external-type-1, external-type-2, inter-area, intra-area, and ospf-direct.

ipv4 prefix <ip>

Displays OSPF route information for the specified IPv4 prefix.

label <label>

Displays information about the OSPF-labeled routes.

mpls unicast <label | type>

Displays information about OSPF MPLS routes

Example: OSPF route information for the default instance

supervisor@rtbrick>SPINE01: op> show ospf route
Instance: default, AFI: ipv4, SAFI: unicast
  Prefix            Area              Type           Cost    Next Hop        Interface
  12.0.0.0/24       198.51.100.0      ospf-direct    10000   n/a             local
  12.1.0.0/24       198.51.100.0      ospf-direct    10000   n/a             local
  24.0.1.0/24       198.51.100.0      inter-area     25000   198.51.100.27   ifl-0/0/0/1
                                                             198.51.100.4    ifl-0/0/0/100
  24.1.1.0/24       198.51.100.0      inter-area     20000   198.51.100.27   ifl-0/0/0/1
                                                             198.51.100.4    ifl-0/0/0/100
  25.0.1.0/24       198.51.100.0      inter-area     35000   198.51.100.27   ifl-0/0/0/1
                                                             198.51.100.4    ifl-0/0/0/100
  198.51.100.15/32  198.51.100.0      ospf-direct    10000   n/a             local
  198.51.100.20/32  198.51.100.0      intra-area     20000   198.51.100.27   ifl-0/0/0/1

OSPF Clear Commands

Clear OSPF Neighbor

Clear OSPF neighbor state information.

Syntax:

clear ospf neighbor <options>

Option Description

-

Without any option, the command clears all the OSPF neighbors.

instance <instance-name>

Clears OSPF neighbor information for the specified instance.

instance <instance-name> area <area-id>

Clears OSPF neighbor for the specified area for the given instance.

instance <instance-name> area <area-id> interface <interface-name>

Clears OSPF neighbor for the specified interface for the specified area of the given instance.

Example:

supervisor@rtbrick>SPINE01: cfg> clear ospf neighbor instance default area 198.51.100.0 interface ifl-0/0/1/100
Instance [default], area[198.51.100.0], interface[ifl-0/0/1/100] clear triggered