Best path selection

I am little confused which of the sequence is correct among the two for best path selection criteria.

  1. AD
  2. Metric
  3. Longest prefix length

Or

  1. Longest Prefix length
  2. Lowest AD Value
  3. Lowest metric value

As per my understanding if we want to install routes in routing table then below we use below sequence

  1. AD
  2. Metric
  3. Longest prefix length

But for routes install in routing table then below sequence is used.

  1. Longest Prefix length
  2. Lowest AD Value
  3. Lowest metric value

Is my understanding correct?

Hello Hemant

There are two processes involved in what you are describing. The first has to do with which candidate routes actually make it into the routing table. This is determined using the AD.

Then we go to the second process, which is choosing the route among all possibilities already in the routing table. Once routes enter the routing table, the next criterion is the longest prefix length. The more specific entry in the routing table is chosen.

If you have two or more routes to the specific destination of the same prefix length, then the metric is used to determine the best path.

If the metric is still the same, then load balancing may take place depending upon the configuration.

For a more thorough explanation, take a look at this NetworkLessons note on the topic.

I hope this has been helpful!

Laz