# Bonding/VLan and Baselayout-1.11.6-r1 (Baselayout-1.11.7-r2)

## Strenuus

I'm using baselayout 1.11.6-r1 and trying to bond two interfaces together and then use vlans on top of bond.  In the file /lib/rcscripts/net.modules.d/bonding, it has "after interface vlan" inside the bonding_depend() function.  I'm sure this is fine for most setups, but this causes my configuration to try to add vlans then setup bonding which isn't possible.  Is this something that has been changed in a later release or is there a better way to overide the value without editing the file?

Also, has there been something done to correct a issue where when adding a vlan it tries to check the interface for being a bonding interface and generating this error:

Adding VLAN i to bond0

Bringing up bond0.i

    bond0.x xxx.xxx.xxx.xxx/xx

/lib/rcscripts/net.modules.d/bonding: line 53: ${slaves_bond0.i}: bad substitution

I'm not 100% sure, but I believe this has something to do with the "." that is added for the vlan interface.Last edited by Strenuus on Wed Dec 08, 2004 10:40 pm; edited 1 time in total

----------

## UberLord

This should be fixed in baselayout-1.11.7-r2

----------

## Strenuus

Thank you for the quick reply, I've updated baselayout and the two problems from before are resolved, but now I seem to have a new one.

/etc/conf.d/net:

```
modules=( "iproute2" )

slaves_bond0="ethX ethY"

config_bond0=( "null" )

vlans_bond0="Z"

config_vlanZ=( "xxx.xxx.xxx.xxx/xx brd xxx.xxx.xxx.xxx" )

```

After running /etc/init.d/net.bond0 start, I get the interfaces from the vlan portion, but it doesn't set the address on the vlan.  After further exploring the /etc/init.d/net.bond0 script, I added a few echo lines for some of the variables and noticed that it's trying to pull the config for bond0 instead of the vlan config (config_vlanZ).

Is there a later version in which this is resolved or something I'm missing in the config for making this work correctly.  I also tried config_bond0_Z (same result), config_bond0.Z (error), config_Z (same result), config_bond0_vlanZ (same result).

Thanks in advance.

----------

## UberLord

 *Strenuus wrote:*   

> 
> 
> ```
> modules=( "iproute2" )
> 
> ...

 

That's correct - here's what your config should look like

```
modules=( "iproute2" )

slaves_bond0="ethX ethY"

config_bond0=( "null" )

vlans_bond0="Z"

config_bond0_Z=( "xxx.xxx.xxx.xxx/xx brd xxx.xxx.xxx.xxx" )

```

----------

## Strenuus

 *Strenuus wrote:*   

> Is there a later version in which this is resolved or something I'm missing in the config for making this work correctly. I also tried config_bond0_Z (same result), config_bond0.Z (error), config_Z (same result), config_bond0_vlanZ (same result).
> 
> 

 

 *UberLord wrote:*   

> That's correct - here's what your config should look like
> 
> ```
> modules=( "iproute2" )
> 
> ...

 

I did try what you had suggested, using config_bond0_Z=( "xxx.xxx.xxx.xxx/xx brd xxx.xxx.xxx.xxx" ), however I also has the same result.  Perhaps this info will help out a little bit.  I modifed the net.eth0 script to give echo the values of the following variables from within the iface_start() function.

I did the echo after:

```
        # New style config - one variable fits all

        eval config=( \"\$\{config_${IFVAR}\[@\]\}\" )

        eval config_fallback=( \"\$\{fallback_${IFVAR}\[@\]\}\" )

```

and before:

```
        # We must support old configs

        if [[ -z ${config} ]]; then

                interface_get_old_config ${iface} || return 1

        fi

```

${1}:  bond0.Z

iface:  bond0.Z

config:  "null"

ifvar:  "bond0"

To work around this issue for now, I added the following code between the two sections listed above, it just changes the "." in bond0.Z to "_" (bond0_Z).  This does make it work and pulls the vlan interface value from the config_bond0_Z value set inside the net conf file.

```
        # Work around for VLANs

        vlan_ifvar="$(echo "${iface}" | awk 'sub("\\.", "_")')"

        if [ ! -z "${vlan_ifvar}" ]

        then

                eval config=( \"\$\{config_${vlan_ifvar}\[@\]\}\" )

                eval config_fallback=( \"\$\{fallback_${vlan_ifvar}\[@\]\}\" )

        fi

```

${1}:  bond0.Z

iface:  bond0.Z

config:  "xxx.xxx.xxx.xxx/xx brd xxx.xxx.xxx.xxx"

ifvar:  "bond0"

vlan_ifvar: "bond0_Z"

I'm sure there is a better way to handle this, but I needed something to work.

----------

## UberLord

Ah yes - thats a bug.

I've implemented a similar fix in CVS

```

   local ifvar=$( interface_variable ${iface} )

...

   eval config=( \"\$\{config_${ifvar}\[@\]\}\" )

   eval config_fallback=( \"\$\{fallback_${ifvar}\[@\]\}\" )

```

Will be in baselayout-1.11.8

----------

