BGP Route Selection Rules

When multiple routes are available to the same destination, BGP selects one optimal route based on BGP route selection rules and adds it to the IP routing table for traffic forwarding.

Figure 1 shows how a BGP NetEngine 8000 F selects the optimal route among multiple routes to the same destination.
Figure 1 BGP route selection process

BGP selects routes by comparing route attributes in a fixed order. When a route attribute is a sufficient condition for determining the optimal route, BGP does not compare the other attributes; If BGP fails to select the optimal route after comparing all route attributes, the route that was first received is selected as the optimal route. Table 1 lists the abbreviated alias, route selection rules, and remarks of each matching item. Table 1 shows that the route priority is directly proportional to the PrefVal or Local_Pref value and inversely proportional to the rest of the attribute values or lengths. In addition, the first column can be summarized as a character string (OPPAAA OMTCC RA), which helps memorize the matching sequence.

Table 1 BGP route selection process

Abbreviated Alias

Matching Item

Route Selection Rules

Remarks

O

Origin AS

Valid > NotFound > Invalid

BGP origin AS validation states are applied to route selection in a scenario where the device is connected to an RPKI server.

P

PrefVal

The route with the largest PrefVal value is preferred.

The default value is 0.

PrefVal is Huawei-specific and valid only on the device where it is configured.

P

Local_Pref

The route with the largest Local_Pref value is preferred.

The default value is 100.

To modify the default Local_Pref value of BGP routes, run the default local-preference command.

A

NOTE:

A is the initial of the character string (ASNIL).

Route generation mode

A > S > N > I > L, where:
  • A: indicates that routes are summarized using the aggregate command.
  • S: indicates that routes are summarized using the summary automatic command.
  • N: indicates that routes are imported using the network command.
  • I: indicates that routes are imported using the import-route command.
  • L: indicates that routes are learned from BGP peers.

-

A

Accumulated Interior Gateway Protocol (AIGP)

The route with the smallest AIGP value is preferred.

The route with AIGP to the route without AIGP is preferred.

-

A

AS_Path

The route with the shortest AS_Path length is preferred.

If the bestroute as-path-ignore command is run, BGP does not compare the AS_Path lengths in different routes during route selection.

O

Origin

IGP > EGP > Incomplete

-

M

Multi Exit Discriminator (MED)

The route with the smallest MED value is preferred.

The default value is 0.

If the bestroute med-none-as-maximum command is configured, BGP considers the largest MED value (4294967295) as the MED of the route that does not carry an MED.

For details about MED usage, see MED.

T

Peer type

EBGP > IBGP

-

C

IGP metric

The route with the smallest IGP cost is preferred.

If the bestroute igp-metric-ignore command is configured, BGP does not compare the IGP cost.

C

Cluster_List

The route with the shortest Cluster_List length is preferred.

By default, Cluster_List takes precedence over Originator_ID during BGP route selection. To enable Originator_ID to take precedence over Cluster_List during BGP route selection, run the bestroute routerid-prior-clusterlist command.

R

Router ID

The route with the smallest router ID is preferred.

If routes carry the Originator_ID, the originator ID is substituted for the router ID during route selection. The route with the smallest Originator_ID is preferred.

A

Peer IP address

The route learned from the peer with the smallest IP address is preferred.

-

Selection of the Routes for Load Balancing

After BGP load balancing is configured, the BGP routes that meet the following conditions are used as equal-cost routes for load balancing:

  • Original next-hop addresses are different.
  • The routes have the same Origin AS.

  • The routes have the same PrefVal value.

  • The routes have the same Local_Pref value.

  • All the routes are summarized or non-summarized routes.

  • The routes have the same AIGP value.

  • The routes have the same AS_Path length.

  • The routes have the same origin type (IGP, EGP, or incomplete).

  • The routes have the same MED value.

  • All the routes are EBGP or IBGP routes. After the maximum load-balancing eibgp command is run, BGP ignores this limitation when selecting the optimal VPN route.

  • The metric values of the IGP routes to which BGP routes within an AS recurse are the same. After the load-balancing igp-metric-ignore command is run, the device does not compare IGP metric values when selecting routes for load balancing.

  • All routes are blackhole or non-blackhole routes.

In addition, BGP labeled routes and non-labeled routes cannot load-balance traffic even if they meet the preceding conditions. Load balancing cannot be implemented between blackhole routes and non-blackhole routes.

VPN Route Selection Rules

On the NetEngine 8000 F, the rules for selecting VPN BGP routes are the same as those for selecting public network BGP routes. The only difference is that VPN BGP routes need to be leaked based on VPN targets. For details about route leaking, see "BGP VPN Route Leaking" in NetEngine 8000 F Feature Description > IP Routing > BGP.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >