On Tue, Apr 18, 2006 at 02:29:05 +1000, John O'Hagan wrote: > On Mon, 17 Apr 2006 11:59 pm, Florian Kulzer wrote: > > [...] > > > > > You can either use mapping in /etc/network/interfaces or write udev > > rules to control the assignment of the names. A nice summary was given a > > while ago by Seeker5528: > > http://lists.debian.org/debian-user/2006/01/msg00075.html > > > > I always had trouble when I tried to assign ethX names with the udev > > rules, so I use a slightly modified approach: > > http://lists.debian.org/debian-user/2006/01/msg03434.html > > > > [...] > > I've been trying to solve this minor annoyance on an up-to date testing > system > ever since udev. I think I have followed the approaches you refer to above; > but I was using eth* names and found that about 10% of the time, interface > names were scrambled, as you mention in your linked post. > > I just tried using this /etc/udev/rules.d/10_local_rules (a link > to /etc/udev/local_rules): > > KERNEL=="eth*", SYSFS{address}=="00:40:ca:c0:d9:a6", > NAME="ethernet" > KERNEL=="eth*", SYSFS{address}=="00:0c:f1:15:c6:e3", > NAME="wireless" > KERNEL=="eth*", SUBSYSTEM=="ieee1394", NAME="firewire" > > however, it does not succeed in renaming the interfaces as I expected. > > Is there something I'm missing?
Your rules look OK to me. I checked my laptop again and mine are equivalent, but I have now linked them as "025_local_rules". I would not expect that to make any difference and I don't remember why I changed it. So let's compare a few more things. When I remove my additional rules and reboot the laptop, I find the following situation: $ ls -l /sys/class/net/ total 0 drwxr-xr-x 3 root root 0 2006-04-17 19:59 eth0 drwxr-xr-x 4 root root 0 2006-04-17 19:59 eth1 drwxr-xr-x 3 root root 0 2006-04-17 19:59 eth2 drwxr-xr-x 3 root root 0 2006-04-17 21:59 lo This should be comparable to what you see as long as your rules are not working. I then relinked my rules and ran udevtest on the three devices: $ udevtest /class/net/eth0 main: looking at device '/class/net/eth0' from subsystem 'net' wait_for_sysfs: file '/sys/class/net/eth0/address' appeared after 0 loops udev_rules_get_name: rule applied, 'eth0' becomes 'lan' rename_net_if: changing net interface name from 'eth0' to 'lan' udev_add_device: renamed netif to 'lan' main: run: 'socket:/org/freedesktop/hal/udev_event' main: run: 'socket:/org/kernel/udev/monitor' main: run: '/bin/sh -c '/lib/udev/net.agent &'' main: run: 'udev_run_hotplugd net' main: run: 'udev_run_devd net' $ udevtest /class/net/eth1 main: looking at device '/class/net/eth1' from subsystem 'net' wait_for_sysfs: file '/sys/class/net/eth1/address' appeared after 0 loops udev_rules_get_name: rule applied, 'eth1' becomes 'wlan' rename_net_if: changing net interface name from 'eth1' to 'wlan' udev_add_device: renamed netif to 'wlan' main: run: 'socket:/org/freedesktop/hal/udev_event' main: run: 'socket:/org/kernel/udev/monitor' main: run: '/bin/sh -c '/lib/udev/net.agent &'' main: run: 'udev_run_hotplugd net' main: run: 'udev_run_devd net' $ udevtest /class/net/eth2 main: looking at device '/class/net/eth2' from subsystem 'net' wait_for_sysfs: file '/sys/class/net/eth2/address' appeared after 0 loops udev_rules_get_name: rule applied, 'eth2' becomes 'modem' rename_net_if: changing net interface name from 'eth2' to 'modem' udev_add_device: renamed netif to 'modem' main: run: 'socket:/org/freedesktop/hal/udev_event' main: run: 'socket:/org/kernel/udev/monitor' main: run: '/bin/sh -c '/lib/udev/net.agent &'' main: run: 'udev_run_hotplugd net' main: run: 'udev_run_devd net' What do you see when you run udevtest? You can run it as a normal user and it will not change anything in the system, even if it claims otherwise. Afterwards I ran as root # udevsynthesize # invoke-rc.d udev restart I did not get any error messages, but the names of the devices were not changed. (Network devices are somewhat special in udev.) After I rebooted once more I found: $ ls -l /sys/class/net/ total 0 drwxr-xr-x 3 root root 0 2006-04-17 20:24 lan drwxr-xr-x 3 root root 0 2006-04-17 22:24 lo drwxr-xr-x 3 root root 0 2006-04-17 20:24 modem drwxr-xr-x 4 root root 0 2006-04-17 20:24 wlan If you try the same maybe you'll notice something which will tell us were things go wrong. -- Regards, Florian -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]