I am working through configuring an ubuntu 20.04 server and am attempting to switch over from using ifupdown to using netplan. I am not a network guru by any stretch, but I believe my problem has something to do with DNS:
root@local:~# curl https://google.com
curl: (6) Could not resolve host: google.com
I followed the top answer from this post to start link. I made sure that I removed these packages: net-tools, ifupdown (and removed lines in /etc/network/interfaces and files in /etc/network/interfaces.d) and resolvconf. I believe that I have my netplan config set up correctly as follows:
---
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses:
- 172.16.15.161/24
routes:
- to: default
via: 172.16.15.1
nameservers:
addresses: [10.x.x.x, 10.x.y.x]
and when a I do a netplan --debug generate
and netplan apply
I don't get any errors, I made sure to reboot after changes. To make sure it wasn't our dns servers causing the issue I tried using 8.8.8.8 as well. I also checked that /etc/resolv.conf was symlinked to /run/systemd/resolve/stub-resolv.conf, DNSSEC=no and that my dns servers are listed when doing a resolvectl and looking at eth0. For what it's worth, we originally had a bond interface when configured with ifupdown but we got rid of it when switching to netplan since we have only one eth interface (I got rid of it by doing ip link delete dev bond0
). We get the feeling that maybe something from the old configuration is possibly still lingering causing issues.
EDIT: adding output of ip a
root@local:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:50:56:b7:41:7f brd ff:ff:ff:ff:ff:ff
inet 172.16.15.161/24 brd 172.16.15.255 scope global eth0
valid_lft forever preferred_lft forever
https://netplan.io
andhttps://netplan.io/examples
.ip a
Welcome to Ask Ubuntu.default via 172.16.15.1 dev eth0 proto static onlink
172.16.15.1 goes out to the internetcat /etc/network/interfaces
Thanks.