问题原文
原帖链接 · Jens Erat · CC BY-SA 4.0
In an Ubuntu 18.04 server, I was not able to rename network interfaces through proven config-management-applied systemd-networkd configuration working on all other servers.
The only difference I see between servers originally set-up by configuration management and this partially hand-petted machine is that the Ubuntu server has been upgraded from at least 14.04, maybe even 12.04.
已采纳解答
原帖链接 · Jens Erat · CC BY-SA 4.0
Investigating initrd and comparing with a server that worked, two obvious differences appeared through upgrading Ubuntu:
/lib/udev/rules.d/71-biosdevname.rulesThis is an old-times relict of renaming network interfaces in Ubuntu. It has to be deleted.
/etc/udev/rules.d/80-net-setup-link.rulesThis was set-up shadowing
/lib/udev/rules.d/80-net-setup-link.rules, which (among others) also applies configuration fromsystemd-networkd. It contains a message indicating some miss-interpreted setup as VM (actually, this is a bare metal server):# This machine is most likely a virtualized guest, where the old persistent # network interface mechanism (75-persistent-net-generator.rules) did not work. # This file disables /lib/systemd/network/99-default.link to avoid # changing network interface names on upgrade. Please read # /usr/share/doc/udev/README.Debian.gz about how to migrate to the currently # supported mechanism.This file also has to be deleted.
A final update-initramfs -u && reboot results in properly renamed network interfaces.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
