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

What is special about the dummy interface dummy0?

· 52CE 我爱测

I'm creating dummy interfaces to set up dynamic routing, which all works fine. But I found one curious detail I can't explain: For some reason, when creating a dummy interface with the name dummy0 , I get an error message, even t…

问题原文

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

I'm creating dummy interfaces to set up dynamic routing, which all works fine. But I found one curious detail I can't explain: For some reason, when creating a dummy interface with the name dummy0, I get an error message, even though the interface is created correctly and works, while when using another name, no error message is shown:

root@sdsdd:~# ip link
[lo and eth0 not shown]
root@sdsdd:~# ip link add dummy0 type dummy
RTNETLINK answers: File exists
root@sdsdd:~# ip link add dummy1 type dummy
root@sdsdd:~# ip link
[lo and eth0 not shown]
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default 
    link/ether c6:9c:73:8b:17:77 brd ff:ff:ff:ff:ff:ff
4: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default 
    link/ether be:50:5b:53:99:ab brd ff:ff:ff:ff:ff:ff

What gives? What makes the name dummy0 special? I could not find any mention of it anywhere in /etc/network/interfaces*. I tried this on Debian 8 and Ubuntu 16.04 with the same result.

已采纳解答

原帖链接 · Feuermurmel · CC BY-SA 4.0

It's actually really simple. When running ip link add dummy1 type dummy, ip will automatically load the dummy kernel module (it did not do that in earlier versions). That module has a parameter numdummies, which configures how many dummy devices to create automatically and which defaults to 1.

Thus, loading the module already creates a dummy0 network interface without ip knowing. ip then tries to create another interface with the same name, which fails with the error message File exists.

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

资料来源与适用范围

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

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

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