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:
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
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
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?