Reset a VPN gateway or connection to reestablish IPsec tunnels - Azure VPN Gateway (2024)

  • Article

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.

What happens during a reset

Gateway reset

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.

Connection reset

When you select to reset a connection, the gateway doesn't reboot. Only the selected connection is reset and restored.

Reset a connection

You can reset a connection easily using the Azure portal.

  1. 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'

  2. On the Connection page, in the left pane, scroll down to the Support + Troubleshooting section and select Reset.

  3. On the Reset page, select Reset to reset the connection.

Reset a gateway

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.

Azure portal

You can reset a Resource Manager VPN gateway using the Azure portal.

  1. In the portal, go to the virtual network gateway that you want to reset.
  2. On the Virtual network gateway page, in the left pane, scroll down to Reset.
  3. On the Reset page, select Reset. After the command is issued, the current active instance of Azure VPN Gateway is rebooted immediately. Resetting the gateway causes a gap in VPN connectivity and might limit future root cause analysis of the issue.

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.

PowerShell

The cmdlet for resetting a gateway is Reset-AzVirtualNetworkGateway. The following example resets a virtual network gateway named VNet1GW in the TestRG1 resource group:

$gw = Get-AzVirtualNetworkGateway -Name VNet1GW -ResourceGroupName TestRG1Reset-AzVirtualNetworkGateway -VirtualNetworkGateway $gw

You can view the reset history of the gateway from Azure portal by navigating to 'GatewayName' -> Resource Health.

Note: If the gateway is set up as active-active, use -GatewayVip <string> to reset both the instances one by one.

Azure CLI

To reset the gateway, use the az network vnet-gateway reset command. 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.

Note: If the gateway is set up as active-active, use --gateway-vip <string> to reset both the instances one by one.

Reset a classic gateway

The cmdlet for resetting a classic gateway is Reset-AzureVNetGateway. The Azure PowerShell cmdlets for Service Management must be installed locally on your desktop. You can't use Azure Cloud Shell. Before performing a reset, make sure you have the latest version of the Service Management (SM) PowerShell cmdlets.

When using this command, make sure you're using the full name of the virtual network. Classic VNets that were created using the portal have a long name that is required for PowerShell. You can view the long name by using Get-AzureVNetConfig -ExportToFile C:\Myfoldername\NetworkConfig.xml.

The following example resets the gateway for a virtual network named "Group TestRG1 TestVNet1" (which shows as simply "TestVNet1" in the portal):

Reset-AzureVNetGateway –VnetName 'Group TestRG1 TestVNet1'

Result:

Error :HttpStatusCode : OKId : f1600632-c819-4b2f-ac0e-f4126bec1ff8Status : SuccessfulRequestId : 9ca273de2c4d01e986480ce1ffa4d6d9StatusCode : OK

Next steps

For more information about VPN Gateway, see the VPN Gateway FAQ.

Reset a VPN gateway or connection to reestablish IPsec tunnels - Azure VPN Gateway (2024)

FAQs

Reset a VPN gateway or connection to reestablish IPsec tunnels - Azure VPN Gateway? ›

Reset the VPN connection: Disconnect from the VPN entirely and reconnect. Sometimes, simply reestablishing the connection can resolve server-related issues. Review security settings: Your firewall or antivirus software might be blocking the connection to the server.

How to reset IPsec tunnel? ›

reset ipsec session
  1. Syntax.
  2. View. User view.
  3. Default level. 2: System level.
  4. Parameters. integer: ID of the IPsec tunnel, in the range 1 to 2000000000.
  5. Description. Use the reset ipsec session command to clear the sessions of a specified IPsec tunnel or all IPsec tunnels. ...
  6. Examples. # Clear all IPsec sessions.

How do I reset my VPN connection? ›

Reset the VPN connection: Disconnect from the VPN entirely and reconnect. Sometimes, simply reestablishing the connection can resolve server-related issues. Review security settings: Your firewall or antivirus software might be blocking the connection to the server.

How do I update my Azure VPN gateway? ›

Workflow
  1. Remove any connections to the virtual network gateway.
  2. Delete the old VPN gateway.
  3. Create the new VPN gateway.
  4. Update your on-premises VPN devices with the new VPN gateway IP address (for site-to-site connections).
Oct 26, 2023

Why is my IPsec tunnel not working? ›

If the tunnel is not establishing, check for UDP entries for ports 500 and 4500 . Rules are normally added automatically for IPsec (IPsec and firewall rules), but that feature can be disabled or there may be edge cases where the firewall cannot identify the remote IPsec gateway. Add rules to pass traffic if needed.

How to setup IPsec VPN tunnel in Azure? ›

2) Configure the IPSec VPN Tunnel on the MS Azure
  1. 2.1 Sign into Azure Management Portal.
  2. 2.2 Select a Deployment Model from Virtual Network Configuration.
  3. 2.3 Configure the VPN settings on Azure.
  4. 2.4 Configure the Virtual Network Subnet on Azure.
  5. 2.5 Configure the Virtual Network Gateway on Azure.
Apr 19, 2024

How do I know if my IPSec tunnel is working? ›

The easiest test for an IPsec tunnel is a ping from one client station behind the firewall to another on the opposite side. If that works, the tunnel is up and working properly.

How do I know if my IPSec tunnel is up? ›

To view status information about active IPsec tunnels, use the show ipsec tunnel command. This command prints status output for all IPsec tunnels, and it also supports printing tunnel information individually by providing the tunnel ID.

How to configure IPSec tunnels? ›

Procedure
  1. Configure IP addresses and static routes for interfaces on. ...
  2. Create IPSec proposals on RouterA and RouterB. ...
  3. Configure IKE peers on RouterA and RouterB. ...
  4. Create IPSec profiles on RouterA and RouterB. ...
  5. Apply the IPSec profiles to IPSec tunnel interfaces on.
Aug 7, 2023

How do I fix my VPN connection problem? ›

How to fix a VPN that's not working
  1. Check your internet connection.
  2. Check your firewall settings.
  3. Try a different VPN protocol.
  4. Check the VPN server status.
  5. Give your VPN more time to connect.
  6. Update your VPN app.
  7. Restart your VPN app.
  8. Reinstall your VPN app.
Nov 9, 2023

Could not connect to VPN gateway.? ›

To fix VPN connection problems, you can try restarting your VPN client, resetting your network settings, changing the VPN server location, checking for updates, and contacting your VPN provider's support team for assistance.

How do I refresh my VPN IP address? ›

When connecting to a server, your connection is assigned an IP address automatically. But what if you wanted to use a different IP address? Without changing servers, you can refresh the IP address assigned to you by disconnecting and reconnecting to the same server.

How do I test my Azure VPN gateway? ›

Sign in to the Azure portal (portal.azure.com) using your Azure account credentials. In the Azure portal, navigate to the Virtual Network (VNet) that is associated with your Site-to-Site VPN connection. In the VNet menu, select “Subnets” and then select the subnet that is associated with your VPN gateway.

What is an Azure VPN gateway? ›

Azure VPN Gateway is a service that can be used to send encrypted traffic between an Azure virtual network and on-premises locations over the public Internet. You can also use VPN Gateway to send encrypted traffic between Azure virtual networks over the Microsoft network.

How do I find my VPN gateway in Azure? ›

Go to your virtual network. On your virtual network page, in the left pane, select Connected devices. Locate your VPN gateway and select it to open it. On the page for the gateway, select Connections.

How do I reset my Azure settings? ›

If you've made changes to the Azure portal settings and want to discard them, select Restore default settings from the top of the My information pane. You'll be prompted to confirm this action. If you do so, any changes you've made to your Azure portal settings are lost.

How do I reset the tunnel in Asa? ›

You can reset the tunnel via the ASDM software as well as in the command line. In the ASDM (Version 6.3): Go to Monitoring, then select VPN from the list of Interfaces. Then expand VPN statistics and click on Sessions.

What is the command to clear IPSec tunnel on a Cisco router? ›

Use the clear crypto ipsec sa command to delete active IPSec sessions or force IPSec to reestablish new SAs. Usually, the establishment of SAs is negotiated between peers through Internet Key Exchange (IKE) on behalf of IPSec.

Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 6371

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.