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 http://vincent.bernat.im/en/blog/2011-uml-network-lab.html 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 8.8.8.8/24.
  • They announce 8.8.8.8/24 prefix, simulating google DNS.
  • The eth0 interface is 10.0.0.2 and peers with Router with iBGP.
TODO
- 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-0.99.22.4.img
# Login with tc user
tce-ab
# Search dnsmasq and install it
#

- Make the configuration permanent execute filetool.sh -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 8.8.8.8/24

inter eth0
ip address 10.0.0.2/24

inter eth1
shutdown

router bgp 64612
network 8.8.8.8 mask 255.255.255.0
neighbor 10.0.0.1 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: