How to set Static IP Address on Ubuntu 20.04

A close up of a computer screen showing a number of different programs.

Login to Ubuntu node as a sudo user.

Backup exiting files

sudo cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.bak

Edit install config file

  1. Open file
sudo /etc/netplan/00-installer-config.yaml
  1. Set this dhcp4: true to dhcp4: no
  2. Right below dhcp4: no enter below values and save and exit
addresses:
      -192.168.1.188/24
gateway4: 192.168.1.1
nameservers:
            addresses: [1.1.1.1, 8.8.8.8]
  1. Apply changes by executing the below command:
sudo netplan apply
  1. Confirm changes by executing the below command:
ip addr show

Leave a Comment

Scroll to Top