How to configure interface in UP state without IP address in networkd

George Shuklin
OpsOps
Published in
Mar 17, 2023

Why do you need this? Because you have something different managing IP address on it. For example, pacemaker.

So, you need to create dummy interface and make it UP with help of systemd-networkd.

It’s a bit more complicated then I expected, because networkd leaves newly created netdev in DOWN state.

You need to files: netdev:

/etc/systemd/network/dummy0.netdev

[NetDev]
Name=dummy0
Kind=dummy

and /etc/systemd/network/dummy0.network

[Match]
Name=dummy0
[Network]
LinkLocalAddressing=no
KeepConfiguration=static

Basically, you need to declare ‘network’ section to make it up, but you don’t want systemd to mess up with anything on that interface, so you need to set KeepConfiguration to appropriate value (see man systemd.network), in my case static is enough. I also don’t want to see link-local address there, so LinkLocalAddressing=no.

--

--

George Shuklin
OpsOps

I work at Servers.com, most of my stories are about Ansible, Ceph, Python, Openstack and Linux. My hobby is Rust.