I am running an Ubuntu Server on my VMBox and need to set static IP. By following the steps described in https://www.techrepublic.com/article/how-to-configure-a-static-ip-address-in-ubuntu-server-18-04/, I created the configuration file 01-netcfg.yaml as follows.
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
addresses: [10.10.21.8/24]
gateway4: 10.10.21.100
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
Running sudo netplan apply --debug
results in:
Which I'm not sure if the process is succesful or not since it mentions a merged config but gives no error at the end. However, I can not connect to Internet. sudo ping www.facebook.com
returns "Temporary failure in name resolution". ping 64.233.169.104
results in "Destination Host Unreachable". sudo apt-get update
fails as well.
sudo lshw -C network:
cat /etc/netplan/*
After trying the answer.
cat /etc/resolv.conf
ls -al /etc/resolv.conf
ls -al /etc/netplan
sudo netplan generate --debug
sudo netplan apply
No output.
systemd-resolve --status