Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev-089-r2 randomly swaps my NICs [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mesch.t
n00b
n00b


Joined: 25 Oct 2004
Posts: 33

PostPosted: Thu Apr 06, 2006 7:56 pm    Post subject: udev-089-r2 randomly swaps my NICs [solved] Reply with quote

Hi!
So I updated to udev-089-r2 (I'm running ~x86) yesterday and after a reboot the network was gone.
I noticed that my NICs were swapped - this is extremly uncomfortable since this box also serves as a router for my laptop.
There seems to be no order how the NICs get a name assigned.
I searched the net and the forums here but didn't find an answer.

After reading the gentoo-udev guide and howto write custom udev rules [http://www.reactivated.net/writing_udev_rules.html] I inserted the following rules to
/etc/udev/rules.d/10-local.rules
Code:

KERNEL=="eth*", SYSFS{address}=="00:50:fc:95:a1:c8", NAME="eth0"
KERNEL=="eth*", SYSFS{address}=="00:0c:6e:19:d0:98", NAME="eth1"
KERNEL=="eth*", SYSFS{address}=="00:09:5b:74:ca:8a", NAME="eth2"

But this doesn't work either. The naming still changes from reboot to reboot.
Any suggestions?
Thanks, mesch.t


Last edited by mesch.t on Sat Apr 08, 2006 1:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
mesch.t
n00b
n00b


Joined: 25 Oct 2004
Posts: 33

PostPosted: Fri Apr 07, 2006 9:20 am    Post subject: Reply with quote

On bootup I see this message 2x fly by:
Code:

rename_net_if: Error changing interface name. File exists


Coldplug is not installed - hotplug is (it is written in the udev-0.89-r2 ebuild that the functionality is still needed..)

I'm using kernel 2.16-r1 (gentoo sources).
Bye, mesch.t


Last edited by mesch.t on Fri Apr 07, 2006 5:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
gemini91
Guru
Guru


Joined: 27 Nov 2003
Posts: 317
Location: Naples, Fl

PostPosted: Fri Apr 07, 2006 12:53 pm    Post subject: Reply with quote

I had this problem with eth1 setting up as wireless instead of eth0, I went back to udev-087
and re-emerged coldplug, and it now works again.
Back to top
View user's profile Send private message
mesch.t
n00b
n00b


Joined: 25 Oct 2004
Posts: 33

PostPosted: Fri Apr 07, 2006 6:07 pm    Post subject: Reply with quote

yeah i guess this is an option but, just out of curiosity...

on the hotplug-devel-mailinglist i found a similar problem (dating of 31.12.2005) which results to add the following to the rule:
http://sourceforge.net/mailarchive/forum.php?forum_id=3157&max_rows=25&style=nested&viewmonth=200512
Code:

KERNEL=="eth*", SYSFS{address}=="00:50:fc:95:a1:c8", NAME="eth0", ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"

Furthermore I get the following which also sounds not normal :wink:
Code:

# udevtest /sys/class/net/eth0/
main: unable to open '/sys/class/net/eth0/'

as it is exactly the same as mentioned in the above udev-rules-writing guide...

ciao, mesch.t
Back to top
View user's profile Send private message
gemini91
Guru
Guru


Joined: 27 Nov 2003
Posts: 317
Location: Naples, Fl

PostPosted: Fri Apr 07, 2006 11:41 pm    Post subject: Reply with quote

Yeah, well I don't feel like I should have to write a udev rule
to make something work that has been working for three years.
Back to top
View user's profile Send private message
derk
Guru
Guru


Joined: 10 Mar 2003
Posts: 347
Location: St Thomas Ontario

PostPosted: Sat Apr 08, 2006 12:18 am    Post subject: Reply with quote

Well I've had to use a udev rule to lock my network cards in place for quite sometime .. with this most recent update I've had some problems again.

Now, after reading this thread and following mesch.t 's code sample to modufy my existing rules, everything works properly again. Thank you mesch.t for digging this correction/modification up.

derk

ps try running
Code:
udevtest /class/net/eth0/


seems something has changed in the way it now works .. ( and strace showed it looking for /sys/sys/class/net/eth0/ using your command)


PPS -- broken again -- don't know how it seems to have blown-up again


Last edited by derk on Sun Apr 09, 2006 2:14 am; edited 1 time in total
Back to top
View user's profile Send private message
mesch.t
n00b
n00b


Joined: 25 Oct 2004
Posts: 33

PostPosted: Sat Apr 08, 2006 1:02 pm    Post subject: Reply with quote

hi!
ok, I think I finally solved this issue:
The above mentioned error:
Code:
rename_net_if: Error changing interface name. File exists

stupid me...after changing the names from eth* to something like wan, lan etc the right hardware gets assigned the right names...finally!

So I have to change my configs to automatically bring up my network again:
Creating the symbolic links in /etc/init.d/net.* and changing /etc/conf.d/net to according names was not enough...
(maybe because of my iptables rules as they expect eth*?)
but right now i'm glad.

tank you
mesch.t
btw:
Code:
udevtest /class/net/wan

gives the expected results...
Back to top
View user's profile Send private message
mesch.t
n00b
n00b


Joined: 25 Oct 2004
Posts: 33

PostPosted: Sat Apr 08, 2006 1:11 pm    Post subject: Reply with quote

ok another stupid mistake:

Code:

rc-update del net.eth0
rc-update add net.wan default


ciao, mesch.t
Back to top
View user's profile Send private message
peterton
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2003
Posts: 110

PostPosted: Sat Apr 08, 2006 2:39 pm    Post subject: Reply with quote

You can force the order in which the network modules are loaded:
I created /etc/modules.d/eth
Code:
add above forcedeth skge
add above eth1394 forcedeth

(Run update-modules afterwards.)
Now my skge will be eth0, forcedeth eth1, and firewire devices will be last.
Back to top
View user's profile Send private message
gemini91
Guru
Guru


Joined: 27 Nov 2003
Posts: 317
Location: Naples, Fl

PostPosted: Tue Apr 11, 2006 3:29 pm    Post subject: Reply with quote

I resolved this problem by changing /etc/conf.d/wireless

From:
# /etc/conf.d/wireless:
# Global wireless config file for net.* rc-scripts
essid_eth0="any"
key_miloulan="e9e61d5f99"

To:
# /etc/conf.d/wireless:
# Global wireless config file for net.* rc-scripts
#essid_eth0="any"
key_miloulan="e9e61d5f99"

Now my wireless connects to either eth0 or eth1, but it
connects. The other ethernet port is a hardwired port
that I hardly ever use.
Back to top
View user's profile Send private message
kbps
n00b
n00b


Joined: 06 Mar 2006
Posts: 38
Location: Vladivostok, Russia

PostPosted: Mon Jul 03, 2006 3:04 am    Post subject: Reply with quote

okay! solved!! :D

udev-094

Code:

# /etc/init.d/net.eth0 stop
# /etc/init.d/net.eth1 stop

# cd /etc/udev/rules.d/

# touch 10-local.rules


add to "10-local.rules" file
Code:

KERNEL=="eth*", SYSFS{address}=="00:aa:bb:dd:cc:00", NAME="net0"
KERNEL=="eth*", SYSFS{address}=="00:bb:aa:dd:5c:bb", NAME="lan0"


'eth0' != 'eth0' --- rename 'eth0' to 'net0' ..etc..

p.s. mac addresses ( !case sensitive! ) from
Code:

# udevinfo -a -p /sys/class/net/eth0|grep addre
   SYSFS{address}=="00:aa:bb:dd:cc:00"
# udevinfo -a -p /sys/class/net/eth1|grep addre
   SYSFS{address}=="00:bb:aa:dd:5c:bb"


p.s. after that unload your eth's modules... (my - skge & ne2k-pci)
Code:

# modprobe -r skge
# modprobe -r ne2k_pci
# rc-update -d net.eth0
# rc-update -d net.eth1
# cd /etc/init.d/
# rm net.eth0 net.eth1
# ln -s net.lo net.net0
# ln -s net.net0 net.lan0
# rc-update -a net.net0
# rc-update -a net.lan0
# /etc/init.d/net.net0 start
# /etc/init.d/net.lan0 start
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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