Skip to content

Commit afa4d0e

Browse files
committed
Update different tenants
1 parent f737fe9 commit afa4d0e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

articles/vpn-gateway/vpn-gateway-create-site-to-site-rm-powershell.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ titleSuffix: Azure VPN Gateway
55
author: cherylmc
66
ms.service: azure-vpn-gateway
77
ms.topic: how-to
8-
ms.date: 12/02/2024
8+
ms.date: 03/25/2025
99
ms.author: cherylmc
1010
ms.custom: devx-track-azurepowershell
1111

@@ -30,6 +30,8 @@ Verify that your environment meets the following criteria before beginning confi
3030
* Make sure you have a compatible VPN device and someone who can configure it. For more information about compatible VPN devices and device configuration, see [About VPN devices](vpn-gateway-about-vpn-devices.md).
3131
* Determine if your VPN device supports active-active mode gateways. This article creates an active-active mode VPN gateway, which is recommended for highly available connectivity. Active-active mode specifies that both gateway VM instances are active. This mode requires two public IP addresses, one for each gateway VM instance. You configure your VPN device to connect to the IP address for each gateway VM instance.<br>If your VPN device doesn't support this mode, don't enable this mode for your gateway. For more information, see [Design highly available connectivity for cross-premises and VNet-to-VNet connections](vpn-gateway-highlyavailable.md) and [About active-active mode VPN gateways](about-active-active-gateways.md).
3232

33+
* If your virtual network gateway and local network gateway reside in different subscriptions and different tenants, you'll need to use slightly different steps. Review the [Connections with different tenants and different subscriptions](#tenants).
34+
3335
### Azure PowerShell
3436

3537
[!INCLUDE [powershell](../../includes/vpn-gateway-cloud-shell-powershell-about.md)]
@@ -91,6 +93,26 @@ The shared key must match the value you used for your VPN device configuration.
9193
-ConnectionType IPsec -SharedKey 'abc123'
9294
```
9395

96+
## <a name="tenants"></a>Connections with different tenants and different subscriptions
97+
98+
When the virtual network gateway and the local network gateway reside in different subscriptions and in different tenants, the connection commands need to be specified differently than in the previous section.
99+
100+
For the LocalNetworkGateway that resides in Tenant2, Subscription 2, use the following commands. Adjust any variables to match your environment.
101+
102+
```azurepowershell-interactive
103+
Connect-AzAccount -TenantID $Tenant2
104+
Select-AzSubscription -SubscriptionId $subscription2
105+
$local = Get-AzLocalNetworkGateway -Name Site1 -ResourceGroupName TestRG1
106+
```
107+
108+
For the VirtualNetworkGateway that resides in Tenant2, Subscription2, use the following commands. Adjust any variables to match your environment.
109+
110+
```azurepowershell-interactive
111+
Select-AzSubscription -SubscriptionId $subscription2
112+
$gateway1 = Get-AzVirtualNetworkGateway -Name VNet1GW -ResourceGroupName TestRG1
113+
New-AzVirtualNetworkGatewayConnection -Name VNet1toSite1 -ResourceGroupName TestRG1 -Location 'East US' -VirtualNetworkGateway1 $gateway1 -LocalNetworkGateway2 $local -ConnectionType IPsec -SharedKey 'abc123'
114+
```
115+
94116
## <a name="toverify"></a>Verify the VPN connection
95117

96118
There are a few different ways to verify your VPN connection.

0 commit comments

Comments
 (0)