Labs / Internetwork / BGP: the internet's routing

Lab 2 of 2 · BGP: the internet's routing

BGP policy: local preference, MED, communities and RPKI

Steer BGP with local-pref, MED and communities, then stop a leak and a hijack.

Open this lab Pro 6 steps

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.

Local preference out, MED in
Local preference out, MED in
A longer prefix wins
A longer prefix wins

Steps

  1. 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
  2. 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

  1. A community tags a route
  2. A customer leaks a more-specific
  3. Check the origin: RPKI
  4. Carry only your customers' routes
Get Pro

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