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.
Best Answer
It's actually really simple. When running
ip link add dummy1 type dummy
,ip
will automatically load thedummy
kernel module (it did not do that in earlier versions). That module has a parameternumdummies
, which configures how many dummy devices to create automatically and which defaults to 1.Thus, loading the module already creates a
dummy0
network interface withoutip
knowing.ip
then tries to create another interface with the same name, which fails with the error messageFile exists
.