Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VLAN's, udev and renaming Virtual Network Interfaces
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
TheAl
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2004
Posts: 134

PostPosted: Thu Jun 23, 2005 10:05 am    Post subject: VLAN's, udev and renaming Virtual Network Interfaces Reply with quote

Hi,

1st, my goal :
Setup a linux box with 802.1Q VLANs and rename interfaces to something more readable.

I can rename NI with the udev stuff, and it seems to be the best way to do it.

I can setup VLANs, with MAC incremented for all vlans (but, there is a bug if you plan to use both _native_ interface (aka untagged) *and* vlans, because the Gentoo init script olny increment MAC for the 2nd VLAN, so you have 2 interfaces with same MAC ...).
But, VLANs are setup after the udev stuff, so I cannot rename VLANs.

I can workarround this with preup and postup() functions, but I think this can be better if supported by Gentoo init scripts.

Any ideas how to do it ?
Back to top
View user's profile Send private message
TheAldo
n00b
n00b


Joined: 09 Dec 2004
Posts: 16

PostPosted: Fri Jul 15, 2005 12:55 pm    Post subject: Reply with quote

Hi,

I'm encountering the same need here.

Any got an idea or a status of the net scripts ?

Thanks
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Jul 15, 2005 12:59 pm    Post subject: Reply with quote

I have no idea what the problem even is.

Try posting your configs and what you expect to happen and what really happens
Back to top
View user's profile Send private message
TheAl
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2004
Posts: 134

PostPosted: Fri Jul 15, 2005 1:48 pm    Post subject: Reply with quote

Ok, sorry for my so bad english :?

I want to setup VLAN interfaces on my network card.
So I can do it using /etc/conf.d/net :
Code:
vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" )
vlans_eth0="2 999 18 10"


1st problem is to setup a MAC address for each VLAN, because the switch behind cannot have same MAC on different VLAN (this is normal).
So, add this :
Code:
mac_vlan2=("00:0c:6e:ee:ee:5b")
mac_vlan999=("00:0c:6e:ee:ee:5c")
mac_vlan18=("00:0c:6e:ee:ee:5d")
mac_vlan10=("00:0c:6e:ee:ee:5f")


and it's working well.

Now, to make it simplier to admin and understand, I want to rename those VLAN interface, for exemple vlan2 -> mgt
How to do it ?

I cannot use the udev renaming scheme, because udev is already started when I create subinterfaces.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Jul 15, 2005 5:01 pm    Post subject: Reply with quote

baselayout-1.12.0-pre1 will feature a "rename" module which allows the following

Code:
# Rename by interface name
rename_vlan2="mgt"

# Rename by MAC
rename_000C6EEEEE5B="mgt"


EDIT: This doesn't work for vlans - heh. Not sure what I can do about this as the vlan is sill reported with the old interface name whereas it's real one has changed - which makes it impossible to stop as it stands.
Back to top
View user's profile Send private message
TheAl
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2004
Posts: 134

PostPosted: Mon Jul 18, 2005 6:47 am    Post subject: Reply with quote

UberLord wrote:
EDIT: This doesn't work for vlans - heh. Not sure what I can do about this as the vlan is sill reported with the old interface name whereas it's real one has changed - which makes it impossible to stop as it stands.


I can see 2 options :

1/ Modify the vconfig tool to accept renaming vlan interfaces at setup (probably hard to do)
2/ Playing with udev and force a reload (udevstart) after the vlan creation to rename it

Let me know what is the best way to do 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: Mon Jul 18, 2005 9:51 am    Post subject: Reply with quote

TheAl wrote:
Let me know what is the best way to do it.


The best way todo it is to hack the VLAN kernel module to report the new interface name via /proc/net/vlan/config.

At this time, I'm very tempted to stop the rename module working for vlan interfaces as it will cause too many problems.
I don't see this at that big an issue - especially as vconfig allows 4 different naming schemes.

However, if you thing it's that big an issue, and can provide a working patch to our up and coming 1.12.0pre1 release then we'll look at it.
Back to top
View user's profile Send private message
TheAl
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2004
Posts: 134

PostPosted: Mon Jul 25, 2005 8:36 am    Post subject: Reply with quote

UberLord wrote:
]I don't see this at that big an issue - especially as vconfig allows 4 different naming schemes.


It's not a big issue, just easy to manage. Let me take an example, a fireall. To limit network cards in PC (and dont use expansive Multiple interface card) we setup 802.1Q VLAN on a gigabit interface with maybe 6 active subinterfaces.
When editing rules and routing, it's realy easier to have "dmz" "lan" "vpn" network interfaces than VLAN002, VLAN123, ...

UberLord wrote:
]The best way todo it is to hack the VLAN kernel module to report the new interface name via /proc/net/vlan/config.

Yes, seems the best way to do it.

Will take a look if I a can get some spare time :(
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Jul 25, 2005 9:18 am    Post subject: Reply with quote

BTW, it does cause too many problems, so 1.12.0_pre2 (in portage) doesn't allow VLAN interfaces to be renamed.
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