Dummy network interface with NetworkManager

Boris HUISGEN

The creation of a dummy
network interface allows to simplify the management of the local services of a host by allowing them to bind to a static IP address, and by extension to have a virtual network.
To add a dummy interface with NetworkManager, a new connection must be created:
$ sudo vim /etc/Network/Manager/dummy
[connection]
id=dummy
uuid=6ad57828-f873-4e4c-9ebd-ac3f49b99cbe
type=dummy
interface-name=dummy0
permissions=
timestamp=1520895027
[ipv4]
address1=169.254.1.1/24
dns-search=
method=manual
[ipv6]
addr-gen-mode=eui64
dns-search=
method=ignore
The new configuration can be applied:
$ sudo nmcli connection reload
The network interface should be available:
$ ip addr show dummy0
5: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 26:ed:f7:10:de:ba brd ff:ff:ff:ff:ff:ff
inet 169.254.1.1/24 brd 169.254.1.255 scope link noprefixroute dummy0
valid_lft forever preferred_lft forever
inet6 fe80::24ed:f7ff:fe10:deba/64 scope link
valid_lft forever preferred_lft forever