我在eth0接口上有几个全局IP地址。 在我的vagrant文件中,我将这个IP指定为public_network:
config.vm.network "public_network", ip: "xxxx.xxxx.xxxx.xxxx"
当stream浪汉开始ssh端口转发到其他端口(如2222)。 而且我可以使用转发的端口通过ssh远程连接到我的虚拟机。 如何将22 ssh端口转发到我的外部IP的同一端口,以便能够连接到我的虚拟机作为简单的VPS(通过ssh [email protected]没有指定端口)?
当我尝试使用“forwarded_port”22到22时,我得到下一个错误:
Vagrant cannot forward the specified ports on this VM, since they would collide with some other application that is already listening on these ports. The forwarded port to 22 is already in use on the host machine.
我可以绑定端口只为我的外部IP地址,但不是主机?