Score:0

Ubuntu 20.04 /etc/network/interfaces and ifupdown not connecting to internet

kr flag

As described in many askUbuntu forum posts, I installed ifupdown and removed/purged netplan.io. While now ifconfig and ip a yield the settings from /etc/network/interfaces (copied from an Ubuntu installation circa 2013, only updated eth0 in the files to enp4s0), there still is no internet. Some connection does appear to be there though, i.e. it recognizes printers on the local network.

ping google.com 

returns Temporary failure in name resolution. However, ping 8.8.8.8 works fine.

System: Ubuntu 20.04.3 LTS (Focal Fossa)

What could be at play here?

ifconfig:

enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.31  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a6ba:dbff:fe03:2e44  prefixlen 64  scopeid 0x20<link>
        inet6 2607:fea8:3e80:64a:a6ba:dbff:fe03:2e44  prefixlen 64  scopeid 0x0<global>
        ether a4:ba:db:03:2e:44  txqueuelen 1000  (Ethernet)
        RX packets 3128  bytes 483360 (483.3 KB)
        RX errors 0  dropped 16  overruns 0  frame 0
        TX packets 482  bytes 84822 (84.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2836  bytes 217982 (217.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2836  bytes 217982 (217.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Bovine avatar
ru flag
If you can successfully `ping 8.8.8.8` then you have Internet access. I'd say the problem is you don't have a working DNS specified.
kr flag
I tried adding dns-nameservers 192.168.1.254 8.8.8.8 to my /etc/network/interfaces file as suggested in http://manpages.ubuntu.com/manpages/trusty/man8/resolvconf.8.html for ifup, but that didn't seem to do anything.
Bovine avatar
ru flag
192.168.1.254 is an address on your local network. 8.8.8.8 is the address of Google's public DNS. Is 192.168.1.254 your router? Or maybe a machine you configured to run bind or some other DNS?
kr flag
Indeed those IP addresses were just taken from the man page. Copying over my old resolv.conf file fixed the issue.
Score:1
kr flag

The /etc/resolv.conf file was set incorrectly. Simply copying the /etc/resolv.conf file from the previous 2013 Ubuntu version did the trick. namely:

domain 'URL address'
search 'URL address'
nameserver 'IP address'
nameserver 'IP address'
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.