Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Updating old system :: Interfaces naming / udev
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
mryoung_fr
n00b
n00b


Joined: 17 Jul 2004
Posts: 43
Location: Reims, France

PostPosted: Sun Nov 17, 2013 10:50 pm    Post subject: Updating old system :: Interfaces naming / udev Reply with quote

Hello there,

I'm coming here for support because I'm currently updating one of my old gentoo system.
Everything is going fine for the moment, as I do it tiny step by tiny step :)

One huge step I had to go through is updating kernel / udev.
My current kernel is "hardened 3.0.4". I prep a 3.10.1 kernel, and in the same time, I'm going to udev-204.

The boot process with 3.10.1 kernel is going fine, except for one little thing: Interface names

With 3.0.4 kernel, I've got 3 interfaces, eth0, eth1, eth2. I want to keep it the same, as lot of scripts are based on these.
When I boot when 3.10.1, eth2 is still eth2, but eth0 is swapped with eth1.

I decided to look into udev, keep the /etc/udev/rules.d/80-net-name-slot.rules empty to go with the old fashionned way, and create my own rules (removing old persistent rules).
A 70-my-own-net.rules ended like this:

Code:
# eth0 / atl1
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:fc:ff:df:1
b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# eth1 / e100
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:90:27:46:86:6
8", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# eth2 / 3c59x
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:4b:06:d7:9
e", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"


It seems I made everything to make it works.

Unfortunately, rebooting with 3.10.1 and this configuration still give the wrong configuration (eth0 <=> eth1)

As i use this box for some personnal services, I decided to go back to 3.0.4, and now everything is back to normal.

I tried lot of modifications, updated udev from 197 to 200 and then to 204, without any luck.

Can anyone out there is able to help me ?

Thanks in advance for your answer.

Cya
Baptiste aka mRyOuNg
_________________
.: mRyOuNg :.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14159

PostPosted: Mon Nov 18, 2013 12:52 am    Post subject: Reply with quote

Udev upstream removed support for using interface renaming in the manner you show. You must either accept kernel assigned names or rename interfaces to names that do not start with a kernel prefix. You could name them lan0, lan1, and wan0, but not ethN for any N.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1388

PostPosted: Mon Nov 18, 2013 1:04 am    Post subject: Reply with quote

If you just want to have old names:

cat /proc/cmdline should show:
net.ifnames=0
Put it in grubs kernel options line!

Or put an empty file
/etc/udev/rules.d/80-net-name-slot.rules
_________________
the thread ain't easily find an end
Back to top
View user's profile Send private message
jonathan183
Guru
Guru


Joined: 13 Dec 2011
Posts: 309

PostPosted: Mon Nov 18, 2013 1:45 am    Post subject: Reply with quote

I'm not using a hardened kernel but I switched to eudev ...
Code:
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-fs/eudev-1.1  USE="gudev hwdb introspection keymap modutils openrc rule-generator -doc -kmod (-selinux) -static-libs {-test}" 0 kB

which may or may not help in your case ...
Back to top
View user's profile Send private message
mryoung_fr
n00b
n00b


Joined: 17 Jul 2004
Posts: 43
Location: Reims, France

PostPosted: Mon Nov 18, 2013 6:34 am    Post subject: Reply with quote

Hu wrote:
Udev upstream removed support for using interface renaming in the manner you show. You must either accept kernel assigned names or rename interfaces to names that do not start with a kernel prefix. You could name them lan0, lan1, and wan0, but not ethN for any N.


Thanks for your answer, it seems pretty logical finally.

So i suppose if eth0 and 1 are swapped it's mainly due to kernel but not to udev, and as udev is not offering a way to rename device, I'm force to live with it.
_________________
.: mRyOuNg :.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14159

PostPosted: Mon Nov 18, 2013 10:14 pm    Post subject: Reply with quote

Udev offers a way to rename the device, but only to certain classes of name. The names you requested are not in the allowed class. As I said, if you want to name them lan0, lan1, and wan0, you can do that, and it will provide stable names.
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