https://www.thenetworkdna.com/2021/11/introduction-to-bgp-peer-groups.html?fbclid=IwAR3s8a7WHAIi0Ky1d-Tl5-988NRughQWjjdlmQnh15Q3ixBmDOMaCsaflcg

BGP Attributes and Path Selection

Attributes

This path was selected based on the following attributes:

Priority Attribute

  1. 1 Weight
  2. 2 Local Preference
  3. 3 Originate
  4. 4 AS path length
  5. 5 Origin code
  6. 6 MED
  7. 7 eBGP path over iBGP path
  8. 8 Shortest IGP path to BGP next hop
  9. 9 Oldest path
  10. 10 Router ID
  11. 11 Neighbor IP address

Weight Prefer the path with the highest weight. This is a value that is local to the router and it’s Cisco proprietary. The default value is 0 for all routes that are not originated by the local router. You can learn how it works in the BGP weight attribute lesson.

Local Preference The local preference is used within an autonomous system and exchanged between iBGP routers. We prefer the path with the highest local preference. The default value is 100. To learn more, take a look at the BGP local preference attribute lesson.

Originate Prefer the path that the local router originated. In the BGP table, you will see next hop 0.0.0.0. You can get a path in the BGP table through the BGP network command, aggregation, or redistribution. A BGP router will prefer routes that it installed into BGP itself over a route that another router installed in BGP.

AS path length Prefer the path with the shortest AS path length. For example, AS path 1 2 3 is preferred over AS path 1 2 3 4 5. You can learn more about AS path length here.

Origin code Prefer the lowest origin code. There are three origin codes:

IGP is lower than EGP and EGP is lower than INCOMPLETE. You can learn how it works in the origin code lesson.

MED Prefer the path with the lowest MED. The MED is exchanged between autonomous systems. For a detailed explanation, take a look at the MED lesson.

eBGP path over iBGP path P * refer eBGP (external BGP) over iBGP (internal BGP) paths.

https://networklessons.com/bgp/bgp-attributes-and-path-selection

https://www.thenetworkdna.com/2019/11/bgp-neighbor-authentication.html?m=1