Reliable (High Availability) networking with Linux

In a word: Bonding. See Nick Ferrier’s post to Debian-Administration. Grab my check_bonding.pl script from my Subversion respository so you can monitor your links. Get two managed switches (I like the DLink DGS-3324SR gigabit switches). Enable MSTP (Multiple vlan Spanning Tree Protocol) on ports 1, 2, 23 and 24, and disable spanning tree on all other ports; patch ports 23 to 1 on the next switch, and 24 to 2 on the next so you have two links between each switch. Plug your two interfaces into any of the other ports (3-22) on each switch. End of story.

UML and NTPL ate my bind, mysql, etc.

So, Running a combination of testing and unstable on my Bytemark UML instance, and over the course of time, the NTPL libraries started to turn up in /lib/tls. Turns out that UML and NTPL are incompatible: every binary I used that utilised threads, such as MySQL, Bind9, Nslookup, all segfault when these libraries are accesible.

Googling around shows that NTPL support doesnt work under UML: the work around is to rename the /lib/tls directory (eg, /lib/tls.disable) so that it can’t be found.

No gallery at the moment

Due to the g++ transition, and me following unstable a little too closely, the Gallery here has gone AWOL. Hopefully the unstable g++ stuff will be completed shortly, and I can sync back up to the latest modperl2.

Modprobe, kernel 2.4 and 2.6

Random note: getting the bonding module to work, edit /etc/modprobe.d/bonding (a new file) and add:

alias bond0 bonding
options bond0 miimon=100 mode=active-backup

If you are using a 2.6 kernel, then the bonding module will be loaded with the correct options when you try to bring up the interface. Referencing the interface by name triggers the loading of the module, and the reading of this config file. However, and I talk to myself here since I forgot today, this doesnt work with the old 2.4 kernel modutils package. Only the new module-init-tools package when using a 2.6 kernel!

To complete the rant here, populate your /etc/network/interfaces file with something like the following, adjusting the address as required of course:

auto iface bond0

iface bond0 inet static

pre-up ifconfig bond0 up

pre-up ifconfig eth0 up

pre-up ifconfig eth1 up

pre-up ifenslave bond0 eth0 eth1

address 10.0.0.5

netmask 255.255.0.0

broadcast 10.10.255.255

gateway 10.0.0.1

down ifconfig eth0 down

down ifconfig eth1 down

Now, if you don’t know which intrefaces you want to bond together into a bond (what Windows calls a ‘team’, or ‘teaming’), then you can take a look at Nick Ferrier‘s solution involving doing a quick DHCP request on each interface and working out which interfaces are on common networks; a very clever piece.

So, if you’re still reading this about bonding, you should probably be monitoring your bonded connections. Otherwise, one link will fail, and you’ll never notice! Check out my SVN repository for the Nagios plugin to check the /proc/net/bonding/* file(s).

code