Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bonding/VLan and Baselayout-1.11.6-r1 (Baselayout-1.11.7-r2)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Strenuus
n00b
n00b


Joined: 27 Jan 2004
Posts: 26
Location: Texas

PostPosted: Wed Dec 08, 2004 8:42 pm    Post subject: Bonding/VLan and Baselayout-1.11.6-r1 (Baselayout-1.11.7-r2) Reply with quote

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
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Dec 08, 2004 8:47 pm    Post subject: Reply with quote

This should be fixed in baselayout-1.11.7-r2
Back to top
View user's profile Send private message
Strenuus
n00b
n00b


Joined: 27 Jan 2004
Posts: 26
Location: Texas

PostPosted: Wed Dec 08, 2004 10:39 pm    Post subject: Bonding/VLan and Baselayout-1.11.7-r2 Reply with quote

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:
Code:
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.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Dec 09, 2004 9:48 am    Post subject: Re: Bonding/VLan and Baselayout-1.11.7-r2 Reply with quote

Strenuus wrote:

Code:
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.


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

Code:
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" )
Back to top
View user's profile Send private message
Strenuus
n00b
n00b


Joined: 27 Jan 2004
Posts: 26
Location: Texas

PostPosted: Thu Dec 09, 2004 4:42 pm    Post subject: Re: Bonding/VLan and Baselayout-1.11.7-r2 Reply with quote

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

Code:
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" )



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:
Code:
        # New style config - one variable fits all
        eval config=( \"\$\{config_${IFVAR}\[@\]\}\" )
        eval config_fallback=( \"\$\{fallback_${IFVAR}\[@\]\}\" )


and before:
Code:
        # 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.

Code:
        # 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.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Dec 09, 2004 5:13 pm    Post subject: Reply with quote

Ah yes - thats a bug.

I've implemented a similar fix in CVS
Code:

   local ifvar=$( interface_variable ${iface} )

...

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


Will be in baselayout-1.11.8
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum