M
M
Melges2013-01-29 15:53:27
linux
Melges, 2013-01-29 15:53:27

Linux KVM bonding and bridging?

Good afternoon,
I would like to ask for help in setting up a bridge over bonding bundle to work with KVM. The idea is the following, there are two network interfaces eth0 and eth1 on the machine that is used as a host for virtual machines. Network interfaces are connected to the same local network, I would like to set up bonding to balance the load between them.
I set up bonding, made a bridge over it, specified the bridge as an interface in virtual machines. Result: there is a network in the host system, it even balances and everything seems to be fine ... But there is no network in the virtual machines.
So configs:

~$ cat /etc/network/interfaces 
# 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

# The primary network interface working in bonding
auto eth0
iface eth0 inet manual
  bond-master bond0
auto eth1
iface eth1 inet manual
  bond-master bond0

# Configure bonding
auto bond0
iface bond0 inet manual
  bond-mode balance-xor #
  bond-slaves none
  bond-miimon 100
#	bond-slaves eth0 eth1

# Interface for virtual machines
auto vbr0
iface vbr0 inet dhcp
#	vlan-raw-device bond0
        bridge_ports bond0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp on

~$ brctl show
bridge name	bridge id		STP enabled	interfaces
vbr0		8000.001a64b402b8	yes		bond0
              vnet0
              vnet1
              vnet2
              vnet3
              vnet4
              vnet5
              vnet6
              vnet7
virbr0		8000.000000000000	yes

~$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:1a:64:b4:02:b8  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3575 errors:0 dropped:1 overruns:0 frame:0
          TX packets:886 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:531166 (531.1 KB)  TX bytes:98628 (98.6 KB)
          Interrupt:28 Memory:92000000-92012800 

eth1      Link encap:Ethernet  HWaddr 00:1a:64:b4:02:ba  
          inet6 addr: fe80::21a:64ff:feb4:2ba/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:63786 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58734 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9155411 (9.1 MB)  TX bytes:13247789 (13.2 MB)
          Interrupt:40 Memory:94000000-94012800 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:56 errors:0 dropped:0 overruns:0 frame:0
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7859 (7.8 KB)  TX bytes:7859 (7.8 KB)

bond0      Link encap:Ethernet  HWaddr 00:1a:64:b4:02:b8  
          inet6 addr: fe80::21a:64ff:feb4:2b8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1077 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:124614 (124.6 KB)  TX bytes:2700 (2.7 KB)

vbr0      Link encap:Ethernet  HWaddr 00:1a:64:b4:02:b8  
          inet addr:192.168.74.9  Bcast:192.168.74.255  Mask:255.255.255.0
          inet6 addr: fe80::21a:64ff:feb4:2b8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1077 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:124614 (124.6 KB)  TX bytes:2700 (2.7 KB)

virbr0    Link encap:Ethernet  HWaddr 42:c6:c1:4a:3d:38  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vnet0     Link encap:Ethernet  HWaddr fe:54:00:2f:6b:0c  
          inet6 addr: fe80::fc54:ff:fe2f:6b0c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:729 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1323 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:74757 (74.7 KB)  TX bytes:267199 (267.1 KB)

vnet1     Link encap:Ethernet  HWaddr fe:54:00:43:62:f8  
          inet6 addr: fe80::fc54:ff:fe43:62f8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:98 errors:0 dropped:0 overruns:0 frame:0
          TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:12704 (12.7 KB)  TX bytes:11014 (11.0 KB)

vnet2     Link encap:Ethernet  HWaddr fe:54:00:72:28:66  
          inet6 addr: fe80::fc54:ff:fe72:2866/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22 errors:0 dropped:0 overruns:0 frame:0
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:3285 (3.2 KB)  TX bytes:9906 (9.9 KB)

vnet3     Link encap:Ethernet  HWaddr fe:54:00:91:4f:a1  
          inet6 addr: fe80::fc54:ff:fe91:4fa1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:3285 (3.2 KB)  TX bytes:8322 (8.3 KB)

vnet4     Link encap:Ethernet  HWaddr fe:54:00:d0:b2:72  
          inet6 addr: fe80::fc54:ff:fed0:b272/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:2943 (2.9 KB)  TX bytes:7842 (7.8 KB)

vnet5     Link encap:Ethernet  HWaddr fe:54:00:0b:e8:3e  
          inet6 addr: fe80::fc54:ff:fe0b:e83e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:4657 (4.6 KB)

vnet6     Link encap:Ethernet  HWaddr fe:54:00:fe:4e:c6  
          inet6 addr: fe80::fc54:ff:fefe:4ec6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:2264 (2.2 KB)  TX bytes:2964 (2.9 KB)

vnet7     Link encap:Ethernet  HWaddr fe:54:00:d5:d3:07  
          inet6 addr: fe80::fc54:ff:fed5:d307/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:2184 (2.1 KB)

Diagnostics with tcpdump showed that packets go from virtual machines to the network, but do not come back. For DHCP requests, we observe the following: DHCP Request is visible on vnet0, vbr0, bond0 eth0 or eth1, DHCP reply is visible on eth0 or eth1, bond0, vbr0, but not visible on vnet0 :(
What I tried to do:
  • Add vlan-raw-device bond0 to vbr0 description and replace bridge_ports bond0 with bridge_ports bond0.1 or bond.0
  • Enable and disable STP
  • Googling a lot.

Over time, I found that the kernel swears at frames in which the sender matches the recipient (apparently I receive frames from one interface on the second). If bond0 is switched to active-backup mode, then everything starts working.
Unfortunately, none of the above helped me, the active-backup mode does not suit me. Perhaps someone more experienced can tell me what the problem is?
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
archim, 2013-09-27
@archim

There is a suspicion that the matter is in rp_filter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question