title | titleSuffix | description | author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Reset a VPN gateway or connection to reestablish IPsec tunnels |
Azure VPN Gateway |
Learn how to reset a gateway or a gateway connection to reestablish IPsec tunnels. |
cherylmc |
azure-vpn-gateway |
how-to |
08/07/2024 |
cherylmc |
Resetting an Azure VPN gateway or gateway connection is helpful if you lose cross-premises VPN connectivity on one or more site-to-site VPN tunnels. In this situation, your on-premises VPN devices are all working correctly, but aren't able to establish IPsec tunnels with the Azure VPN gateways. This article helps you reset a VPN gateway or gateway connection.
A VPN gateway is composed of two virtual machine (VM) instances running in an active-standby or active-active configuration. When you reset the gateway, it reboots the gateway, and then reapplies the cross-premises configurations to it. The gateway keeps the public IP address it already has. This means you won’t need to update the VPN router configuration with a new public IP address for Azure VPN gateway.
When you issue the command to reset the gateway in active-standby setup, the current active instance of the Azure VPN gateway is rebooted immediately. A brief connectivity disruption can be expected during the failover from the active instance (being rebooted), to the standby instance.
When you issue the command to reset the gateway in active-active setup, one of the active instances (for example, primary active instance) of the Azure VPN gateway is rebooted immediately. A brief connectivity disruption can be expected as the gateway instance gets rebooted.
If the connection hasn't restored after the first reboot, the next steps might vary depending on if the VPN gateway is configured as active-standby or active-active:
- If the VPN gateway is configured as active-standby, issue the same command again to reboot the second VM instance (the new active gateway).
- If the VPN gateway is configured as active-active, the same instance gets rebooted when the reset gateway operation is issued again. You can use PowerShell or CLI to reset one or both of the instances using VIPs.
When you select to reset a connection, the gateway doesn't reboot. Only the selected connection is reset and restored.
You can reset a connection easily using the Azure portal.
-
Go to the Connection that you want to reset. You can find the connection resource either by locating it in All resources, or by going to the 'Gateway Name' -> Connections -> 'Connection Name'
-
On the Connection page, in the left pane, scroll down to the Help section and select Reset.
-
On the Reset page, select Reset to reset the connection.
:::image type="content" source="./media/reset-gateway/reset-connection.png" alt-text="Screenshot showing the Reset button selected." lightbox="./media/reset-gateway/reset-connection.png":::
Before you reset your gateway, verify the following key items for each IPsec site-to-site (S2S) VPN tunnel. Any mismatch in the items results in the disconnect of S2S VPN tunnels. Verifying and correcting the configurations for your on-premises and Azure VPN gateways saves you from unnecessary reboots and disruptions for the other working connections on the gateways.
Verify the following items before resetting your gateway:
- The Internet IP addresses (VIPs) for both the Azure VPN gateway and the on-premises VPN gateway are configured correctly in both the Azure and the on-premises VPN policies.
- The preshared key must be the same on both Azure and on-premises VPN gateways.
- If you apply specific IPsec/IKE configuration, such as encryption, hashing algorithms, and PFS (Perfect Forward Secrecy), ensure both the Azure and on-premises VPN gateways have the same configurations.
You can reset a Resource Manager VPN gateway using the Azure portal.
[!INCLUDE portal steps]
Note: If the VPN gateway is configured as active-active, you can reset the gateway instances using VIPs of the instances in PowerShell or CLI.
The cmdlet for resetting a gateway is Reset-AzVirtualNetworkGateway. If the gateway is set up as active-active, use -GatewayVip <string>
to reset both the instances one by one.
The following example resets a virtual network gateway named VNet1GW in the TestRG1 resource group:
$gw = Get-AzVirtualNetworkGateway -Name VNet1GW -ResourceGroupName TestRG1
Reset-AzVirtualNetworkGateway -VirtualNetworkGateway $gw
You can view the reset history of the gateway from Azure portal by navigating to 'GatewayName' -> Resource Health.
To reset the gateway, use the az network vnet-gateway reset command. If the gateway is set up as active-active, use --gateway-vip <string>
to reset both the instances one by one.
The following example resets a virtual network gateway named VNet5GW in the TestRG5 resource group:
az network vnet-gateway reset -n VNet5GW -g TestRG5
You can view the reset history of the gateway from Azure portal by navigating to 'GatewayName' -> Resource Health.
For more information about VPN Gateway, see the VPN Gateway FAQ.