BGP/old setup

From Wikitech
< BGP
Revision as of 14:07, 13 January 2005 by Hashar (Talk)

Jump to: navigation, search

This page is obsolete. See VRRP.


To do automatic NAT failover, we use the BGP routing protocol, as implemented by Quagga. The two routers, Zwinger and Albert, run a BGP daemon configured to advertise the default route, 0.0.0.0/0. All internal machines (currently all apaches except vincent) run bgpd and peer with both zwinger and albert, getting the default route from either one (zwinger is weighted lower, so by default it should use that). If either Zwinger or Albert goes down, the BGP connection is dropped and Quagga automatically moves the default route to the remaining host, if needed. We use ASN 64512 (reserved for private use) with IBGP.

Quagga is divided into two parts, zebra (the main daemon) and bgpd (the BGP implementation). it should be started by:

/opt/quagga/bin/zebra -d
/opt/quagga/bin/bgpd -d

on hosts acting as routers, also do this:

ifconfig eth0:2 207.142.131.216 netmask 255.255.255.255
iptables -t nat -I POSTROUTING -o eth0 -s 10.0.0.0/8 -j SNAT --to 207.142.131.216

(Replace .216 with a spare IP)

To add a new internal host to a router:

[root@zwinger root]# telnet zwinger bgpd
Trying 207.142.131.234...
Connected to zwinger.
Escape character is '^]'.
 
Hello, this is quagga (version 0.96.5).
Copyright 1996-2002 Kunihiro Ishiguro.
 
 
User Access Verification
 
Password:
zwinger.wikimedia.org> en
Password:
zwinger.wikimedia.org# conf t
zwinger.wikimedia.org(config)# router bgp 64512
zwinger.wikimedia.org(config-router)# neighbor 10.0.0.X remote-as 64512
zwinger.wikimedia.org(config-router)# ex
zwinger.wikimedia.org(config)# ex
zwinger.wikimedia.org# cop run sta
Configuration saved to /opt/quagga/etc/bgpd.conf
zwinger.wikimedia.org# 

Do this on both Albert and Zwinger. Do the same on the new internal host, but add Zwinger and Albert as neighbors (using their internal IPs).

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox