Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
a bug in /lib/rcscripts/net.modules.d/vlan. [SOLVED]
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
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 11:47 am    Post subject: a bug in /lib/rcscripts/net.modules.d/vlan. [SOLVED] Reply with quote

i'm trying to setup vlans on my box

Code:

vlans_eth1="10 12"
vconfig_eth1=( "set_name_type VLAN_PLUS_VID_NO_PAD" )
vconfig_vlan10=( "set_flag 1" )
vconfig_vlan12=( "set_flag 1" )
config_vlan10=( "xx.xx.xx.xx/24" )
config_vlan12=( "yy.yy.yy.yy/24" )

and '/etc/init.d/net.vlan10 start' fails with error
Code:

 *   vconfig set_flag vlan10 1
 *   ERROR: trying to set flag on device -:vlan10:- error: Invalid argument

inestigating /lib/rcscripts/net.modules.d/vlan i've found that vconfig commands are executed in vlan_pre_start
function, but actual vlan interface is added in vlan_post_start.
so, how to specify vconfig option to vlan interface?

by the way - initially i was trying to use . name notation (ex. eth1.10, eth1_10 in conf.d/net, as in net.example)
starting /etc/init.d/net.eth1_10 fails with
Code:

 *   vconfig set_flag eth1_10 1
 *   ERROR: trying to set flag on device -:eth1_10:- error: Invalid argument

so, underscore is not translated to dot notation.
/etc/init.d/net.eth1.10 fails as it is trying to configure interface 10, so it takes trailing part after last dot.


Last edited by ruff on Tue Nov 22, 2005 3:13 pm; edited 3 times 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: Tue Nov 22, 2005 12:03 pm    Post subject: Reply with quote

Whoops, that won't work. It should, but it won't and it's my fault :oops:

I'm not going to fix that for baselayout-1.11, but I'll see if I can fix it for baselayout-1.12.0_pre11
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 12:09 pm    Post subject: Reply with quote

ok
so should i use manual configuration until baselayout update?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 12:27 pm    Post subject: Reply with quote

If you need it working, then yes ;)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 12:32 pm    Post subject: Reply with quote

thanx, will wait :roll:
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 1:30 pm    Post subject: Re: a bug in /lib/rcscripts/net.modules.d/vlan. Will be [SOL Reply with quote

ruff wrote:

by the way - initially i was trying to use . name notation (ex. eth1.10, eth1_10 in conf.d/net, as in net.example)
starting /etc/init.d/net.eth1_10 fails with
Code:

 *   vconfig set_flag eth1_10 1
 *   ERROR: trying to set flag on device -:eth1_10:- error: Invalid argument


Yes, that won't work because you don't create init.d scripts for your vlan interfaces (unlike other interfaces types where you do).
And if you did, it would be net.eth1.10 as we only use the _ translation for variable names
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 1:33 pm    Post subject: Reply with quote

BTW, I have your config and the net.example config fully working for the next baselayout-1.12 release.

It will work with 1.12.0_pre10-r1 provided you disable ifplugd and/or netplug if you have them installed
Code:
modules_eth0=( "!plug" )

_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 2:17 pm    Post subject: Re: a bug in /lib/rcscripts/net.modules.d/vlan. Will be [SOL Reply with quote

UberLord wrote:
Yes, that won't work because you don't create init.d scripts for your vlan interfaces (unlike other interfaces types where you do).
And if you did, it would be net.eth1.10 as we only use the _ translation for variable names

But i did! And it tells me
Code:

root@relay init.d # /etc/init.d/net.eth1.10 start
 * Caching service dependencies ...                                                                                     [ ok ]
 * Starting 10
 *   Cannot default to dhcp as there is no dhcp module loaded
 *   No configuration for 10                                                                                            [ !! ]
root@relay init.d #

is i said befor - it seems only trailing part, after last period, treated as interface name
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 2:41 pm    Post subject: Reply with quote

That's because you don't create init scripts for vlan interfaces ...... :roll:
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 2:46 pm    Post subject: Reply with quote

ahh... how? what init scripts? i've made symlink to net.lo with name net.eth1.10, i havn't found anything else in net.example/handbook concirning vlans. Where can i find info about it?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 2:49 pm    Post subject: Reply with quote

Woe is me for dealing with support on day 3 of Not Smoking :twisted:

eth1 is the interface
eth1.10 is the vlan

So you use the net.eth1 init sript and don't create/use one for net.eth1.10

Clear? Good :wink:
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 2:57 pm    Post subject: Reply with quote

aha, got it.
but not good %)
Code:

root@relay init.d # /etc/init.d/net.eth1 start
 * Caching service dependencies ...                                                                                     [ ok ]
 * Starting eth1
 *   Cannot default to dhcp as there is no dhcp module loaded
 *   No configuration for eth1                                                                                          [ !! ]
root@relay init.d #


btw - i have not smoked already about a month - filling good %)
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 3:06 pm    Post subject: Reply with quote

You need to state that there is no config for eth1 - we assume dhcp otherwise as this is what most users will want.

Code:
config_eth1=( "null" )

_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 3:12 pm    Post subject: Reply with quote

Wow! It works %)

Code:

root@relay conf.d # /etc/init.d/net.eth1 start
 * Starting eth1
 *   Bringing up eth1                                                                                                   [ ok ]
 *   Adding VLAN 10 to eth1                                                                                         [ ok ]
 *   Bringing up eth1.10
 *     xxx.xxx.xxx.xxx                                                                                                 [ ok ]
 *   Adding VLAN 12 to eth1                                                                                         [ ok ]
 *   Bringing up eth1.12
 *     yyy.yyy.yyy.yyy                                                                                                 [ ok ]
root@relay conf.d #

Thanx, so it would be nice to add this to net.examlpe i think :roll:
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 3:22 pm    Post subject: Reply with quote

Why don't you post an improvement to net.example here - I've tried to explain it as best I can.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
ruff
n00b
n00b


Joined: 13 May 2005
Posts: 22

PostPosted: Tue Nov 22, 2005 3:34 pm    Post subject: Reply with quote

i think

Code:

240a241,243
> # Tell init script not to handle with interface configuration
> #config_eth0=( "null" )
>
251a255,256
> # After all make init script for real (physical) interface.
>


should be sufficient. As i know, when using vlans, ethernet interface should be only in up state,
and without any ipaddress assigned, so config_<dev>=( "null" ) might be default for this case.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Nov 22, 2005 4:17 pm    Post subject: Reply with quote

I've pre-phrased that to match our documentation style and comitted it - it will appear in baselayout-1.12.0_pre11
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
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