show ip ospf database
Lists the link-state advertisements in this router’s OSPF database, by area and LSA type.
Written by a working field network engineer · CCNA, Security+, CySA+
Lists the link-state database every router in an area shares. On the CCNA you mainly need to recognise Router (type 1) and Network (type 2) LSAs and confirm that every router in the area appears.
Example output
R1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 845 0x80000004 0x00A1C3 2
2.2.2.2 2.2.2.2 843 0x80000004 0x004E2B 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.0.12.2 2.2.2.2 843 0x80000001 0x00F713Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.
Useful variants
show ip ospf database routershow ip ospf database networkshow ip ospf database summary
What each column or field means
| Field | Meaning |
|---|---|
Router Link States | Type 1 LSAs: one per router in the area, listing its links. |
Net Link States | Type 2 LSAs: one per multi-access segment with a DR, generated by the DR. Its Link ID is the DR’s interface address. |
ADV Router | The router ID that originated the LSA. |
Age | Seconds since the LSA was originated. LSAs are refreshed every 30 minutes and flushed at 3600 seconds. |
Seq# | Sequence number; the higher one is newer. |
Link count | How many links the router describes in its type 1 LSA. |
When it doesn’t look right
A router in the area is missing from Router Link States.
It has no FULL adjacency with anyone in the area. Fix the adjacency first (show ip ospf neighbor on its neighbors).
Different routers in one area show different databases.
They should be identical within an area. A difference means flooding is failing on some link; check neighbor states along it.
Related commands
Try it yourself
- OSPF Multi-Area Tuning (Pro)
- OSPF Network Statements Across Two Areas (Pro)
- Or build the example network in the free Sandbox
Learn it in the CCNA path
- OSPF Basics & Neighbor States (3. IP Connectivity)
- Multi-Area OSPF & Default Route Injection (3. IP Connectivity)
Topic
OSPF — Enable single-area OSPFv2, form neighbor adjacencies, read the neighbor and interface tables and confirm learned routes.