通过无线路由器连接到仅限主机vm网络

时间:2014-02-27 02:00:28

标签: networking routing ip virtual-machine wireless

我设置了一个仅限主机的虚拟机网络,其中包含以下内容。

DHCP Server
address: 192.168.56.1
server mask: 255.255.255.0
lower bound 192.168.56.2
upper bound 192.168.56.100

从VM到VM和VM连接到192.168.56.1的主机没有问题。我有一个netgear无线路由器,其IP为192.168.1.1,并使用以太网电缆插入我的计算机,并使用IP为192.168.1.2的eth0。我希望能够使用另一台计算机连接到此无线路由器,并能够访问我的主机网络。我希望能够连接到我在192.168.56.2192.168.56.3

运行的两个虚拟机

我尝试将以下内容添加到路由器中作为静态路由。从我的另一台计算机上,我可以连接到路由器并ping 192.168.56.1但我无法ping我正在运行的任何虚拟机192.168.56.2 and 192.168.56.3

enter image description here

为了能够在网络上与我的虚拟机对话,我需要更改什么?我在Linux薄膜机器上运行我的VM并与Mac OSx连接。

1 个答案:

答案 0 :(得分:1)

它被称为host only,因为虚拟机故意无法与正在运行的主机之外的任何人通信。

来自VirtualBox docs

Similarly, as with internal networking however, a physical networking interface need not   
be present, and the virtual machines cannot talk to the world outside the host since they 
are not connected to a physical networking interface.)

如果要从主机外部的计算机访问VM,则需要使用桥接网络。 NAT网络可以工作,但我过去遇到过麻烦。如果您打算使用这些虚拟机,就好像它们是独立的,独立的机器,桥接可能是要走的路。主机将为它们分配IP地址,主机网络接口将流量路由到它们,就好像它们是独立的独立计算机一样。

相关问题