Change IP Address on Ubuntu Server 20
Modify the file with nano.
sudo nano /etc/netplan/00-installer-config.yaml
You will see the following content:
network: ethernets: enp0s3: dhcp4: true version: 2
Then modify it to look like this:
dhcp4: no addresses: - 192.168.121.199/24 gateway4: 192.168.121.1 nameservers: addresses: [8.8.8.8, 1.1.1.1]
Then save the changes and close the file. Remember that the file is in yml format so it respects the rules and syntax so it does not give any error.
To apply the changes, execute the following command:
sudo netplan apply