cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
210
Views
5
Helpful
2
Replies
Highlighted
Frequent Contributor

BGP best Route selection when AS path is same

We have two BGP nei

one is IBGP other is EBGP to ISP

 

below is one route

 

show ip bgp 1.32.225.100
BGP routing table entry for 1.32.225.0/24, version 2263349
Paths: (2 available, best #2, table default)
Advertised to update-groups:
3
Refresh Epoch 1
6327 1299 2914 64050>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>AS path
192.41.x.x from 192.41.x.x(64.141.118.154)
Origin IGP, metric 0, localpref 100, valid, internal
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
25983 812 2914 64050>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>AS path 
72.29.230.182 from 72.29.230.182 (72.29.224.129)
Origin IGP, localpref 100, valid, external, best??????????????????????????????????????
rx pathid: 0, tx pathid: 0x0

 

 

Here we see that AS path is same 4 hops

It prefers external route via 72.29.230.182 

 

does this mean that if AS path is same then BGP will prefer route learned from EBGP over IBGP?

1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Expert

Re: BGP best Route selection when AS path is same

Hello Mahesh,

yes if the AS path length is the same, the origin code is the same and  the MED is the same BGP prefers eBGP over iBGP ( neighbor type).

Note: a missing MED is considered like MED= 0 by default.

 

The steps for BGP best path selection are the following:

1) the BGP next-hop has to be reachable = a route to the BGP next-hop must exist

2) the highest weight is preferred (this is Cisco proprietary and weight is not a BGP attribute and it is confined to a single device)

3) the highest local preference is preferred the local preference is limited to a single AS and it is a BGP attribute

4) Locally injected paths are preferred (in any way they are generated network command or redistribute). Cisco routers give weight 32768 instead of 0 to locally injected routes so this step in Cisco implementation is usually masked by step 2

5) the shortest AS path is preferred

6) the lowest origin code is preferred i better then e better then ?. In Cisco routers code i is given when network command is used , the incomplete ? is associated to the prefix when redistribute is used.

7) Lowest MED is preferred if comparable

8) neighbor type eBGP is preferred over iBGP, it is considered first hand information

9) lowest IGP metric to BGP next-hop if all routes are iBGP

There are other criteria and a lot of possible cases for MED.

see the following document for more details

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

BGP uses an ordered list of criteria to choice the BGP best path if previous steps do not provide a single best path it goes on looking at the next criteria in the list.

 

and also

https://community.cisco.com/t5/networking-documents/understanding-bgp-best-path-selection-manipulation/ta-p/3150576

 

Hope to help

Giuseppe

 

 

 

2 REPLIES 2
Hall of Fame Expert

Re: BGP best Route selection when AS path is same

Hello Mahesh,

yes if the AS path length is the same, the origin code is the same and  the MED is the same BGP prefers eBGP over iBGP ( neighbor type).

Note: a missing MED is considered like MED= 0 by default.

 

The steps for BGP best path selection are the following:

1) the BGP next-hop has to be reachable = a route to the BGP next-hop must exist

2) the highest weight is preferred (this is Cisco proprietary and weight is not a BGP attribute and it is confined to a single device)

3) the highest local preference is preferred the local preference is limited to a single AS and it is a BGP attribute

4) Locally injected paths are preferred (in any way they are generated network command or redistribute). Cisco routers give weight 32768 instead of 0 to locally injected routes so this step in Cisco implementation is usually masked by step 2

5) the shortest AS path is preferred

6) the lowest origin code is preferred i better then e better then ?. In Cisco routers code i is given when network command is used , the incomplete ? is associated to the prefix when redistribute is used.

7) Lowest MED is preferred if comparable

8) neighbor type eBGP is preferred over iBGP, it is considered first hand information

9) lowest IGP metric to BGP next-hop if all routes are iBGP

There are other criteria and a lot of possible cases for MED.

see the following document for more details

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

BGP uses an ordered list of criteria to choice the BGP best path if previous steps do not provide a single best path it goes on looking at the next criteria in the list.

 

and also

https://community.cisco.com/t5/networking-documents/understanding-bgp-best-path-selection-manipulation/ta-p/3150576

 

Hope to help

Giuseppe

 

 

 

Frequent Contributor

Re: BGP best Route selection when AS path is same

Many Thanks Again.

Mu ch Appreciated.

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards