我最近才發現這個問題,顯然我所有的 Ubuntu 虛擬機器都停止上網。主機是Windows 10,透過乙太網路或WiFi連接,Vmware Workstation 12.5.6,Vmware中的網路配置是NAT。我的 Ubuntu VM 需要靜態位址,我無法使用 DHCP,這是 ifconfig 的輸出:
docker0 Link encap:Ethernet HWaddr 02:42:f6:c9:67:3d
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
ens33 Link encap:Ethernet HWaddr 00:0c:29:91:eb:b8
inet addr:192.168.72.179 Bcast:192.168.72.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe91:ebb8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:564 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:39862 (39.8 KB)
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:744 errors:0 dropped:0 overruns:0 frame:0
TX packets:744 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:64884 (64.8 KB) TX bytes:64884 (64.8 KB)
and this is the content of /etc/network/interfaces:
# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.72.179
netmask 255.255.255.0
gateway 192.168.72.2
dns-nameservers 208.67.222.222, 208.67.222.220, 8.8.8.8
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
我嘗試 ping 8.8.8.8,目標主機無法存取。我還能檢查什麼嗎?