To display lists of information related to the Open Shortest Path First (OSPF) database for a specific router, use the show ip ospf database command in EXEC mode.
Syntax
show ip ospf [process-id [area-id]] database
show ip ospf database router
show ip ospf database network
show ip ospf database summary
show ip ospf database as-summary
show ip ospf database as-summary
show ip ospf database as-external
show ip ospf database nssa-external
Parameters
-
process-id—Internal identification. It is locally assigned and can be any positive integer. The number used here is the number assigned
administratively when enabling the OSPF routing process.
-
area-id—Area number associated with the OSPF address range defined in the network router configuration command used to define the
particular area.
-
network—Displays information only about the network LSAs.
-
router—Displays information only about the router LSAs.
-
nssa-external—Displays information only about the NSSA external LSAs.
-
as-external—Displays information only about the external LSAs.
-
as-summary—Displays information only about the ASBR summary LSAs.
Command Mode
User EXEC mode
User Guidelines
The various forms of this command deliver information about different OSPF link state advertisements.
Example
Example 1 The following is sample output from the show ip ospf database command when no arguments or keywords are used:
switchxxxxxx# show ip ospf database
OSPF Routing Process 300 with ID 192.168.239.66
Router Link States(Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum Link count
------------------ --------------- ----- ---------------- --------------- -----------
172.16.21.6 172.16.21.6 1731 0x80002CFB 0x69BC 8
172.16.21.5 172.16.21.5 1112 0x800009D2 0xA2B8 5
172.16.1.2 172.16.1.2 1662 0x80000A98 0x4CB6 9
172.16.1.1 172.16.1.1 1115 0x800009B6 0x5F2C 1
172.16.1.5 172.16.1.5 1691 0x80002BC 0x2A1A 5
172.16.65.6 172.16.65.6 1395 0x80001947 0xEEE1 4
172.16.241.5 172.16.241.5 1161 0x8000007C 0x7C70 1
172.16.27.6 172.16.27.6 1723 0x80000548 0x8641 4
172.16.70.6 172.16.70.6 1485 0x80000B97 0xEB84 6
Net Link States(Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum
------------------ --------------- ----- ---------------- --------------
172.16.1.3 192.168.239.66 1245 0x800000EC 0x82E
Summary Net Link States(Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum
------------------ --------------- ----- ---------------- --------------
172.16.240.0 172.16.241.5 1152 0x80000077 0x7A05
172.16.241.0 172.16.241.5 1152 0x80000070 0xAEB7
172.16.244.0 172.16.241.5 1152 0x80000071 0x95CB
Example 2. The following is sample output from the show ip ospf database command with the asbr-summary keyword:
switchxxxxxx# show ip ospf database asbr-summary
OSPF Routing Process 300 with ID 192.168.239.66
Summary ASB Link States(Area 0.0.0.0)
LS age: 1463
Options: (No TOS-capability)
LS Type: Summary Links(AS Boundary Router), Type 4
Link State ID: 172.16.245.1 (AS Boundary Router address)
Advertising Router: 172.16.241.5
LS Seq Number: 0x80000072
LS Checksum: 0x3548
LS Length: 28
Network Mask: 0.0.0.0
TOS: 0 Metric: 1
Example 3. The following is sample output from the show ip ospf database command with the external keyword:
switchxxxxxx# show ip ospf database external
OSPF Routing Process 300 with ID 192.168.239.66
AS External Link States
LS age: 280
Options: (No TOS-capability)
LS Type: AS External Link, Type 5
Link State ID: 10.105.0.0 (External Network)
Advertising Router: 172.16.70.6
LS Seq Number: 0x80000AFD
LS Checksum: 0xC3A
LS Length: 36
Network Mask: 255.255.0.0
TOS: 0
Metric Type: 2 (Larger than any link state path)
Metric: 1
Forward Address: 0.0.0.0
External Route Tag: 0
Example 4. The following is sample output from the show ip ospf database command with the network keyword:
switchxxxxxx# show ip ospf database network
OSPF Routing Process 300 with ID 192.168.239.66
Network Link States(Area 0.0.0.0)
LS age: 1367
Options: (No TOS-capability)
LS Type: Network Links, Type 2
Link State ID: 172.16.1.3 (address of Designated Router)
Advertising Router: 192.168.239.66
LS Seq Number: 0x800000E7
LS Checksum: 0x1229
LS Length: 52
Network Mask: 255.255.255.0
Attached Router: 192.168.239.66
Attached Router: 172.16.241.5
Attached Router: 172.16.1.1
Attached Router: 172.16.54.5
Attached Router: 172.16.1.5
Example 5. The following is sample output from the show ip ospf database command with the router keyword:
switchxxxxxx# show ip ospf database router
OSPF Routing Process 300 with ID 192.168.239.66
Router Link States(Area 0.0.0.0)
LS age: 1176
Options: (No TOS-capability)
LS Type: Router Links, Type 1
Link State ID: 172.16.21.6
Advertising Router: 172.16.21.6
LS Seq Number: 0x80002CF6
LS Checksum: 0x73B7
LS Length: 120
AS Boundary Router
Number of Links: 8
Link connected to: another Router (point-to-point)
Link ID) Neighboring Router ID: 172.16.21.5
(Link Data) Router Interface address: 172.16.21.6
Number of TOS metrics: 0
TOS 0 Metrics: 2
Link connected to: another Router (transit network
Link ID) Neighboring Router ID: 182.16.21.5
(Link Data) Designated Router: 182.18.21.6
Number of TOS metrics: 0
TOS 0 Metrics: 2
Example 6. The following is sample output from show ip ospf database command with the summary keyword:
switchxxxxxx# show ip ospf database summary
OSPF Routing Process 300 with ID 192.168.239.66
Summary Net Link States(Area 0.0.0.0)
LS age: 1401
Options: (No TOS-capability)
LS Type: Summary Links(Network), Type 3
Link State ID: 172.16.240.0 (summary Network Number)
Advertising Router: 172.16.241.5
LS Seq Number: 0x80000072
LS Checksum: 0x84FF
LS Length: 28
Network Mask: 255.255.255.0
TOS: 0 Metric: 1
Example 7. The following is sample output from show ip ospf database command with the database-summary keyword:
switchxxxxxx# show ip ospf database database-summary
OSPF Routing Process 1 with ID 10.0.1.1
Area 0.0.0.0 database summary
LSA Type Count
Router 3
Network 0
Summary Net 0
Summary ASBR 0
Type-7 Ext 0
Opaque Link 0
Opaque Area 0
Subtotal 3
Process 1 database summary
LSA Type Count
Router 2
Network 0
Summary Net 2
Summary ASBR 0
Type-7 Ext 0
Opaque Link 0
Opaque Area 0
Opaque AS 0
Total 4
Example 8. The following is sample output from the show ip ospf database command with the nssa-external keyword
switchxxxxxx# show ip ospf database nssa-external
OSPF Routing Process 300 with ID 192.168.239.66
NSSA External Link States
LS age: 280
Options: (No TOS-capability)
LS Type: NSSA External Link, Type 7
Link State ID: 10.105.0.0 (External Network)
Advertising Router: 172.16.70.6
LS Seq Number: 0x80000AFD
LS Checksum: 0xC3A
LS Length: 36
Network Mask: 255.255.0.0
TOS: 0
Metric Type: 2 (Larger than any link state path)
Metric: 1
Forward Address: 0.0.0.0
External Route Tag: 0