# multiple bonded interfaces (bond0, bond1) [SOLVED]

## DNAspark99

Trying to create 2 bonded interfaces here. (4 actual network interfaces: eth0,eth1,eth2,eth3)

bond0 works. bond1 does not. 

Here is my /etc/conf.d/net :

```

config_eth0=( null )

config_eth1=( null )

config_eth2=( null )

config_eth3=( null )

  preup() {

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

                BOND_MODE="active-backup"

                BOND_MIIMON="100"

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

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

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

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

        elif [[ ${IFACE} == "bond1" ]] ; then

                BOND_MODE="active-backup"

                BOND_MIIMON="100"

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

                echo ${BOND_MIIMON}  >/sys/class/net/bond1/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

   }

   slaves_bond0="eth0 eth2"

   slaves_bond1="eth1 eth3"

   config_bond0=( "dhcp" )

   config_bond1=( "dhcp" )

```

/etc/modules.d/bond :

```

alias bond0 bonding

options bond0 -o bond0 mode=0 miimon=100

alias bond1 bonding

options bond1 -o bond1 mode=0 miimon=100

```

Attempts to start the bond1 interface result in:

```

 * Starting bond1

 *   Running preup function

/etc/conf.d/net: line 32: /sys/class/net/bond1/bonding/mode: No such file or directory

/etc/conf.d/net: line 33: /sys/class/net/bond1/bonding/miimon: No such file or directory

 *     Bonding mode is set to active-backup on bond1

 *     MII monitor interval is set to 100 ms on bond1                     [ ok ]

 *   network interface bond1 does not exist

 *   Please verify hardware or kernel module (driver)                     [ !! ]

```

The files under /sys do not exist because the interface bond1 is not created. 

```

ifenslave bond1 eth1 eth3

Master 'bond1': Error: handshake with driver failed. Aborting
```

hrm. ideas?Last edited by DNAspark99 on Mon Nov 10, 2008 9:33 am; edited 1 time in total

----------

## DNAspark99

Discovered the "max_bonds" option needs to be present, since it defaults to just allowing one bond. 

/etc/modules.d/bond :

```

alias bond0 bonding

alias bond1 bonding

options bonding mode=0 miimon=100 max_bonds=2

```

Also, it seems the module can *not* be compiled into the kernel, and must remain a module for these settings to take effect.

----------

