Macro 32 Ramblings

Mind Archive

BGP path selection

http://knol.google.com/k/juniper-hacks/bgp-path-selection/1xqkuq3r2h459/41

Background

Border Gateway Protocol can be a complex in the way it selects its route. Here is the manner in which BGP goes about selecting its path.

BGP Path Selection

1.) Can the BGP next hop be reached, which also means it must have a route in the inet.0 routing table to the ip address in the BGP next hop attribute field.
2.) Prefer higher local preference
3.) Prefer shortest AS path (very common tie-breaker)
4.) Prefer lowest origin code
5.) Prefer lowest MED value, this will occur if always-compare-med is turned on or if any of the remaining routers are advertised from the same neighboring AS. No MED value implies a MED of 0.
6.) Prefer routes learned by EBGP over IBGP, if routes were learned via EBGP go to the router Id (9)
7.) Prefer path with lowest IGP metric
    a.) Examine tables inet.0 and inet.3 for the BGP next hop, activate next hop for route with the lower preference
    b.) If the preferences are equal use next hop in inet.3
    c.) If a preference tie exists in the same routing table, use the the route with the greater number of equal cost paths
8.) Prefer paths with shortest cluster length
9.) Prefer paths with lowest router id (RID), if equal prefer currently active route
10.) Prefere paths with lowest peer-id

The most common cases can be remembered by
We Love All Our Mothers, which stands for
Weight (cisco only)
Local preference
Autonomous system
Origin
Med


Leave a Reply