07-05-2017 02:01 AM - edited 03-05-2019 08:48 AM
Hi Friends,
Hope you all re doing good :)
I have one query, If i have configured one router to reach the destination as below:
Source: 192.168.1.1
Destination : 10.0.0.5
1. I configured Static Routing
10.0.0.0/24
2. I configured for OSPF
Here i specified the network 10.0.0.0 /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 :)
07-05-2017 05:24 AM
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.
07-05-2017 09:40 PM
Thank you Grant :)
07-05-2017 09:21 AM
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.
07-05-2017 09:39 PM
Thank you Doherty :).
07-05-2017 09:40 PM
Hi
The router will always prefer the most specific entry into the routing table, for example:
You want to reach the IP 10.0.0.1 from your router:
You are receiving a prefix 10.0.0.0/8 via OSPF but you already have a static route 10.0.0.1/32 (ip route 10.0.0.1 255.255.255.255 next hop IP), the router will prefer the most specific and in this case is: 10.0.0.1/32
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.
07-05-2017 09:40 PM
Thank you Julio moisa :)
07-06-2017 05:27 AM
It was a pleasure, have a great day!
:-)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide