cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1307
Views
0
Helpful
5
Replies

BGP-metric

Suppose we have 3 routers. R1 & R2 are in the same AS & the other is in a different one. Router that count as eBGP has lower metric than the other that is iBGP. Which one will be chosen as the best next hop?

Thanks

1 Accepted Solution

Accepted Solutions

Hello miracle_david@yahoo.com ,

the command bgp always-compare-med is needed in the case that you want to make comparable two BGP advertisements that have two different AS paths attributes that are of the same length  (number of ASN in the path) but they differ in the peer AS (the leftmost AS, that is the BGP AS that passed the advertisemnt to the local router /AS).

 

The MED attribute is not the first criteria in the BGP best path selection.

by default MED values coming from different ASes are considered not comparable as each ISP is free to set it or even not setting it ( by default a missing MED is advertised as MED 0 that would be the best possible value).

 

In real world when a multihomed customer AS with eBGP relationships with ISP A and ISP B the negotiation can lead to a coordinate action in setting the MED and so in this case using the command bgp always-compare-med becomes appropriate because all the involved actors (the customer, and its upstream providers iSPA and ISPB) have agreed on this.

 

In all other cases using that command is not recommended.

Note: the MED attribute can be set only by directly connected eBGP ASes, it is not a global parameter it is reset to zero when sending to another AS. It comes from a peer AS.

 

There are other parameters that can be tuned like local preference.

 

Finally there is a correlated command to make the value of a missing MED not zero but the highest value possible for this parameter. This is recommended when multihoming and using MED as the criteria to choice the upstream provider.

 

Hope to help

Giuseppe

 

View solution in original post

5 Replies 5

omz
VIP Alumni
VIP Alumni

Administrative Distance of eBGP is 20 vs iBGP is 200 

 

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello miracle_david@yahoo.com ,

even in case of a tie an eBGP path is preferred over an iBGP path because it is considered first hand information.

The AS path attribute is not changed in iBGP until a router needs to advertise to a router in another BGP AS over an eBGP session.

The BGP best path choice is performed in the BGP table aka BGP RIB and the admin distance is not considered in this context even if as noted by @omz it will lead to the same choice.

AD is used by the IP routing table daemon.

BGP performs the best path selection before and presents its best path choice to the IP routing table daemon.

 

Hope to help

Giuseppe

 

Thanks, shall I issue the special configuration command "bgp always-compare-med" on the router in order for the router to compare metrics from neighbors that come from different ASs ?
In the following link "metric" section page 33, 4th paragraph, why RTA doesn't compare RTB's metric?
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.pdf?dtid=osscdc000283

Hello miracle_david@yahoo.com ,

the command bgp always-compare-med is needed in the case that you want to make comparable two BGP advertisements that have two different AS paths attributes that are of the same length  (number of ASN in the path) but they differ in the peer AS (the leftmost AS, that is the BGP AS that passed the advertisemnt to the local router /AS).

 

The MED attribute is not the first criteria in the BGP best path selection.

by default MED values coming from different ASes are considered not comparable as each ISP is free to set it or even not setting it ( by default a missing MED is advertised as MED 0 that would be the best possible value).

 

In real world when a multihomed customer AS with eBGP relationships with ISP A and ISP B the negotiation can lead to a coordinate action in setting the MED and so in this case using the command bgp always-compare-med becomes appropriate because all the involved actors (the customer, and its upstream providers iSPA and ISPB) have agreed on this.

 

In all other cases using that command is not recommended.

Note: the MED attribute can be set only by directly connected eBGP ASes, it is not a global parameter it is reset to zero when sending to another AS. It comes from a peer AS.

 

There are other parameters that can be tuned like local preference.

 

Finally there is a correlated command to make the value of a missing MED not zero but the highest value possible for this parameter. This is recommended when multihoming and using MED as the criteria to choice the upstream provider.

 

Hope to help

Giuseppe

 

The eBGP is always Preferred over iBGP , as per the attribute.

 

AD is always used to compare the best path for a particular prefix before making it as best and installing it in the routing table.

Please do not hesitate to click the STAR button if you are satisfied with my answer.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card