我必须在 Virtual Box 上安装虚拟机。最初,以太网和 WiFi 都可以正常工作。
不知何故,我搞乱了虚拟机的网络配置。
之后,我无法通过以太网在主机上访问互联网,但 WiFi 仍可正常工作。从一些在线教程中,我了解到平命令。
ping -c 3 www.google.com
1)通过WiFi从命令行终端的输出是:
PING www.google.com (216.239.34.117) 56(84) bytes of data.
64 bytes from 216.239.34.117: icmp_seq=1 ttl=56 time=46.7 ms
64 bytes from 216.239.34.117: icmp_seq=2 ttl=56 time=51.9 ms
64 bytes from 216.239.34.117: icmp_seq=3 ttl=56 time=48.3 ms
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 46.703/48.988/51.916/2.190 ms
2)LAN 连接的 ping 输出为:
PING www.google.com (192.0.2.1) 56(84) bytes of data.
From 192.168.0.1 icmp_seq=1 Destination Net Unreachable
From 192.168.0.1 icmp_seq=2 Destination Net Unreachable
From 192.168.0.1 icmp_seq=3 Destination Net Unreachable
--- www.google.com ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2000ms
3)命令输出cat /etc/network/interfaces
:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
3)命令输出ifconfig
:
eth0 Link encap:Ethernet HWaddr 6c:c2:17:e3:c7:6d
inet addr:192.168.0.71 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6ec2:17ff:fee3:c76d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3663 errors:0 dropped:0 overruns:0 frame:0
TX packets:4123 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2398876 (2.3 MB) TX bytes:696669 (696.6 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:15414 errors:0 dropped:0 overruns:0 frame:0
TX packets:15414 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1150874 (1.1 MB) TX bytes:1150874 (1.1 MB)
wlan0 Link encap:Ethernet HWaddr 90:48:9a:b8:d8:bb
inet addr:192.168.0.25 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::9248:9aff:feb8:d8bb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:154062 errors:0 dropped:0 overruns:0 frame:0
TX packets:89908 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:108917728 (108.9 MB) TX bytes:19010105 (19.0 MB)
我尝试了网上提到的很多方法,例如sudo service network-manager restart
,但Destination Net Unreachable
问题仍然没有解决
请提出建议。