Concepts / Dynamic routing

Dynamic routing

Local preference

Also called local-pref, LOCAL_PREF, set local-preference, BGP best path, best-path selection, route-map

A BGP value an AS sets on routes it receives to choose its own way out, checked before the AS path.

Higher wins, and the default is 100. A route-map applied in on one neighbour sets it (set local-preference 200), so every route through that neighbour wins, however long its AS path. It stays inside the AS (iBGP carries it, eBGP does not), so it decides how your traffic leaves, never how others send traffic to you. The best-path order in short: weight, local preference, AS path length, origin, MED, eBGP over iBGP, IGP cost, router ID.

See it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab