Friday, February 13, 2015

Anycast with BGP

Anycast with BGP

I have been playing with docker image from GNS3 and I wanted to test it.
I choose this great lab from Vincent Bernat based on a great article from Paul Vixie explaining why DNS servers use anycast.
The Vicent's lab uses UML linux as he explains in and the lab uses IPv6 addresses. I have migrated it to GNS3 and IPv4. I pushed the GNS3 project directory to my github repository for share.
The lab has 16 IOL Routers, 3 Quagga Servers acting as DNS and 5 PC Clients and it uses over 2 G of RAM.
PC users:
  • They acquire IP by DHCP with network 192.168.X.0/24 where X is the PC number.
  • The PC network is announced by BGP so we can have global reachability.
Quagga routers:
  • They have a loopback address
  • They announce prefix, simulating google DNS.
  • The eth0 interface is and peers with Router with iBGP.
- Install DNS and HTTP server run Tiny core image on qemu and install dnsmasq for DNS

qemu-system-i386 -drive file=linux-core-4.7.7-openvswitch-1.11.0_guagga-
# Login with tc user
# Search dnsmasq and install it

- Make the configuration permanent execute -b after configure quagga
I can't export the configuration but it's the same for the 3 routers, you only need to copy&paste changing the AS number
inter lo
ip address

inter eth0
ip address

inter eth1

router bgp 64612
network mask
neighbor remote-as 64612
IOL Routers:
  • ID = 2 last digits of ASN ID=646XX.
  • Loopback0 = 1.1.1.XX.
  • Inter-routing addresses 10.ID1.ID2.0/24 with ID1 < ID2.
  • If AS is ID1 the use .1 as last digit and ID2 use .2.
  • AS64600 uses custom networks.

If you trace from the PCs you can show the different routes: