This topic is to discuss the following lesson:
Didnt got the AD value part
If lets say there is a router A
If it gets 2 routes of same prefix x.x.x.x/24 from ibgp and ebgp so it will select ebgp because ebgp has lower AD value of 20 compared to Ibgp which is 200 right ?
Its a bit confusing for me as i read ur notes
Hello Anoop
We must keep in mind the order of operations with which these processes take place.
The BGP router will first consider all of the possible routes that have been learned via BGP. These routes are all listed in the BGP table. From this, using the best path selection algorithm, BGP will choose the best one. Once this is done, that best path will then become a candidate to be installed in the routing table.
This candidate route will then be compared with routes to the same destination that have been learned from other routing protocols (if they exist) using the Administrative Distance. The candidate route with the lowest AD is chosen.
The note that Rene mentions in the lesson, is simply saying that the choice of eBGP over iBGP within the BGP process and the BGP table should not be confused with the process of comparing routes for the routing table using the AD.
Now having said that, we know that eBGP routes have a default AD of 20 and iBGP routes have a default AD of 200. Because the BGP best path algorithm always prefers eBGP over iBGP, you will never have a BGP router choose both an iBGP and eBGP route to the same destination as the best paths. Therefore, you will never need to compare the AD of an iBGP and eBGP route on the same router. BGP itself chooses the best path before you even get to the comparison of ADs. Does that make sense?
I hope this has been helpful!
Laz
I guess we can say the Routing Table is the World Championships and in that best athletes (routes) from different countries (routing protocols ) participate .
So to identify the best athlete in a country is the responsibility of that country
So here BGP selects the best route to reach to x.x.x.x route and iBGP and eBGP give the best route and BGP says that for us eBGP is the better route and i am not checking the AD value its because of best path selection criteria
But then in the Routing Table (World championships) x.x.x.x route is given by lots of countries like BGP,RIP,OSPF,ISIS and EIGRP and now AD value comes into picture
So inside a country we trust all citizens so not checking AD value inside a country but in world championship we have to trust a country based on their trustworthiness using AD value
I hope this is the right analogy for my understanding
Hello Anoop
Wow, that’s a great analogy! And it’s spot on! The only thing I would add is that BGP is a nation that is composed of two countries, iBGP and eBGP, in a similar way that the UK is composed of four. But only one of those two countries can compete for the nation.
BGP must have iBGP compete with eBGP if they both enter the national competition. eBGP will always win and will go to the world championships with an AD of 20. However, if eBGP does not enter the national competition at all, then iBGP wins by default, and it goes to the world championships with an AD of 200. So you will never have eBGP and iBGP compete at the world championships together…
Great job! I think I’ll use this analogy in the future too…
I hope this has been helpful!
Laz
Hello, i have a question to ask, I have looked at the configuration, but I don’t quite understand it.
Why there is no ospf configuration between R1 and R2?
Many thanks
Hello Xinran
The prerequisite that exists for Autonomous Systems within which iBGP peers are deployed, is that there must be routing established such that all iBGP routers within the AS can reach each other.
When you have a large AS with multiple routers, you would typically deploy a routing protocol like OSPF or EIGRP to ensure that this prerequisite is fulfilled. However, if you just have two routers such as those in AS12, they are directly connected, and they already know how to reach each other via their directly connected network of 192.168.12.0/24. So the prerequisite is fulfilled without the need to deploy a routing protocol.
In a real world scenario where you would typically have dozens of iBGP peers within an AS, a routing protocol like OSPF is absolutely necessary. But for this specific situation with two routers, it is unnecessary. Does that make sense?
I hope this has been helpful!
Laz
Hi Rene/Laz,
I wonder why the path towards R3 via 192.168.13.3 selected as best when the local preference via R2 path is higher ? I thought for path selection, weight, local preference etc are checked sequentially. Not sure how the path via 13.3 got local pref of 100 as that path is coming via ebgp and local pref is an ibgp shared attribute inside an AS ?
Hello Jeff
Remember, local preference is an attribute that is shared between iBGP peers within an AS. It has no meaning beyond the local AS and is not advertised between eBGP peers. So when R1 learns the route directly from R3, which is an eBGP peer, the BGP update from R3 does not contain a local preference value. That is why the LocPrf field appears blank for that entry in the BGP table.
However, for best-path selection, Cisco IOS treats that route as having the default local preference of 100. The path learned from R2 via iBGP also has local preference 100, so local preference is effectively a tie. Since the earlier attributes are also equal, BGP continues down the decision process and chooses the eBGP-learned path over the iBGP-learned path. Make sense?
I hope this has been helpful!
Laz
Hi Laz,
Thank you for the response. Yes it makes sense. However, from my understanding, BGP local_pref has no say-so in how a path is determined when it stays at its default value. What I mean is, BGP assigns local-pref of 100 to all routes by default, whether it’s an ibgp route or if a router learns it from ebgp peer. When looking at the BGP table, it doesn’t show up for ebgp peer but it is still allocated by the receiving router, a value of 100 for calculation.
Only when we manually change the value of local_pref to a higher value is the exit path selection in ibgp affected. Else, it just goes through the list top down to find best path comparing each parameter. Am I right to assume this?
Thanks
Jeffin
Hello Jeff
Yeah, I guess you can look at it that way, but I think a more accurate way to put it is that local_pref is set to its default value of 100 across all your routes, so it doesn’t appear to make a difference because all routes are equal at that step. BGP still evaluates it, but since there’s no differentiation, the decision process moves to the next criterion. The value is still being evaluated but routes just tie at that step.
The moment you manually set local_pref to a different value, say, 200 for iBGP routes and leave eBGP at 100, then you see local_pref actively influencing path selection. This is actually one of the most common uses of local_pref: making specific iBGP routes preferable over eBGP routes by assigning them a higher local_pref value, thus making the decision much earlier in the BGP best path algorithm process. Does that make sense?
I hope this has been helpful!
Laz
Thanks Laz. Yes its clear now. Much appreciated!