how does BGP select routes

When there are multiple routes to the same destination, BGP (Border Getaway Protocol)  on Huawei devices:

  1. Prefers the route with the largest PreVal. PrefVal is a Huawei-specific parameter. It is valid only on the device where it is configured.
  2. Prefers the route with the highest Local_Pref.
  3. Prefers a locally originated route. A locally originated route takes precedence over a route learned from a peer.
  4. Prefers the aggregated route. The preference of an aggregated route is higher than a non-aggregated route.
  5. Prefers the local route that is manually aggregated. The preference of the local route that is manually aggregated is higher than that of automatically aggregated.
  6. Prefers the local route that is imported by using network command. The preference of the route that is imported by using the network command is higher than that imported by  import-route command.
  7. Prefers the route with the shortest AS_Path.
  8. Compares Origin attributes, and selects routes whose origin types are IGP, EGP, and Incomplete respectively.
  9. Prefers the route with the smallest MED.
  10. Prefers the routes learned from EBGP. The preference of an EBGP route is higher than an IBGP.
  11. Prefers the route of an IGP with the lawest metric in an AS. If load balancing is configured and there are multiple external routes with the same AS_Path, load balancing is performed according to the number of configured routes.
  12. Prefers the route with the shortest Cluster_List.
  13. Prefers the route with the smallest Originator_ID.
  14. Prefers the route advertised by the router with the smallest router ID.
  15. Compares IP addresses of its peers, and prefers the route that is learnt from the peer with the smallest IP address.
Advertisements

One thought on “how does BGP select routes

  1. CYYAP

    Very informative. Thank you.
    The first selection in Huawei is equivalent to Cisco “Weight”.
    A question, for order number 10, Huawei prefer EBGP than IBGP. But do you know why Huawei uses preference of 255 for both Internal and external BGP in routing table?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s