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
- Create a network file:
sudo nano /etc/systemd/network/20-wired.network
- Add configuration:
[Match]
Name=eth0
[Network]
DHCP=yes
- 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
Matchwith MACAddress if names are unstable.