RE: Ethernet adapters logically reversed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Bob wrote:
>> Hi there,
>> 
>> I have a fedora 5 system with the latest updates.  This machine has
three
>> network adapters, each of which uses a different hardware driver.  
>> 
>> $ cat /etc/modprobe.conf
>> 
>> alias usb-controller uhci-hcd
>> alias eth0 3c59x
>> alias eth1 e100
>> alias eth2 8139too
>> 
>> 
>> When I first boot, the eth0 and eth2 interfaces are logically
attached to
>> the wrong controllers.  In /var/log/dmesg, the Realtek controller is
>> loaded
>> first, and attaches to eth0 and the 3Com controller loads last and
>> attaches
>> to eth2.  If I stop the network service, remove the 3c59x and 8139too
>> modules and restart the network, things get configured correctly.  Is
>> there
>> a way to get things to work right when first booted?
>> 
> You can try editing the /etc/sysconfig/network-scripts/ifcfg-eth?
> files and make sure the HWADDR= lines have the correct MAC address
> for the interfaces you want.
>
> Mikkel

This is the way I used to do it too - then I found-out it only works if
"ONBOOT=yes"... otherwise the adapter sits there with the wrong name and
never gets renamed to the name you want it to be until you bring the
interface up.

Fortunately, there's a few ways around this;

1) Write a boot script that uses ifrename:
http://www.die.net/doc/linux/man/man8/ifrename.8.html

2) Write some udev rules...
[root@test-pes ~]# cat /etc/udev/rules.d/50-udev.rules
# There are a number of modifiers that are allowed to be used in some of
the
# fields.  See the udev man page for a full description of them.
#
# default is OWNER="root" GROUP="root", MODE="0600"
#

# all block devices
SUBSYSTEM=="block",             GROUP="disk", MODE="0640"

- SNIP -
- This is all the default stuff -

KERNEL=="dvb*", PROGRAM=="/etc/udev/scripts/dvb.sh %k", NAME="%c"

# Added lines start here
KERNEL=="eth*", SYSFS{address}=="aa:bb:cc:dd:ee:ff", NAME="eth1"
KERNEL=="eth*", SYSFS{address}=="00:11:22:33:44:55", NAME="eth0"
[root@test-pes ~]#

NOTE: MAC addresses are listed for SYSFS portion should be unique to
each and every network interface.  They are CASE SENSITIVE (don't ask me
why...)

Just to be safe, I use the second method AND put it in the ifcfg-ethX
files as well.

- Gareth 

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux