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:
| Property | Weight | Local Preference |
|---|---|---|
| Scope | Single router | Entire AS |
| Propagated to iBGP peers | No | Yes |
| Sent to eBGP peers | No | No |
| Higher wins | Yes | Yes |
| Best-path order | 1st | 2nd |
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
Respuesta
B is correct. Local Preference is shared among internal routers over iBGP, so the whole AS can agree on the preferred exit.
- A) False — single-router scope describes Weight.
- C) False — it does not cross AS boundaries; it stays within one AS.
- D) False — it is not sent to 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
Respuesta
B is correct. The default is 100, and a higher Local Preference is more preferred.
- A) False — the default is 100, and higher (not lower) wins.
- C) False — higher wins, not lower.
- D) False — 32768 is Weight’s local-origination default, not Local Preference.
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
Respuesta
B is correct. Local Preference is meaningful only within an AS; it is stripped when advertised to an eBGP peer.
- A) False — it is not modified, it is removed at the boundary.
- C) False — it is not folded into the AS-PATH.
- D) False — it is not converted to another attribute automatically.
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
Respuesta
B is correct. Configured on border routers and propagated over iBGP, it makes the entire AS agree on a preferred exit.
- A) False — loop prevention is AS-PATH’s job.
- C) False — single-router override is Weight’s role.
- D) False — authentication is unrelated to Local Preference.