在 VirtualBox (OS X) 中排除 Ubuntu 的網路連線故障

在 VirtualBox (OS X) 中排除 Ubuntu 的網路連線故障

我正在執行 OS X Yosemite 的 iMac 上使用 VirtualBox 設定 Ubuntu Server 14.04。我對設定網路資訊知之甚少,並且無法將 Ubuntu 連接到互聯網(儘管我可以 ssh 進入伺服器)。我想使用具有靜態 IP 的橋接適配器。下面我有一些有用的(我希望)資訊。讓我知道是否應該添加其他內容。


我目前的/etc/network/interfaces文件:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.0.1.251
netmask 255.255.255.0
gateway 10.0.1.1
dns-nameservers 8.8.8.8 8.8.4.4

結果ifconfig

eth0      Link encap:Ethernet  HWaddr 08:00:27:13:0c:ba  
          inet addr:10.0.1.251  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe13:cba/64 Scope:Link
          inet6 addr: 2601:444:c000:33f4:a00:27ff:fe13:cba/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:920 errors:0 dropped:0 overruns:0 frame:0
          TX packets:539 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:84566 (84.5 KB)  TX bytes:75947 (75.9 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:61 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5752 (5.7 KB)  TX bytes:5752 (5.7 KB)

嘗試 ping 8.8.8.8 的結果:

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 10.0.1.251 icmp_seq=1 Destination Host Unreachable
From 10.0.1.251 icmp_seq=2 Destination Host Unreachable
From 10.0.1.251 icmp_seq=3 Destination Host Unreachable
From 10.0.1.251 icmp_seq=4 Destination Host Unreachable
From 10.0.1.251 icmp_seq=5 Destination Host Unreachable
From 10.0.1.251 icmp_seq=6 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6999ms
pipe 4

如果我嘗試 ping 任何其他網站,它只會掛在那裡,直到它最終顯示ping: unknown host www.google.com(或我嘗試過的任何網站)。


是什麼導致了這個問題?如果我可以提供其他有用的信息,請告訴我。

謝謝

相關內容