BuildTheNet

Opening your workspace

Your learning content and tools are loading.

OSPF

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 0x00F713

Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.

Useful variants

What each column or field means

FieldMeaning
Router Link StatesType 1 LSAs: one per router in the area, listing its links.
Net Link StatesType 2 LSAs: one per multi-access segment with a DR, generated by the DR. Its Link ID is the DR’s interface address.
ADV RouterThe router ID that originated the LSA.
AgeSeconds 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 countHow 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

Learn it in the CCNA path

Topic

OSPF — Enable single-area OSPFv2, form neighbor adjacencies, read the neighbor and interface tables and confirm learned routes.

All 57 commands