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:
iface dummy0 inet static
And then add
source /etc/network/interfaces.d/dummy.cfg in
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 192.168.98.1/24 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?