’show ip ospf database’ is one of those commands that every CCIE candidate needs to know how to use as it can show you a ton of very good OSPF information. There are a ton of options for this command:
r2#show ip ospf database ?
adv-router Advertising Router link states
asbr-summary ASBR summary link states
database-summary Summary of database
external External link states
network Network link states
nssa-external NSSA External link states
opaque-area Opaque Area link states
opaque-as Opaque AS link states
opaque-link Opaque Link-Local link states
router Router link states
self-originate Self-originated link states
summary Network summary link states
| Output modifiers
<cr>
I can’t believe that I’ve gotten this far and never used the “database-summary” option for this command.
database-summary
(Optional) Displays how many of each type of LSA for each area there are in the database, and the total.
Here’s the output of the command for an OSPF process with area 0 and three non-zero areas (note the difference in the LSA types in Area 0 versus the non-zero areas):
r1#show ip ospf database database-summary
OSPF Router with ID (1.1.1.1) (Process ID 100)
Area 0 database summary
LSA Type Count Delete Maxage
Router 2 0 0
Network 1 0 0
Summary Net 6 0 0
Summary ASBR 0 0 0
Type-7 Ext 0 0 0
Prefixes redistributed in Type-7 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Subtotal 9 0 0
Area 100 database summary
LSA Type Count Delete Maxage
Router 1 0 0
Network 0 0 0
Summary Net 8 0 0
Summary ASBR 0 0 0
Type-7 Ext 0 0 0
Prefixes redistributed in Type-7 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Subtotal 9 0 0
Area 101 database summary
LSA Type Count Delete Maxage
Router 1 0 0
Network 0 0 0
Summary Net 8 0 0
Summary ASBR 0 0 0
Type-7 Ext 0 0 0
Prefixes redistributed in Type-7 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Subtotal 9 0 0
Area 102 database summary
LSA Type Count Delete Maxage
Router 1 0 0
Network 0 0 0
Summary Net 8 0 0
Summary ASBR 0 0 0
Type-7 Ext 0 0 0
Prefixes redistributed in Type-7 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Subtotal 9 0 0
Process 100 database summary
LSA Type Count Delete Maxage
Router 5 0 0
Network 1 0 0
Summary Net 30 0 0
Summary ASBR 0 0 0
Type-7 Ext 0 0 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Type-5 Ext 0 0 0
Prefixes redistributed in Type-5 0
Opaque AS 0 0 0
Total 36 0 0
As you can see this command shows a count of each type of LSA for each OSPF area (per process if you’re running multiple processes). You can limit the output to a specific area (or process) with a grep command:
Show just the database-summary for area 0:
r2#show ip ospf database database-summary | sec Area 0
Area 0 database summary
LSA Type Count Delete Maxage
Router 2 0 0
Network 1 0 0
Summary Net 6 0 0
Summary ASBR 0 0 0
Type-7 Ext 0 0 0
Prefixes redistributed in Type-7 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Subtotal 9 0 0
Show just the database-summary for Process 100:
r2#show ip ospf database database-summary | sec Process 100
Process 100 database summary
LSA Type Count Delete Maxage
Router 5 0 0
Network 1 0 0
Summary Net 30 0 0
Summary ASBR 0 0 0
Type-7 Ext 0 0 0
Opaque Link 0 0 0
Opaque Area 0 0 0
Type-5 Ext 0 0 0
Prefixes redistributed in Type-5 0
Opaque AS 0 0 0
Total 36 0 0