Dynamic routing
Local preference
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.