cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
479
Views
4
Helpful
10
Replies

why router is choosing iBGP over eBGP?

Gucamole
Level 1
Level 1

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 

Key Attributes

  1. Weight: defaults to 0 for both paths.
  2. Local Preference: Both have a local preference of 100.
  3. Locally Originated: Neither path is locally originated.
  4. AS Path Length: N/A
  5. Origin Code: Both have the origin IGP.
  6. MED: Both have a metric of 0.
  7. eBGP over iBGP: So this should have chosen eBGP over iBGP but it's not happening. If I shutdown iBGP neighbor, the router uses eBGP with AD of 20 but as soon I bring the iBGP it again chooses iBGP. 

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

 

1 Accepted Solution

Accepted Solutions

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

View solution in original post

10 Replies 10

why you bypass AS-PATH 
the ebgp have longest as-path than the ibgp?

MHM

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. 

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

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

Can you share simple draw of topolgy 

MHM

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

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. 

 

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

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

Review Cisco Networking for a $25 gift card