This repo provides a script that:
- Switches Debian-based systems from ipupdown and NetworkManager to systemd-networkd.
- Switches from wpa_supplicant to iwd, if WiFi is used by the system (mainly on Raspberry Pi systems).
- Removes netplan (see below).
- Enables DHCP for all network interfaces.
This script is intended for headless server systems, not for desktop systems.
It's intended for these distros:
- Debian
- Ubuntu
- Raspberry Pi OS
See also: Network Configuration for Debian, Ubuntu, Raspberry Pi OS
Execute with:
curl -fsSL https://raw.githubusercontent.com/skrysm/systemd-networkd-init/main/1-init.sh | bashOr with a non-main branch:
export GIT_BRANCH=feature/branch; curl -fsSL "https://raw.githubusercontent.com/skrysm/systemd-networkd-init/${GIT_BRANCH}/1-init.sh" | bashI personally find network configuration on Debian-based server systems a mess. Each distro uses a different method:
- Debian: ifupdown
- Ubuntu: systemd-networkd with netplan
- Raspberry Pi OS: NetworkManager with netplan
This script unifies the network configuration as: systemd-networkd without netplan (and iwd for WiFi, if necessary)
With this, the network configuration is always found in:
- systemd-networkd:
/etc/systemd/network/ - iwd:
/var/lib/iwd/
Using systemd-networkd over NetworkManager is mainly opinionated (I needed to pick one). One thing I found is that NetworkManager seems to prefer UIs for configuration over configuration files - and I explicitly wanted configuration files.
My first thought was to use netplan on all systems (instead of forcing systemd-networkd) - but this didn't work because on Raspberry Pi OS 13 netplan and/or NetworkManager are heavily patched so that any configuration under /etc/netplan is removed and replaced with a generated one every time netplan runs.
To goal of this repo is to have stable, human-readable and human-editable configuration files for network configuration - and this is no longer (easily) possible on Raspberry Pi OS 13.
Also, netplan doesn't support iwd but only wpa-supplicant for WiFi.