Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to fix particular ethX to some card permanently ?
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
brankob
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 188

PostPosted: Wed Dec 27, 2006 7:38 am    Post subject: How to fix particular ethX to some card permanently ? Reply with quote

There was some debate in GWN about this. Some time ago one could count on modules to be loaded as listed in /etc/modules.autoload/kernel-2.6, but that has changed.

Then Stephen Bennet suggested writing udev rules for cards just as for any other peripheral that has to emerge under the some particular user-defined name.

Trouble is, this doesn't work for me. I have Athlon K7 with via-rhine on board, two Gig-E Realtek 8169 cards, one 100 Mbit Realtek 8139 and two Ralink RT2500 wireless cards.

All cards are recognised by their drivers, but they end up with some default name instead of those that I have defined in /etc/udev/rules.d/10_ethernet.

I have tried to check documentation for whispering the data to kernel modules at load time, but there is no universal data format for all drivers an 90% of this is undocumented anyway...

KErnel used is gentoo-sources-2.6.19-r2 and 2.6.17-r4 (tried both of them) - both were compiled with and without "automatic module load" option and at least from the network driver modules perspective both behave the same- modules get load whether I list them in modules.autoload/kernel-2.6 or not, even if net.eth0/1/2/3 are not in any runlevel...


Any suggestions ?
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed Dec 27, 2006 8:13 am    Post subject: Reply with quote

shouldn't this file /etc/udev/rules.d/10_ethernet be suffixed with .rules ?

Can we see this file? and other interesting info?
_________________
The End of the Internet!
Back to top
View user's profile Send private message
brankob
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 188

PostPosted: Wed Dec 27, 2006 8:47 am    Post subject: Reply with quote

True. :oops:

I can't believe I had wated few hours not spotting such stupid mistake...

Still I have now problems with renaming cards. Udev reports errors like "cant rename eth1 to eth3- device doesn't exist".

Which seems plausible, since all drivers are compiled as modules, module autoloading by kernel os off and udev starts before script for module loading.

So what should work ? Compiled_in drivers or modules with kernel autoloading ?

Thanks for your help...
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Dec 27, 2006 8:59 am    Post subject: Reply with quote

Snippet from my /etc/udev/rules.d/10-local.rules, for my 2 network cards (formerly eth0 & eth1) and my wireless card (formerly wlan0):
Code:
# http://www.reactivated.net/writing_udev_rules.html#example-netif
# Match based on MAC address:
# udevinfo -a -p /sys/class/net/eth0 | grep -i address
# udevinfo -a --name /dev/ttyUSB0
# http://forums.gentoo.org/viewtopic-t-489863.html
SUBSYSTEM=="net", ATTR{address}=="00:18:f3:64:8d:82", NAME="lan"
SUBSYSTEM=="net", ATTR{address}=="00:18:f3:64:6a:c4", NAME="inet"
KERNEL=="wlan*", ATTR{address}=="00:15:af:07:a0:80", NAME="wlan"

Udev performs a modprobe itself.
Back to top
View user's profile Send private message
brankob
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 188

PostPosted: Wed Dec 27, 2006 9:52 am    Post subject: Reply with quote

After recompiling kernel with automatic module loading it seems to be working, although I did probably tweak some other things so I can't be sure that it is that one that was crucial.

Eth0/1/2/3 seem to be on the right cards, but I didn't have the time to try couple of physical card permutations to see if eth's would follow them as they should...
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