# bonding + vlan does not work anymore as expected

## Rocco83

Hi,

i have updated yesterday my gentoo test xen server, and now i have

--

[ebuild   R    ] sys-apps/baselayout-2.0.3  USE="-build" 0 kB

[ebuild   R    ] sys-apps/openrc-0.9.8.1  USE="ncurses pam unicode -debug (-selinux) -static-libs" 0 kB

--

said that, on the server i have:

eth0: management

bond0 (eth1): vlans for virtual machines.

/etc/init.d/net.bond0 will start correctly bond0,

BUT will setup vlans on eth1 and not on bond0 (as was before).

i have another machine with a perfectly working configuration:

[ebuild   R    ] sys-apps/baselayout-2.0.3  USE="-build" 40 kB

[ebuild     U  ] sys-apps/openrc-0.9.8.1 [0.8.3-r1] USE="ncurses pam unicode -debug (-selinux) -static-libs%" 163 kB

here both NOT working and WORKING (in another machine) net configuration.

/etc/conf.d/net NOW (not working)

---

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc*/net.example* and save your configuration

# in /etc/conf.d/net (this file :]!).

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0="172.16.6.210/24 192.168.1.210/24 192.168.0.210/24"

routes_eth0="default via 192.168.0.251"

mtu_eth0="9000"

config_eth1="null"

vlan_start_bond0="no" 

mtu_eth1="9000"

#config_eth2="null"

##mtu_eth2="9000"

#config_eth3="null"

##mtu_eth3="9000"

#config_eth4="null"

##mtu_eth4="9000"

#config_eth5="null"

##mtu_eth5="9000"

#config_eth6="null"

##mtu_eth6="9000"

#config_eth7="null"

##mtu_eth7="9000"

preup() {

        # Adjusting the bonding mode / MII monitor

        # Possible modes are : 0, 1, 2, 3, 4, 5, 6,

        #     OR

        #   balance-rr, active-backup, balance-xor, broadcast,

        #   802.3ad, balance-tlb, balance-alb

        # MII monitor time interval typically: 100 milliseconds

        if [[ ${IFACE} == "bond0" ]] ; then

                BOND_MODE="802.3ad"

                BOND_MIIMON="100"

                ifconfig bond0 down

                echo ${BOND_MODE} >/sys/class/net/bond0/bonding/mode

                echo ${BOND_MIIMON}  >/sys/class/net/bond0/bonding/miimon

                ifconfig bond0 up

                einfo "Bonding mode is set to ${BOND_MODE} on ${IFACE}"

                einfo "MII monitor interval is set to ${BOND_MIIMON} ms on ${IFACE}"

        else

                einfo "Doing nothing on ${IFACE}"

        fi

        return 0

}

postup() {

        # L'elenco delle interfacce deve essere quello degli slave del bonding

        # example: "eth0|eth1|eth2)"

        case ${IFACE} in

        eth1|eth2|eth3|eth4|eth5)       

                /usr/sbin/ethtool -K ${IFACE} tx off

        ;;

        #xenbr1)

        #       /etc/init.d/net.xenbr1.6 start

        #       /etc/init.d/net.xenbr1.11 start

        #       /etc/init.d/net.xenbr1.13 start

        #       ;;

        *)              

        esac 

        return 0

}

predown() {

        case ${IFACE}  in

        bond0_5)       

                rmmod -f aoe

        ;;

        *)              

        esac 

        return 0

}

# To bond interfaces together

slaves_bond0="eth1"

#config_eth1="null"

#config_eth1_6="null"

#config_eth1_11="null"

#config_eth1_13="null"

# You may not want to assign an IP to the bonded interface

config_bond0="null"

mtu_bond0="9000"

#rc_need_bond0="eth1"

# Depend on eth0, eth1 and eth2 as they may require extra configuration

#depend_bond0() {

#  need net.eth1

#}

vlans_bond0="6 11 13"

config_bond0="null"

config_bond0_6="null"

config_bond0_11="null"

config_bond0_13="null"

bridge_xenbr1="bond0"

config_xenbr1="null"

#brctl_br0=( "setfd 0" "sethello 0" "stp off" )

bridge_xenbr1_6="bond0.6"

config_xenbr1_6="null"

bridge_xenbr1_11="bond0.11"

config_xenbr1_11="null"

bridge_xenbr1_13="bond0.13"

config_xenbr1_13="null"

#depend_xenbr1() {

#  need net.bond0

#}

#RC_NEED_bond0="net.eth0 net.eth1"

rc_need_xenbr1="net.bond0"

rc_need_xenbr1_1="net.xenbr1"

rc_need_xenbr1_2="net.xenbr1"

rc_need_xenbr1_3="net.xenbr1"

rc_need_xenbr1_4="net.xenbr1"

rc_need_xenbr1_5="net.xenbr1"

rc_need_xenbr1_6="net.xenbr1"

rc_need_xenbr1_7="net.xenbr1"

rc_need_xenbr1_8="net.xenbr1"

rc_need_xenbr1_9="net.xenbr1"

rc_need_xenbr1_10="net.xenbr1"

rc_need_xenbr1_11="net.xenbr1"

rc_need_xenbr1_12="net.xenbr1"

rc_need_xenbr1_13="net.xenbr1"

rc_need_xenbr1_14="net.xenbr1"

rc_need_xenbr1_15="net.xenbr1"

---

/etc/conf.d/net WORKING (in another machine)

---

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

#Following the above advice lets the Network cards scan for an dhcp server when booting (baselayout-1.12.9), i had to add:

config_eth0=( "null" )

#mtu_eth0="9000"

config_eth1=( "null" )

#mtu_eth1="9000"

config_eth2=( "null" )

#mtu_eth2="9000"

config_eth3=( "null" )

#mtu_eth3="9000"

config_eth4=( "null" )

#mtu_eth4="9000"

config_eth5=( "null" )

#mtu_eth5="9000"

config_eth6=( "null" )

#mtu_eth6="9000"

config_eth7=( "null" )

#mtu_eth7="9000"

preup() {

        # Adjusting the bonding mode / MII monitor

        # Possible modes are : 0, 1, 2, 3, 4, 5, 6,

        #     OR

        #   balance-rr, active-backup, balance-xor, broadcast,

        #   802.3ad, balance-tlb, balance-alb

        # MII monitor time interval typically: 100 milliseconds

        if [[ ${IFACE} == "bond0" ]] ; then

                BOND_MODE="802.3ad"

                BOND_MIIMON="100"

                ifconfig bond0 down

                echo ${BOND_MODE} >/sys/class/net/bond0/bonding/mode

                echo ${BOND_MIIMON}  >/sys/class/net/bond0/bonding/miimon

                ifconfig bond0 up

                einfo "Bonding mode is set to ${BOND_MODE} on ${IFACE}"

                einfo "MII monitor interval is set to ${BOND_MIIMON} ms on ${IFACE}"

        else

                einfo "Doing nothing on ${IFACE}"

        fi

        if [[ ${IFACE} == "pbond0" ]] ; then

                BOND_MODE="802.3ad"

                BOND_MIIMON="100"

                echo ${BOND_MODE} >/sys/class/net/pbond0/bonding/mode

                echo ${BOND_MIIMON}  >/sys/class/net/pbond0/bonding/miimon

                einfo "Bonding mode is set to ${BOND_MODE} on ${IFACE}"

                einfo "MII monitor interval is set to ${BOND_MIIMON} ms on ${IFACE}"

        else

                einfo "Doing nothing on ${IFACE}"

        fi

        return 0

}

postup() {

        # L'elenco delle interfacce deve essere quello degli slave del bonding

        # example: "eth0|eth1|eth2)"

        case ${IFACE}  in

        eth2|eth3|eth4|eth5)       

                /usr/sbin/ethtool -K ${IFACE} tx off

        ;;

        *)              

        esac 

        return 0

}

predown() {

        case ${IFACE}  in

        bond0_5)       

                rmmod -f aoe

        ;;

        *)              

        esac 

        return 0

}

# To bond interfaces together

slaves_bond0="eth2 eth3 eth4 eth5"

slaves_pbond0="eth2 eth3 eth4 eth5"

# You may not want to assign an IP to the bonded interface

config_bond0=( "null" )

#mtu_bond0=("9000")

# Depend on eth0, eth1 and eth2 as they may require extra configuration

depend_bond0() {

  need net.eth1 net.eth2

}

vlans_pbond0="3 5 7 9 10 11 12 13"

config_pbond0=( "null" )

config_pbond0_3=( "null" )

config_pbond0_5=( "null" )

config_pbond0_7=( "null" )

config_pbond0_9=( "null" )

config_pbond0_10=( "null" )

config_pbond0_11=( "null" )

config_pbond0_12=( "null" )

config_pbond0_13=( "null" )

vlans_bond0="3 5 7 9 10 11 12 13"

config_bond0=( "null" )

config_bond0_3=( "null" )

config_bond0_5=( "null" )

config_bond0_7=( "null" )

config_bond0_9=( "null" )

config_bond0_10=( "null" )

config_bond0_11=( "null" )

config_bond0_12=( "null" )

config_bond0_13=( "null" )

config_eth0=( "192.168.1.104/24" )

routes_eth0=( "default via 192.168.1.254" )

bridge_xenbr1="bond0"

config_xenbr1=( "null" )

#brctl_br0=( "setfd 0" "sethello 0" "stp off" )

bridge_xenbr1_3="bond0.3"

config_xenbr1_3=( "null" )

bridge_xenbr1_7="bond0.7"

config_xenbr1_7=( "null" )

bridge_xenbr1_9="bond0.9"

config_xenbr1_9=( "null" )

bridge_xenbr1_10="bond0.10"

config_xenbr1_10=( "null" )

bridge_xenbr1_11="bond0.11"

config_xenbr1_11=( "null" )

bridge_xenbr1_12="bond0.12"

config_xenbr1_12=( "null" )

bridge_xenbr1_13="bond0.13"

config_xenbr1_13=( "null" )

depend_xenbr1() {

  need net.bond0

}

#RC_NEED_bond0="net.eth0 net.eth1"

RC_NEED_xenbr1="net.bond0"

---

thanks,

d.

----------

