systemd-networkd

On this page 7

systemd-networkd is the system daemon in systemd that configures network interfaces declaratively, applying addresses, routes, DHCP, bridges, bonds and VLANs from plain configuration files. In Linux networking it is the lightweight alternative to NetworkManager, designed mainly for servers, containers, virtual machines and embedded systems where connections are static and predictable.

The daemon watches network devices through the kernel’s netlink interface, matches each device against configuration files and keeps its state as described, reacting automatically when links appear, disappear or change carrier. It is the backend that Netplan uses by default on Ubuntu Server, so many administrators run it without editing its files directly.

How systemd-networkd applies configuration

At startup the daemon reads configuration from /etc/systemd/network, /run/systemd/network and /usr/lib/systemd/network, with files in /etc taking precedence over packaged defaults of the same name. Files are processed in lexical order, and for .network files the first file whose [Match] section fits an interface wins, so names such as 10-lan.network and 90-default.network are used to control priority.

The configuration is split into three file types with different responsibilities. Keeping these roles apart is the key to understanding the daemon.

File typePurposeProcessed by
.networkAddresses, DHCP, routes, DNS and membership in bridges or bondssystemd-networkd
.netdevCreates virtual devices such as bridges, bonds, VLANs, VXLAN and WireGuardsystemd-networkd
.linkLow-level link settings such as interface name, MTU and MAC addressudev at device detection
Configuration file types

The .link files explain where predictable interface names such as enp3s0 come from. A default file shipped with systemd tells udev which naming policies to try, based on firmware data, PCI slot or bus path. Administrators can add their own .link file that matches a MAC address and assigns a stable name such as lan0, which keeps configurations valid when hardware is moved between slots.

The daemon itself does not resolve host names. DNS servers learned from DHCP or set with DNS= are passed to systemd-resolved, which manages name resolution and the stub resolver that /etc/resolv.conf usually points to.

Key sections and settings

A .network file consists of INI-style sections. A minimal static configuration needs only a match and a network section, while advanced setups add routes, routing policy rules or a built-in DHCP server.

Section and keyExample valueEffect
[Match] Name=en* or eth0Selects interfaces by name pattern
[Network] DHCP=yes, ipv4, ipv6 or noEnables the built-in DHCP client
[Network] Address=192.0.2.10/24Assigns a static address with prefix length
[Network] Gateway=192.0.2.1Adds a default route
[Network] DNS=192.0.2.53Supplies DNS servers to systemd-resolved
[Network] Bridge=br0Attaches the interface to a bridge created by a .netdev
[Route] Destination=10.20.0.0/16Adds a static route
[Link] RequiredForOnline=noExcludes an interface from the online check
Frequently used .network settings

The daemon also includes a DHCP server, IPv6 router advertisement support and IPv6 prefix delegation, which makes it suitable for small routers and container hosts without additional services.

Managing the daemon with networkctl

The networkctl tool shows and controls the state of interfaces managed by the daemon. Its output distinguishes operational state, such as routable or degraded, from setup state, such as configured, configuring or unmanaged, which helps locate problems quickly.

  • `networkctl list` shows every link with its type and states.
  • `networkctl status eth0` shows addresses, gateway, DNS and recent log lines.
  • `networkctl reload` rereads configuration files without restarting the service.
  • `networkctl reconfigure eth0` reapplies configuration to one interface.
  • `journalctl -u systemd-networkd` shows the full log for troubleshooting.

The service systemd-networkd-wait-online blocks boot until configured interfaces are online, so services that need the network can order themselves after network-online.target. Its default timeout is two minutes, which explains slow boots on machines with an unplugged interface.

Comparison with other Linux network managers

Several tools can configure networking on Linux, and they suit different environments. The choice is mainly between static infrastructure and changing user connections.

ToolTypical environmentStrengthLimitation
systemd-networkdServers, containers, VMsSmall, declarative, part of systemdNo built-in Wi-Fi authentication
NetworkManagerDesktops and laptopsWi-Fi, VPN plugins, graphical toolsLarger and more dynamic than servers need
NetplanUbuntu systemsOne YAML format for both backendsA generator, not a daemon itself
ifupdownOlder Debian systemsSimple interfaces fileLimited reaction to runtime changes
systemd-networkd and related tools

For wireless links, the daemon can manage addresses once wpa_supplicant or iwd has authenticated the connection, but roaming between networks is far more convenient with NetworkManager. Configuration of the interfaces themselves at runtime remains possible with the ip command, although such changes are not persistent.

In container platforms, the daemon is often used inside lightweight hosts and minimal images because it adds few dependencies. systemd-nspawn containers, for example, ship default files that configure the virtual Ethernet pair between host and container automatically, so container networking works without extra tools.

Common mistakes

SymptomLikely causeFix
Settings change unexpectedlyNetworkManager and networkd manage the same interfaceLeave each interface to one manager
Boot waits two minuteswait-online expects an unused interfaceSet RequiredForOnline=no or narrow the check
Configuration ignoredAnother file matched first in lexical orderRename files to control priority
No name resolutionsystemd-resolved not running or resolv.conf not linkedEnable resolved and link the stub file
Edits to .link files have no effectudev applies them only at device detectionReload udev rules and replug or reboot
Typical problems and fixes

When Netplan is in use, files in /run/systemd/network are generated output. Editing them directly is a common error, because the next netplan apply or reboot overwrites the changes; the YAML in /etc/netplan is the source of truth.

In everyday language

systemd-networkd is a quiet background helper that sets up network connections on a Linux computer. It reads a few small text files that say which address each network port should have.

Then it makes it so and keeps it that way. If a cable is unplugged and plugged back in, the helper restores the settings automatically. It suits servers that stay in one place, while laptops that hop between Wi-Fi networks usually use a different tool.

Seen in the real world

A hosting provider runs virtualization hosts with two bonded 25 Gbps ports, several VLANs for customer traffic and a management network. Previously, interface scripts differed between hosts and a typo on one host once disconnected all its virtual machines after a reboot.

The team standardized on systemd-networkd with a set of .netdev files for the bond, the VLANs and one bridge per VLAN, plus .network files that attach each component. The files are generated from a template by the configuration management system, so every host receives identical, reviewed network definitions. After a reboot, networkctl list shows every link as routable within seconds, and adding a new customer VLAN means adding two small files and running networkctl reload.