HOWTO configure bonding and bridging

For high-availability of a KVM system you need to combine bonding and bridging of the network. On Debian GNU/Linux (here squeeze 6.0) you can configure it this way:


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto bond0
iface bond0 inet manual
        slaves eth0 eth1
        bond_mode active-backup
        bond_miimon 100
        bond_downdelay 200
        bond_updelay 200

auto br0
iface br0 inet static
    bridge_ports bond0
    bridge_stp off
    bridge_fd 9
    bridge_hello 2
    bridge_maxage 12
    bridge_maxwait 0
        # dns-* options are implemented by the resolvconf package, if installed
        dns-search domain.lan

Only bonding mode active-backup (1) or 802.3ad (4) modes run fine. Else you will get network problems and get error messages like "br0: recieved packet on bond0 with own address as source address".