Can't get bonding and bridging to work for KVM

Posted by user9546 on Ask Ubuntu See other posts from Ask Ubuntu or by user9546
Published on 2011-01-24T22:03:18Z Indexed on 2011/02/01 7:33 UTC
Read the original article Hit count: 366

Filed under:
|
|
|
|

Hi everyone.

I can't for the life of me get bonding and bridging to work for the KVM setup I'm building. I'm using a fresh install (not an upgrade) of Ubuntu Server 10.10. I have 4 NICs on the same subnet (two intended for each of my two VMs). I'm trying to achieve the setup that Uthark describes here.

But following his guidelines didn't work for me. My eth0 and eth1 did not come up, and "brctl show" showed that br0 didn't have any interfaces (the bond). I assumed it didn't work because he's using 10.4, and this article says there's a recent change in bonding:

[I can't post more than one hyperlink per post because I'm a newbie.]

I had to use this article to get my interfaces to work at all on the same subnet, which is why I have the post-up lines on some of my interfaces:

[I can't post more than one hyperlink per post because I'm a newbie.]

I installed ifenslave and ethtool. I also created /etc/modprobe.d/aliases.conf with the following content:

alias bond0 bonding
options bonding mode=6 miimon=100 downdelay=200 updelay=200

And I included "bonding" in /etc/modules

So, after several approaches, here is my latest interfaces file:

auto lo
iface lo inet loopback

auto eth5
iface eth5 inet manual

auto br5
iface br5 inet static
post-up /sbin/ip rule add from [network].79 lookup 10
post-up /sbin/ip route add table 10 default via [network].1 src [network].79 dev br5
address [network].79
netmask 255.255.255.0
network [network].0
broadcast [network].255
gateway [network].1
bridge_ports eth5
bridge_stp off
bridge_fd 0
bridge_maxwait 0

auto eth2
iface eth2 inet manual

auto br2
iface br2 inet static
post-up /sbin/ip rule add from [network].78 lookup 11
post-up /sbin/ip route add table 11 default via [network].1 src [network].78 dev br2
address [network].78
netmask 255.255.255.0
network [network].0
broadcast [network].255
gateway [network].1
bridge_ports eth2
bridge_stp off
bridge_fd 0
bridge_maxwait 0

iface eth0 inet manual

iface eth1 inet manual

auto bond0
iface bond0 inet static
bond_miimon 100
bond_mode balance-alb
up /sbin/ifenslave bond0 eth0 eth1
down /sbin/ifenslave -d bond0 eth0 eth1

auto br0
iface br0 inet static
address [network].60
netmask 255.255.255.0
network [network].0
broadcast [network].255
gateway [network].1
bridge_ports bond0

eth2, eth5, br2, and br5 all seem to be working fine.

The only other thing I could find that looked suspicious is an error regarding bonding in /var/log/messages:

kernel: [ 3.828684] bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.

even though there is a bond-miimon line in /etc/network/interfaces (if that's what they're talking about).

Also, the bond seems to go in and out of promiscuous mode several times on boot:

Jan 20 14:19:02 kvmhost kernel: [ 3.902378] device bond0 entered promiscuous mode
Jan 20 14:19:02 kvmhost kernel: [ 3.902390] device bond0 left promiscuous mode
Jan 20 14:19:02 kvmhost kernel: [ 3.902393] device bond0 entered promiscuous mode
Jan 20 14:19:02 kvmhost kernel: [ 3.902397] device bond0 left promiscuous mode
Jan 20 14:19:03 kvmhost kernel: [ 4.998990] device bond0 entered promiscuous mode
Jan 20 14:19:03 kvmhost kernel: [ 4.999005] device bond0 left promiscuous mode
Jan 20 14:19:03 kvmhost kernel: [ 4.999008] device bond0 entered promiscuous mode
Jan 20 14:19:03 kvmhost kernel: [ 4.999012] device bond0 left promiscuous mode

Any advice would be greatly appreciated. It seems that this must be possible, based on other posts, but I can't see what I'm doing wrong.

Thanks.

© Ask Ubuntu or respective owner

Related posts about 10.10

Related posts about server