Table of Contents

systemd-networkd

Introduction

Systemd-networkd is a system service that manages networks. Debian conventionally has the networking service networking.service configured as the default network manager. Which uses /etc/network/interfaces file to manage your network interfaces by means of ifup and ifdown commands.

Systemd-networkd is an alternative option to the Debian networking service — networking.service. Since Debian 12 (Bookworm) systemd-networkd is used to configure the network within the lxc container.

Required services

To use systemd-networkd, start/enable systemd-networkd.service. It is optional to also configure systemd-resolved, which is a network name resolution service to local applications, considering the following points:

Configuration files

Systemd-networkd reads files from the following locations:

Network Adapter naming

Systemd/udev automatically assigns predictable, stable network interface names for all local Ethernet, WLAN, and WWAN interfaces. e.g. enp1s0 is the wired adapter and wlp2s0 is the wireless adapter. Use networkctl list to list the devices on the system.

# networkctl list
--------------------------------------------
IDX LINK TYPE     OPERATIONAL SETUP     
  1 lo   loopback carrier     unmanaged
  2 eth0 ether    routable    configured

2 links listed.
--------------------------------------------

Configuration

All configurations in this section are stored as *.network in /etc/systemd/network/. For a full listing of options and processing order, see #Configuration files and systemd.network(5). There are three types of configuration files. They all use a format similar to systemd unit files.

They all follow the same rules: If all conditions in the [Match] section are matched, the profile will be activated an empty [Match] section means the profile will apply in any case (can be compared to the * wildcard) all configuration files are collectively sorted and processed in lexical order, regardless of the directory in which they live files with identical name replace each other

After making changes to a configuration file, restart systemd-networkd.service.