:: Re: [DNG] systemd-udevd: renamed ne…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Didier Kryn
Datum:  
To: dng
Betreff: Re: [DNG] systemd-udevd: renamed network interface eth0 to eth1
Le 06/10/2017 à 18:12, J. Fahrner a écrit :
> Hello,
> I found the message
> "systemd-udevd[415]: renamed network interface eth0 to eth1"
> in my dmesg log.
> 1. why is there a systemd daemon?
> 2. why is my ethernet device renamed?
>
> I would like it as eth0 and wlan0, not eth1 and wlan1.
>
> Jochen


     If your machine is running Devuan, you shouldn't have Systemd 
running. Maybe "Systemd-udev" is just the new name for "Udev". Since the 
advent of Udev, the interfaces are renamed automatically, by Udev, when 
they are discovered by the kernel. The goal is to have a stable 
interface name attached to any given interface, given that there is no 
guaranty on the order in which the kernel discovers the interfaces. Udev 
remembers the MAC addresses of the interfaces and gives them stable 
numbers. For that, it asks the kernel to rename them. When a yet unknown 
interface is discovered it is given the lowest unused number.


     The rationale behind this is debatable and has been vastly 
discussed on this list, but the fact is that it is working like this.


     If you aren't satisfied witht the current numbering of your 
interfaces, there is a simple way to change the numbering:
     find the file /etc/udev/rules.d/70-persistent-net-rules. You will 
see there is a line per known interface, containing notably its MAC 
address (eg ATTR{address}=="e8:de:27:a8:14:e1") and the name it will be 
given (eg NAME="eth0"). You can change the names and/or the MAC 
addresses, but take care that a name or a MAC address doesn't appear twice.


     You can notice that each rule contains variable names separated 
from the value by == , which is a condition and, at the end, NAME=ethX, 
which is an assignment. Each "rule" is preceded by a comment line 
indicating the PCI address of the device.


     You can also let Udev forget all the MAC addresses it knows and 
restart numbering the existing interfaces from scratch. For this, just 
erase all the lines; only keep the 5 comment lines at the beginning.


     HTH.
                             Didier