Configuring a Linux network can be confusing because several tools often appear to do the same job. You might find yourself editing a YAML file one minute to set a Static IP and using an ip addr command the next to verify it, only to realize your changes vanished after a reboot. This conflict usually happens because users confuse persistent configuration tools with runtime state tools.
Whether you are managing a local workstation or a remote cloud instance, knowing which tool handles the “source of truth” for your network is vital for system stability. This guide explains the differences between the Netplan abstraction layer, the NetworkManager and systemd-networkd backends, and the temporary ip command utilities. Mastering these differences will ensure your Linux network configuration remains robust and predictable.
Table of Contents
Key Takeaways: Linux Networking Components
- Netplan → The configuration abstractor used in Ubuntu. It uses YAML files to define network intent.
- NetworkManager → A backend daemon typically used on Desktop systems to manage Wi-Fi and dynamic connections.
- systemd-networkd → A backend daemon preferred for Servers and virtualized environments for lightweight persistence.
- ip command → A runtime utility used to view current status or make temporary changes that do not survive a reboot.
- YAML Syntax → Netplan is highly sensitive to indentation; errors in the file will prevent the network from starting.
Method 1: Netplan (The High-Level Configurator)
Netplan is the default tool in modern Ubuntu for defining persistent network settings. It does not manage the network itself; instead, it reads YAML configuration files and generates instructions for a chosen backend (renderer).
- Config Location: Files are found in
/etc/netplan/(e.g.,01-netcfg.yaml). - How it works: You define your IP addresses, gateways, and nameservers in the file, then apply it.
Example Command to Apply Config: sudo netplan apply
Sample Output (Checking Status):
sudo netplan status -a
Online state: online
DNS Addresses: 127.0.0.53 (stub)
2: enp0s25 ethernet UP (networkd: enp0s25)
Addresses: 10.102.66.200/24 (dynamic, dhcp)
Method 2: NetworkManager vs. systemd-networkd (The Renderers)
These are the background daemons that actually “render” or execute the network instructions provided by Netplan.
- NetworkManager: Best for environments with frequent changes, like laptops switching between Wi-Fi networks. It is often managed via the ultimate nmcli cheat sheet.
- systemd-networkd: A simpler, faster backend used for servers where the network configuration is static and rarely changes.
You choose between them in the Netplan file by setting the renderer: key to either NetworkManager or networkd.
Method 3: The ip Command (The Runtime State Tool)
The ip command (from the iproute2 suite) is the successor to ifconfig. It allows you to see the current runtime state of the kernel’s networking stack.
- Usage: Use this to how to check IP address in Ubuntu quickly or to add a temporary IP for testing.
- Warning: Any change made with
ip addr addis temporary and will be lost when the machine reboots.
Example Command to View Interfaces: ip addr
Step-by-Step Process: Configuring a Permanent Static IP
If you need to move from a dynamic address to a fixed one, follow these steps using the persistent configuration workflow:
See also: Mastering the Linux Command Line — Your Complete Free Training Guide
- Launch your terminal and identify your interface name using
ip addr(e.g.,eth0). - Navigate to the Netplan directory:
cd /etc/netplan/. - Edit the configuration file using the sudo command.
- Define your settings in YAML format, ensuring you include
addresses,routes, andnameservers. - Test the syntax: Run
sudo netplan generateto check for formatting errors. - Apply the changes: Run
sudo netplan apply. - Verify the results: Use
ip addr showto confirm the new Static IP is active.
Summary Tables
| Component | Category | Main Purpose | Persistence |
|---|---|---|---|
| Netplan | Abstractor | Defining network intent via YAML files. | Yes |
| NetworkManager | Backend | Managing dynamic/Desktop connections. | Yes |
| networkd | Backend | Managing static/Server connections. | Yes |
| ip command | Runtime Tool | Viewing state or temporary changes. | No |
| Netplan Keyword | Meaning | Example |
|---|---|---|
| renderer | The daemon that executes the config. | networkd or NetworkManager |
| dhcp4 | Automatic IP assignment toggle. | true or false |
| addresses | List of IPs with CIDR mask. | 10.10.10.2/24 |
| via | The IP of the default gateway. | 10.10.10.1 |
FAQs
Why did my system lose its IP after a reboot? You likely used the ip command to set the address. To make changes permanent, you must use Netplan to save the configuration to disk.
Can I use NetworkManager and Netplan at the same time? Yes. Netplan acts as the “manager” that tells NetworkManager what to do. You define the settings in YAML, and Netplan instructs NetworkManager to apply them.
What happens if I have a typo in my YAML file? Netplan is extremely sensitive to indentation. If the structure is wrong, running sudo netplan apply will fail with a syntax error.



