After 12 hours straight, i've got this setup working for now:
First, enable bonding module, by appending it at /etc/modules:
Code:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
loop
lp
rtc
bonding
Then edit /etc/network/interfaces:
Code:
# The loopback network interface
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet manual
bond-slaves none
bond-mode balance-alb
bond-miimon 100
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0 eth1
auto eth1
iface eth1 inet manual
bond-master bond0
bond-primary eth0 eth1
auto vnet0
iface vnet0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
bridge-ports bond0
Reboot and confirm that:
- Your slave interfaces (eth0 and eth1 in my case) are UP, RUNNING and in SLAVE mode (check with ifconfig ethX)
Code:
root@kvmhost:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:30:48:f0:1b:ef
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:188 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1372 (1.3 KB) TX bytes:11311 (11.3 KB)
Memory:fafe0000-fb000000
root@kvmhost:~# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:30:48:f0:1b:ee
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:65 errors:0 dropped:0 overruns:0 frame:0
TX packets:227 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:7810 (7.8 KB) TX bytes:18041 (18.0 KB)
Memory:faf20000-faf40000
- Check if your bond (bond0 in my case) is UP, RUNNING, in MASTER mode (check with ifconfig bondX) and has no IP assigned.
Code:
root@kvmhost:~# ifconfig bond0
bond0 Link encap:Ethernet HWaddr 00:30:48:f0:1b:ef
inet6 addr: fe80::230:48ff:fef0:1bef/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:145 errors:0 dropped:0 overruns:0 frame:0
TX packets:948 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16408 (16.4 KB) TX bytes:62374 (62.3 KB)
- Check if your bridge (vnet0 in my case) is UP, RUNNING and has the IP you've set (192.168.1.2 in my case):
Code:
root@kvmhost:~# ifconfig vnet0
vnet0 Link encap:Ethernet HWaddr 00:30:48:f0:1b:ef
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::230:48ff:fef0:1bef/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:144 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14788 (14.7 KB) TX bytes:11344 (11.3 KB)
- Check if the bond is attached to the bridge. brctl show should show something like:
Code:
root@kvmhost:~# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
vnet0 8000.003048f01bef no bond0
- Check your ip routing table:
Code:
root@kvmhost:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 vnet0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
default 192.168.1.1 0.0.0.0 UG 100 0 0 vnet0
- Check your KVM VM's XML definitions (listed at /etc/libvirt/qemu):
Code:
<interface type='bridge'>
<mac address='52:54:00:0a:7b:f7'/>
<source bridge='vnet0'/>
<model type='virtio'/>
</interface>
I really hope all this hassle can be avoided, maybe by compiling netcf support in libvirt, so physical network interfaces can be detected and configured from virsh or virt-manager.
Don't forget to adjust bond-mode to your favorite bonding method!
Bookmarks