BGP Local Preference: Primary/Backup and Transit Tiers
Two transit providers, one bill you would rather not pay, and traffic that keeps leaving through the wrong one: that is the day most engineers meet BGP local preference . LOCAL_PREF is the knob that decides where traffic leaves your autonomous system. It is set by you, on your own border routers, and it is shared by every router in the AS, so they all agree on the exit. It beats AS_PATH length, ORIGIN and MED, which is why it carries most of the routing policy of the Internet: customer routes before peer routes before transit routes. This part of the series covers the attribute itself (bytes, defaults, error handling), then the three designs operators actually build with it, tested in a GoBGP lab and compared with what large transit networks publish today.