System information
Configuring BGP
12-49
Configuring BGP Path Selection Algorithm
BGP selects the best possible path for a route and installs it in its route table. If only
one route exists for a specific destination, BGP selects that route, because, by
definition, it is the best route. If multiple routes exist, BGP uses the BGP Path
Selection Algorithm to select the best path.
BGP Path Selection Algorithm
The BGP path selection process uses the following sequential criteria to select a path:
1. If the next hop is inaccessible, BGP does not consider the route. For this reason, it
is important to have an IGP route to the next hop.
2. If synchronization is enabled, the path is internal, and the route is not in an IGP.
BGP ignores the route.
3. BGP uses the route that was locally originated, using either the network or
aggregate-address command, or through redistribution from an IGP.
4. BGP uses the path with the largest weight, a value ranging from 0 to 65535. The
administrative weight is local to the router. BSR originating paths have a of
weight 32768 by default; other paths, from peers, have a default weight of 0. To
configure specific neighbors as preferred for most traffic, use the neighbor
weight command to assign a higher weight to all routes learned from that
neighbor. You can also assign weights based on AS path access lists. A given
weight becomes the weight of the route, if the AS path is permitted by the access
list. Any number of weight filters are allowed.
5. BGP uses the route with the largest local preference. Define a particular path as
more preferable or less preferable than other paths by changing the default local
preference value of 100. To assign a different default local preference value, use
the bgp default local-preference command.
6. BGP uses the route with the shortest AS path.
7. BGP uses the route with the lowest origin type. IGP is lower than EGP, and EGP
is lower than INCOMPLETE.
8. BGP uses the route with the lowest MED. The comparison is made only if the
neighboring AS is the same, except when the bgp always-compare-med
command is enabled.