go to /etc/netplan
List the files and open the cloud init file, in my case it is 50-cloud-init.yaml
network:
ethernets:
eth0:
dhcp4: false
addresses: [192.168.0.200/16]
routes:
- to: default
via: 192.168.10.1
nameservers:
addresses: [8.8.8.8,8.8.4.4,192.168.0.1]
# optional: true
version: 2
gateway4: 192.168.0.1 is deprecated
then run
sudo netplan apply
alternatively if you have any issue
sudo netplan --debug apply