我有一台电脑,让我们称之为linux@home。我有一个专用的远程linux服务器,让我们称它为linuxHost@datacenter。我在专用服务器上有一个运行windows 7的virtualbox虚拟机,让我们称它为windowsGuest@datacenter。
我通过virtualbox管理器在windowsGuest上建立了NAT网络接口。
windowsGuest@datacenter正在运行一个服务,该服务需要访问linuxHost@datacenter上的sql数据库,并且运行良好。windowsHost上的相同服务需要侦听udp端口上的连接,比如12345。windowsGuest可以接入互联网,网页浏览工作正常(不需要,但效果很好)。
因此,现在我需要linux@home tu运行一个连接在windowsGuest@datacenter上的udp端口12345上的客户机应用程序。我所做的是在用于windowsGuest的NAT网络上配置端口转发:
-host ip : 127.0.0.1
-host port : 12346
-protocol : UDP
-guest ip : 10.0.2.4 (which is windowsGuest@datacenter ip address)
-guest port : 12345我预计UDP端口12346上的linuxHost@datacenter上的任何连接都将被转发到windowsGuest@datacenter端口12345,但这种情况似乎没有发生。
更多的信息:
- windowsGuest@datacenter's firewall is turned OFF
- linuxHost@datacenter runs iptables and is configured to allow any connection from linux@home, both tcp and udp.
- linuxHost@datacenter 's iptables doesn't log any blocked packets.
- I don't want to turn off iptables since linuxHost@datacenter is running other services and i don't want to expose that.
- I cannot test the client application on linuxHost@datacenter我做错什么了?我是否应该在端口udp 12346上手动转发从internet到linuxHost@datacenter的连接到127.0.0.1:12345?是否应该以不同的方式配置NAT端口转发?我完全错了吗?我不应该这样处理这种情况吗?
发布于 2018-03-19 12:27:53
多亏了this answer,我才能管理我想要的东西。我必须在virtualbox管理器首选项中修改NAT端口。可以将主机ip字段保留为空白,以便将来自任何ip地址的连接转发给来宾。
https://stackoverflow.com/questions/49362090
复制相似问题