Jas*_*onK 6 networking virtualbox bridge virtual-machine ubuntu
I'm trying use a network bridge adapter for my VM (fresh Ubuntu server 16.04 LTS install) within the latest version of Virtualbox (v5.0.20). Running ifconfig -a gives the following output:
正如您所看到的,IP 地址是 192.168.3.59,它是由我的主机网络(子网 192.168.3)的 DHCP 服务器分配的。所以一切似乎都工作得很好,但是当我尝试 ping 到 时8.8.8.8,例如,我收到以下错误消息:
连接:网络不可达
我尝试了不同的适配器设置,禁用了防火墙,创建了新的虚拟机,并用谷歌搜索了我能想到的所有内容;然而,问题并没有得到解决。
更多可能有用的信息:
/etc/network/interfaces) 文件未受影响任何帮助/建议将不胜感激!
编辑:添加路由表
ip route show输出以下内容:
172.23.23.0/24 via 192.168.3.108 dev enp0s3
192.168.3.0/24 dev enp0s3 proto kernel scope link src 192.168.3.59
Run Code Online (Sandbox Code Playgroud)
您缺少子网范围之外的流量的默认路由。以特权用户身份运行以下命令:
ip 路由通过 ip-of-router-on-local-network dev enp0s3 添加默认值
这应该允许您 ping 谷歌的服务器并建立外部连接。使此设置永久化(重新启动后保留)将取决于虚拟机连接的方法,但这应该适用于大多数系统:http ://www.linuxquestions.org/questions/linux-networking-3/permanently-add-static -路线-16769/
| 归档时间: |
|
| 查看次数: |
35399 次 |
| 最近记录: |