View previous topic :: View next topic |
Author |
Message |
brankob Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 29 Apr 2004 Posts: 188
|
Posted: Wed Dec 27, 2006 7:38 am Post subject: How to fix particular ethX to some card permanently ? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
truc Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/128604942846f4cd99d01cb.jpg)
Joined: 25 Jul 2005 Posts: 3199
|
Posted: Wed Dec 27, 2006 8:13 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
brankob Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 29 Apr 2004 Posts: 188
|
Posted: Wed Dec 27, 2006 8:47 am Post subject: |
|
|
True.
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 |
|
![](templates/gentoo/images/spacer.gif) |
PaulBredbury Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/15669254994381f44a81f83.jpg)
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Dec 27, 2006 8:59 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
brankob Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 29 Apr 2004 Posts: 188
|
Posted: Wed Dec 27, 2006 9:52 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|