[Contents] [Prev] [Next] [Index] [Report an Error]


Examine BGP Routes and Route Selection

Purpose

You can examine the BGP path selection process to determine the single, active path when BGP receives multiple routes to the same destination prefix.


Figure 16: BGP Network Topology

The network in Figure 16 shows that R1 and R5 announce the same aggregate routes to R2 and R4, which results in R2 and R4 receiving two routes to the same destination prefix. The route selection process on R2 and R4 determines which of the two BGP routes received is active and advertised to the other internal routers (R3 and R6).

Before the router installs a BGP route, it must make sure that the BGP next-hop attribute is reachable. If the BGP next hop cannot be resolved, the route is not installed. When a BGP route is installed in the routing table, it must go through a path selection process if multiple routes exist to the same destination prefix. The BGP path selection process proceeds in the following order:

  1. Route preference in the routing table is compared. For example, if an OSPF and a BGP route exist for a particular destination, the OSPF route is selected as the active route because the OSPF route has a default preference of 10, while the BGP route has a default preference of 170.
  2. Routes are compared for local preference. The route with the highest local preference is preferred. For example, see Examine the Local Preference Selection.
  3. The AS path attribute is evaluated. The shorter AS path is preferred.
  4. The origin code is evaluated. The lowest origin code is preferred ( I (IGP) < E (EGP) < ? (Incomplete)).
  5. The MED value is evaluated. By default, if any of the routes are advertised from the same neighboring AS, the lowest MED value is preferred. The absence of a MED value is interpreted as a MED of 0. For an example, see Examine the Multiple Exit Discriminator Route Selection.
  6. The route is evaluated as to whether it is learned through EBGP or IBGP. EBGP learned routes are preferred to IBGP learned routes. For an example, see Examine the EBGP over IBGP Selection
  7. If the route is learned from IBGP, the route with the lowest IGP cost is preferred. For an example, see Examine the IGP Cost Selection. The physical next hop to the IBGP peer is installed according to the following three rules:
  1. After BGP examines the inet.0 and inet.3 routing tables, the physical next hop of the route with the lowest preference is used.
  2. If the preference values in the inet.0 and the inet.3 routing tables are a tie, the physical next hop of the route in the inet.3 routing table is used.
  3. When a preference tie exists in the same routing table, the physical next hop of the route with more paths is installed.
  1. The route reflection cluster list attribute is evaluated. The shortest length cluster list is preferred. Routes without a cluster list are considered to have a cluster list length of 0.
  2. The router ID is evaluated. The route from the peer with the lowest router ID is preferred (usually the loopback address).
  3. The peer address value is examined. The peer with the lowest peer IP address is preferred.

Steps To Take

To determine the single, active path when BGP receives multiple routes to the same destination prefix, enter the following JUNOS CLI operational mode command:

user@host> show route destination-prefix < detail >

The following steps illustrate the inactive reason displayed when BGP receives multiple routes to the same destination prefix and one route is selected as the single, active path:

  1. Examine the Local Preference Selection
  2. Examine the Multiple Exit Discriminator Route Selection
  3. Examine the EBGP over IBGP Selection
  4. Examine the IGP Cost Selection

[Contents] [Prev] [Next] [Index] [Report an Error]