このエントリは2020/06/11現在の情報に基づくものです。今後の機能追加や変更により、記載内容との乖離が発生する可能性があります。
実は以下のエントリの表を日本語にしてるだけだったりするが、VNet間をつなぐ際に、VPN Gatewayを使う方法とVNet Peeringを使う方法がある。以下は自身の備忘録。
Choosing between Azure VNet Peering and VNet Gateways
https://azure.microsoft.com/blog/vnet-peering-and-vpn-gateways/
なお、Virtual WANはVNetを結ぶというよりは、P2S/S2S VPNやExpressRouteとVNetを結ぶものなので、毛色が違うから対象外。
TL;DR
- 広帯域、低遅延を求めるならVNet Peering
- レイテンシや帯域よりも通信の暗号化を求めるならVPN Gateway
- VNet Peeringの制約(A-B間、B-C間をPeeringしていてもA-C間は通信不可)に注意
- 通信暗号化がTLSでの接続で許容されるのであれば、VPN GatewayではなくVNet Peeringも選択肢(というかそちらを推奨)
VNet Peering
VNet peering enables you to seamlessly connect Azure virtual networks. Once peered, the VNets appear as one, for connectivity purposes. The traffic between virtual machines in the peered virtual networks is routed through the Microsoft backbone infrastructure, much like traffic is routed between virtual machines in the same VNet, through private IP addresses only. No public internet is involved. You can peer VNets across Azure regions, too – all with a single click in the Azure Portal.
- ピアリングしたVNetのVM間のトラフィックはMicrosoftバックボーンネットワークを経由する(外部に出ない)
- リージョン間でもピアリングできる(Global VNet Peering)
- ピアリングの場合、ゲートウェイを挟まないため、余分なホップがなく、低遅延、高帯域幅の接続である
VPN Gateway
A VPN gateway is a specific type of VNet gateway that is used to send traffic between an Azure virtual network and an on-premises location over the public internet. You can also use a VPN gateway to send traffic between VNets. Each VNet can have only one VPN gateway.
- VNetとOn-premiseだけでなく、VNet間も接続できる
- VNet間の場合はMicrosoftバックボーンネットワークを通るため、外部に出ない
- 通信を暗号化するが、帯域幅は制限され、レイテンシはVNet Peeringに比べて大きくなる
VPN GatewayとVNetはGateway transitを使って共存できる。
Create a transit VNet using VNet peering
https://azure.microsoft.com/blog/create-a-transit-vnet-using-vnet-peering/
対比表
VNetピアリング | VPN Gateway | |
---|---|---|
リージョン間の接続をサポートしているか? | ○ Global VNet Peeringでサポート | ○ |
Azure Active Directoryのテナントを跨ぐ接続をサポートしているか? | ○ 以下のドキュメントを参照 Create a virtual network peering – Resource Manager, different subscriptions and Azure Active Directory tenants https://docs.microsoft.com/azure/virtual-network/create-peering-different-subscriptions | ○ 以下のドキュメントを参照 Can I establish a VNet-to-VNet connection across Azure Active Directory (AAD) tenants? https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-resource-manager-portal#can-i-establish-a-vnet-to-vnet-connection-across-azure-active-directory-aad-tenants |
サブスクリプションを跨ぐ接続をサポートするか? | ○ 以下のドキュメントを参照 Create a virtual network peering – Resource Manager, different subscriptions and Azure Active Directory tenants https://docs.microsoft.com/azure/virtual-network/create-peering-different-subscriptions | ○ 以下のドキュメントを参照 Configure a VNet-to-VNet VPN gateway connection by using the Azure portal https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-resource-manager-portal |
異なるデプロイメントモデルでの接続をサポートするか? | ○ 以下のドキュメントを参照 Create a virtual network peering – different deployment models, same subscription https://docs.microsoft.com/azure/virtual-network/create-peering-different-deployment-models | ○ 以下のドキュメントを参照 Connect virtual networks from different deployment models using the portal https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-connect-different-deployment-models-portal |
制限事項 | 1個のVNetで最大500個のピアリングが可能。詳細はNetworkingの制限事項を参照。 Networking limits https://docs.microsoft.com/azure/azure-resource-manager/management/azure-subscription-service-limits#networking-limits | 各VNetには1個のVPN Gatewayのみ。VPN Gatewayでトンネリング可能な個数は、SKUによって異なる。詳細はVPN Gatewayの制限事項を参照。 https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-about-vpngateways#gwsku |
おかね | Ingress/Egressともに課金対象 https://azure.microsoft.com/pricing/details/virtual-network/ | GatewayとEgressに対して課金 https://azure.microsoft.com/pricing/details/vpn-gateway/ |
通信は暗号化されている? | × ソフトウェアレベルの暗号化を推奨 | ○ カスタムIPsec/IKEポリシーを作成し、新規もしくは既存の接続に適用できる。 About cryptographic requirements and Azure VPN gateways https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-about-compliance-crypto |
帯域幅の制約はあるか? | 帯域幅の制限なし | 選択したGateway SKUに依存。 100Mbpsから 1.25 Gbps。 Gateway SKUs by tunnel, connection, and throughput https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-about-vpngateways#benchmark |
プライベートネットワークで閉じている? | ○ Public IPのエンドポイントはない。全てMicrosoftのバックボーンネットワークを経由するため、外部インターネットに出ることはない。 | △ 外部インターネットを経由する場合がある。Azureのリソース間(VNet間)であればMicrosoftのバックボーンを通るため外部インターネットに出ないが、オンプレミスとの接続であればもちろん外部インターネットに出る。 |
推移する関係 | VNet A-VNet Bがピアリング、VNet B-VNet Cもピアリングしている場合でも、VNet A-VNet Cの通信はできない。スポーク間の通信は、ハブとなるVNetでNVA (Network Virtual Appliance) やGatewayを使う必要がある(ドキュメントにサンプルあり)。 Spoke connectivity https://docs.microsoft.com/azure/architecture/reference-architectures/hybrid-networking/hub-spoke#spoke-connectivity | VNet A、VNet B、VNet CがVPN Gatewayを通じて接続し、BGPがVNet接続で有効になっていれば、VNet A<->VNet Cの通信は可能。 |
ユースケース | データレプリケーション データベースのフェールオーバー 大量データの頻繁なバックアップが必要なケース | レイテンシや高スループットよりは暗号化が求められるケース |
セットアップの時間 | 原著者の環境では24.38秒。 | 30分…。 |
FAQ | VNet peering FAQ https://docs.microsoft.com/azure/virtual-network/virtual-networks-faq#vnet-peering | VPN gateway FAQ https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-vpn-faq |