Verify a VPN Gateway connection

This article shows you how to verify a VPN gateway connection for both the classic and Resource Manager deployment models.

Azure portal

In the Azure portal, you can view the connection status of a Resource Manager VPN Gateway by navigating to the connection. The following steps show one way to navigate to your connection and verify.

  1. In the Azure portal, click All resources and navigate to your virtual network gateway.

  2. On the blade for your virtual network gateway, click Connections. You can see the status of each connection.

  3. Click the name of the connection that you want to verify to open Essentials. In Essentials, you can view more information about your connection. The Status is 'Succeeded' and 'Connected' when you have made a successful connection.

    Verify VPN Gateway connection using Azure portal

PowerShell

To verify a VPN gateway connection for the Resource Manager deployment model using PowerShell, install the latest version of the Azure Resource Manager PowerShell cmdlets.

You can verify that your connection succeeded by using the 'Get-AzVirtualNetworkGatewayConnection' cmdlet, with or without '-Debug'.

  1. Use the following cmdlet example, configuring the values to match your own. If prompted, select 'A' in order to run 'All'. In the example, '-Name' refers to the name of the connection that you want to test.

    Get-AzVirtualNetworkGatewayConnection -Name VNet1toSite1 -ResourceGroupName TestRG1
    
  2. After the cmdlet has finished, view the values. In the example below, the connection status shows as 'Connected' and you can see ingress and egress bytes.

    "connectionStatus": "Connected",
    "ingressBytesTransferred": 33509044,
    "egressBytesTransferred": 4142431
    

Azure CLI

To verify a VPN gateway connection for the Resource Manager deployment model using Azure CLI, install the latest version of the CLI commands (2.0 or later).

You can verify that your connection succeeded by using the az network vpn-connection show command. In the example, '--name' refers to the name of the connection that you want to test. When the connection is in the process of being established, its connection status shows 'Connecting'. Once the connection is established, the status changes to 'Connected'.

az network vpn-connection show --name VNet1toSite2 --resource-group TestRG1

Azure portal (classic)

In the Azure portal, you can view the connection status for a classic VNet VPN Gateway by navigating to the connection. The following steps show one way to navigate to your connection and verify.

  1. In the Azure portal, click All resources and navigate to your classic virtual network.

  2. On the virtual network blade, click Overview to access the VPN connections section of the blade.

  3. On the VPN connections graphic, click the site.

    Local site

  4. On the Site-to-site VPN connections blade, view the information about your site.

    Connection status

  5. To view more information about the connection, click the name of the connection to open the Site-to-site VPN Connection blade.

    Connection status more

PowerShell (classic)

To verify your VPN gateway connection for the classic deployment model using PowerShell, install the latest versions of the Azure PowerShell cmdlets. Be sure to download and install the Service Management module. Use 'Add-AzureAccount' to log in to the classic deployment model.

You can verify that your connection succeeded by using the 'Get-AzureVNetConnection' cmdlet.

  1. Use the following cmdlet example, configuring the values to match your own. The name of the virtual network must be in quotes if it contains spaces.

    Get-AzureVNetConnection "Group ClassicRG ClassicVNet"
    
  2. After the cmdlet has finished, view the values. In the example below, the Connectivity State shows as 'Connected' and you can see ingress and egress bytes.

     ConnectivityState         : Connected
     EgressBytesTransferred    : 181664
     IngressBytesTransferred   : 182080
     LastConnectionEstablished : 1/7/2016 12:40:54 AM
     LastEventID               : 24401
     LastEventMessage          : The connectivity state for the local network site 'RMVNetLocal' changed from Connecting to
                                 Connected.
     LastEventTimeStamp        : 1/7/2016 12:40:54 AM
     LocalNetworkSiteName      : RMVNetLocal
    

Next steps