Networking-Forums.com

Professional Discussions => Routing and Switching => Topic started by: Nerm on June 30, 2017, 01:03:32 PM

Title: OSPF route selection
Post by: Nerm on June 30, 2017, 01:03:32 PM
I am hoping someone with deeper knowledge of OSPF can answer this for me.

In a hypothetical situation you have two OSPF routers in the same area and both learn the same subnet let's say 10.100.10.0/24. Both routes learned are of equal distance and equal links across both paths. They also have equal metrics/etc. Essentially the routes are identical. When this happens how does OSPF select which route to inject into the routing table? My assumption is that each one will inject the one with the shorter hop count like a distance vector protocol would do. I haven't labbed it yet and I realize to most of you this is probably a pretty rookie question, but it is something I am struggling getting my mind wrapped around it.
Title: Re: OSPF route selection
Post by: icecream-guy on June 30, 2017, 01:28:05 PM
A)    When there are multiple routes available to the same network with different route types, routers use this order of preference (from highest to lowest): 1. Intra-area routes. 2. Inter-area routes. 3. External Type-1 routes. 4. External Type-2 routes.
B)    If there are multiple routes to a network with the same route type, the OSPF metric calculated as cost based on the bandwidth is used for selecting the best route. The route with the lowest value for cost is chosen as the best route.
C)    If there are multiple routes to a network with the same route type and cost, it chooses all the routes to be installed in the routing table, and the router does equal cost load balancing across multiple paths.
Title: Re: OSPF route selection
Post by: deanwebb on June 30, 2017, 01:47:36 PM
So, in the above case, if they have equal cost and route type, then the router learning both of them will do load balancing. Is that right?
Title: Re: OSPF route selection
Post by: icecream-guy on June 30, 2017, 01:52:17 PM
Quote from: deanwebb on June 30, 2017, 01:47:36 PM
So, in the above case, if they have equal cost and route type, then the router learning both of them will do load balancing. Is that right?

that's what the rule sez.
Title: Re: OSPF route selection
Post by: Nerm on July 03, 2017, 08:31:42 AM
So if I don't want them to be load-balanced I would need to modify one of the routes to have a different cost than the other.
Title: Re: OSPF route selection
Post by: SimonV on July 03, 2017, 10:06:59 AM
Quote from: Nerm on July 03, 2017, 08:31:42 AM
So if I don't want them to be load-balanced I would need to modify one of the routes to have a different cost than the other.

You should be able to specify the number of maximum-paths:

http://www.cisco.com/c/m/en_us/techdoc/dc/reference/cli/nxos/commands/ospf/maximum-paths-ospf.html