BGP Attribute and Path Selection

BGP Attribute and Path Selection

Usually, numerous paths connect to the same destination, which BGP routers receive. The optimal path for traffic forwarding and installation in the IP routing table is determined by the BGP best path algorithm.


BGP does not load balance by default; instead, it attempts to focus path selection on a single best path. In order to achieve this, it looks at the following sequence of path properties for routes with an accessible next-hop:


1. Weight:

Choose the route with the highest weight. This is a Cisco proprietary?attribute?that is local to the router. For any routes that are not originated by the local router the weight is considered as 0.?


2. Local Preference

Prefer the path with the highest local preference. This is shared across iBGP routers and utilized inside an autonomous system. The path with the highest local preference is the one we choose. 100 is the default value.


3. Originate

Choose the route originated?by the local router first. You will see next hop 0.0.0.0 in the BGP table for all locally originated routes. A BGP router will give preference to routes that it has added to BGP itself?over those that have been added by another router.


4. AS Path Length

The path with the smallest AS path length should be chosen. In comparison to AS path 1 2 3 4 5, AS path 1 2 3 is preferred.


5. Origin Code

Choose the lowest possible origin code. Three origin codes are available: IGP, EGP, and INCOMPLETE

EGP is lower than INCOMPLETE, while IGP is lower than EGP.


6. MED (Multi-Exit Discriminator)

Choose the route with the lowest MED, if the same autonomous system advertises the possible routes.


7. eBGP path over iBGP path

Choose an eBGP route over an iBGP route.


8. Shortest IGP path to BGP next hop

Prefer the path with the lowest IGP metric to the BGP next hop.


9. Oldest

When both paths are external, prefer the path that was received first (the oldest one).


10. Router ID

Prefer the route that comes from the BGP router with the lowest router ID.

The router ID is the highest IP address on the router, with preference given to loopback addresses. Also, you can use the bgp router-id command in order to manually set the router ID.


11. Neighbor IP address

Prefer the path that comes from the lowest neighbor address. This address is the IP address that is used in the BGP neighbor configuration. The address corresponds to the remote peer that is used in the TCP connection with the local router.


In order to choose the best possible route, we go along this attribute list until we reach a tiebreaker.


Somen Dey

Network Security Engineer

7 个月

Thanks for sharing

回复
Umesh Prajapati

Network Engineer || CCNA Certified || CCNP trained|| Fortinet NSE1&2 Certified || Sophos XG Firewall || Routing & Switching ||

7 个月

Where is next hop ??

回复

要查看或添加评论,请登录

Chirag Dhall的更多文章

  • Introduction to MPLS

    Introduction to MPLS

    Multiprotocol Label Switching is a technology that allows efficient data transmission across networks. Network…

    2 条评论
  • How I Got My CCIE EI #68677 Part 5: Conquering the Lab Exam

    How I Got My CCIE EI #68677 Part 5: Conquering the Lab Exam

    After failing my first attempt I returned home disappointed but was sure about giving it another try. I knew I couldn’t…

    16 条评论
  • How I Got My CCIE EI #68677 Part 4: The Day I failed!

    How I Got My CCIE EI #68677 Part 4: The Day I failed!

    After spending months on traditional networking concepts, SDN, automation, and more, I was finally ready to attempt my…

    4 条评论
  • How I Got My CCIE EI #68677 Part 3: Taking the First Steps Toward CCIE

    How I Got My CCIE EI #68677 Part 3: Taking the First Steps Toward CCIE

    Having CCNP under my belt, I was ready and eligible to appear for the CCIE lab exam—but definitely not prepared. The…

    9 条评论
  • How I got my CCIE EI #68677 Part 2: From CCNA to CCNP

    How I got my CCIE EI #68677 Part 2: From CCNA to CCNP

    In my previous post, shared how my networking journey began with a spark of curiosity and determination. I took the…

    10 条评论
  • How I Got My CCIE EI #68677 Part 1: The Beginning of the Journey

    How I Got My CCIE EI #68677 Part 1: The Beginning of the Journey

    I still remember the moment I decided to step into the networking world. It was a chilly winter night, and I was…

    26 条评论
  • Understanding the Syslog Messages

    Understanding the Syslog Messages

    Syslog is undoubtedly something you have seen when working on a router or switch, even if you have never heard of it…

  • Redistribution between EIGRP and OSPF

    Redistribution between EIGRP and OSPF

    In this article, we‘ll look at an example of how to redistribute routes between EIGRP and OSPF. Configuration: Here is…

    1 条评论
  • CONFIGURING OSPF STUB AREAS

    CONFIGURING OSPF STUB AREAS

    Stub Area In this lab, we have 2 areas: Area 0 and Area 1. Let see how we can configure OSPF and enable Area 1 as Stub…

    3 条评论
  • How to Configure OSPF MD5 Authentication

    How to Configure OSPF MD5 Authentication

    Here is the topology that we will use: Here is the configuration to enable MDS authentication For MD5 authentication…

社区洞察

其他会员也浏览了