show ip ospf database

Shows OSPFv2 database information.

Syntax

show ip ospf database
show ip ospf database database-summary
show ip ospf database external-link-state [ advertise index | extensive | link-state-id id | router-id router-id | sequence-number num ]
show ip ospf database grace-link-state
show ip ospf database link-state [ advertise index | asbr [ asbr-id | adv-router router-id ] | extensive | link-state-id id | network { net-id | adv-router router-id } | nssa { nssa-id | adv-router router-id } | router { router-id | adv-router router-id } | router-id router-id | self-originate | sequence-number num | summary { id | adv-router router-id } ]

Parameters

database-summary
Displays how many link state advertisements (LSAs) of each type exist for each area, as well as total number of LSAs.
external-link-state
Displays information by external link state, based on the following parameters:
advertise index
Displays the hexadecimal data in the specified LSA packet. The index parameter identifies the LSA packet by its position in the router’s External LSA table. To determine an LSA packet’s position in the table, enter the show ip ospf external-link-state command.
extensive
Displays LSAs in decrypt format. Do not use this parameter in combination with other display parameters because the entire database is displayed.
link-state-id id
Displays external LSAs for the LSA source that you specify.
router-id router-id
Displays external LSAs for the advertising router that you specify.
sequence-number num
Displays the External LSA entries for the hexadecimal LSA sequence number that you specify.
link-state
Displays the link state, based on the following parameters:
adv-router router-id
Displays the link state for the advertising router that you specify.
advertise index
Displays the hexadecimal data in the specified LSA packet. The index parameter identifies the LSA packet by its position in the router’s external-LSA table. To determine an LSA packet’s position in the table, enter the show ip ospf external-link-state command.
asbr
Displays autonomous system boundary router (ASBR) LSAs.
extensive
Displays LSAs in decrypt format. Do not use this parameter in combination with other display parameters because the entire database is displayed.
link-state-id id
Displays LSAs for the LSA source that you specify.
network
Displays either all network LSAs or the LSAs for a network that you specify.
nssa
Displays either all NSSA LSAs or the LSAs for a not-so-stubby area (NSSA) that you specify.
router
Displays LSAs by router link.
router-id router-id
Displays LSAs for the advertising router that you specify.
self-originate
Displays self-originated LSAs.
sequence-number
Displays the LSA entries for the hexadecimal LSA sequence number that you specify.
summary
Displays summary information. You can specify link-state ID or advertising router ID.
adv-router router-id
Displays the link state for the advertising router that you specify.

Modes

User EXEC mode

Command Output

The show ip ospf database command displays the following information:

Output field

Description

Index

ID of the entry

Area ID

ID of the OSPF area

Type

Link state type of the route.

LS ID

The ID of the link-state advertisement from which the router learned this route.

Adv Rtr

ID of the advertised route.

Seq(Hex)

The sequence number of the LSA. The OSPF neighbor that sent the LSA stamps the LSA with a sequence number. This number enables the device and other OSPF routers to determine which LSA for a given route is the most recent.

Age

The age of the LSA in seconds.

Chksum

The checksum for the LSA packet. The checksum is based on all the fields in the packet except the age field. The device uses the checksum to verify that the packet is not corrupted.

SyncState

This field indicates whether the synchronization is complete or not.

Examples

The following example shows output for the show ip ospf database command.

device> show ip ospf database

Index Area ID 			 Type LS ID 	 	 	 	 	 Adv Rtr 		 	 	  Seq(Hex) Age  Cksum  SyncState  
1     0.0.0.200   Rtr  192.168.98.111  192.168.98.111  8000003b 626  0xf885 Done       
2     0.0.0.200   Rtr  192.168.98.213  192.168.98.213  800000c9 963  0x209c Done       
3     0.0.0.200   Rtr  192.168.98.113  192.168.98.113  80000028 169  0x0275 Done       
4     0.0.0.200   Rtr  192.168.98.112  192.168.98.112  8000002d 226  0x1c03 Done       
5     0.0.0.200   Net  193.113.111.113 192.168.98.113  8000001f 1132 0x353d Done       
6     0.0.0.200   Net  192.213.111.213 192.168.98.213  8000002d 1683 0x17bc Done  

The following example shows output for the show ip ospf database command when the link-state parameter is used.

device> show ip ospf database link-state

Index Area ID Type LS ID       Adv Rtr     Seq(Hex) Age  Cksum 	 	 SyncState
1     0       Rtr  10.1.10.1   10.1.10.1   800060ef 3    0x4be2	 	 Done
2     0       Rtr  10.65.12.1  10.65.12.1  80005264 6    0xc870	 	 Done
3     0       Net  10.1.64.2   10.65.12.1  8000008c 1088 0x06b7	 	 Done
4     0       Net  10.1.167.2  10.65.12.1  80000093 1809 0x86c8	 	 Done
5     0       Net  10.1.14.2   10.65.12.1  8000008c 1088 0x2ec1	 		Done
6     0       Net  10.1.117.2  10.65.12.1  8000008c 1087 0xbccb	 		Done
7     0       Net  10.1.67.2   10.65.12.1  8000008c 1088 0xe4d5	 	 Done
8     0       Net  10.1.170.2  10.65.12.1  80000073 604  0xa5c6	 	 Done
9     0       Net  10.1.17.2   10.65.12.1  8000008c 1088 0x0ddf	 	 Done
10    0       Net  10.1.120.2  10.65.12.1  8000008c 1087 0x9be9	 	 Done
11    0       Net  10.1.70.2   10.65.12.1  8000008c 1088 0xc3f3	 	 Done
12    0       Net  10.1.173.2  10.65.12.1  80000017 1087 0x3d88	 	 Done
13    0       Net  10.1.20.2   10.65.12.1  8000008c 1088 0xebfd	 	 Done
14    0       Net  10.1.123.2  10.65.12.1  8000008c 1087 0x7a08	 	 Done
15    0       Net  10.1.73.2   10.65.12.1  8000008c 1088 0xa212	 	 Done
16    0       Net  10.1.176.2  10.65.12.1  80000025 1087 0xffb4	 	 Done
17    0       Net  10.1.23.2   10.65.12.1  8000008c 1088 0xca1c	 	 Done
18    0       Net  10.1.126.2  10.65.12.1  8000008c 1087 0x5926	 		Done

The following example shows output for the show ip ospf database command when the external-link-state parameter is used.

device> show ip ospf database external-link-state

Index Age LS ID						Router 	  Netmask 	Metric 	 Flag		Fwd Address SyncState
1     591 10.65.13.0 10.65.12.1 ffffff00 8000000a 0000		0.0.0.0		 	 Done
2     591 10.65.16.0 10.65.12.1 ffffff00 8000000a 0000 	0.0.0.0			 	Done
3     591 10.65.14.0 10.65.12.1 ffffff00 8000000a 0000 	0.0.0.0			 	Done
4     591 10.65.17.0 10.65.12.1	ffffff00 8000000a 0000	 0.0.0.0			 	Done
5     592 10.65.12.0 10.65.12.1 ffffff00 8000000a 0000 	0.0.0.0			 	Done
6     592 10.65.15.0 10.65.12.1 ffffff00 8000000a 0000 	0.0.0.0			 	Done
7     592 10.65.18.0 10.65.12.1 ffffff00 8000000a 0000 	0.0.0.0			  Done

The following example shows output for the show ip ospf database command when the database-summary parameter is used.

device> show ip ospf database database-summary 

Area ID    Router Network Sum-Net Sum-ASBR NSSA-Ext Opq-Area Subtotal
0.0.0.0    104    184     19      42       0        0        349     
AS External                                                  308
Total      104    184     19      42       0        0        657   

History