Read more

Prevent systemd from dropping IP-Addresses configured from other processes

Avatar
Moritz Kraus
January 22, 2021Software engineer at makandra GmbH

Systemd's networkd will drop IP-Addresses configured by other processes like Keepalived's VRRP, when it is restarted. This may happens on updates.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

To prevent this following settings are required in /run/systemd/network/10-netplan-eth0.network

v242 or earlier (even if you do not use DHCP client in networkd)

[DHCP]
CriticalConnection=yes

v243 or newer

[Network]
KeepConfiguration=yes

If there is netplan in place these files will be generated.

Add critical: yes to /etc/netplan/50-cloud-init.yaml

eth1:
  addresses:
    - 192.0.2.67/24
  gateway4: 192.0.2.1
  nameservers:
    addresses:
      - 198.51.100.42
      - 198.51.100.53
    search:
      - example.lcal
  critical: yes

run netplan generate

This will add the CriticalConnection to your networkd configuration.

Posted by Moritz Kraus to makandra Operations (2021-01-22 16:40)