You are not logged in.

#1 2012-09-23 18:19:20

hussam
Member
Registered: 2006-03-26
Posts: 572
Website

persistent device naming

hi, I have two network adapters. one is internal and one is a pci card. I used this https://wiki.archlinux.org/index.php/Ud … ork_device and added udev rules to make sure the correct one is always eth0 and the other one is eth1. but they still occasionally switch after a reboot,

my /etc/udev/rules.d/10-network.rules looks like this:

SUBSYSTEM=="net", ATTR{address}=="74:ea:3a:83:86:5e", NAME="eth0"
SUBSYSTEM=="net", ATTR{address}=="00:1c:c0:88:0b:3f", NAME="eth1"

I am using a full systemd environment. no classic initscripts or sysvinit installed (just in case that affects things).
Any idea how I can tell why this is happening?

Offline

#2 2012-09-23 18:31:28

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: persistent device naming

the wiki page you linked to wrote:

When choosing the static names it should be avoided to use "ethX" and "wlanX", because this may lead to race conditions between the kernel und udev during boot. Instead better use interface names that are not used by the kernel as default, e.g. "net0, net1, wifi0, wifi1"

Offline

#3 2012-09-23 19:14:32

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: persistent device naming

I think what 65kid's link is trying to say is that you should not try to change the kernel's naming structure, but rather add an alternate persistent name, and then direct everything to that instead. 

For instance symlink 74:ea:3a:83:86:5e to /dev/net0 and then use that rather than /dev/eth0.  It is the same thing as being able to use the /dev/disk/by-* insetad of /dev/sdXY

Offline

#4 2012-09-23 19:24:51

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: persistent device naming

Try with NAME:= rather than NAME=

From "man udev":

Assign a value to a key finally; disallow any later changes.

However, I always saw the recommended method as being to assign a SYMLINK, and not change the name. E.g.:

SUBSYSTEM=="net", ATTR{address}=="00:c3:d1:a5:e4:09", SYMLINK+="eth-router"

Offline

#5 2012-09-23 19:27:53

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: persistent device naming

Assigning a NAME is still valid for network devices, you're just not supposed to trample on the kernel's namespace. It's racy, and udev used to contain hacks to allow the switch to happen. The wiki is correct in this case -- pick a name that isn't ethX or wlanX.

Offline

#6 2012-09-23 23:09:55

hussam
Member
Registered: 2006-03-26
Posts: 572
Website

Re: persistent device naming

ok, thank you guys. I will change eth0 to net0 and eth1 to local0 before next reboot. thanks you very much smile

Offline

Board footer

Powered by FluxBB