Cisco Systems OL-14356-01 Network Router User Manual


 
Implementing BGP on Cisco IOS XR Software
Information About Implementing BGP on Cisco IOS XR Software
RC-28
Cisco IOS XR Routing Configuration Guide
OL-14356-01
3. If the paths have unequal weights, the path with the highest weight is chosen. Note: the weight is
entirely local to the router, and can be set with the weight command or using a routing policy.
4. If the paths have unequal local preferences, the path with the higher local preference is chosen. Note:
If a local preference attribute was received with the path or was set by a routing policy, then that
value is used in this comparison. Otherwise, the default local preference value of 100 is used. The
default value can be changed using the bgp default local-preference command.
5. If one of the paths is a redistributed path, which results from a redistribute or network command,
then it is chosen. Otherwise, if one of the paths is a locally generated aggregate, which results from
an aggregate-address command, it is chosen.
Note Step 1 through Step 4 implement the “Degree of Preference” calculation from Section 9.1.1 of
draft-ietf-idr-bgp4-24.txt.
6. If the paths have unequal AS path lengths, the path with the shorter AS path is chosen. This step is
skipped if bgp bestpath as-path ignore command is configured. Note: when calculating the length
of the AS path, confederation segments are ignored, and AS sets count as 1. (See Section 9.1.2.2a
of draft-ietf-idr-bgp4-24.txt.)
7. If the paths have different origins, the path with the lower origin is selected. Interior Gateway
Protocol (IGP) is considered lower than EGP, which is considered lower than INCOMPLETE. (See
Section 9.1.2.2b of draft-ietf-idr-bgp4-24.txt.)
8. If appropriate, the MED of the paths is compared. If they are unequal, the path with the lower MED
is chosen.
A number of configuration options exist that affect whether or not this step is performed. In general,
the MED is compared if both paths were received from neighbors in the same AS; otherwise the
MED comparison is skipped. However, this behavior is modified by certain configuration options,
and there are also some corner cases to consider. (See Section 9.1.2.2c of draft-ietf-idr-bgp4-24.txt.)
If the bgp bestpath med always command is configured, then the MED comparison is always
performed, regardless of neighbor AS in the paths. Otherwise, MED comparison depends on the AS
paths of the two paths being compared, as follows:
a. If a path has no AS path or the AS path starts with an AS_SET, then the path is considered to
be internal, and the MED is compared with other internal paths
b. If the AS path starts with an AS_SEQUENCE, then the neighbor AS is the first AS number in
the sequence, and the MED is compared with other paths that have the same neighbor AS
c. If the AS path contains only confederation segments or starts with confederation segments
followed by an AS_SET, then the MED is not compared with any other path unless the bgp
bestpath med confed command is configured. In that case, the path is considered internal and
the MED is compared with other internal paths.
d. If the AS path starts with confederation segments followed by an AS_SEQUENCE, then the
neighbor AS is the first AS number in the AS_SEQUENCE, and the MED is compared with
other paths that have the same neighbor AS.
Note If no MED attribute was received with the path, then the MED is considered to be 0 unless the
bgp bestpath med missing-as-worst command is configured. In that case, if no MED attribute
was received, the MED is considered to be the highest possible value.