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

predictable network interface names in systemd

· 52CE 我爱测

Recent version of Ubuntu and Debian (stretch) bring a new network interface naming scheme. Now, when updating from a system that's using old style names like "eth0", I'd like to know prior to booting what the new name will be. Ho…

问题原文

原帖链接 · Ralf Hildebrandt · CC BY-SA 3.0

Recent version of Ubuntu and Debian (stretch) bring a new network interface naming scheme.

Now, when updating from a system that's using old style names like "eth0", I'd like to know prior to booting what the new name will be.

How can I do this? Is there a magic invocation of "systemd" I can use to edit /etc/network/interface befor booting (and subsequently losing network connectivity)?

社区高分解答

原帖链接 · GnP · CC BY-SA 3.0

There's two different schemes available: biosdevname vs predictable network interface name.

biosdevname

Biosdevname seems to be the default in ubuntu. It is activated by installing the biosdevname package.

The biosdevname of an interface can be found with:

biosdevname -i eth0

Predictable network interface names

I believe this is the default in Debian stretch, but needs to be explicitly enabled on upgrade from previous releases.

The predictable name for eth0 can be found with:

udevadm test-builtin net_id /sys/class/net/eth0 | grep '^ID_NET_NAME_'

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

资料来源与适用范围

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

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

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