Netplan is the default network configuration tool on Ubuntu since 18.04. It uses YAML configuration files to describe network interfaces and passes them to either NetworkManager (desktops) or systemd-networkd (servers). This guide configures a static IP address using Netplan on Ubuntu 26.04 LTS.
Tested and valid on:
- Ubuntu 26.04 LTS
Prerequisites
- Ubuntu 26.04 LTS
- A user with sudo privileges
- Knowledge of your network interface name, gateway, and DNS servers
Step 1 – Identify Your Network Interface
ip link show
ip addr
Step 2 – View Current Netplan Config
ls /etc/netplan/
cat /etc/netplan/*.yaml
Step 3 – Configure a Static IP
sudo nano /etc/netplan/01-netcfg.yaml
Replace the contents with:
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
- 192.168.1.100/24
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
- 1.1.1.1
Step 4 – Validate the Configuration
sudo netplan try
Step 5 – Apply the Configuration
sudo netplan apply
ip addr show ens3
ip route show
Step 6 – Configure Multiple IPs (optional)
addresses:
- 192.168.1.100/24
- 192.168.1.101/24
Step 7 – Configure Bonding or VLANs (optional)
Example VLAN:
network:
version: 2
ethernets:
ens3: {}
vlans:
ens3.100:
id: 100
link: ens3
addresses: [192.168.100.10/24]
Conclusion
A static IP is configured using Netplan on Ubuntu 26.04 LTS. Netplan’s YAML syntax supports complex configurations including bonds, bridges, VLANs, and multiple interfaces. Validate with netplan try before applying.