How to use systemd-networkd for network management

· Category: Linux

Short answer

systemd-networkd is a lightweight network manager suitable for servers, containers, and simple desktop setups.

Steps

  1. Create a network file:
sudo nano /etc/systemd/network/20-wired.network
  1. Add configuration:
[Match]
Name=eth0

[Network]
DHCP=yes
  1. Enable and start:
sudo systemctl enable --now systemd-networkd
sudo systemctl enable --now systemd-resolved

Tips

  • Works well with systemd-resolved for DNS.
  • Supports bridges, bonds, and VLANs.
  • Often used in containers and minimal installations.

Common issues

  • Conflicts with NetworkManager; disable one or the other.
  • Incorrect interface names: use Match with MACAddress if names are unstable.