Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

New Dell Latitude laptop with Fedora 20. One built-in Ethernet interface, one add-in ExpressCard Ethernet interface. I can't seem to get consistent old-style (ethx) interface names.

I've toyed with adding biosdevname=0 and net.ifnames=0 to grub.cfg, creating /etc/udev/rules.d/70-persistent-net.rules, copying /lib/udev/rules.d/71-biosdevname.rules to /etc/udev/rules.d and uncommenting the branch command, removing the biosdevname RPM package, and creating /etc/modules-load.d/ethernet_drivers.conf with the necessary drivers listed in the right order. No combination seems to get the right result.

If the add-in card is not present, it seems fairly easy to get the built-in port named eth0 as I want. But when the add-in card is present, the best I've been able to get is for it to be named eth0 and the built-in port named eth1. Of course, that is backward and inconsistent.

Here is a summary of my results. Removing the biosdevname package did not change these results.

grub2          udev  udev  add-in   Ethernet  Ethernet
biosdevname=0  70    71    present  built-in  add-on  
net.ifnames=0
=============  ====  ====  =======  ========  ========
no             no    mod   no       enp12s0   --
no             no    mod   yes      enp12s0   ens1
no             no    no    no       enp12s0   --
no             no    no    yes      enp12s0   ens1
no             yes   mod   no       enp12s0   --
no             yes   mod   yes      eth0      ens1
no             yes   no    no       enp12s0   --
no             yes   no    yes      eth0      ens1
yes            no    mod   no       eth0      --
yes            no    mod   yes      eth1      eth0
yes            no    no    no       eth0      --
yes            no    no    yes      eth1      eth0
yes            yes   mod   no       eth0      --
yes            yes   mod   yes      eth1      eth0
yes            yes   no    no       eth0      --
yes            yes   no    yes      eth1      eth0

Here's the content of /etc/udev/rules.d/70-persistent-net.rules (just two lines).

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ec:f4:bb:02:44:7a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:3b:00:73:cb", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Here's the content of /etc/modules-load.d/ethernet_drivers.conf (just two lines).

tg3
r8169

And here's the content of /etc/sysconfig/network-scripts/ifcfg-eth?.

TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="cda65a57-3f30-444d-b041-2e77c056a1b1"
ONBOOT="yes"
HWADDR="EC:F4:BB:02:44:7A"
PEERDNS="yes"
PEERROUTES="yes"

TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME="eth1"
UUID=722a5c3b-b6e5-44a8-93fa-e0f070059d8c
ONBOOT=no
HWADDR=00:13:3B:00:73:CB
PEERDNS=yes
PEERROUTES=yes

Syslog seems to show that the drivers are loaded in the correct sequence. There are also some interface renaming messages.

So what's the right way to accomplish my objective?

share|improve this question
4  
See the FreeDesktop Page on PredictableNetworkInterfaceNames, last section –  eyoung100 May 13 at 20:38
    
AFAIK renaming interfaces to ethX was never reliable, making the specific case of swapping eth0 and eth1 fragile. –  Pavel Šimerda May 13 at 20:40
4  
I would resist the urge to try and force the ethX. –  slm May 13 at 20:43
1  
Add biosdevname=0 to grub or edit /lib/udev/rules.d/71-biosdevname.rules from ` ENV{UDEV_BIOSDEVNAME}=="1", GOTO="netdevicename_start" to ENV{UDEV_BIOSDEVNAME}=="1", GOTO="netdevicename_end" to avoid interface rename. –  nwildner May 13 at 21:06
    
Thanks, @Carter. But I need an answer that works. I've tried all those techniques and I don't get the right result. –  Dave Close May 13 at 23:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.