Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

Route selection

Hi Friends,

Hope you all re doing good :)

I have one query, If i have configured one router to reach the destination as below:


Destination :

1. I configured Static Routing

2. I configured for OSPF

Here i specified the network /27

Best path will prefer based on AD value or the prefix.?

If its AD value, its choose the Static routing Or it will choose the prefix length it will use the oSPF route (Because it has longer prefix match).

Kindly advise, That process to select the best route.

Thank you :)


They are technically two

They are technically two different routes. I belive the OSPF route would be chosen in this case due to the longer prefix.

If both routes were the same, e.g /24 then the AD would come into play and the static would be preferred.

Thank you Grant :)

Thank you Grant :)

Super Bronze

As the others have already

As the others have already noted, longer prefix is preferred.  For the same prefix, lower AD is preferred.

Normally (i.e. by default) a static route would have a lower AD than OSPF, but both their ADs can be modified.

Thank you Doherty :). 

Thank you Doherty :). 



The router will always prefer the most specific entry into the routing table, for example:

You want to reach the IP from your router:

You are receiving a prefix via OSPF but you already have a static route (ip route next hop IP), the router will prefer the most specific and in this case is:

In your case /27 is most specific than /24 so it should prefer the prefix received by OSPF.

The AD is useful when you have different routing protocols or static routes and you want to prefer other path. 

Thank you Julio moisa :)

Thank you Julio moisa :)

It was a pleasure, have a

It was a pleasure, have a great day!


CreatePlease login to create content