Score:0

Ubuntu Server - Internet connectivity issue, empty /etc/network/interfaces

fr flag

I manage a server which hosts a few applications. It's running on a VM and I access via SSH.

OS: Ubuntu Server 20.04.1 LTS

Everything was working fine until today, my scripts can't access WAN. (Can still SSH in)

I can ping out:

$ ping google.com
PING google.com (216.58.212.206) 56(84) bytes of data.
64 bytes from ams16s21-in-f14.1e100.net (216.58.212.206): icmp_seq=1 ttl=118 time=5.26 ms
64 bytes from ams16s21-in-f14.1e100.net (216.58.212.206): icmp_seq=2 ttl=118 time=5.54 ms

DNS resolves fine:

$ nslookup google.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   google.com
Address: 216.58.212.206
Name:   google.com
Address: 2a00:1450:4009:80a::200e

Can't get anything with curl:

$ curl -v https://www.google.com
*   Trying 216.58.212.196:443...
* TCP_NODELAY set
*   Trying 2a00:1450:4009:80a::2004:443...
* TCP_NODELAY set
* Immediate connect fail for 2a00:1450:4009:80a::2004: Network is unreachable
*   Trying 2a00:1450:4009:80a::2004:443...
* TCP_NODELAY set
* Immediate connect fail for 2a00:1450:4009:80a::2004: Network is unreachable

$ ip link list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:15:5d:01:fd:32 brd ff:ff:ff:ff:ff:ff
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:42:c2:db:08:92 brd ff:ff:ff:ff:ff:ff

$ ip route list
default via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.14 metric 100 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.14 
192.168.1.1 dev eth0 proto dhcp scope link src 192.168.1.14 metric 100 

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.1     0.0.0.0         255.255.255.255 UH    100    0        0 eth0

$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:c2:db:08:92  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.14  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::215:5dff:fe01:fd32  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:01:fd:32  txqueuelen 1000  (Ethernet)
        RX packets 35862  bytes 5205966 (5.2 MB)
        RX errors 0  dropped 4364  overruns 0  frame 0
        TX packets 3838  bytes 1097697 (1.0 MB)
        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 8663  bytes 1793628 (1.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8663  bytes 1793628 (1.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Could this be a problem:

$ cat /etc/network/interfaces 

(EMPTY)


$ cat /etc/netplan/*.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2

Many thanks for your help!

chili555 avatar
cn flag
"Could this be a problem: $ cat /etc/network/interfaces (EMPTY)" No, because networking in server edition is now managed by netplan. What does this tell us? `cat /etc/netplan/*.yaml` Welcome to Ask Ubuntu.
Luke Wood avatar
fr flag
Thanks, `network: ethernets: eth0: dhcp4: true version: 2`
ru flag
`eth0` is usually NOT the proper definition for a device on system - what does `ip -4 link list` show (so we can ID what the actual network interface name is and help you fix the config)?
Luke Wood avatar
fr flag
Okay, I get the same as with `ip link list` as above.
Luke Wood avatar
fr flag
It was an external firewall issue Thanks, for your efforts!
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.