cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
339
Views
0
Helpful
4
Replies

Command to Auto Calculate OSPF Path

btomisser
Level 1
Level 1

Hello,

Is there a command to auto calculate the OSPF path to a destination prefix from the originating router. 

I know you might say just check the cost in the routing table, but when I do that it doesn't give me a clear representation of load balanced links deeper in the path.

I still have to log into each hop from end to end and add up the egress interface hops manually.

Is there a faster way to do this?

Thanks,

Bill

4 Replies 4

Traceroute

Give you each hop to destiantion.

hjhjh.png
note:- it is easy to use OSPF router-ID then you know exactly what is this Hop.

Joseph W. Doherty
Hall of Fame
Hall of Fame

Sorry, I'm a bit confused about what you're trying to determine regarding OSPF end-to-end (one end being the current router, other end being some destination prefix) cost.

You mention "I know you might say just check the cost in the routing table, but when I do that it doesn't give me a clear representation of load balanced links deeper in the path." but ECMP doesn't change end-to-end OSPF cost, so unclear how OSPF cost helps you determine that.  Further OSPF cost, to destination, is cumulative, so it also doesn't indicate number of links/hops.

Are you, in fact, actually trying to determine if there are ECMP instances along the path, and/or number of interfaces being egressed and cost for each?

If so, for either, or similar information, believe that's all within the LSA database (for the same area).  Don't recall, though, any command, to break out some form of informational listing, from router you're using to the destination.

The following might be helpful for a manual analysis of the OSPF LSA database: Reading and Understanding the OSPF Database 

 

Hello,

 

In addition to what @Joseph W. Doherty and @MHM Cisco World mentioned I'm not sure you can extract that full information by the very nature of how OSPF works. (Depending on your setup).

 

If you have more than 1 area configured then the "path" information is not advertised by the ABR, only network information along with the metric and "if you want to reach this network you gotta go through me".  This is how OSPF cuts down on LSA flooding and doesn't expect every router (in a multi-area design) to know the specific SPT (Shortest Path Tree) of each route. So a router in Area 0 wont know how many paths the ABR has to reach the destination just that it can reach the path through it.

 

Lets say you have Area 0 and Area 1 configured. Area 0 does not have detailed path information into Area 1. The ABR sends Type 3 LSAs from Area 1 to Area 0 (and vice versa). These LSAs have the total path metric it takes the ABR to reach these routes plus the cost of the link of the router in Area 0 to the ABR.

 

You might be able to get some info out of traceroute, but you would have to run it several times to possibly see if there are multiple paths based on the hop IPs it returns, and even that isn't guaranteed if you don't know how the network is set up or if you have stuff like PBR or other route manipulations in place.

 

Not sure your topology but you could log into every device and diagram out your network and look at link costs and configurations along with the OSPF database table (path information should not be changing that often).

 

 

 

Hope that helps

 

-David

paul.driver
Level 1
Level 1

Hello

sh ip route ospf 
sh ip ospf route
Will provide your the administrative/cost of each ospf route install in the global route table.
Another alternative is to map out your topology database with each interface costing

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card