You are not logged in.

#1 2006-02-13 16:18:24

mezcal
Member
From: Czech Republic
Registered: 2006-01-31
Posts: 64
Website

the name of network card is changing

Hello,
I have network card and wifi card in my notebook. I have updated udev, kernel, firefox etc. Since time the name of network card is changing. Sometimes lan is eth1 and wlan is eth0 and sometimes lan is eth0 and wlan is eth1.
It s problem for me. Becouse I dont use dhcp.
Any sugestions.

Offline

#2 2006-02-13 16:35:46

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,262

Re: the name of network card is changing

you need to load it in right order use MODULES=(!moduleA !moduleB moduleA moduleB) in rc.conf
moduleA=network moduleB=wlan
use hwdetect --show-modules to get the right names

Offline

#3 2006-02-13 17:01:32

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

Re: the name of network card is changing

mezcal wrote:

Sometimes lan is eth1 and wlan is eth0 and sometimes lan is eth0 and wlan is eth1.

You can thank the wonderfully insightful udev developers for this.  They recommend using static rules which is, well, dumb.  But right now it's the only solution.

use the following info:

$ udevinfo -a -p /sys/class/net/eth0/
   looking at class device '/sys/class/net/eth0':
     SYSFS{address}="XX:XX:XX:XX:XX:XX"

to create a file like so:

#/etc/udev/rules.d/netdevices.rules
KERNEL="eth*", SYSFS{address}="XX:XX:XX:XX:XX:XX", NAME="eth0"

Yes, I know it's bad.  I hate it too, but it's hard to get anything through to the udev devs...

Offline

#4 2006-02-13 18:19:45

phydeaux
Member
Registered: 2005-06-13
Posts: 68

Re: the name of network card is changing

I gave this a shot and I'm still haveing the same problems.

This is my /etc/udev/rules.d/netdevices.rules:

KERNEL="eth*", SYSFS{address}="00:0d:56:b3:52:fc", NAME="eth0"
KERNEL="eth*", SYSFS{address}="00:0e:35:40:91:77", NAME="eth1"

Output from ifconfig (just to show names and macs...

eth0      Link encap:Ethernet  HWaddr 00:0E:35:40:91:77  
eth1      Link encap:Ethernet  HWaddr 00:0D:56:B3:52:FC

It seems that udev just ignores the custom rules and its potluck on whether it comes up with the right names or not.  I have another custom rule file in there as well which changes various usb cameras and stick drives into more meaning full names other then sd?1, those rules seem to be ignored as well.

[edit]Solved!

The following netdevices.rules works:

KERNEL=="eth*", SYSFS{address}=="00:0d:56:b3:52:fc", NAME="eth0"
KERNEL=="eth*", SYSFS{address}=="00:0e:35:40:91:77", NAME="eth1"

It seems that you have to use "==" in comparison operations.  Did this used to be the case?  I don't remember having to use them before and most examples I see use a "=" for both comparison and assignment.  Did they change the rules syntax for the new version or maybe just correct an error that allowed "=" to work as "=="?
[/edit]

andy

Offline

#5 2006-02-13 18:44:08

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

Re: the name of network card is changing

Yeah, I saw the == mention in another thread.  It seems to be newer, but then again, I haven't written custom rules in a while.

It's also recommended to use SUBSYSTEM=="net" instead of KERNEL=="eth*"

Offline

#6 2006-02-14 01:01:00

phydeaux
Member
Registered: 2005-06-13
Posts: 68

Re: the name of network card is changing

For some reason using SUBSYSTEM=="net" doesn't seem to work.  It seems to name them right more often then not but its not 100%.  So far using KERNEL=="eth*" gets the names right  ever time.  I'd guess I've done about 20 reboot each way but I wasn't counting.

andy

Offline

#7 2006-02-14 05:12:45

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

Re: the name of network card is changing

according to Judd, he was unable to get the NAME="eth0" to work correctly, and had to use NAME="lan0" or something similar.
I don't have multiple NICs on this box, so can't test this.

Offline

#8 2006-02-14 15:18:51

phydeaux
Member
Registered: 2005-06-13
Posts: 68

Re: the name of network card is changing

I'll have to agree with judd that the NAME="lan0" works with SUBSYSTEM=="net" but I still have yet to have a problem with KERNEL=="eth*" and NAME="eth0".  I don't have the time or patients to sit here and reboot 300 times to thoroughly test it but I'm sure some law of averages or something would say that if it hasn't caused a problem by now its probably not going to.  Hopefully the udev devs will take notice and fix this.  Maybe if enough people file enough bug reports with them..... :twisted:

andy

Offline

#9 2006-02-14 16:25:21

mezcal
Member
From: Czech Republic
Registered: 2006-01-31
Posts: 64
Website

Re: the name of network card is changing

It s working for me.

KERNEL=="eth*", SYSFS{address}=="00:14:38:2a:55:4d", NAME="lan" 
KERNEL=="eth*", SYSFS{address}=="00:13:ce:6b:58:95", NAME="wlan"
KERNEL=="eth*", SYSFS{address}=="71:8b:50:00:49:a1:3d:a6", NAME="fw"

fw is firewire.

I think that it is not possible write NAME="eth0" if the eth0 is not renamed before. Becouse the eth0 will be rewritten.
I have tried:

KERNEL=="eth*", SYSFS{address}=="00:14:38:2a:55:4d", NAME="tmp" 
KERNEL=="eth*", SYSFS{address}=="00:13:ce:6b:58:95", NAME="eth1"
KERNEL=="tmp", SYSFS{address}=="00:14:38:2a:55:4d", NAME="eth0"
or
SUBSYSTEM=="net", SYSFS{address}=="00:14:38:2a:55:4d", NAME="eth0"

It is not working.


Thanks all for your advices.

UDEV is evil now.

Offline

Board footer

Powered by FluxBB