Ubuntu Server 15.10 VirtualBox Bridged 和 NAT 无法协同工作

Ubuntu Server 15.10 VirtualBox Bridged 和 NAT 无法协同工作

我已经安装并安装了 Ubuntu Server 15.10 作为 VM,并设置了 2 个网络适配器 - 默认 NAT + 桥接以连接到 VM。

lspci 以及其他东西带来了

00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
00:08.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)

/etc/network/interfaces我已经添加了第二个适配器,如下所示(这是我使用 eth0/eth1 对 Debian 所做的,它始终运行良好):

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp

# Host-only network
auto enp0s8
iface enp0s8 inet static
        address 192.168.56.105
        netmask 255.255.255.0
        gateway 192.168.56.1

每次我更改此文件时,我都会重新启动计算机(否则不确定如何应用配置)。所以现在我可以通过 SSH 进入机器,但它没有互联网连接。当我删除配置时enp0s3,互联网又可以正常工作了。

请指教如何使它们协同工作。

答案1

解决方案来自这个问题对我有用。

所以我要做的就是删除这条gateway 192.168.56.1线。

相关内容