Historically, configuring network interfaces on a Linux server involved editing fragmented, distribution-specific text files—such as /etc/network/interfaces on Debian/Ubuntu or /etc/sysconfig/network-scripts/ on RHEL/CentOS. These legacy scripts were imperative; they executed sequential commands to bring interfaces up, assign IPs, and configure routing. If a script failed midway, the network stack was left in an unstable, indeterminate state. To resolve this fragmentation and introduce a modern, declarative architecture, the systemd project created systemd-networkd, a highly performant, native daemon that manages network configurations uniformly across all modern Linux distributions.
The Architecture of systemd-networkd
Unlike legacy scripts, systemd-networkd is entirely declarative. You define the desired state of the network (e.g., “Interface eth0 must have this static IP and belong to this VLAN”), and the daemon continuously monitors the Linux kernel’s netlink socket to enforce that state.
If you unplug a physical Ethernet cable, systemd-networkd detects the carrier loss instantaneously and tears down the associated routes. When you plug the cable back in, it dynamically reconstructs the configuration in milliseconds. It natively supports complex virtual networking topologies—including bonded interfaces, network bridges, VXLANs, and WireGuard tunnels—without requiring external third-party utilities like brctl or ifenslave.
Because it is tightly integrated into PID 1 (systemd), it drastically reduces boot times. systemd-networkd initializes the network asynchronously in parallel with other system services, rather than blocking the boot sequence waiting for a DHCP lease.
Enabling the Daemon
While systemd-networkd is installed on almost all modern distributions, it is often disabled by default in favor of NetworkManager (on desktops) or legacy scripts.
To transition to systemd-networkd, you must first disable the conflicting legacy services to prevent race conditions:
# Disable legacy networking on Debian/Ubuntu
sudo systemctl disable --now networking
# Disable NetworkManager (if present)
sudo systemctl disable --now NetworkManager
Next, enable and start the native systemd daemons. You must also enable systemd-resolved to handle DNS resolution, as networkd does not manually edit /etc/resolv.conf.
sudo systemctl enable --now systemd-networkd
sudo systemctl enable --now systemd-resolved
Authoring Declarative Configuration Files
systemd-networkd reads its configuration from .network, .netdev, and .link files located in the /etc/systemd/network/ directory.
To configure a standard static IP address on a primary interface (e.g., eno1), create a new file named 10-static-eno1.network:
sudo nano /etc/systemd/network/10-static-eno1.network
Populate the file with the declarative syntax:
[Match]
# Bind this configuration to the specific interface name
Name=eno1
[Network]
# Define the static IP and subnet mask (CIDR notation)
Address=192.168.10.50/24
# Define the default gateway
Gateway=192.168.10.1
# Define upstream DNS resolvers
DNS=1.1.1.1
DNS=8.8.8.8
# Ensure the interface only comes up if a physical cable is connected
LinkLocalAddressing=no
IPv6AcceptRA=no
If you need to configure a secondary interface (e.g., eno2) to automatically acquire an IP address via DHCP, the configuration is extremely concise. Create 20-dhcp-eno2.network:
[Match]
Name=eno2
[Network]
DHCP=ipv4
Applying and Verifying the State
After creating or modifying the configuration files, you must restart the daemon to apply the new mathematical state to the kernel:
sudo systemctl restart systemd-networkd
To verify the operational status of all network interfaces, utilize the native networkctl utility:
networkctl status
This command provides a comprehensive, color-coded output displaying the exact state of every link, the assigned IP addresses, the upstream DNS servers, and whether the interface is actively routed. By migrating to systemd-networkd, Linux engineers eradicate legacy scripting errors and achieve a unified, highly reliable, and purely declarative network infrastructure across their entire server fleet.