Bug 192084

Summary: eth0 and eth1 are confused
Product: [Fedora] Fedora Reporter: Martin Wyser <martin.wyser>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: dedourek, redhat
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-06-01 07:00:33 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Martin Wyser 2006-05-17 10:51:29 EDT
Description of problem: eth0 and eth1 are confused.


Version-Release number of selected component (if applicable): udev-084-13


Steps to Reproduce:
1. Machine with two Ethernet interfaces x and y, onboot=no
2. Some order in /etc/modprobe.conf (alias eth0 x-driver ...)
3. Boot, interfaces are now down, but drivers are already loaded (that is order
of eth-names is already fixed!).
4. ifup ethx
  
Actual results:

eth-y comes up if udev (by chance) loaded drivers in another order than given in
modprobe.conf


Expected results:

eth-x up, udev should respect order in modprobe.conf.

Additional info:
Comment 1 Stefan Neufeind 2006-05-30 10:22:44 EDT
For me eth0 (fixed) and eth1 (wirerless) are also loaded in the wrong order -
not as defined in modprobe.conf. Is a "dirty quickfix" possible somehow?
Comment 2 Stefan Neufeind 2006-05-30 10:51:57 EDT
Load-order can be fixed with udev-rules. That helped me out:
http://wiki.archlinux.org/index.php/Udev#Mixed_Up_Devices.2C_Sound.2FNetwork_Cards_Changing_Order_Each_Boot

Though I think this bug is still valid (should honour modprobe.conf-information)
this works for now.
Comment 3 Harald Hoyer 2006-05-31 08:55:37 EDT
I would bind the interface name to the MAC Address.. Either with
system-config-network or by hand with the HWADDR parameter.
Comment 4 Martin Wyser 2006-05-31 11:02:23 EDT
Both interfaces are down, and "ifup eth0" causes eth1 to come up, and eth0 to
stay down - this is definitely a bug.

You probably mean setting HWADDR=... in
/etc/sysconfig/network-scripts/ifcfg-eth*, by hand or with
system-config-network.  But this method will set the HWADDR of the interface,
and will not influence the order in which the interfaces are named!  In fact, in
the initial installation, the configuration was like this, and a 3com and an
Intel interface would come up with HWADDRs swapped - very confusing, but most
importantly, does not work reliably. The word "bind" is ambiguous here.

I tried using netdev= kernel parameters, but this did not work.  I also tried
the /etc/udev/rules.d/10-network.rules implied by the archlinux wiki link
(thanks Stefan), but to no avail.  I have not tried the MODULES method, due to
lack of rc.conf.

I am not quite sure if the bug is in udev, but I am sure it is a bug.
Comment 5 Harald Hoyer 2006-06-01 07:00:33 EDT
if "binding" does not work, then initscripts are to be blamed. This worked in
FC3, FC4 and I am pretty sure, it should work in FC5 also.
Comment 6 ginn wang 2006-06-02 03:26:06 EDT
(In reply to comment #4)
> Both interfaces are down, and "ifup eth0" causes eth1 to come up, and eth0 to
> stay down - this is definitely a bug.
> You probably mean setting HWADDR=... in
> /etc/sysconfig/network-scripts/ifcfg-eth*, by hand or with
> system-config-network.  But this method will set the HWADDR of the interface,
> and will not influence the order in which the interfaces are named!  In fact, 
in
> the initial installation, the configuration was like this, and a 3com and an
> Intel interface would come up with HWADDRs swapped - very confusing, but most
> importantly, does not work reliably. The word "bind" is ambiguous here.
> I tried using netdev= kernel parameters, but this did not work.  I also tried
> the /etc/udev/rules.d/10-network.rules implied by the archlinux wiki link
> (thanks Stefan), but to no avail.  I have not tried the MODULES method, due to
> lack of rc.conf.
> I am not quite sure if the bug is in udev, but I am sure it is a bug.

try this rule 
SUBSYSTEM=="pci", SYSFS{class}=="0x020000",             OPTIONS="ignore_device"
in /etc/udev/rules.d/10-local.rules
Comment 7 Martin Wyser 2006-06-06 10:54:36 EDT
Yes, this works, thanks Ginn.

These solutions worked for me (different cards have different drivers):

1. probe driver for eth0 in rc.sysinit before udev is started
2. have udev ignore network cards (ifup will probe in right order)
3. use netdev=irq,io,eth0 and netdev=...,eth1 kernel parameters
4. HWADDR in ifcfg-eth...

3. and 4. will probably also work if the different cards use the same driver.

I have at least one machine where I cannot predict what eth0 and eth1 will be,
unless one of the methods above is used.  But if Harald thinks this is not a
bug, I won't spend more time.