You are not logged in.

#1 2006-02-13 09:01:07

allucid
Member
Registered: 2006-01-06
Posts: 259

udev swapping the network interfaces [solved?]

After a recent upgrade my network devices (eth0 and eth1) seem to be randomly assigned at boot. This obviously causes problems for the network scripts. I tried to rectify this by specifying the device names via udev:

/etc/udev/rules.d/10-network.rules

KERNEL="eth*", SYSFS{address}="00:0d:70:a8:63:12", NAME="eth0"
KERNEL="eth*", SYSFS{address}="00:0b:a1:18:80:ba", NAME="eth1"

but this does not seem to have any effect on the device names. Anyone aware of how to fix this problem or what exactly is causing it?

*note*
I manually searched through the first couple of pages of this forum before posting this because I figured others would have this problem and forum search currently does not work for me. Sorry if this is a duplicate.

Offline

#2 2006-02-13 09:16:03

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: udev swapping the network interfaces [solved?]

You need to make sure the addresses tehre match your network card's own mac addresses.

You can attain these mac addresses by checking the output of ifconfig -a and looking at the hwaddr

iphitus

Offline

#3 2006-02-13 09:24:28

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: udev swapping the network interfaces [solved?]

They do match. I just double-checked with ifconfig and udevinfo. sad

Offline

#4 2006-02-13 09:53:50

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: udev swapping the network interfaces [solved?]

KERNEL="eth*", SYSFS{address}="00:0d:70:a8:63:12", NAME="eth0"

This is your udev line. And now compare it to this one:

KERNEL=="eth*", SYSFS{address}=="00:0d:70:a8:63:12", NAME="eth0"

See the difference? Stare at it until you see it.

I'd also reommend this change:

SUBSYSTEM=="net", SYSFS{address}=="00:0d:70:a8:63:12", NAME="eth0"

It makes this rule more general and even works if the interface is named completely different by the kernel.

Offline

#5 2006-02-13 13:01:27

viniosity
Member
From: New York, NY
Registered: 2005-01-22
Posts: 404
Website

Re: udev swapping the network interfaces [solved?]

This is kind of useful.. I have this happen sometimes (rarely) too.  Perhaps a wiki page..

Offline

#6 2006-02-13 22:18:13

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: udev swapping the network interfaces [solved?]

brain0 wrote:
KERNEL="eth*", SYSFS{address}="00:0d:70:a8:63:12", NAME="eth0"

This is your udev line. And now compare it to this one:

KERNEL=="eth*", SYSFS{address}=="00:0d:70:a8:63:12", NAME="eth0"

See the difference? Stare at it until you see it.

I'd also reommend this change:

SUBSYSTEM=="net", SYSFS{address}=="00:0d:70:a8:63:12", NAME="eth0"

It makes this rule more general and even works if the interface is named completely different by the kernel.

Thank you! I copied that bit I had above (except for the MACs) from a howto page on udev. I guess they changed some things recently to require double equals for comparison? I had to go back and change some of my rules for other things as well.

Offline

#7 2006-02-14 01:10:32

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: udev swapping the network interfaces [solved?]

allucid wrote:

Thank you! I copied that bit I had above (except for the MACs) from a howto page on udev. I guess they changed some things recently to require double equals for comparison? I had to go back and change some of my rules for other things as well.

"Recently" as in "about 3 months ago" - Yes.

Offline

#8 2006-02-14 02:53:06

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: udev swapping the network interfaces [solved?]

Spoke too soon! I've tried all the suggested fixes and it still does not work correctly. sad I re-verified that the MAC addresses are valid and are referring to the correct interface names. Any other ideas?


brain0 wrote:

"Recently" as in "about 3 months ago" - Yes.

Some of my udev rules are from over a year ago and I haven't had a reason to suspect they were incorrect.

Offline

#9 2006-02-14 06:03:21

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: udev swapping the network interfaces [solved?]

Try using NAME="lan0" instead of eth0, it seems some people have reported that renaming to eth* devices fails.

Offline

#10 2006-02-14 22:12:03

allucid
Member
Registered: 2006-01-06
Posts: 259

Re: udev swapping the network interfaces [solved?]

phrakture wrote:

Try using NAME="lan0" instead of eth0, it seems some people have reported that renaming to eth* devices fails.

OK! That seems to work now. Thanks, everyone, for your help. smile

Offline

#11 2006-02-14 23:31:10

ozar
Member
From: USA
Registered: 2005-02-18
Posts: 1,686

Re: udev swapping the network interfaces [solved?]

phrakture wrote:

Try using NAME="lan0" instead of eth0, it seems some people have reported that renaming to eth* devices fails.

It often amazes me how we can be banging our heads against the wall trying to fix something and the solution turns out to be so simple.   8)


oz

Offline

#12 2006-02-18 11:49:36

test1000
Member
Registered: 2005-04-03
Posts: 834

Re: udev swapping the network interfaces [solved?]

and so illogical..


KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein

Offline

Board footer

Powered by FluxBB