The best way to do this is to use the 'sh ip ospf database' command, suffixed with one of the following: "router, network, summary, asbr-summary, or external". For example:
sh ip ospf database router
sh ip ospf database network
sh ip ospf database summary
sh ip ospf database asbr-summary
sh ip ospf database external
PS> Pls do remember to rate posts.
trying to figure out what networks or destinations from the database it can be more chalenging ,the best place to look for that is the routing table.
However to do so you have to understand each lsa type very well ,for example : from what the link-id is derivated !!, what kind of router advertise a given kind of LSA!! but yes indeed for some kind of LSAs you can find out the information you are looking for, i mean the destination networks for instance lsa type 1 called router advertissement that lsa could not give you any information about the destination since the link-id in that case is just a RID of the router advertising that LSA, but LSA type 3 which is a summary ,here the link-id indeed shows you the destination network that are reachable within the area and only that area the advertising ABR router reside in.
you can do so using the commands posted by Paresh , show ip ospf database summary X.X.X.X
and dont get surprised if you find a destination in the database but you dont find it in the routing table this true especialy when it comes to advertise a default route by the ABR to a stub area, this route you find it using show ip ospf database summary 0.0.0.0
but when you perform show ip route 0.0.0.0 on that ABR you will not find it.but sure you do find it on the routers within the stub area to which that ABR advertise it.
please do rate if it does clarify
Apologies for reopening an old post, but still it does not seem to be answered.
As previous replies have rightly pointed out that Link ID does not in any way refer to the route being advertised. Each link ID contains the "destinations" being advertised.
My question is, is there a way to avoid going through the LSAs one by one and get to know all the received routes for a particular destination. The routing table is not a great place to look for since it is populated by best paths and does not include "candidate" routes.
I do not believe any such command is available on Cisco devices. The reason, as I see it, is that you basically want to see a set of all possible paths between vertices u and v. The Dijkstra algorithm behind OSPF never constructs such a set so there is no immediate stored information which could be displayed to you.
if it is an intra area route, the easiest way is to take the router-id reported by the "from" field in the output of a "show ip route
Hope this helps,