在内部networking上路由到远程桌面网关

我有一个作为虚拟化实验室使用的单一物理主机,Hyper-V上的一些虚拟机通过内部networking连接到主机。 我有它的工作,以便物理主机作为远程桌面网关路由器指向网关,一切都很好,我可以通过互联网login到我的虚拟机。

我已经把我的网关移动到位于我的活动目录的DNS位于remote.example.com的静态IP地址的内部networking上的虚拟机。 这是为了让单个虚拟机执行特定的angular色,并最终能够在虚拟机上使用负载均衡。

目前只有一台虚拟机作为RDG,我可以通过主机访问内部networking上的所有虚拟机,因为它可以看到remote.example.com的IP地址。 我想我需要添加一些转发/路由/redirect到主机,使网关从“外部”可见。

(Internet)== 1 ==>(Router)== 2 ==> [Host] == 3 ==> [remote.example.com] == 4 ==> [VM_1 | VM_2 | VM_3]

让我的主机代理请求到我的内部虚拟机/网关是什么正确的方法?

我的ApplicationHost.config中的ARR当前设置:

<webFarms> <webFarm name="Remote" enabled="true"> <server address="192.168.1.3" enabled="true" /> <applicationRequestRouting> <protocol> <cache enabled="false" /> </protocol> </applicationRequestRouting> </webFarm> <applicationRequestRouting> <hostAffinityProviderList> <add name="Microsoft.Web.Arr.HostNameRoundRobin" /> <add name="Microsoft.Web.Arr.HostNameMemory" /> </hostAffinityProviderList> </applicationRequestRouting> </webFarms> 

在system.webServer / rewrite / globalRules下:

 <globalRules> <rule name="ARR_Remote_loadbalance_SSL" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTPS}" pattern="on" /> <add input="{HTTP_HOST}" pattern="remote.example.com" /> </conditions> <action type="Rewrite" url="https://Remote/{R:0}" /> </rule> <rule name="ARR_Remote_loadbalance" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <action type="Rewrite" url="http://Remote/{R:0}" /> <conditions> <add input="{HTTP_HOST}" pattern="remote.example.com" /> </conditions> </rule> </globalRules> 

编辑:

在外部设备上,我可以连接到https://remote.example.com并查看IISlogin页面。 当我去https://remote.example.com/rpc我收到503必须使用后

当我尝试通过RDP客户端使用网关服务器时,我收到

 The gateway failed to connect with the message: 404 not found 

主机和虚拟机重新启动后,我可以从外部设备访问该站点,并且可以在RDP连接上执行失败的请求跟踪。

失败的请求跟踪

看起来ARR正在尝试处理请求本身,而不是将请求转发给远程VM

原来这是一个稍微错误configuration的简单例子。 我发布的ARR路由模式是{HTTP_HOST} = remote.example.com。 根据失败的请求日志,这不匹配

失败的ARR规则匹配

我相信这是因为ARR规则只会看到主机名即remote.example,而不是remote.example.com,因为各种组合如remote.example。 ,远程。 ,远程*匹配,并正确转发,也许我错过了与模式匹配ARR的一些技巧。

作为参考,我已经基本上遵循本指南: http:

我很确定使用ARR不受支持,即使它可以工作。 您最简单的方法是让网关虚拟机与“外部”networking交谈,以便您的路由器可以直接向其发送stream量。 或者你需要“某些东西”,可以将stream量路由到网关虚拟机,NATing防火墙等等。 我不会把这个“东西”放在我的Hyper-V盒子上,那些东西应该尽可能保持干净。