[systemd-devel] Antw: [EXT] Upgraded multiple systems to systemd 249.3 and all had eth1 not started / configured

Amish anon.amish at gmail.com
Tue Aug 17 04:44:32 UTC 2021


On 16/08/21 7:46 pm, Michael Biebl wrote:
> How exactly do you rename your interfaces? Do you use a udev rule? Can
> you post those scripts/rules?

I had already posted this in PS of my first email. It is two step process.

Here it is again:

Little about tmpeth* naming.

Some old scripts that we have expect interface names starting with eth. 
But those names are not predictable.

So to get predictable names starting with eth*, first I temporarily 
rename all interface with tmpeth*. This is done via udev rules.

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:XX", 
NAME="tmpeth0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:YY", 
NAME="tmpeth1"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:ZZ", 
NAME="tmpeth2"

Then I have a small service (script) which runs before 
network-pre.target to convert these names back to eth*

#search for network interface with name starting from "tmpeth" and 
rename them to "eth"
/usr/bin/find /sys/class/net -maxdepth 1 -name "tmpeth[0-9]" -type l 
-printf "%f\n" | while read tmpiface; do /usr/bin/ip link set dev 
"$tmpiface" name "$(echo $tmpiface | sed s/tmpeth/eth/)"; done

This ensures that I have predictable names starting with eth*. And it is 
working fine from 2-3 years. Even with current issue, name assignment is 
working fine.

Amish.



More information about the systemd-devel mailing list