I am trying to create a dummy network interface on a Ubuntu 18.04 server. Here is how I would do it on my previous Ubuntu 16.04 servers:

In /etc/network/interfaces.d/dummy.cfg, write: auto dummy0 iface dummy0 inet static address netmask And then add source /etc/network/interfaces.d/dummy.cfg in /etc/network/interfaces/

From what I understand, Ubuntu 18.04 does not use /etc/network/interfaces anymore, we should use netplan instead. Apparently netplan does not support the creation of virtual interface (!) https://bugs.launchpad.net/ubuntu/+source/nplan/+bug/1743200.

I can create the dummy interface with the iproute2 toolkit instead: $ ip link add dummy0 type dummy $ ip addr add dev dummy0 $ ip link set dummy0 up But this interface will disappear after reboot, as one would expect.

How can I create such a dummy network interface that will persist after reboot?


I had the same problem on 18.04 server and directly used the systemd-networkd way of configuring interfaces:

I created 2 files in /etc/systemd/network/:

  1. 10-dummy0.netdev

  2. 20-dummy0.network


On boot the dummy interface is created automatically with IPv4 and IPv6 addresses an is shown in ip addr . Also systemctl restart systemd-networkd should create the interface.

I filed a bug on netplan, please support: https://bugs.launchpad.net/netplan/+bug/1774203

The docs:

https://www.freedesktop.org/software/systemd/man/systemd.netdev.html# https://www.freedesktop.org/software/systemd/man/systemd.link.html# https://www.freedesktop.org/software/systemd/man/systemd.network.html#

| improve this answer | |
  • On 16.04, I needed to systemctl enable systemd-networkd before the restart. – J P Nov 4 '19 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.