Get new ip from DHCP (If not working, check your connection to router)
//Release ip
sudo dhclient -r [Interface name](optional)
//Renew ip
sudo dhclient [Interface name](optional)
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
addresses: [192.168.2.2/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]