阻止客户端通过我的 RRAS VPN 使用互联网

Prevent client from using internet via my RRAS VPN

我在 Azure 中有一个 windows 服务器 2016 运行,带有 RRAS VPN + NAT。 我使用此 RRAS VPN 能够通过 RDP 连接到虚拟网络中的其他 VM。 但是,当我将我的客户端 (windows 10) 计算机连接到 RRAS VPN 时,我的互联网将停止在客户端上工作(因为互联网访问在 RRAS VM 上被阻止)。

如何防止客户端尝试使用我的 RRAS VPN 虚拟机提供的互联网?我尝试禁用 use-default-gateway 复选框,但我无法再连接到虚拟网络中的其他 VM。

谢谢!

根据 this link 看来,当您禁用 "use-default-gateway checkbox" 时,默认路由不会添加到您的机器。具体来说:

If “User default gateway on remote network” is turned on, the VPN client on successful VPN tunnel connection adds the default route on VPN interface with highest precedence. This way all the IP packets (except those destined to local subnet) go to VPN server. If this parameter is turned off, the default route is not added on VPN tunnel. This scenario will require user to add specific network specific route on the VPN interface – in order to reach the corpnet resources

因此,您需要手动编辑路线以确保它们有效。您可以在 windows 中通过使用路由 table 轻松完成此操作。 following article 给出了如何设置的基础知识。

基本上你会想要运行这样的东西:

route ADD <azure network> MASK <azure mask> <azure gw ip>

完成此操作后,您应该能够使用互联网(通过您的本地配置)并访问您的 Azure 服务器(通过您在上面创建的路由)。