05-11-2019 12:01 AM
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?
Solved! Go to Solution.
05-11-2019 02:43 AM - edited 05-11-2019 02:46 AM
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
Hope to help
Giuseppe
05-11-2019 02:43 AM - edited 05-11-2019 02:46 AM
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
Hope to help
Giuseppe
05-11-2019 07:20 AM
Many Thanks Again.
Mu ch Appreciated.
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