When your network connects to multiple ISPs or has multiple exit points, you need a way to tell every router in your AS which exit to prefer for specific destinations. That's what LOCAL_PREF does — it's a well-known discretionary attribute carried by iBGP throughout your AS, and it's evaluated at step 2 of the best path algorithm (right after the Cisco-proprietary weight). Higher values are preferred.
How Local Preference Works
- Default value: 100 on Cisco IOS XE
- Scope: iBGP only — LOCAL_PREF is stripped from eBGP advertisements. Your ISPs never see your local-pref values.
- Propagation: Set on a border router, carried to all iBGP peers (and route reflector clients). Every router in the AS sees it and makes the same path selection decision.
- Selection: Higher wins. A route with local-pref 200 beats local-pref 100 at step 2 of best path selection (see BGP Best Path Selection Algorithm).
Configuration
Set local-pref with an inbound route-map on the eBGP session:
route-map PREFER-ISP-A permit 10
set local-preference 150
!
router bgp 65001
neighbor 172.16.0.2 route-map PREFER-ISP-A inNow all routes from ISP-A (172.16.0.2) get local-pref 150 instead of the default 100. Since R1-HQ's iBGP peer R2-HQ also learns some of these routes from ISP-B (with default local-pref 100), the ISP-A path wins across the entire AS.
Selective Local Preference
More commonly, you want different local-pref values for different prefixes:
ip prefix-list CRITICAL-SERVICES seq 10 permit 100.64.0.0/18
ip prefix-list CRITICAL-SERVICES seq 20 permit 100.64.64.0/18
!
route-map ISP-A-IN permit 10
match ip address prefix-list CRITICAL-SERVICES
set local-preference 200
!
route-map ISP-A-IN permit 20
set local-preference 80
!
router bgp 65001
neighbor 172.16.0.2 route-map ISP-A-IN inCritical services route through ISP-A (local-pref 200). Everything else prefers ISP-B (which gets default 100, beating ISP-A's 80).
Common Design Patterns
Primary/Backup ISP
! ISP-A = primary (all traffic)
route-map ISP-A-IN permit 10
set local-preference 200
!
! ISP-B = backup (only used if ISP-A is down)
route-map ISP-B-IN permit 10
set local-preference 50
!
router bgp 65001
neighbor 172.16.0.2 route-map ISP-A-IN in
neighbor 172.16.0.6 route-map ISP-B-IN inLoad Sharing by Destination
ip prefix-list HALF-A seq 10 permit 0.0.0.0/1
ip prefix-list HALF-B seq 10 permit 128.0.0.0/1
!
! ISP-A preferred for 0.0.0.0/1
route-map ISP-A-IN permit 10
match ip address prefix-list HALF-A
set local-preference 200
route-map ISP-A-IN permit 20
set local-preference 80
!
! ISP-B preferred for 128.0.0.0/1
route-map ISP-B-IN permit 10
match ip address prefix-list HALF-B
set local-preference 200
route-map ISP-B-IN permit 20
set local-preference 80This splits outbound traffic roughly 50/50 by destination. The /1 split is a common quick-and-dirty approach — for finer control, split by specific high-traffic destinations.
Verification
R1-HQ# show ip bgp 100.64.0.0/18
BGP routing table entry for 100.64.0.0/18, version 22
Paths: (2 available, best #1, table default)
65010
172.16.0.2 from 172.16.0.2 (203.0.113.1)
Origin IGP, metric 0, localpref 200, valid, external, best
65020 65010
172.16.0.6 from 172.16.0.6 (198.51.100.1)
Origin IGP, metric 0, localpref 80, valid, externalPath via ISP-A wins with local-pref 200 vs 80.
! Verify on iBGP peer (R2-HQ) — should see the same local-pref
R2-HQ# show ip bgp 100.64.0.0/18
...
1.1.1.1 from 1.1.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 200, valid, internal, bestR2-HQ sees local-pref 200 propagated via iBGP — confirming AS-wide path preference.
Local Preference vs Weight
| Aspect | Local Preference | Weight |
|---|---|---|
| Scope | Entire AS (via iBGP) | Single router only |
| Best path step | Step 2 | Step 1 (evaluated first) |
| Default | 100 | 0 (learned), 32768 (local) |
| Higher/Lower wins | Higher wins | Higher wins |
| Visibility | All iBGP peers see it | Not advertised |
| Use case | AS-wide traffic engineering | Per-router override |
Use local-pref when you want the entire AS to agree on a path. Use weight when you need one specific router to override the AS-wide decision (see Cisco BGP Weight Attribute).
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Local-pref set on border router but iBGP peers still using other path | Route-map not applied, or soft reset not done after config change | Verify show ip bgp neighbors [ip] | include route-map. Run clear ip bgp [peer] soft in. |
| Both paths showing same local-pref despite route-map | Route-map match condition not matching the intended prefixes | Check show route-map [name] and prefix-list hit counts. Test with show ip bgp [prefix]. |
| eBGP peer receiving local-pref values | This shouldn't happen — local-pref is stripped at eBGP boundaries by default | Verify the neighbor is actually eBGP (different AS). If confederation eBGP, local-pref is preserved — this is expected. |
Key Takeaways
- LOCAL_PREF is the primary tool for controlling outbound traffic across your entire AS — higher values win at step 2 of best path selection.
- It propagates via iBGP to all routers in the AS, ensuring consistent path selection everywhere.
- Set it with an inbound route-map on your eBGP sessions. Default is 100 — go higher to prefer, lower to deprioritize.
- LOCAL_PREF never leaves your AS — it's stripped at eBGP boundaries. Your ISPs can't see or influence it.
- For per-router overrides, use weight instead. For influencing your neighbor's path to you, use MED or AS-path prepending.