13 Local Preference

Local Preference is a well-known discretionary attribute used to influence the exit path for an entire AS. It is the second step in the best-path algorithm, right after Weight.

Characteristics

  • Influences the outbound path for the whole AS: unlike Weight, which is local to one router, Local Preference is shared among internal routers so the entire AS can agree on which exit to prefer.
  • Exchanged between iBGP peers, but not sent to eBGP peers. It propagates inside the AS and is stripped when crossing an AS boundary.
  • Higher value wins: a higher Local Preference is more preferred.
  • Range: 0 to 4294967295.
  • Default value: 100.

Why it is AS-wide

Local Preference is carried in iBGP updates, so every internal router learns the same preference value. This is exactly what lets an AS make a consistent exit decision.

The key contrast with Weight:

PropertyWeightLocal Preference
ScopeSingle routerEntire AS
Propagated to iBGP peersNoYes
Sent to eBGP peersNoNo
Higher winsYesYes
Best-path order1st2nd

Typical use case

When an AS has multiple exit points (multiple border routers), Local Preference is configured on those border routers to signal which exit the whole AS should prefer. Because it propagates over iBGP, all internal routers learn the preferred exit and route toward it consistently.

Why it stops at the AS boundary

Local Preference is meaningful only within an AS. When a route is advertised to an eBGP peer, the Local Preference is discarded. Influencing another AS’s decision requires a different attribute (AS-PATH prepend or MED, notes 14 and 16).

How it is applied

  • Per prefix, with a route-map that matches routes and sets Local Preference, applied inbound on a border router (so the preference is set on incoming external routes before being propagated internally).
  • Globally on a router, changing the default Local Preference for all routes it handles, instead of the standard 100.

Self-check

Q1 — What is the scope of Local Preference?

A) A single router only
B) The entire AS (propagated over iBGP)
C) All AS along the path
D) Only eBGP peers

Q2 — What is the default Local Preference, and which value wins?

A) Default 0, lower wins
B) Default 100, higher wins
C) Default 100, lower wins
D) Default 32768, higher wins

Q3 — What happens to Local Preference when a route is advertised to an eBGP peer?

A) It is incremented
B) It is discarded (not sent across the AS boundary)
C) It is copied into the AS-PATH
D) It is converted to MED

Q4 — What is the typical use case for Local Preference?

A) Preventing loops between AS
B) Choosing which exit point the whole AS should prefer when there are multiple border routers
C) Overriding best-path on a single router only
D) Authenticating BGP sessions