Ubuntu 18 uses Netplan for network settings. Some examples.
Netplan reads network configuration from /etc/netplan/*.yaml
which are written by administrators, installers, cloud image instantiations, or other OS deployments.
cd /etc/netplan/
The *.yaml file is usually created by the distribution installer. For example 00-installer-config.yaml.
In my case it’s called 50-cloud-init.yaml and I edit it with nano.
sudo nano /etc/netplan/50-cloud-init.yaml
network:
ethernets:
enp0s3:
dhcp4: true
enp0s8:
addresses: [192.168.56.101/24]
dhcp4: no
Other configuration
network:
ethernets:
enp0s3:
dhcp4: true
enp0s8:
addresses:
– 192.168.56.102/24
nameservers:
addresses: []
search: []
version: 2
Apply the changes
sudo netplan apply
ip a
Useful links
How to Configure Static IP Address on Ubuntu 20.04 | Linuxize