show ip ospf routes

Syntax

show ip ospf [<INSTANCE-TAG>] routes 
     [<PREFIX/LENGTH>] [all-vrfs | vrf <VRF-NAME>] [vsx-peer]

Description

Displays OSPF routing table information.

Command context

Operator (>) or Manager (#)

Parameters

<INSTANCE-TAG>

Enter an OSPF Process ID to display information on the OSPF routing table for the particular OSPF process. Range: 1-63.

<PREFIX/LENGTH>

Select to display information about a particular network prefix (subnet), specified in IPv4 format (A.B.C.D/M).

all-vrfs

Optionally select to display OSPF routing table information for all VRFs.

vrf <VRF-NAME>

Optionally select to display routing table information for a particular VRF. If the VRF is not specified, information for the default VRF is displayed.

[vsx-peer]

Shows the output from the VSX peer switch. If the switches do not have the VSX configuration or the ISL is down, the output from the VSX peer switch is not displayed.

Authority

Operators or Administrators. Users without administrator authority can execute this command from the operator context (>) only.

Examples

Showing OSPF routing table information:

switch# show ip ospf routes
Codes: i - Intra-area route, I - Inter-area route
       E1 - External type-1, E2 - External type-2

OSPF Process ID 1 VRF default, Routing Table
---------------------------------------------

Total Number of Routes : 2

10.1.1.0/24        (i) area: 0.0.0.0
     directly attached to interface 1/1/1, cost 1 distance 110
20.1.1.0/24        (I)
     via 10.1.1.2 interface 1/1/1, cost 2 distance 110

Showing OSPF routing table information for a specific subnet:

switch# show ip ospf routes 10.1.1.0/2
Codes: i - Intra-area route, I - Inter-area route
       E1 - External type-1, E2 - External type-2

OSPF Process ID 1 VRF default, Routing Table for prefixes 10.1.1.0/24
----------------------------------------------------------------------

Total Number of Routes : 1

10.1.1.0/24        (i) area: 0.0.0.0
     directly attached to interface 1/1/1, cost 1 distance 110