[CentOS-virt] Bonds, VLANs, and Bridges on Centos 5.6

Jason Nagashima

jason at daylife.com
Wed Nov 23 21:49:56 UTC 2011


Thank you everyone for responding and helping out. I'm happy to report that we got it working!


----- Original Message -----
From: "David Martin" <dmartls1 at gmail.com>
To: "Discussion about the virtualization on CentOS" <centos-virt at centos.org>
Sent: Tuesday, November 22, 2011 12:39:02 PM
Subject: Re: [CentOS-virt] Bonds, VLANs, and Bridges on Centos 5.6

We are doing this quite a bit in production and it works great.

bond as you normally would:
BONDING_OPTS="mode=4 miimon=100"

one of these for each vlan (in this case 50):

and finally the bridge device to expose to guests:

On Tue, Nov 22, 2011 at 10:07 AM, Tait Clarridge <tait at taiter.com> wrote:
> On Fri, 2011-11-18 at 17:56 -0500, Jason Nagashima wrote:
>> Running on Centos 5.6 with KVM...
>> I was wondering if anyone had any luck configuring the NICs where eth0 and eth1 are bonded together with vlan support to a bridge?
>> I noticed some threads show this as a possibility (http://lists.centos.org/pipermail/centos-virt/2009-November/001417.html), but haven't had any luck implementing it.  There also seems to be a bug with 5.6 (http://bugs.centos.org/view.php?id=4801), but that post died the day it was created it.
>> Any advice/working examples would be greatly appreciated.
> Hi Jason,
> I have had luck doing this with Xen, where I create bond0 on a trunk
> interface and have xen bring it up as xenbr0 with pbond0 in the back
> end.
> You should be able to do roughly the same by creating a bridge interface
> in /etc/sysconfig/network-scripts referencing bond0 as a member.
> After that you should be able to run a script to create VLAN bridges
> like the following:
> #!/bin/bash
> /sbin/modprobe 8021q
> # Add your vlans here that you want with the numbers separated by a
> # space
> VLANS="5 10 15 20"
> # This should work with the bonding interface
> TRUNKINT="bond0"
> for VLAN in $VLANS
> do
>        vconfig add $TRUNKINT $VLAN
>        brctl add br$VLAN
>        brctl addif br$VLAN $TRUNKINT.$VLAN
>        ifconfig $TRUNKINT.$VLAN up
>        ifconfig br$VLAN up
> done
> I have done this with Xen on 5.5, 5.6 and 5.7... but it should work for
> KVM. If you create the standard bridge interface br0 using just bond0
> that will get you a trunk on whatever the native vlan is for that trunk.
> Tait
> _______________________________________________
> CentOS-virt mailing list
> CentOS-virt at centos.org
> http://lists.centos.org/mailman/listinfo/centos-virt
CentOS-virt mailing list
CentOS-virt at centos.org

More information about the CentOS-virt mailing list