Ubuntu 16.04 互联网无法工作,但升级后 SSH 可以工作

Ubuntu 16.04 互联网无法工作,但升级后 SSH 可以工作

我刚刚从 14.04 升级到 16.04,但现在互联网无法使用。

我可以通过 SSH 进入该盒子。

我可以 ping 8.8.8.8

我已尝试过sudo dpkg-reconfigure resolvconfsudo reboot但是并没有解决问题。

我也尝试过 sudo rm /etc/resolv.conf sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf sudo resolvconf -u 但仍然没有结果

编辑:

ip addr show输出

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
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
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:26:6c:f7:b2:b8 brd ff:ff:ff:ff:ff:ff
    inet 209.123.74.69/27 brd 209.123.74.95 scope global em1
       valid_lft forever preferred_lft forever
    inet6 fe80::226:6cff:fef7:b2b8/64 scope link 
       valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:26:6c:f7:b2:b9 brd ff:ff:ff:ff:ff:ff

ifconfig 输出

em1       Link encap:Ethernet  HWaddr 00:26:6c:f7:b2:b8  
          inet addr:209.123.74.69  Bcast:209.123.74.95  Mask:255.255.255.224
          inet6 addr: fe80::226:6cff:fef7:b2b8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12013 errors:0 dropped:10 overruns:0 frame:0
          TX packets:7250 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2076402 (2.0 MB)  TX bytes:1061991 (1.0 MB)
          Memory:c0000000-c001ffff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:13464 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13464 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:1003144 (1.0 MB)  TX bytes:1003144 (1.0 MB)

并且/etc/resolv.conf是空的

答案1

空的 /etc/resolv.conf 文件看起来像是问题 - 你应该在那里看到类似

nameserver 8.8.8.8
nameserver 8.8.4.4

将这些添加到其中,看看是否能解决互联网连接问题。如果能,您可以通过在网络管理器设置中进行更改来使更改永久生效。

您还可以添加适用于 IPv6 的:

nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844

相关内容