Static IP using Netplan
How to setup static IP using netplan on ubuntu 22.04 and above
Setting a static IP address on Ubuntu 22.04 and higher using netplan
netplan
Netplan basically acts as a translation layer, it takes configuration files, and creates the right systemd-networkd or Networkmanager configuration.
First disable the cloud-init networking.
Create a file, sudo nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
with the following contents:
Then, edit the existing netplan configuration file, for me this was sudo nano /etc/netplan/50-cloud-init.yaml
, which originally looked like this:
What it’s basically doing is setting the network interface enp1s0
to use DHCP (and is not static).
Change it to make it look like this:
Apply changes using:
Check status using:
Last updated