cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4425
Views
0
Helpful
14
Replies

BGP best path selection

shelley_wang
Level 1
Level 1

A BGP router receives 2 updates of the same prefix. One is an IBGP update, and the other is an EBGP update.

The IBGP prefix has a higher weight. Which route will this BGP router select as the best route to be installed in the routing table?

1 Accepted Solution

Accepted Solutions

vishwancc wrote:

Hi Atif ,

BGP is AS to AS routing protocol , Even though there is AD difference between IBGP and EBGP ,BGP always like to prefer route from Outide the AS than inside the AS if they are having same prefix .

Chao
Vishwa

BGP has its own decision criteria for selecting the best route. A external route does have a preference over an internal route, but this criteria comes way down in the decision path. Kindly go through the BGP best path selection criteria to understand how this process works better.

Regarding role of AD, it is not applicable here as I have been trying to clarify to the other gentleman. AD applies when we are evaluating routes learnt from two different routing protocols which is not the case here.

View solution in original post

14 Replies 14

relsethagen
Level 1
Level 1

EBGP is always preferred due to default administrative distance of 20 vs 200 for IBGP

relsethagen wrote:

EBGP is always preferred due to default administrative distance of 20 vs 200 for IBGP

AD comes into play when you are comparing routes from two different routing protocols for installation in RIB. In this particular case the question is specific to BGP so you have to follow BGP's bestpath selection criteria.

Hi Atif ,

BGP is AS to AS routing protocol , Even though there is AD difference between IBGP and EBGP ,BGP always like to prefer route from Outide the AS than inside the AS if they are having same prefix .

Chao
Vishwa

Am I missing something? The reason they prefer outside to inside for same prefix is because of the different AD.

relsethagen wrote:

Am I missing something? The reason they prefer outside to inside for same prefix is because of the different AD.


The point here is that it is not the AD that comes into play in this case as we are not evaluating routes learnt via two different routing protocols. AD would have come into play in case, for example, a route was being learnt via OSPF (AD 110) and also via IBGP (AD 200). In this case we will install the OSPF route because of its lower AD.

In this case both routes are from BGP and consequently we use BGP's well documented decision criteria to pick the best route. Weight is on top of it so the route with the largest weight gets chosen as the best route.

Atif

If I understood the original question correctly there basically are two different routing protocols in play, EBGP with AD of 20 and IBGP with AD of 200.

relsethagen wrote:

If I understood the original question correctly there basically are two different routing protocols in play, EBGP with AD of 20 and IBGP with AD of 200.


EBGP and iBGP are not two different routing protocols, BGP is the routing protocol here. EBGP and iBGP are more like intrinsic BGP behaviors that pertain to neighborships within BGP and define how we treat updates to/from such neighbors.

Thank you for clarifying that.

vishwancc wrote:

Hi Atif ,

BGP is AS to AS routing protocol , Even though there is AD difference between IBGP and EBGP ,BGP always like to prefer route from Outide the AS than inside the AS if they are having same prefix .

Chao
Vishwa

BGP has its own decision criteria for selecting the best route. A external route does have a preference over an internal route, but this criteria comes way down in the decision path. Kindly go through the BGP best path selection criteria to understand how this process works better.

Regarding role of AD, it is not applicable here as I have been trying to clarify to the other gentleman. AD applies when we are evaluating routes learnt from two different routing protocols which is not the case here.

altheb_5
Level 1
Level 1

Path selection in BGP :

1   weight

2  local preference

3  local originator

4  as path

5  orgine

6  MED

7 EBGP or IBGP

,,,,,,,

So in this question i think IBGP with higher weight will be installd in routing table

Hope this help

Hi Khaled,

Could you please give examples to the roles of "locally originated" and "origin"

when influcing best path selection? 

thx

Could you please give examples to the roles of "locally originated" and "origin"

when influcing best path selection?

Origin:

If the BGP prefixes have equal weight, local preference and AS_Path length, then bestpath selection process compares routes origin.

IGP: Meaning the route gerenrated by using Network statement under bgp aggregated address command. It appears as "i" in BGP table output

INCOMPLETE: meaning the source could not be determined. This origin is assigned to the prefixes redistributed in to BGP.

Routes with origin IGP is prefered over incomplete.

Francisco.

Hello Jingyi,

Khaled is right: the path with the highest weight is chosen as it is the first criteria in the hierarchy of BGP path selection.

Francisco has provided examples of the effect of origin attribute.

Locally generated routes are those that are injected in the BGP table on the local node as a result of a network command or of a redistributed command (=imported by another protocol).

Cisco implementation uses weight as first decision criteria and locally originated routes can be recognized by the values of two fields:

weight = 32768  (at the middle of weight range)

BGP next-hop = 0.0.0.0    (that means that a BGP next-hop local in the router will be used, the exact value may change towards different neighbors)

As a result of this we never see this pick locally generated prefix in action directly as the weight value provides the correct behaviour.

To be noted other vendors do not use weight (for example Juniper) that is not exchanged between BGP peers and for this reason is not a BGP attribute.

Hope to help

Giuseppe

Hi,

This is what I find out in the lab.

Next hop

Origin

Network command

0.0.0.0

i

Aggregate-address

0.0.0.0

i

Redistributed BGP route

0.0.0.0

?

Case 1:

2 locally originated routes. First route is originated via network command, second is originated via redistribute command, first route is preferred because of its lowest ORIGIN.

Case 2:

First route is learned from neighbor, second route is originated via redistribute command, second route is preferred because it is locally originated route.

Thx,

Jingyi

Review Cisco Networking for a $25 gift card