network:
ethernets:
enp0s3:
addresses: [192.168.1.3/24]
gateway4: 192.168.1.1
nameservers:
addresses: [4.2.2.2, 8.8.8.8]
version: 2
#go to file name can vary
sudo nano /etc/netplan/01-netcfg.yaml
# edit to
network:
ethernets:
enp0s3:
dhcp4: false
addresses: [192.168.50.195/24]
gateway4: 192.168.50.254
nameservers:
addresses: [8.8.8.8]
#save
#apply with
sudo netplan apply
dig +short myip.opendns.com @resolver1.opendns.com