> ## Content Index
> Fetch the complete content index at: https://www.pinglabz.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Manipulating BGP Local Preference for Inbound Path Selection
- URL: https://www.pinglabz.com/bgp-local-preference/
- Published: 2026-03-28T06:51:59.000Z
- Updated: 2026-08-24T00:32:43.000Z
- Description: Local preference tells every router in your AS which exit to prefer for specific destinations. It rides iBGP throughout the AS and resolves in step 2 of best path. The cleanest tool for inbound exit engineering.
- Author: Jaime
- Tags: BGP, #Import 2026-08-01 19:54

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.

For where this topic sits in the wider picture, see the [BGP complete guide](https://www.pinglabz.com/bgp/).

## 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](https://www.pinglabz.com/bgp-best-path-selection/)).

## 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 in
```

Now 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 in
```

Critical 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 in
```

### Load 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 80
```

This 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, external
```

Path 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, best
```

R2-HQ sees local-pref 200 propagated via iBGP - confirming AS-wide path preference.

## Local Preference vs Weight

Scope

Local PreferenceEntire AS (via iBGP)

WeightSingle router only

Best path step

Local PreferenceStep 2

Weight

Step 1 (evaluated first)

Default

Local Preference100

Weight

0 (learned), 32768 (local)

Higher/Lower wins

Local PreferenceHigher wins

WeightHigher wins

Visibility

Local PreferenceAll iBGP peers see it

WeightNot advertised

Use case

Local Preference

AS-wide traffic engineering

WeightPer-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](https://www.pinglabz.com/bgp-weight/)).

## Troubleshooting

Local-pref set on border router but iBGP peers still using other path

Cause

Route-map not applied, or soft reset not done after config change

Fix

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

Cause

Route-map match condition not matching the intended prefixes

Fix

Check `show route-map [name]` and prefix-list hit counts. Test with `show ip bgp [prefix]`.

eBGP peer receiving local-pref values

Cause

This shouldn't happen - local-pref is stripped at eBGP boundaries by default

Fix

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.