03-19-2009 02:09 PM - edited 03-04-2019 04:00 AM
Hey, imagine that I have in my routing table routes to a same destination:
a) iBGP (via a network /24) and OSPF destination via a /27 network address;
Given the administrative distance that for iBGP is 200, is the OSPF (adm distance=110) the preferred one in this case?
Solved! Go to Solution.
03-19-2009 02:16 PM
Longest prefix will dictate the preferred route, not the administrative distance.
Based on your example, if you were to send:
192.168.1.0/27 via OSPF
and
192.168.1.0/24 via BGP
You will prefer to reach hosts from 192.168.1.1-31 via OSPF and 192.168.1.32-254 via BGP.
HTH,
__
Edison.
03-19-2009 02:15 PM
Marlon
Your question is not clear to me. When you talk about a /24 for IBGP and a /27 for OSPF are these the masks for the networks you go through to get to the destination (in which case the mask of the network you go through does not have any impact on which route is preferred) or are these the masks of the prefix in the routing table (in which case you have two different prefixes and not two routes to the same prefix). Can you clarify this?
If it is two routes to the same prefix then OSPF is preferred over IBGP.
HTH
Rick
03-19-2009 02:16 PM
Longest prefix will dictate the preferred route, not the administrative distance.
Based on your example, if you were to send:
192.168.1.0/27 via OSPF
and
192.168.1.0/24 via BGP
You will prefer to reach hosts from 192.168.1.1-31 via OSPF and 192.168.1.32-254 via BGP.
HTH,
__
Edison.
03-19-2009 02:18 PM
Hello Marlon,
the most specific route is used regardless of AD and metric.
So in your case if destination address is within the /27 the OSPF route is used.
If the destination address is out of the /27 but within the /24 the BGP route is used.
AD is considered by the IP routing mantainer when two different protocols offer a path to the same prefix.
In this case the lower AD route is installed.
In your case being the two subnets with different prefix length both are installed in the routing table and the most specific is used as explained above.
Hope to help
Giuseppe
03-19-2009 02:22 PM
Hey thanks!
That explains what I see here, the prefix could win the decision over the AD itself!
03-19-2009 07:18 PM
Marton,
If you allow me just a precision. It is not that the prefix length wins over the AD but rather that AD only comes into play if two prefixes with the same prefix length are learned from two different sources.
Regards
03-20-2009 12:37 PM
Marlon:
At the risk of being accused of beating a dead horse, let me say that the issue boils down to comparable routes.
Within a routing protocol, two comparable routes that are received will have their metrics compared. The better metric will be selected as the primary path.
When comparing two comparable routes learned from two different routing protocols, such as BGP and OSPF, the routing protocol with the lower AD will win.
Notice that in both cases the keyword to focus on is "comparable." That means they have to have the same prefix length. A /24 route and a /27 are not comparable, so no comparisons are drawn with regard to metrics or AD. Why? Because the more specific route - the one with the longer prefix -- is the better route, period. There is no comparison.
HTH
Victor
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