Use it to make the whole AS prefer one exit for a destination (primary and backup ISP), or when routers inside the AS pick an exit you did not expect.
LOCAL_PREF
LOCAL_PREF tells routers inside your AS which exit to prefer for a destination; the highest value wins (default 100). It is shared with iBGP peers but never sent to eBGP peers, making it the main tool for outbound traffic engineering.
1. Set inbound with a route-map: set local-preference 200 — higher wins.
2. Default 100; shared with all iBGP peers in the AS.
3. show ip bgp <prefix> — LocPrf column on each path.
route enters the AS over eBGP → inbound route-map sets LOCAL_PREF → value carried to all iBGP peers → highest LOCAL_PREF wins (after Weight) → RIB → outbound traffic leaves via that exit
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show route-mapShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 First 30 seconds Verify boundary
Immediate answer: Compare LOCAL_PREF only after confirming the same prefix has multiple eligible paths and no earlier local-only policy overrides your test.
Verification chain: received paths → inbound policy → LOCAL_PREF values → best-path decision → RIB → forwarding
Stop condition: Higher LOCAL_PREF explains preference only within its comparison context, but it does not show the resulting exit path works.
Step 2 Operational verification and known-good state Verify boundary
show ip bgp 203.0.113.0 255.255.255.0
show route-map FROM-PRIMARY
show ip bgp neighbors 192.0.2.2 routes
The first shows localpref on each path and which is best. The route-map view shows the clause that sets the value. The third lists the routes accepted from one neighbour after inbound policy, with the LocPrf column — a quick way to see whether the policy hit the prefixes you meant.
Known-good: on the edge the intended paths carry the intended value, internal routers show the same value and the same best path, and the traceroute leaves through that exit.
Step 3 Verification and output interpretation Verify boundary
Inspect the attribute on the same prefix across relevant iBGP speakers and confirm the higher value is present where expected. Verify which route-map or policy set the value, then confirm the chosen exit in the BGP table and RIB. If the attribute appears only on one router, investigate propagation or policy boundaries rather than assuming all routers share the same decision.
Step 4 Verification & troubleshooting Narrow the fault
1. On the edge router that sets it: show ip bgp <prefix> → localpref on the path.
2. On an internal router: the same command → did the value arrive, and is that path best?
3. Value not set? show route-map for matches, confirm the route-map is applied in on the right neighbour, then clear ip bgp <neighbour> soft in.
4. One router disagrees with the rest? Look for a Weight on that router.
5. Confirm the exit with a traceroute.
Step 5 Failure signatures and troubleshooting branches Narrow the fault
- The preferred exit is not chosen. The route-map is not applied, matches too little, or no soft clear was done after the change.
- Far more prefixes moved than intended. The route-map clause has no
matchand applies to every route from that neighbour. - One router uses the other exit. A local Weight overrides LOCAL_PREF there, or that router does not receive the preferred path.
- Inbound traffic did not change. LOCAL_PREF never leaves the AS; use AS_PATH prepending, MED or provider communities for the inbound direction.
- Internal routers show only one path. Normal — the backup edge keeps its path to itself while it prefers the other.
- Traffic stays on the primary although the provider behind it is broken. As long as the route is received, LOCAL_PREF keeps preferring it.
Step 6 When the problem is really fixed Narrow the fault
- The intended exit's paths carry the higher LOCAL_PREF on the edge and on internal routers.
- All routers select the same exit, and no local Weight contradicts it.
- A traceroute leaves through that exit.
- With the primary session shut in a test, the backup path becomes best and traffic continues.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Higher wins, default 100, compared right after Weight and before AS_PATH. It travels only over iBGP and never reaches a neighbouring AS, so it steers outbound traffic only. Set it inbound on the eBGP session where the route enters the AS.
show ip bgp <prefix> → localpref on each path. show route-map → the clause that sets it and its match counters. After a policy change: clear ip bgp <ip> soft in, then read the prefix again.
ReferenceWhat it is2 sections · depth on demand
BGP scope — internal and external paths
LOCAL_PREF chooses the preferred exit within an AS, with higher values preferred among eligible paths. It is carried to iBGP peers and normally not advertised to external peers outside a confederation. An inbound eBGP route map can assign LOCAL_PREF before internal distribution, and an iBGP import policy can change it locally. A community only causes such a preference when policy explicitly matches the tag and sets the value. LOCAL_PREF cannot make an unreachable NEXT_HOP eligible.
What it is
LOCAL_PREF is a number attached to a route inside one AS that says how much that AS prefers the path. The highest value wins. It is how an AS chooses which exit to use toward a destination.
ReferenceWhy it matters1 section · depth on demand
Why it matters
It is the main tool for steering outbound traffic. One setting on an edge router decides for every router in the AS, and because it is evaluated before AS_PATH, policy — customer before peer before transit, primary before backup — beats path length. When "BGP picked the longer path", LOCAL_PREF is usually the reason, and usually on purpose.
ReferenceImportant terms & boundaries7 sections · depth on demand
Key points
- Higher wins. Default 100 (
bgp default local-preferencechanges it). - On Cisco it is the second step, right after Weight.
- Carried over iBGP only and removed toward eBGP neighbours — so it controls outbound traffic, never inbound.
- Set it inbound on the eBGP session at the edge: a route-map with
set local-preference. - Every router in the AS then sees the same value and picks the same exit.
- A typical scheme: customer routes high, peers in the middle, transit at the default, backup links lower.
- It does not test whether the preferred exit actually works.
In depth
LOCAL_PREF chooses the exit point for the whole AS
LOCAL_PREF is step 2 in Cisco's best path order, right after weight. Higher wins. The Cisco document gives the default as 100. It is carried to all iBGP peers, but not sent to eBGP peers, so it tells every router in the AS which exit to use for outbound traffic.
R1(config)# route-map FROM-ISP-A permit 10
R1(config-route-map)# set local-preference 200
R1(config)# router bgp 64500
R1(config-router)# neighbor 192.0.2.1 route-map FROM-ISP-A in
R1# clear ip bgp 192.0.2.1 soft in
R2# show ip bgp 0.0.0.0
64510
10.0.0.1 from 10.0.0.1 (10.0.0.1)
Origin IGP, metric 0, localpref 200, valid, internal, best
64511
10.0.0.3 from 10.0.0.3 (10.0.0.3)
Origin IGP, metric 0, localpref 100, valid, internal
Every router in the AS now prefers ISP A, without configuration on each one.
LOCAL_PREF versus weight
| LOCAL_PREF | Weight | |
|---|---|---|
| Scope | Whole AS (iBGP) | One router |
| Default | 100 | 0 (32768 for locally originated routes) |
| Order | Step 2 | Step 1 |
| Standard | Yes | Cisco-specific |
Typical policies
| Policy | Values |
|---|---|
| Primary and backup ISP | 200 on the primary, 100 (default) on the backup |
| Prefer customer, then peer, then transit (providers) | For example 300, 200, 100 |
| Community-driven by customers | Set LOCAL_PREF based on communities the customer attaches |
Points to watch
- Set LOCAL_PREF inbound (on received routes). It has no effect on what neighbouring ASes do.
- After a policy change, use a soft clear (
clear ip bgp <neighbor> soft in) instead of resetting the session. - Routes with a higher LOCAL_PREF win even with a much longer AS_PATH, since LOCAL_PREF comes first.
Documented example, not captured output.
Platform, version and operating-envelope scope
Cisco IOS / IOS XE first; best-path tie breakers and command output vary by release and feature set.
Quick reference
LOCAL_PREF is a well-known discretionary attribute exchanged only inside an AS. The highest value wins (default 100), making it the standard way to choose which exit point the whole AS uses for outbound traffic.
route-map ISP-A-IN permit 10
set local-preference 200
router bgp 65010
address-family ipv4 unicast
neighbor 203.0.113.1 route-map ISP-A-IN in
Documented example, not captured output.
Set it inbound on the edge router facing the preferred provider; iBGP carries the value to every other router.
Mechanics and state ownership
A route arriving from an eBGP neighbour carries no LOCAL_PREF. The edge router assigns one — the default, or the value from its inbound route-map — and includes it when it passes the route to its iBGP peers. From then on every router in the AS compares the same numbers.
With two edge routers something less obvious happens. Say edge A sets 200 and edge B leaves the default 100 for the same prefix. B hears A's path over iBGP, prefers it, and now its best path is an iBGP-learned one. A router advertises only its best path, and iBGP-learned routes are not passed on to other iBGP peers — so B stops announcing its own external path. Internal routers then see just one path, A's. B still holds the backup in its own table, and if A's path is withdrawn B's becomes best and is advertised at once.
That is why show ip bgp on an internal router often shows a single path although the AS has two exits: the backup is hidden, not missing.
State model and selection mechanics
LOCAL_PREF is propagated to iBGP peers inside the AS and is normally not advertised to ordinary eBGP neighbors. Cisco commonly uses 100 as the default local preference. Because it is evaluated early in best-path selection, it can intentionally override shorter AS_PATHs and other later criteria. This makes it a strong mechanism for expressing “our AS should leave through this exit” consistently across multiple internal BGP speakers.
Limits and common misconceptions
LOCAL_PREF is not sent across ordinary eBGP boundaries, so it cannot directly force another AS to choose your preferred inbound path. It also does not test reachability or quality of the selected exit. A high value can keep traffic pinned to a path even when a lower-level transport is degraded unless another mechanism withdraws or changes the route.
ReferenceConfiguration & state1 section · depth on demand
Policy and configuration model
Apply LOCAL_PREF at a clear policy ingress point, commonly on routes learned from a particular external neighbor or matching a controlled prefix/community set. Keep the scope narrow enough that the preference represents a real business or transport policy. If several routers set conflicting values for the same routes, the resulting AS-wide behavior can become difficult to reason about.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Lab addressing; local AS 65000; eBGP neighbours already Established; route-refresh supported.
route-map FROM-PRIMARY permit 10
set local-preference 200
!
router bgp 65000
address-family ipv4 unicast
neighbor 192.0.2.2 route-map FROM-PRIMARY in
!
! then: clear ip bgp 192.0.2.2 soft inExpected output
show ip bgp 203.0.113.0 255.255.255.0Expected state: The path with localpref 200 is best even though its AS_PATH is longer.
BGP routing table entry for 203.0.113.0/24
Paths: (2 available, best #1, table default)
65010 65030
192.0.2.2 from 192.0.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 200, valid, external, best
65020
10.0.0.2 from 10.0.0.2 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, internal
! Illustrative output, not captured Evidence.Path 1 has the longer AS_PATH but wins on LOCAL_PREF 200 against 100, because LOCAL_PREF is compared first. Path 2 is the backup exit learned over iBGP from the other edge router.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Routing → BGP → eBGP → LOCAL_PREF. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%Quick lookup tables
LOCAL_PREF · routing reference
Compact path-selection and evidence boundaries for fast lookup.
| Property | LOCAL_PREF |
|---|---|
| Scope | Inside local AS |
| Preference | Higher wins |
| Common default | 100 |
| Typical use | Outbound exit policy |
LOCAL_PREF operational reference
Topic-specific bounded interpretation: known-good BGP state, suspicious signatures and the next technical proof boundary.
| Boundary | Known-good for LOCAL_PREF | Suspicious signature | Next proof |
|---|---|---|---|
| Session/input | Correct peer, AF and prefix context | Transport, FSM or prefix eligibility disagrees | Peer detail and exact prefix |
| Attribute/policy | LOCAL_PREF as an AS-internal outbound-exit preference, normally propagated to iBGP peers and evaluated with higher values preferred before AS_PATH/MED decisions matches intended policy | the preferred exit not winning because LOCAL_PREF was never set, a route-map applying the value to too broad or too narrow a prefix set, inconsistent LOCAL_PREF across iBGP speakers, an operator expecting an eBGP peer to honor the local value, or a high LOCAL_PREF path selected even though its forwarding next hop is broken | Compare candidate paths and policy |
| Route/forwarding | Expected best path reaches RIB/FIB | BGP state exists but installed path disagrees | RIB/FIB/CEF and next-hop proof |
| Closure | Original test passes for explained reason | Symptom moved, was bypassed or state was forced | Regression/failover test |