大网数据广告活动
服务器运维问答

Renaming networking interface through systemd-networkd not working in upgraded Ubuntu 18.04

· 52CE 我爱测

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…

问题原文

原帖链接 · 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:

  1. /lib/udev/rules.d/71-biosdevname.rules

    This is an old-times relict of renaming network interfaces in Ubuntu. It has to be deleted.

  2. /etc/udev/rules.d/80-net-setup-link.rules

    This was set-up shadowing /lib/udev/rules.d/80-net-setup-link.rules, which (among others) also applies configuration from systemd-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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-05-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。