The idea
With BGP policy you, running ourRouter (AS 65001), decide where traffic leaves, ask neighbours where it should come in, and refuse routes you should not believe. Your neighbours are two transit providers, transitA and transitB, and a customer, customerRouter; a laptop behind you reaches a content provider's web server.
Steps
-
Local preference picks the exit
transitA reaches the content provider in two networks, transitB in three, but transitB is cheaper: a price BGP cannot see. Give what transitB sends local preference 200.
ourRouter:~# vtysh -c 'show bgp ipv4 unicast 10.0.4.0/24' ourRouter:~# vtysh ourRouter:~# vtysh -c 'show bgp ipv4 unicast 10.0.4.0/24' laptop:~# traceroute -n -w 1 -q 1 10.0.4.10
-
MED asks a neighbour
Your customer, AS 65005, has two links to ourRouter and wants link A used. It cannot set your local preference, but it can ask: on customerRouter, send a lower MED on link A than on link B.
customerRouter:~# vtysh ourRouter:~# vtysh -c 'show ip route 10.0.5.0/24'
Pro
4 more steps in the app
- A community tags a route
- A customer leaks a more-specific
- Check the origin: RPKI
- Carry only your customers' routes