FAQ
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?idH01), but that post died the day it was created it.

Any advice/working examples would be greatly appreciated.

Regards,
Jason

Search Discussions

  • Tait Clarridge at Nov 22, 2011 at 11:07 am

    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?idH01), 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
  • David Martin at Nov 22, 2011 at 12:39 pm
    We are doing this quite a bit in production and it works great.

    bond as you normally would:
    DEVICE=bond0
    ONBOOT=yes
    USERCTL=no
    BONDING_OPTS="mode=4 miimon0"

    one of these for each vlan (in this case 50):
    VLAN=yes
    VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
    DEVICE=vlan50
    PHYSDEV=bond0
    TYPE=Ethernet
    ONBOOT=yes
    BRIDGE=br50

    and finally the bridge device to expose to guests:
    DEVICE=br50
    TYPE=Bridge
    ONBOOT=yes
    DELAY=0
    GATEWAYDEV=none



    On Tue, Nov 22, 2011 at 10:07 AM, Tait Clarridge 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?idH01), 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
  • Jason Nagashima at Nov 23, 2011 at 4:49 pm
    Awesome!

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

    Cheers,
    Jason

    ----- 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:
    DEVICE=bond0
    ONBOOT=yes
    USERCTL=no
    BONDING_OPTS="mode=4 miimon0"

    one of these for each vlan (in this case 50):
    VLAN=yes
    VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
    DEVICE=vlan50
    PHYSDEV=bond0
    TYPE=Ethernet
    ONBOOT=yes
    BRIDGE=br50

    and finally the bridge device to expose to guests:
    DEVICE=br50
    TYPE=Bridge
    ONBOOT=yes
    DELAY=0
    GATEWAYDEV=none



    On Tue, Nov 22, 2011 at 10:07 AM, Tait Clarridge 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?idH01), 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
    http://lists.centos.org/mailman/listinfo/centos-virt

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos-virt @
categoriescentos
postedNov 18, '11 at 5:56p
activeNov 23, '11 at 4:49p
posts4
users3
websitecentos.org
irc#centos

People

Translate

site design / logo © 2022 Grokbase