virtualbox下的ubuntu连不上网络是为什么

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
z513597924
帖子: 10
注册时间: 2017-09-20 23:02
系统: windows10

virtualbox下的ubuntu连不上网络是为什么

#1

帖子 z513597924 » 2017-09-21 12:38

ping不通百度,我的主机连校园WIFI,虚拟机上选了桥接模式都不行
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: virtualbox下的ubuntu连不上网络是为什么

#2

帖子 vickycq » 2017-09-21 14:05

你学校怎么上网的,IP 地址分配有没有限制
有没有限制路由器
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: virtualbox下的ubuntu连不上网络是为什么

#3

帖子 poloshiao » 2017-09-21 16:47

virtualbox下的ubuntu连不上网络是为什么
把下面指令 複製 貼進終端機 執行
1. sudo ifconfig -a
2. sudo ping -c 3 127.0.0.1
3. sudo ping -c 3 localhost
4. sudo ping -c 3 198.71.84.64
5. sudo ping -c 3 forum.ubuntu.org.cn
6. sudo tracepath 198.71.84.64
7. sudo tracepath forum.ubuntu.org.cn
把結果全部直接 選取/複製 貼上來
z513597924
帖子: 10
注册时间: 2017-09-20 23:02
系统: windows10

Re: virtualbox下的ubuntu连不上网络是为什么

#4

帖子 z513597924 » 2017-09-21 21:17

poloshiao 写了:
virtualbox下的ubuntu连不上网络是为什么
把下面指令 複製 貼進終端機 執行
1. sudo ifconfig -a
2. sudo ping -c 3 127.0.0.1
3. sudo ping -c 3 localhost
4. sudo ping -c 3 198.71.84.64
5. sudo ping -c 3 forum.ubuntu.org.cn
6. sudo tracepath 198.71.84.64
7. sudo tracepath forum.ubuntu.org.cn
把結果全部直接 選取/複製 貼上來
1.png
2.png
3.png
4.png
5.png
5.png (6.51 KiB) 查看 3241 次
6.png
7.png
7.png (6.99 KiB) 查看 3241 次
求救
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: virtualbox下的ubuntu连不上网络是为什么

#5

帖子 vickycq » 2017-09-21 21:43

如果能 ping IP 地址,不能 ping 域名,试试 https://askubuntu.com/a/957908

因为有很多类似案例,即宿主机连 vpn 后,虚拟机使用 nat 方式无法解析域名
https://superuser.com/questions/570984/ ... vpn/584326
https://www.virtualbox.org/ticket/13993
https://askubuntu.com/questions/419327/ ... connection
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: virtualbox下的ubuntu连不上网络是为什么

#6

帖子 poloshiao » 2017-09-22 11:46

把結果全部直接 選取/複製 貼上來
不必擷圖
文字 方便回覆時 直接引用
方便你閱讀
z513597924
帖子: 10
注册时间: 2017-09-20 23:02
系统: windows10

Re: virtualbox下的ubuntu连不上网络是为什么

#7

帖子 z513597924 » 2017-09-22 12:26

poloshiao 写了:
把結果全部直接 選取/複製 貼上來
不必擷圖
文字 方便回覆時 直接引用
方便你閱讀
ubuntu系统复制的,没办法在windows系统黏贴。。。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: virtualbox下的ubuntu连不上网络是为什么

#8

帖子 poloshiao » 2017-09-22 12:39

用编辑文件程式或办公文件程式 存成 Ubuntu / Windows 可以打开的格式
z513597924
帖子: 10
注册时间: 2017-09-20 23:02
系统: windows10

Re: virtualbox下的ubuntu连不上网络是为什么

#9

帖子 z513597924 » 2017-09-22 14:38

poloshiao 写了:用编辑文件程式或办公文件程式 存成 Ubuntu / Windows 可以打开的格式
enp0s3 Link encap:以太网 硬件地址 08:00:27:63:07:bf
inet 地址:10.0.2.15 广播:10.0.2.255 掩码:255.255.255.0
inet6 地址: fe80::41b6:15a4:cc99:bc45/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:14 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:748 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:1370 (1.3 KB) 发送字节:60485 (60.4 KB)

lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 跃点数:1
接收数据包:514 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:514 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:34180 (34.1 KB) 发送字节:34180 (34.1 KB)
root@zxs-VirtualBox:~# sudo ping -c 3 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.014 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.065 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.019 ms

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2042ms
rtt min/avg/max/mdev = 0.014/0.032/0.065/0.023 ms

root@zxs-VirtualBox:~# sudo ping -c 3 localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.012 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.042 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.023 ms

--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2036ms
rtt min/avg/max/mdev = 0.012/0.025/0.042/0.013 ms

root@zxs-VirtualBox:~# sudo ping -c 3 198.71.84.64
PING 198.71.84.64 (198.71.84.64) 56(84) bytes of data.
64 bytes from 198.71.84.64: icmp_seq=1 ttl=48 time=163 ms
64 bytes from 198.71.84.64: icmp_seq=2 ttl=48 time=163 ms
64 bytes from 198.71.84.64: icmp_seq=3 ttl=48 time=164 ms

--- 198.71.84.64 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 163.448/163.914/164.603/0.497 ms

root@zxs-VirtualBox:~# sudo ping -c 3 forum.ubuntu.org.cn
ping: unknown host forum.ubuntu.org.cn

root@zxs-VirtualBox:~# sudo tracepath 198.71.84.64
1?: [LOCALHOST] pmtu 1500
1: 10.0.2.2 0.181ms
1: 10.0.2.2 0.283ms
2: no reply
3: no reply
4: no reply
5: no reply
6: no reply
7: no reply
8: no reply
9: no reply
10: no reply
11: no reply
12: no reply
13: no reply
14: no reply
15: no reply
16: no reply
17: no reply
18: no reply
19: no reply
20: no reply
21: no reply
22: no reply
23: no reply
24: no reply
25: no reply
26: no reply
27: no reply
28: no reply
29: no reply
30: no reply
Too many hops: pmtu 1500
Resume: pmtu 1500

root@zxs-VirtualBox:~# sudo tracepath forum.ubuntu.org.cn
gethostbyname2: Host name lookup failure
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: virtualbox下的ubuntu连不上网络是为什么

#10

帖子 poloshiao » 2017-09-23 16:04

sudo ping -c 3 198.71.84.64
PING 198.71.84.64 (198.71.84.64) 56(84) bytes of data.
64 bytes from 198.71.84.64: icmp_seq=1 ttl=48 time=163 ms
64 bytes from 198.71.84.64: icmp_seq=2 ttl=48 time=163 ms
64 bytes from 198.71.84.64: icmp_seq=3 ttl=48 time=164 ms

--- 198.71.84.64 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 163.448/163.914/164.603/0.497 ms
1. 表示 你的網路可以連上網際網路
sudo ping -c 3 forum.ubuntu.org.cn
ping: unknown host forum.ubuntu.org.cn
sudo tracepath forum.ubuntu.org.cn
gethostbyname2: Host name lookup failure
2. 表示 你的 DNS 不起作用
2-1. 參閱
https://zh.wikipedia.org/wiki/%E5%9F%9F ... B%E7%BB%9F
網域名稱系統(英文:Domain Name System,縮寫:DNS)是網際網路的一項服務。

3. 把下面指令 複製 貼進終端機 執行
3-1. sudo ls -al /etc/resolv.conf
3-2. sudo cat /etc/resolv.conf
把結果全部直接 選取/複製/貼上來
不必擷圖
回复