UDEV rules ignored for ethernet (eth*) devices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
udev (Ubuntu) |
Expired
|
Low
|
Unassigned |
Bug Description
Binary package hint: yelp
Hello,
I'm trying to set my network interfaces so that they don't get random every boot.
(eg assign eth0 to a network interface with a given MAC addr, and eth1 to the other one)
I threw in a udev rule (in fact just modified the rules that was automatically generated and set the ethX in it) but the system ignores my udev rule.
Here is all the info :
$cat /etc/udev/
# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-
# file; however you are also free to add your own entries.
# PCI device 0x11ab:0x4362 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}
# PCI device 0x11ab:0x4362 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}
$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:18:f3:cd:83:2c
UP BROADCAST MULTICAST MTU:1500 Metric:1
Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
eth1 Link encap:Ethernet HWaddr 00:18:f3:cd:73:8c
inet adr:192.168.0.130 Bcast:192.168.0.255 Masque:
adr inet6: fe80::218:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:1101 erreurs:0 :0 overruns:0 frame:0
TX packets:1156 errors:0 dropped:0 overruns:0 carrier:0
Octets reçus:682128 (682.1 KB) Octets transmis:336863 (336.8 KB)
We see that the MAC addr 00:18:f3:cd:83:2c should have eth1 according to udev, but in fact it gets eth0
udevadm info gets me nothing wrong about my rules selection criteria:
$ udevadm info -a -p /sys/class/net/eth0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/
KERNEL=="eth0"
SUBSYSTEM=
DRIVER==""
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{type}=="1"
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{
ATTR{
looking at parent device '/devices/
KERNELS=
SUBSYSTEMS=
DRIVERS=="sky2"
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
ATTRS{
I am on Karmic 64
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
$ uname -a
Linux zakhar-desktop 2.6.31-21-generic #59-Ubuntu SMP Wed Mar 24 07:28:27 UTC 2010 x86_64 GNU/Linux
$ lspci
(.....)
03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 20)
04:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 20)
$dmesg
(...)
[ 1.738451] sky2 driver version 1.23
[ 1.738545] sky2 0000:04:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 1.738560] sky2 0000:04:00.0: setting latency timer to 64
[ 1.738597] sky2 0000:04:00.0: Yukon-2 EC chip revision 2
[ 1.738673] alloc irq_desc for 30 on node 0
[ 1.738676] alloc kstat_irqs on node 0
[ 1.738690] sky2 0000:04:00.0: irq 30 for MSI/MSI-X
[ 1.739317] sky2 eth0: addr 00:18:f3:cd:83:2c
[ 1.739381] sky2 0000:03:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 1.739392] sky2 0000:03:00.0: setting latency timer to 64
[ 1.739420] sky2 0000:03:00.0: Yukon-2 EC chip revision 2
[ 1.739495] alloc irq_desc for 31 on node 0
[ 1.739497] alloc kstat_irqs on node 0
[ 1.739508] sky2 0000:03:00.0: irq 31 for MSI/MSI-X
[ 1.740214] sky2 eth1: addr 00:18:f3:cd:73:8c
Here we see on dmesg that it does NOT care of what is in udev. It takes the first interface, which here is the one finishing by 83:2c, and gives it eth0 although udev says it should be eth1
The problem is interfaces are presented randomly by my BIOS to the system according to the moment when they are ready. Yesterday, they were reversed, and thus got right... but it is just randomly right.
This is quite bad as I'd like to use this PC as a router, and thus I have to know which interface is eth0 and which is eth1.
I suppose this bug was never spotted (or maybe it's a "feature"!) because you need a stupid BIOS (like mine) that gives the ethernet devices randomly to the O.S.
If the BIOS gave them in a reliable order, there should still be a UDEV bug, but I might not have noticed it. And if I did, it would have been easy to do the workaround.
Best regards.
ProblemType: Bug
Architecture: amd64
Date: Sat Jun 12 10:18:40 2010
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/yelp
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
NonfreeKernelMo
Package: yelp 2.28.0-0ubuntu2
ProcEnviron:
LANG=fr_FR.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: yelp
Uname: Linux 2.6.31-22-generic x86_64
XsessionErrors:
(gnome-
(nautilus:2669): Eel-CRITICAL **: eel_preferences
(polkit-
(thunderbird-
(firefox:3055): GLib-WARNING **: g_set_prgname() called multiple times
not a yelp issue, let's assign it to udev for now.