upgrade to pve 7 renamed interfaces because of /etc/systemd/network/99-defaults.link

dirks

Member
Feb 6, 2016
26
19
23
43
On our nodes interfaces got renamed from predictable to old naming scheme, i.e. eno1 -> eth0, eno33p0 -> eth3 … But why? No /dev/null links in /etc/systemd/network. No net.ifnames=0 in /proc/cmdline. No … wait, why is there a /etc/systemd/network/99-default.link file. That is new. Contents:

Code:
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Link]
NamePolicy=keep kernel database onboard slot path
MACAddressPolicy=persistent

That is identical to what was in /usr/lib/systemd/network/99-default.link before the upgrade. It is a new systemd version so let's check what is in /usr/lib/systemd/network/99-default.link after the upgrade

Code:
#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Match]
OriginalName=*

[Link]
NamePolicy=keep kernel database onboard slot path
AlternativeNamesPolicy=database onboard slot path
MACAddressPolicy=persisten

Ok, Match section and the AlternativeNamesPolicy in the Link section Some iterations of modifying /etc/systemd/network/99-default.link and rebooting revealed: adding the Match section brings back the old behavior. Strange

From https://www.freedesktop.org/software/systemd/man/systemd.link.html
[Match] Section Options
A link file is said to match a device if all matches specified by the [Match] section are satisfied. When a link file does not contain valid settings in [Match] section, then the file will match all devices and systemd-udevd warns about that. Hint: to avoid the warning and to make it clear that all interfaces shall be matched, add the following:

OriginalName=*
The following keys are accepted:

apt-file search /etc/systemd/network/99-default.link is empty. I wonder what creates /etc/systemd/network/99-default.link what is the reasoning here to deviate from upstream? To add to the confusion there is no /run/systemd/network path?
 
Have you ever found the reason behind all this? I'm experiencing the same issue.

I have 'the old naming scheme' on my Proxmox 8 installation, which is only a couple of months old. The worst part is that sometimes it's referred to as eth0 and sometimes (after reboot) as eth1, while the other NIC named eno1 always remains consistent...