Bug 989099 - persistent-net.rules does not work for eth
persistent-net.rules does not work for eth
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
: Reopened
: 989212 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-27 10:30 EDT by Nerijus Baliūnas
Modified: 2013-08-19 09:43 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-19 09:43:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
udevadm output (7.81 KB, text/plain)
2013-07-29 20:05 EDT, Nerijus Baliūnas
no flags Details
udevadm eth1 output (7.91 KB, text/plain)
2013-08-10 19:13 EDT, Nerijus Baliūnas
no flags Details

  None (edit)
Description Nerijus Baliūnas 2013-07-27 10:30:10 EDT
I have in /etc/udev/rules.d/70-persistent-net.rules:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d4:3d:7e:02:xx:xx", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:0e:xx:xx", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

But when booting:
r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
r8169 0000:02:00.0 eth0: RTL8168evl/8111evl at 0xf7e16000, d4:3d:7e:02:xx:xx, XID 0c900800 IRQ 44
r8169 0000:02:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
e1000: Copyright (c) 1999-2006 Intel Corporation.
e1000 0000:04:01.0 eth1: (PCI:33MHz:32-bit) 00:1b:21:0e:xx:xx
e1000 0000:04:01.0 eth1: Intel(R) PRO/1000 Network Connection

As you can see, d4:3d:7e:02:xx:xx is eth0, while it should be eth1.
The rule for USB wifi device in 70-persistent-net.rules works. Renaming to 99-persistent-net.rules did not help.
The same setup worked correctly in F18.
Comment 1 Kay Sievers 2013-07-27 10:37:09 EDT
Interface names can no longer be swapped, they need different names not
clashing with the kernel namespace. It is not expected to work in Fedora 19
or any newer release.

Edit the file to use any name other than eth0/1. Remove the rules and use
the new default names, or install biosdevname.

http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
Comment 2 Nerijus Baliūnas 2013-07-28 08:35:55 EDT
I removed the rules (deleted the file completely), but after reboot interface names were still eth0 and eth1. How to get the new names?
Comment 3 Kay Sievers 2013-07-28 10:32:58 EDT
*** Bug 989212 has been marked as a duplicate of this bug. ***
Comment 4 Kay Sievers 2013-07-28 10:38:15 EDT
Hmm, what does (running as root):
  udevadm test /sys/class/net/eth0
print?
Comment 5 Nerijus Baliūnas 2013-07-29 20:04:50 EDT
# udevadm test /sys/class/net/eth0
calling: test
version 204
...
read rules file: /usr/lib/udev/rules.d/80-net-name-slot.rules
read rules file: /etc/udev/rules.d/80-persistent-net.rules
...
PROGRAM '/lib/udev/rename_device' /usr/lib/udev/rules.d/60-net.rules:1
starting '/lib/udev/rename_device'
'/lib/udev/rename_device' [9468] exit with return code 0
IMPORT builtin 'net_id' /usr/lib/udev/rules.d/75-net-description.rules:6
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/75-net-description.rules:12
NAME 'enp2s0' /usr/lib/udev/rules.d/80-net-name-slot.rules:12
RUN '/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/$name --prefix=/proc/sys/net/ipv4/neigh/$name --prefix=/proc/sys/net/ipv6/conf/$name --prefix=/proc/sys/net/ipv6/neigh/$name' /usr/lib/udev/rules.d/99-systemd.rules:52
changing net interface name from 'eth0' to 'enp2s0'
error changing net interface name eth0 to enp2s0: Device or resource busy

Will attach full command output.
Comment 6 Nerijus Baliūnas 2013-07-29 20:05:43 EDT
Created attachment 780185 [details]
udevadm output
Comment 7 Nerijus Baliūnas 2013-07-29 20:16:59 EDT
Please note - I do have /etc/udev/rules.d/80-persistent-net.rules, which is the same as in this bug's description except eth0 and eth1 are swapped.

But with or w/o it after reboot the interface names are the same - eth0 and eth1.
Comment 8 Kay Sievers 2013-07-29 21:01:02 EDT
(In reply to Nerijus Baliūnas from comment #7)
> Please note - I do have /etc/udev/rules.d/80-persistent-net.rules, which is
> the same as in this bug's description except eth0 and eth1 are swapped.
> 
> But with or w/o it after reboot the interface names are the same - eth0 and
> eth1.

The rules might fail any random time in the future, when the drivers are
loaded in a different order. It's not safe to use them. Userspace cannot
reliably rename devices in the same namespace the kernel uses to create new
devices.

(In reply to Nerijus Baliūnas from comment #2)
> I removed the rules (deleted the file completely), but after reboot
> interface names were still eth0 and eth1. How to get the new names?

By removing your rules file. If custom names are specified, the default names
will not be used.
Comment 9 Nerijus Baliūnas 2013-07-29 21:20:18 EDT
As I told before - I removed the rules file, but dmesg after reboot still showed the names as eth0 and eth1, but not enp2s0 or similar.
Comment 10 Kay Sievers 2013-07-29 21:26:45 EDT
(In reply to Nerijus Baliūnas from comment #9)
> As I told before - I removed the rules file, but dmesg after reboot still
> showed the names as eth0 and eth1, but not enp2s0 or similar.

The requested test in comment 4 shows that the rules file is still there,
that's why I assume that is the reason for the default names not getting active.

The output shows that the names are properly composed, just not applied.

If you want to debug it further, please repeat the test without the rules file.
Comment 11 Nerijus Baliūnas 2013-08-10 19:12:02 EDT
The same "error changing net interface name eth0 to enp2s0: Device or resource busy" w/o the rules file. But ifconfig eth0 down helped - after it was renamed correctly:

changing net interface name from 'eth0' to 'enp2s0'
renamed netif to 'enp2s0'
changed devpath to '/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/enp2s0'
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/enp2s0

But running udevadm test /sys/class/net/eth1 does not rename the PCI e1000 card (output attached). Why?
Comment 12 Nerijus Baliūnas 2013-08-10 19:13:18 EDT
Created attachment 785287 [details]
udevadm eth1 output
Comment 13 Zbigniew Jędrzejewski-Szmek 2013-08-19 08:40:03 EDT
(In reply to Nerijus Baliūnas from comment #11)
Comment 14 Kay Sievers 2013-08-19 09:43:59 EDT
Busy interfaces can never be renamed, that was always the case. If something
uses the device already, brings it up, it is too late to rename it.

Seems you have a ifcfg file telling the device should be named eth1:
  NAME 'eth1' /usr/lib/udev/rules.d/60-net.rules:1

Note You need to log in before you can comment on or make changes to this bug.