Sub topic 3
Which Tool Manages Your Network Configuration
This chapter assumes you can use a Linux shell, run commands with sudo, and understand basic IPv4 addresses, subnets, and gateways. Before changing a server's address, identify which service owns the interface. Editing the wrong configuration file may have no effect or may cause two services to fight over the same interface.
The main network configuration tools
Linux separates the kernel's network functions from the programs that configure them. The kernel carries packets. A network manager assigns addresses, creates routes, and activates interfaces.
The common choices are:
- Netplan is a configuration layer used mainly by Ubuntu. It reads YAML files from
/etc/netplan/and generates configuration for a renderer. - systemd-networkd is a network service that reads
.networkand.netdevfiles, usually from/etc/systemd/network/. - NetworkManager manages connections through profiles. You can control it with
nmcli, and desktop environments often use it. - ifupdown is another older configuration system found on some Debian-based systems. This chapter focuses on Netplan, NetworkManager, and systemd-networkd.
Netplan is not usually the service that owns the interface. Its renderer setting selects networkd or NetworkManager as the backend.
| Configuration found | Likely owner | Main inspection command |
|---|---|---|
| `/etc/netplan/*.yaml` | Netplan with a selected renderer | `netplan get` |
| NetworkManager connection profiles | NetworkManager | `nmcli connection show` |
| `/etc/systemd/network/*.network` | systemd-networkd | `networkctl list` |
Inspect the active services
Start with the interface names and current addresses. Interface names vary. A server might use enp1s0, ens18, or another predictable name.
ip -br link
ip -br addressCheck whether NetworkManager is running:
systemctl is-active NetworkManager
nmcli device statusIf the service is active, nmcli device status lists devices and their connection state. The GENERAL.STATE and GENERAL.CONNECTION fields give more detail for one interface:
nmcli device show enp1s0Replace enp1s0 with the actual interface name. A response such as unknown device means the name is wrong, not necessarily that NetworkManager is absent.
Check systemd-networkd:
systemctl is-active systemd-networkd
networkctl list
networkctl status enp1s0networkctl list shows whether networkd recognizes each interface. If both NetworkManager and systemd-networkd are active, do not assume both manage the same device. It is possible for them to manage different devices, but one interface should normally have one owner.
On an Ubuntu server, inspect Netplan files and the generated configuration:
sudo ls -l /etc/netplan/
sudo netplan getLook for a renderer value in the YAML:
network:
version: 2
renderer: networkdIf the renderer is networkd, Netplan generates files for systemd-networkd. If it is NetworkManager, Netplan generates NetworkManager profiles. If no renderer is shown, the distribution's default usually applies. Confirm the result with the service checks rather than relying only on the file.
Avoid competing configuration
A network service may assign an address temporarily through DHCP while a file contains a different intended configuration. It may also leave an old address or route after a partial change. Check the complete state before editing:
ip address show dev enp1s0
ip route
nmcli connection show
networkctl status enp1s0Do not edit generated files under /run/NetworkManager/ or /run/systemd/network/. They are temporary output and may be replaced. Edit the source configuration: a Netplan YAML file, a NetworkManager connection profile, or a systemd-networkd file.
Once the owner is known, use that tool's configuration method. Netplan and NetworkManager are covered in the next chapters; the key decision is to avoid applying commands from one system to an interface controlled by another.
Exercise
NetworkManager is active, but /etc/netplan/01-static.yaml contains renderer: networkd. Which service should you confirm before changing the YAML?
Show answer
Confirm systemd-networkd, because the Netplan renderer says it is the backend intended to receive the generated configuration. Also verify the live owner with systemctl is-active systemd-networkd and networkctl status <interface>.