netplan is a YAML-based network configuration abstraction for Linux that simplifies network setup on Ubuntu and other systems. It provides a consistent interface for configuring networking regardless of the underlying renderer (NetworkManager or systemd-networkd), making network automation straightforward.
📑 Table of Contents
By describing network configurations in simple YAML files, netplan eliminates the complexity of traditional network configuration methods. Changes are applied atomically, reducing the risk of configuration errors leaving systems unreachable.
Key Features
- YAML Configuration – Human-readable config files
- Backend Agnostic – Works with NetworkManager or systemd-networkd
- Declarative – Describe desired state, not steps
- Atomic Apply – All-or-nothing configuration changes
- Cloud-Init Integration – Perfect for cloud deployments
Configuration Example
# /etc/netplan/01-config.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
addresses:
- 192.168.1.100/24
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
Basic Commands
# Apply configuration
sudo netplan apply
# Generate and show configuration
sudo netplan generate
# Try configuration with rollback
sudo netplan try
# Debug configuration
sudo netplan --debug apply
Use Cases
- Server Setup – Configure static networking
- Cloud Instances – Automated network configuration
- Bonding/Bridging – Complex network setups
- VLAN Configuration – Network segmentation
Was this article helpful?