ā05-20-2024 10:46 AM
Why is my router choosing iBGP over eBGP? I am advertising the same prefix in a lab from the iBGP router(RR client) and from eBGP neighbor. Below are the attributes
192.168.101.8 = eBGP neighbor
192.168.102.2 = iBGP neighbor
sh IP bgp
* 5.5.5.0/24 192.168.101.8 0 0 8 i
*>i 5.5.5.0/24 192.168.102.2 0 100 0 I
*******************************
R9#sh ip bgp 5.5.5.0
BGP routing table entry for 5.5.5.0/24, version 4
Paths: (2 available, best #1, table default)
Advertised to update-groups:
8
Refresh Epoch 2
Local
192.168.102.2 from 192.168.102.2 (10.0.1.2)
Origin IGP, metric 0, localpref 100, valid, internal, best
Originator: 10.0.3.5, Cluster list: 10.0.1.2
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
8
192.168.101.8 from 192.168.101.8 (192.168.101.8)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Solved! Go to Solution.
ā05-20-2024 12:53 PM
ebgp over ibgp steps after AS-PATH'
If AS-PATH and other criteria is same then the tiebreak is ebgp over ibgp.
You can not skip step in bgp best path selection.
To make see ebgp over ibgp work do the following
1- remove 5.5.5.5 from D
2- interconnect B to D
3-add static route in A for link connect B to D
After that check path in A you will see it prefer ebgp over ibgp since now the as-path is equal.
MHM
ā05-20-2024 11:08 AM
why you bypass AS-PATH
the ebgp have longest as-path than the ibgp?
MHM
ā05-20-2024 11:41 AM
I thought there wouldn't be any AS-Path on iBGP. i.e AS_PATH for iBGP should be empty.
If that's the case then iBGP will always be preferred over eBGP by default.
ā05-20-2024 11:46 AM
Not always'
if we have routerA connect to routerB ebgp and RouterC ibgp and ibgp is re-advertise the prefix from RouterB ebgp
Then RouterA have two path with same AS-PATH and hence here we can prefer ebgp over ibgp.
Note:- ibgp not modify as-path by add as to as-path
So are above is same as your case ?
Thanks
MHM
ā05-20-2024 12:11 PM - edited ā05-20-2024 12:12 PM
Then RouterA have two path with same AS-PATH and hence here we can prefer ebgp over ibgp.
--> Correct. This is similar to what I was playing with. However in my case iBGP is preferred over eBGP.
Router A connects to Router B via eBGP
Router A also connected to Router C via iBGP
Router C connects to Router D via iBGP. Router C is RR and router D is RR-client.
so 5.5.5.5/24 comes from router D-->RouterC----> Router A (All iBGP)
I also have a loopback on Router B (5.5.5.5/24) and advertise using network command to router A via eBGP.
So 5.5.5.5/24-->Router B-->Router A (eBGP)
Router A has learned 5.5.5.0/24 from
eBGP and iBGP
It then chooses iBGP
ā05-20-2024 12:14 PM
Can you share simple draw of topolgy
MHM
ā05-20-2024 12:31 PM
ā05-20-2024 12:34 PM
So LO 5.5.5.5 is config in both B and D?
If Yes then ibgp will prefer than ebgp'
The reason the path from B add AS to as-path and path from D dont add any AS'
So ibgp is shortest than ebgp.
MHM
ā05-20-2024 12:45 PM
So LO 5.5.5.5 is config in both B and D?
--> correct.
If Yes then ibgp will prefer than ebgp'
--> If that's the case then why does the Best path selection state "eBGP over iBGP". If iBGP doesn't add AS(which makes sense) so Shortest AS path will always be iBGP.
ā05-20-2024 12:53 PM
ebgp over ibgp steps after AS-PATH'
If AS-PATH and other criteria is same then the tiebreak is ebgp over ibgp.
You can not skip step in bgp best path selection.
To make see ebgp over ibgp work do the following
1- remove 5.5.5.5 from D
2- interconnect B to D
3-add static route in A for link connect B to D
After that check path in A you will see it prefer ebgp over ibgp since now the as-path is equal.
MHM
ā05-20-2024 01:31 PM
As @MHM Cisco World pointed out not necessarily. You have a small lab. For BGP you need to scale out and lok at the internet as a whole. There are several things that can break a tie BEFORE the e/iBPG scenario comes into play. Lets say have 2 routers connected to 2 ISPs (1 each) and those routers (your routers are connected in an iBGP configuration). Both ISPs are advertising the 5.5.5.0/24 network. Lets say the LEFT routers AS path is shorter to get to the 5.5.5.0/24 network. It will advertise that to its iBGP neighbor. The right side router has a longer AS path. Even though its iBGP neighbor didnt add to the path the shorter AS path is through iBGP so thats the tie breaker.
Contrary to that if both AS path's are the same the tie breakers continue, and each router will respectively choose its eBGP path.
Hope that helps
-David
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