Centos6.4 - lacp (bond 4) + bridge setup

Discussion in 'HOWTO-Related Questions' started by badassbob, Jun 4, 2013.

  1. badassbob

    badassbob New Member

    I followed the Centos 6.4 KVM howto, and it worked perfect. I setup QEMU on a Slackware box to admin the guest, and that works great too.

    I was wondering if anyone has any experience with setting up LACP (802.3ad dynamic link aggregation) & a bridge for use with KVM.

    I have a HP ML370 with 2 x gigabit nics that I installed Centos 6.4 & KVM (virgin run with KVM). To keep it simple I just configured 1 nic, and setup a bridge (as the docs recommended). This setup worked fine. I was able to access the host & the guests no problem.

    I would like to take advantage of both nics on the server & would like to setup LACP (bonding mode 4) + the Bridge. I am no stranger to LACP, and all my servers with more than 2 nics are setup this way. No problem.

    The problem I am having is getting the bonded links to work with the bridge. Does anyone know how to do this? I currently have the bond 4 working, and can confirm on the switch that LACP partnership is active & up. I cannot ping/access the guests anymore, and the guests (using the bridge) cannot access anything.

    Here are my config files:

    ifcfg-eth0
    DEVICE=eth0
    BOOTPROTO=none
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    USERCTL=no

    ifcfg-eth1
    DEVICE=eth1
    BOOTPROTO=none
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    USERCTL=no

    ifcfg-bond0
    DEVICE=bond0
    USERCTL=no
    BOOTPROTO=none
    ONBOOT=yes
    BONDING_OPTS="miimon=100 mode=4"
    IPV6INIT=no
    IPADDR=192.168.12.240
    NETMASK=255.255.255.0
    GATEWAY=192.168.12.1
    DNS1=192.168.12.35

    Up to this point bonding works, I can ping the host, and the host can access outbound.

    When I originally configged the KVM bridge I called it br0, so I would like to keep this name so I don't have to redo everything.

    Some of the docs online mention I need to setup a tagged vlan on the switch for this config. Is this true, do I really need a vlan?
    I did setup a tagged vlan (vlan11), and added the following ifcfg files, but no dice.

    ifcfg-bond0.11
    DEVICE=bond0.11
    ONBOOT=yes
    BRIDGE=br0
    VLAN=yes

    ifcfg-br0
    DEVICE="br0"
    NM_CONTROLLED="yes"
    ONBOOT=yes
    TYPE=Bridge
    BOOTPROTO=none
    NAME="System br0"
    IPADDR=192.168.12.240
    NETMASK=255.255.255.0
    GATEWAY=192.168.12.1
    DNS1=192.168.12.35
    VLAN=yes
    STP=on

    So, do I really need a vlan setup on the switch for this config?
    If not I suppose I can ditch the ifcfg-bond0.11 config file, and remove the tagged vlan from the switch? If this is the case, can I simply add BRIDGE=br0 to the bond0 config, and remove the VLAN & STP from the br0 config?

    Any insight on this would be greatly appreciated.

    Thanks!

    Mr. B-o-B
     
  2. badassbob

    badassbob New Member

    Solved

    I was able to solve the problem. VLAN is not required, so I deleted the vlan from the switch, and removed it from the config files.
    I changed the bond0 config to layer 2, and added the BRIDGE setup. Made the br0 (bridge) config layer 3.

    Here are the config files for the LACP (2 nics) + Bridge setup for KVM in case anyone else needs help with this type of setup (Centos).

    ifcfg-eth0
    DEVICE=eth0
    BOOTPROTO=none
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    USERCTL=no

    ifcfg-eth1
    DEVICE=eth1
    BOOTPROTO=none
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    USERCTL=no

    ifcfg-bond0
    DEVICE=bond0
    USERCTL=no
    BOOTPROTO=none
    ONBOOT=yes
    BONDING_OPTS="miimon=100 mode=4"
    BRIDGE=br0

    ifcfg-br0
    DEVICE="br0"
    NM_CONTROLLED="yes"
    ONBOOT=yes
    TYPE=Bridge
    BOOTPROTO=none
    IPADDR=192.168.12.240
    PREFIX=24
    GATEWAY=192.168.12.1
    DNS1=192.168.12.35
    DNS2=192.168.11.10
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=no
    NAME="System br0"

    Restarted the network:

    Bringing up loopback interface: [ OK ]
    Bringing up interface bond0: [ OK ]
    Bringing up interface br0: [ OK ]

    Check the switch to make sure LACP still active:

    PORT LACP TRUNK PORT LACP LACP
    NUMB ENABLED GROUP STATUS PARTNER STATUS
    ---- ------- ------- ------- ------- -------
    3 Active Trk9 Up Yes Success
    4 Active Trk9 Up Yes Success

    Was able to ping the host & guests again. Fantastic!

    Have a great day everyone!

    Mr. B-o-B
     

Share This Page