VMware 和多个网络接口和 ssh

VMware 和多个网络接口和 ssh

我有一个 Linux VM,我为其分配了两张网卡。

eth0 (autodetect vmware settings)

eth1 (private to my mac vmware settings)

这是我的内容/etc/network/interfaces

auto eth0
auto eth1
iface eth0 inet dhcp
iface eth1 inet static 
    address 172.16.230.129
    netmask 255.255.255.0
    gateway 172.16.230.1

这样设置的原因是为了让我可以在我的 vmware 上拥有一个静态 IP,而不限制连接性。

即:如果我将 eth0 设置为给定 IP 的静态 IP,并且移动网络,我将无法再连接。过去,在某些网络环境中(我的学校),与我的 Mac 共享不起作用

照这样说,

我希望能够使用 172.16.230.129 连接通过 ssh 进入我的虚拟机。但是现在它超时了。

有什么解决办法吗?

答案1

重要的一点是,如果你在 eth1 上定义了网关,并在 eth0 上设置了 dhcp,dhcp 通常也会发布一个默认网关,也许正是因为这个原因,你才会丢失连接

相关内容