[lfs-dev] The joys of systemd

Armin K. krejzi at email.com
Sat Apr 5 16:56:25 PDT 2014

On 04/06/2014 01:25 AM, Armin K. wrote:
> On 04/05/2014 11:41 PM, Bruce Dubbs wrote:
>> Now I come to setting up udev and networking.  I have the rule:
>> /etc/udev/rules.d/70-persistent-net.rules
>> The contents are
>> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \ 
>> ATTR{address}=="00:11:11:79:4d:17", ATTR{dev_id}=="0x0", \
>> ATTR{type}=="1", KERNEL=="enp*", NAME="eth0"
>> It doesn't work in udev-211, although it did using udev-208.  I can add 
>> net.ifnames=0 to the kernel command line and get eth0, but why doesn't 
>> the custom udev rule work?
>> Actually, when I run
>> # udevadm test-builtin net_id /sys/class/net/enp0s25
>> Then the rule kicks in and renames the interface, but it doesn't seem to 
>> run automatically.  Armin, do you have any insight?
>>    -- Bruce
> I've just tried this one:
> $ cat /etc/udev/rules.d/99-network.rules
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="correct
> mac address goes here", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth1"
> The trick is, LFS uses /etc/udev/rules.d/70-persistent-net.rules but
> systemd udev has /lib/udev/rules.d/80-net-setup-link.rules. The latter
> one appears to be ran after persistent-net.rules and it's the one that
> does renaming to enpwhatever. That's why 99-network.rules worked for me.

A correction on this one. Name matters not since it appears that rules
in /etc/udev/rules.d are run after all rules in /lib/udev/rules.d have
been ran. The problem was KERNEL=="..." line that was present in your
rule but not in mine.

Note: My last name is not Krejzi.

More information about the lfs-dev mailing list