OSPF Path Selection explained

This topic is to discuss the following lesson:

Great post Rene. OSPF is a protocol with lots of details. We can see some interesting things when we do OSPF external type 2 with same cost but different cost to ASBR.

i’ve learn something new, thanks rene :slight_smile:

You are welcome Tim.

good site… for good lessons :smiley:

keep sharing, m/

I learned inner depth regarding protocol working …keep sharing …

First of all thankx to all,
my ques.
If there are multiple routes to a network with the same route type and cost,what is the next criteria 4 selecting best path.

1 Like


I have doubt in ospf network, we have scenario like R1-R2-R3 triangle connection. If R1 want to reach R3 loopback, the traffic should goto R2 then reach R3. but here the condition without ospf cost how traffic will control also i configured all area as Area 0.

Here diagram sample.
( R1----R2
R3 (

When the cost and type are the same, OSPF will do load balancing.

Hi Vijay,

If you want to influence OSPF directly then there are two options:

- Change the cost with the “ip ospf cost” command.
- Change the bandwidth of the interface with the “bandwidth” command.

OSPF uses the bandwidth of the interface to calculate the cost.

Best Regards,



Just a small correction. The OSPF path selection is a bit more complex than you have outlined:

External Type 1 (E1 and N1, where E1 wins in a tie of metrics)
External Type 2 (E2 and N2, where E2 wins in a tie of metrics. Cost to FA is the final tiebreaker)

So, as an example, N1 always beats E2. Type 1 always beat Type 2, but E does not always beat N.

Another one: If I have an E2 and N2 both with metric 20, but the N2’s cost to the FA is less than the E2’s cost to the FA, N2 wins. If an E2 or N2 LSA has FA of, cost the ASBR is computed. But technically the forward metric is, in fact, the cost to the FA.

Hi Rene,

Thank you for sharing such a wonderful knowledge bank.
You have explained each and every concept/topic in such a way that no one should have any doubt after reading. I am very much impressed the way you have explained and provided the quantity and quality information.

I have completed CCNA in 2009 then I have done CCNP ( SWITCH and TSHOOT). Now I am preparing for ROUTE.

I love Cisco and Networking.

You are very good in teaching and conveying information.

Hello Rene,

You can also use :
(router)# neighbor ip cost numer


Rene is Nick correct on this? need your clarification

yes :slight_smile:

Hi Rene,

I am very much confused the difference between OSPF E1 and E2 external route. Can you please help me to understand.


Hi Manami,
There are three things you should know about E1 vs E2 routes:

  1. The default type is E2. When you redistribute into OSPF without specifying what type of external route to use, E2 will be chosen

  2. OSPF prefers E1 routes over E2 routes. So long as both E1 and E2 routes to the same destination within the OSPF database, E1 will always be chosen, even if the E2 route has a better metric or administrative distance.

  3. E2 routes have the same cost throughout an OSPF domain, whereas E1 routes factor in both the original cost plus the cost to transit across the OSPF domain to reach the exit point to the external route.

As an example of #3 above, imagine you have an OSPF network that has two exit points - R2 and R3. There is a third router, R1, with links to both R2 and R3, where the cost to R2 is slightly higher than the cost to R3. Now suppose both R2 and R3 are both connected to an external network, say R2’s connection to this network is 10 gigs, while R3’s connection is just 1 gig.

What happens now when R2 and R3 both redistribute into OSPF? If they used external type E1, this means that R1 would consider its cost to get to either R2 or R3 as part of its decision making process, and in this case it would incorrectly choose R3 because of this. In this scenario, you would want to make sure that R2 and R3 are using E2 type routes so that R1 doesn’t consider either the R1-R2 or R1-R3 connection costs.


Rene, I’m not sure if you answered this anywhere in the OSPF lessons or not, but can you please explain ISPF and what makes it better than OSPF? I was asked this and I do not know. I would like to know for my information. Thanks, Brandon

Hi Brandon,

That’s a good question and rarely asked.

Here the best explanation that is taken from Cisco website about ISPF:

As you know, OSPF uses Dijkstra’s SPF algorithm to compute the shortest path tree (SPT). During the computation of the SPT, the shortest path to each node is discovered. The topology tree is used to populate the routing table with routes to IP networks. When changes to a Type-1 or Type-2 link-state advertisement (LSA) occur in an area, the entire SPT is recomputed. In many cases, the entire SPT need not be recomputed because most of the tree remains unchanged. Incremental SPF allows the system to recompute only the affected part of the tree. Recomputing only a portion of the tree rather than the entire tree results in faster OSPF convergence and saves CPU resources. Note that if the change to a Type-1 or Type-2 LSA occurs in the calculating router itself, then the full SPT is performed.
Incremental SPF is scheduled in the same way as the full SPF. Routers enabled with incremental SPF and routers not enabled with incremental SPF can function in the same internetwork.

Now to enable ISPF, it is a quite simple command:

router ospf 1

So as a summary, ISPF can make the process of OSPF to go faster by saving CPU resources when a change happen to Type-1 or Type-2 LSA.

Hope this could help.


What about path selection between different OSPF processes running on the same router?
I am having trouble finding an answer to this…
Thanks for any repy