- Best Path Selection:
- Default chooses single best path.
- Best path installed in RIB/FIB
- Advertised to other BGP peers.
- Decision process
- RFC 4271
- Prerequisites:
- Next hop must be in routing table
- prevents route recursion failure.
- Synchronization rule must be met or disabled.
- AS-Path must not contain local-AS
- Standard EBGP Loop prevention
- Can be disabled with ‘allow-as in’
- First ASN in path must be neighbor’s ASN
- ‘bgp enforce-first-as’ command.
- Next hop must be in routing table
- Path Selection Order
- Weight
- Cisco proprietary
- Locally significant
- Higher value is preferred
- Local Preference
- Higher value is preferred
- Not advertised to EBGP peers.
- Carried through confederation EBGP.
- Locally Originated
- Locally originated gets weight of 32768
- AS-Path
- Smaller length is preferred
- Origin
- IGP over EBGP over Incomplete
- IGP origination is from network statement.
- Incomplete is from redistribution.
- Network statement preferred over redistribution.
- IGP over EBGP over Incomplete
- MED
- Smaller value preferred.
- Only compared for peerings to same provider by default.
- Typically only used for comparing the same route from the same provider over multiple links.
- Weight
Tie Breakers:
- EBGP over iBGP
- If learned from EBGP, it’s not your prefix.
- EBGP always preferred.
- IGP Metric to Next-Hop
- Can use multi-path if all equal after this step.
- Hidden command to allow multipath if AS_Path is not the same (has to be same length)
- ‘bgp bestpath as-path multipath-relax’
- Additional Tie Breakers:
- Oldest
- Lowest RID
- Shortest cluster list
- Lowest Neighbor Address
- Exceptions:
- ‘bgp bestpath as-path ignore’
- ‘bgp always-compare-med’
- Compares MED for routes locally originated in Confederation.
- ‘bgp bestpath med missing-as-worst’
- Assign 4,294,967,294 to NULL MED
- ‘bgp deterministic med’
- Compare MED against all possible paths.
- IGP Metric
- ‘bgp bestpath igp-metric ignore’
- IOS-XE 3.4S
- ‘bgp bestpath igp-metric ignore’
- Router-ID
- ‘no bgp bestpath compare-router-id’
Manipulating Best Path Selection
- Outbound routing policy affects inbound traffic
- Inbound routing policy affects outbound traffic
- Longest match routing is above all
- Affects both directions.
- Attributes for influencing outbound path selection:
- Weight and Local Pref
- Set inbound
- Affects outbound traffic
- Weight and Local Pref
- Attributes for influencing inbound path selection:
- AS-Path and MED
- Set outbound
- Affects inbound traffic
- AS-Path and MED
- Multipath Load Balancing
- MP load balancing for external links with unequal bandwidth
- Enabled for IPv4, IPv6, VPNv4, VRF AF
- For iBGP, eBGP, eiBGP
- Still only one best path advertised to peers.
- MP load balancing for external links with unequal bandwidth