User Tools

Site Tools


bgp

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
  • EGP
  • INCOMPLETE

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.

  • Shortest IGP path to BGP next hop
  • Prefer the path within the autonomous system with the lowest IGP metric to the BGP next hop.
  • Oldest Path
  • Prefer the path that we received first, in other words, the oldest path.
  • Router ID
  • Prefer the path with the lowest BGP neighbor router ID. The router ID is based on the highest IP address. If you have a loopback interface, then the IP address on the loopback will be used. The router ID can also be manually configured.
  • Neighbor IP address
  • Prefer the path with the lowest neighbor IP address. If you have two eBGP routers and two links in between then the router ID will be the same. In this case, the neighbor IP address is the tiebreaker.
  • Path Selection
  • When BGP has multiple paths to a destination they are stored in the BGP table. All paths are in the BGP table but only one gets installed in the routing table.
  • Which path do we select? We start at the top of the list with BGP attributes and work our way to the bottom:
  • We start with weight because it’s at the top of the BGP attributes list. We now have two options:
  • If one path has a better weight then we select this path as the best path.
  • If the weight is equal, we move down to the next attribute.
  • The next attribute is local preference. Once again, we have two options:
  • If one path has a better local preference then we select this path as the best path.
  • If the local preference is equal, we move down to the next attribute.
  • We work our way down this attribute list until we have a tiebreaker to select the best path. If all paths have the same BGP attributes, then we end up with the neighbor IP address.

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

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

bgp.txt · Last modified: 2023/03/06 11:31 by 127.0.0.1