首页 文章

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

提问于
浏览
-1

我有一个仅主机VM网络设置如下 .

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 ,并使用以太网电缆插入我的计算机,并使用eth0,IP为 192.168.1.2 . 我希望能够与另一台计算机连接到这个无线路由器,并能够访问我的主机网络 . 我希望能够连接到我在 192.168.56.2192.168.56.3 运行的两个VM

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

enter image description here

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

1 回答

  • 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地址,主机网络接口将流量路由到它们,就好像它们是独立的独立计算机一样 .

相关问题