BGP Route Attributes and Best-Path Policy
Separate eligibility from preference
A route must be usable and permitted before it can win a comparison. NEXT_HOP identifies the address toward which traffic should be forwarded; the router needs a resolvable path to that next hop. The BGP next hop need not be the same as the TCP peer address, particularly when iBGP carries routes learned externally. AS_PATH records AS traversal information; ordinary loop checks and import policy can exclude a candidate. The selected BGP route may still compete with routes from other sources for installation in the routing table.
Choose a path under a stated policy
LOCAL_PREF expresses the preference of the local AS for an exit; higher is preferred and it is ordinarily distributed inside the AS, not to ordinary external peers. AS_PATH length may favor fewer AS hops after earlier criteria tie. MED (MULTI_EXIT_DISC) can suggest an entry point to a neighboring AS; lower is usually preferred when compared, normally among routes from the same neighboring AS. ORIGIN is a classification of how reachability entered BGP, not a proof of ownership. Communities attach policy labels; the receiving policy decides how ordinary labels affect treatment. RFC 1997 defines special meanings for well-known communities such as NO_EXPORT.
Work through two competing exits
Both rows below describe the same prefix; both are eligible, next hops are reachable, and earlier criteria such as weight and locally originated status tie. For this deliberately small model, compare higher LOCAL_PREF, then shorter ordered AS_PATH. A wins despite crossing more ASes. If its local preference falls to 100, B wins by path length. This resembles part of FRRouting 10.0 selection, which also considers weight and other criteria; it is not the full decision process or a universal vendor ordering. MED is not compared in this example.
Destination: 192.0.2.0/24Path LOCAL_PREF AS_PATHA 200 64497 64498 64499B 100 64500 64499Winner: ADo not confuse selection and forwarding
BGP compares paths for a particular prefix. Forwarding chooses the longest matching installed prefix for a destination address; a more specific installed route can therefore carry traffic even when a covering route has a higher local preference. A shorter AS path also says little about latency, capacity or cost. Review the selected route, actual forwarding table and return path separately. Practice changing preference and next-hop reachability in the manual lab.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
BGP Route Attributes and Best-Path Policy Quiz
Apply BGP reasoning to fictional routing evidence.
Two eligible paths for one prefix have LOCAL_PREF 180 and 100. Earlier criteria tie. Which is preferred?
Both paths have equal LOCAL_PREF and all earlier criteria tie. A has ordered AS_PATH length 3, B length 2. Under the lesson model, which wins?
A path has LOCAL_PREF 250 but an unresolved NEXT_HOP. What is the correct first decision?
What is MED normally intended to influence?
Both 192.0.2.0/24 and 192.0.2.128/25 are installed. Which matches 192.0.2.200 most specifically?