Is there any show command which allows me to determine the number of routers in a specific OSPF area? I can use the show ip ospf database router command and consider each LSA represent one router, but I need a clear command to do that. Are you aware of any such command?

I'm trying to find the number of routers inside area 0 from the CLI on any router. The screenshot is showing that, but i want to find that from the router:

enter image description here

Is there any tool that can read a Cisco configuration file? For example, I give the tool the input as the configuration file, and this tool can represent this configuration in more proper way.


2 Answers 2


The show ip ospf neighbor command will show you the list of OSPF neighbors. This will give you the list of directly connected neighbors for an OSPF router. This document from Cisco describes the command. LSAs don't really represent routers, so counting them to count routers is not the correct way to do it.

According to this Cisco document, Reading and Understanding the OSPF Database, the show ip ospf database command will first show you each router in the area.

As far as a tool recommendation, such recommendations are specifically off-topic. You can ask this on the SE Software Recommendations site, but not here. I don't really understand what you mean about representing it in a more proper way.

  • thank you Ron for your answer, but as you said the show ip ospf neighbor will show the directly connected routers on the same network segment, let us assume that there are other routers in the area 0 connected to different segments so since it's on different segments we can not see these routers as a neighbor, about the LSAs as i know every router inside the area generates one LSA Type 1 to describe the routes that is connected to, is their any situation that make the router generate more than one LSA type 1 to describe it's connected routes ?
    – MRM
    Nov 14, 2015 at 23:49
  • Every router in an area will generate Type 1 LSAs which describe directly connected routes. Simply counting these will not give you all the routers in the area. Remember, OSPF is a routing protocol, and that means it is all about routes. A router needs to know about its neighbors, but, beyond that, it doesn't really care about the routers, only the routes. You may be able to manipulate the Type 1 LSA information (eliminate duplicate routers, etc.) to figure out all the routers in an area.
    – Ron Maupin
    Nov 14, 2015 at 23:56
  • i updated the main question with screenshot so that might clarify my question
    – MRM
    Nov 14, 2015 at 23:57
  • According to Cisco, show ip ospf database will first give you every router in an area. See Reading and Understanding the OSPF Database
    – Ron Maupin
    Nov 15, 2015 at 0:08

Actually the output of show ip ospf database router, as suggested by MRM, gives the same output as the first part of show ip ospf database which was suggested by Ron. Both commands can be extended with the area keyword to show the information for a specific area.

So, for example, show ip ospf database router area 51 should show you all the routers belonging to area 51. Unless some are abducted ofcourse ;) I have tested this on a Cisco Nexus 7000.

If you do not want to count there is another command which gives you the actual numnber of routers:

Router# show ip ospf database database-summary
                 OSPF Router with ID (

Area database summary
  LSA Type            Count
  Opaque Link         0
  Router              49  <<---------------
  Network             27
  Summary Network     0
  Summary ASBR        0
  Type-7 AS External  0
  Opaque Area         0
  Subtotal            76

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.