Netplan is a modern network configuration tool introduced in Ubuntu 17.10 and later adopted as the default for managing network interfaces in Ubuntu 18.04 and beyond. With its YAML-based configuration files, Netplan simplifies the process of managing complex network setups, providing a seamless interface to underlying tools like systemd-networkd and NetworkManager.
In this guide, we’ll walk you through the process of configuring network interfaces using Netplan, from understanding its core concepts to troubleshooting potential issues. By the end, you’ll be equipped to handle basic and advanced network configurations on Ubuntu systems.
Understanding Netplan
Netplan serves as a unified tool for network configuration, allowing administrators to manage networks using declarative YAML files. These configurations are applied by renderers like:
-
systemd-networkd: Ideal for server environments.
-
NetworkManager: Commonly used in desktop setups.
The key benefits of Netplan include:
-
Simplicity: YAML-based syntax reduces complexity.
-
Consistency: A single configuration file for all interfaces.
-
Flexibility: Supports both simple and advanced networking scenarios like VLANs and bridges.
Prerequisites
Before diving into Netplan, ensure you have the following:
-
A supported Ubuntu system (18.04 or later).
-
Administrative privileges (sudo access).
-
Basic knowledge of network interfaces and YAML syntax.
Locating Netplan Configuration Files
Netplan configuration files are stored in /etc/netplan/
. These files typically end with the .yaml
extension and may include filenames like 01-netcfg.yaml
or 50-cloud-init.yaml
.
Important Tips:
-
Backup existing configurations: Before making changes, create a backup with the command:
sudo cp /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.bak
-
YAML Syntax Rules: YAML is indentation-sensitive. Always use spaces (not tabs) for indentation.
Configuring Network Interfaces with Netplan
Here’s how you can configure different types of network interfaces using Netplan.
Step 1: Identify Network Interfaces
Before modifying configurations, identify available network interfaces using:
Source: Read More