Skip to content

Commit 02c0f51

Browse files
authored
Update vpn-gateway-ipsecikepolicy-rm-powershell.md
1 parent 965f38d commit 02c0f51

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

articles/vpn-gateway/vpn-gateway-ipsecikepolicy-rm-powershell.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: cherylmc
77

88
ms.service: vpn-gateway
99
ms.topic: how-to
10-
ms.date: 01/12/2023
10+
ms.date: 01/30/2023
1111
ms.author: cherylmc
1212
ms.custom: devx-track-azurepowershell
1313

@@ -219,7 +219,7 @@ $vnet2 = Get-AzVirtualNetwork -Name $VNetName2 -ResourceGroupName $RG2
219219
$subnet2 = Get-AzVirtualNetworkSubnetConfig -Name "GatewaySubnet" -VirtualNetwork $vnet2
220220
$gw2ipconf1 = New-AzVirtualNetworkGatewayIpConfig -Name $GW2IPconf1 -Subnet $subnet2 -PublicIpAddress $gw2pip1
221221
222-
New-AzVirtualNetworkGateway -Name $GWName2 -ResourceGroupName $RG2 -Location $Location2 -IpConfigurations $gw2ipconf1 -GatewayType Vpn -VpnType RouteBased -GatewaySku VpnGw2
222+
New-AzVirtualNetworkGateway -Name $GWName2 -ResourceGroupName $RG2 -Location $Location2 -IpConfigurations $gw2ipconf1 -GatewayType Vpn -VpnType RouteBased -VpnGatewayGeneration Generation2 -GatewaySku VpnGw2
223223
```
224224

225225
It can take about 45 minutes or more to create the VPN gateway.
@@ -332,7 +332,19 @@ To enable "UsePolicyBasedTrafficSelectors" when connecting to an on-premises pol
332332
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $connection6 -IpsecPolicies $newpolicy6 -UsePolicyBasedTrafficSelectors $True
333333
```
334334

335-
To check the connection for the updated policy, run the following command.
335+
Similar to "UsePolicyBasedTrafficSelectors", configuring DPD timeout can be performed outside of the IPsec policy being applied:
336+
337+
```azurepowershell-interactive
338+
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $connection6 -IpsecPolicies $newpolicy6 -DpdTimeoutInSeconds 30
339+
```
340+
341+
Either/both **Policy-based traffic selector** and **DPD timeout** options can be specified with **Default** policy, without a custom IPsec/IKE policy, if desired.
342+
343+
```azurepowershell-interactive
344+
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $connection6 -UsePolicyBasedTrafficSelectors $True -DpdTimeoutInSeconds 30
345+
```
346+
347+
You can get the connection again to check if the policy is updated. To check the connection for the updated policy, run the following command.
336348

337349
```azurepowershell-interactive
338350
$connection6 = Get-AzVirtualNetworkGatewayConnection -Name $Connection16 -ResourceGroupName $RG1
@@ -367,6 +379,12 @@ $connection6.IpsecPolicies.Remove($currentpolicy)
367379
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $connection6
368380
```
369381

382+
You can use the same script to check if the policy has been removed from the connection.
383+
384+
## IPsec/IKE policy FAQ
385+
386+
To view frequently asked questions, go to the IPsec/IKE policy section of the [VPN Gateway FAQ](vpn-gateway-vpn-faq.md#ipsecike).
387+
370388
## Next steps
371389

372-
See [Connect multiple on-premises policy-based VPN devices](vpn-gateway-connect-multiple-policybased-rm-ps.md) for more details regarding policy-based traffic selectors.
390+
See [Connect multiple on-premises policy-based VPN devices](vpn-gateway-connect-multiple-policybased-rm-ps.md) for more details regarding policy-based traffic selectors.

0 commit comments

Comments
 (0)