在升级到Debian10 (Buster)时,注意到公共eth0网络接口现在称为AWS EC2上的ens5。
是否有一种方法可以创建一个符号链接或类似的方法,以便具有eth0硬编码的遗留应用程序可以继续引用eth0和新的ens5网络接口?
发布于 2021-02-24 05:46:29
为此,您可以尝试使用systemd.link并将ens5重命名为eth0。接口可以基于不同的标准进行匹配,例如MAC地址、PCI插槽、原始名称等,然后您可以链接它,这意味着您可以对它执行不同的操作,包括重命名它。
下面是一个示例:
Example: /etc/systemd/network/10-eth.link
This example assigns the fixed name "eth0" to the interface with the MAC address 00:a0:de:63:7a:e6:
[Match]
MACAddress=00:a0:de:63:7a:e6
[Link]
Name=eth0更多信息可在以下Debian网页中找到:https://wiki.debian.org/NetworkInterfaceNames或systemd.link手册页:https://manpages.debian.org/buster/udev/systemd.link.5.en.html
https://serverfault.com/questions/1054793
复制相似问题