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.
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
Apply the changes
sudo netplan apply
How to Configure Static IP Address on Ubuntu 20.04 | Linuxize