通过另一个 Azure 虚拟网络直接连接到 Azure 虚拟网络中的资源

Connect directly to resources in an Azure virtual network via another Azure virtual network

我在通过 VNET 到 VNET 连接的不同区域中使用两个 Azure vnet 进行测试,并将点到站点 VPN 连接到其中一个。有点像这样:

-------------------   VPN    ---------        ---------
| Client Computer | -------> | VNET1 | -----> | VNET2 |
-------------------          ---------        ---------
                             10.1.0.0/24      10.0.0.0/24

是否可以从客户端计算机直接访问 VNET2 中的 computer/resource,通过 VNET1 进行有效路由?

我发现这篇文章 http://hindenes.com/trondsworking/2016/08/07/azure-vnet-peering 表明可以使用相对较新的对等互连功能来完成,但不幸的是,这不适用于跨区域。

如有任何建议,我将不胜感激。

-------------------   VPN    ---------        ---------
| Client Computer | -------> | VNET1 | -----> | VNET2 |
-------------------          ---------        ---------
192.168.0.0/16               10.1.0.0/24      10.0.0.0/24

您需要在 Vnet1 上有一个路由 table,其中 10.0.0.0/24 和 192.168.0.0/16 都指向虚拟网络网关。

虚拟网络网关将从那里决定将流量路由到哪里。

更一般地说,您在子网上创建路由 table 以确定应将源自该子网的流量定向到何处。

好的,所以我终于让它工作了。我之前在 VNET1 和 VNET2 之间使用 VNET 到 VNET 连接,但我最终将其换成了站点到站点连接。这种类型的连接使用 Azure 的 'Local Network Connection' 资源,这些资源会根据您在设置时指定的地址定义路由。

将路由 Table 添加到子网,即使您不添加任何路由,在这里也非常有用,因为它允许您使用 'Support + Troubleshooting' 下的 'Effective routes' 功能查看您网络的路由表。

无论如何,我听从了这个博客中的建议 post https://www.altitude365.com/2016/04/26/azure-p2s-vpn-how-to-route-between-vnets which was pretty much the setup I was trying to achieve. The key appears to be the adding of the P2S VPN range to VNET2 and, obviously, altering the routes on your client. I also found this article that explains how to re-package the VPN client for distribution https://msfreaks.wordpress.com/2015/12/11/building-an-azure-lab-customizing-the-p2s-point-to-site-vpn-client

我仍然有兴趣看看这是否可以使用 VNET 到 VNET 连接,但到目前为止我一直没有成功。

@MichaelB 感谢您的帮助。您关于路由的回答为我指明了正确的方向。