
Azure VPN logs can be a lifesaver when troubleshooting connectivity issues. Azure VPN logs provide a detailed record of all VPN connections, including successes and failures.
The logs include information such as connection timestamps, IP addresses, and error codes. This data can be used to identify patterns and pinpoint the source of the issue.
Azure VPN logs can be accessed through the Azure portal, making it easy to monitor and troubleshoot your VPN connections. The logs can be filtered by date, time, and other criteria to help you quickly find the information you need.
Diagnostic Logs
Diagnostic logs are a crucial tool for troubleshooting Azure VPN issues. They provide a detailed record of events, allowing you to identify potential causes of connectivity problems.
The GatewayDiagnosticLog table is where you'll find configuration changes and events. It may take a few minutes for changes to be reflected in the logs. This table is useful for auditing configuration changes and comparing results with the TunnelDiagnosticLog table to determine if a tunnel connectivity failure occurred during a configuration change or maintenance activity.
The TunnelDiagnosticLog table is used to inspect historical connectivity statuses of the tunnel. It shows columns like TimeGenerated, OperationName, remoteIP_s, and Instance_s. This table is useful for troubleshooting past events about unexpected VPN disconnections.
IKEDiagnosticLog offers verbose debug logging for IKE/IPsec, making it useful for reviewing when troubleshooting disconnections or failure to connect VPN scenarios. It shows columns like TimeGenerated, RemoteIP, LocalIP, and Event. Notice how RemoteIP, LocalIP, and Event columns aren't present in the original column list, but are added to the query by parsing the output of the "Message" column.
P2SDiagnosticLog traces the activity for Point to Site (only IKEv2 and OpenVPN protocols). It shows columns like TimeGenerated, OperationName, and Message. This table is useful for tracing Point to Site settings and IPsec policies in place.
Here's a quick reference guide to the diagnostic logs:
By understanding these diagnostic logs, you'll be better equipped to troubleshoot Azure VPN issues and get your connections up and running smoothly.
Troubleshooting
Troubleshooting Azure VPN logs can be a daunting task, but with the right tools and knowledge, you can quickly identify the root cause of connectivity issues.
To start, it's essential to understand that Azure VPN logs are stored in three main tables: GatewayDiagnosticLog, TunnelDiagnosticLog, and IKEDiagnosticLog. Each table provides a unique perspective on VPN connectivity, and by analyzing them together, you can gain a deeper understanding of what's happening with your VPN.
Comparing the results from the GatewayDiagnosticLog table with the TunnelDiagnosticLog table can help determine if a tunnel connectivity failure happened during a configuration change or maintenance activity. If so, it provides a significant indication towards the potential root cause.
If you observe a disconnection event on one gateway instance, followed by a connection event on a different gateway instance within a few seconds, it indicates a gateway failover. This typically arises due to maintenance on a gateway instance.
Here are some key troubleshooting tips to keep in mind:
- Look for the initial SA_INIT message in the IKEDiagnosticLog table to identify the start of an IPSec negotiation.
- Azure keeps retrying every few seconds if the IPsec tunnel fails to establish, making it convenient to troubleshoot "VPN down" issues in the IKEDiagnosticLog table.
- The SA_INIT message contains the IPSec parameters that the peer wants to use for this IPsec negotiation, which can be found in the Default IPsec/IKE parameters.
Tunnel Diagnostic Log
The Tunnel Diagnostic Log is a valuable tool for troubleshooting unexpected VPN disconnections. It provides a historical record of tunnel connectivity statuses, allowing you to identify potential issues.
This log is particularly useful for analyzing large time ranges over several days with little effort. You can use it to pinpoint the timestamp of a disconnection and then switch to the IKEdiagnosticLog table for more detailed analysis.
The TunnelDiagnosticLog table has several columns, including TimeGenerated, OperationName, remoteIP_s, Instance_s, Resource, and ResourceGroup. Understanding these columns can help you troubleshoot issues effectively.
For example, if you observe a disconnection event on one gateway instance, followed by a connection event on a different gateway instance within a few seconds, it may indicate a gateway failover due to maintenance on a gateway instance.
Here are some possible scenarios to look out for in the TunnelDiagnosticLog:
- Disconnection event on one gateway instance, followed by a connection event on the same gateway instance in a few seconds: This might be a network glitch causing a DPD timeout, or a disconnection erroneously sent by the on-premises device.
- Disconnection event on one gateway instance, followed by a connection event on a different gateway instance within a few seconds: This indicates a gateway failover, often due to maintenance on a gateway instance.
- Intentionally running a Gateway Reset on the Azure side: This causes a reboot of the active gateway instance, leading to a disconnection event on one gateway instance, followed by a connection event on the same or a different gateway instance.
By analyzing the TunnelDiagnosticLog, you can gain valuable insights into your VPN's connectivity and identify potential issues before they become major problems.
Verify the Connection
To verify the connection, start by navigating to the Azure portal and selecting your virtual network gateway. From there, click on Connections to see the status of each connection. Click on the name of the connection you want to verify to open Essentials, where you can view more information about your connection.
The Status should be 'Succeeded' and 'Connected' when you have made a successful connection. You can also access the VPN Status page by navigating to Organization > Monitor > VPN Status tab, or by going to Security & SD-WAN > Monitor > VPN Status tab.
On the non-Meraki peers tab, you can find the following information: Status, Name, Public IP, and Subnets. The Status indicates whether the peer is currently reachable or not. The Name is the name of the non-Meraki peer configured on the Security & SD-WAN > Configure > Site-to-Site VPN page. The Public IP is the public IP configured for the non-Meraki VPN peer.

To troubleshoot issues with your VPN connection, it's helpful to know what to look for. Here's a quick rundown of the key information you can find on the VPN Status page:
By checking these details, you can quickly identify if there are any issues with your VPN connection.
Log Tuple Bandwidth Calculation
When analyzing network traffic, understanding log tuples and bandwidth calculations is crucial for troubleshooting.
Log tuples provide a detailed record of network activity, including flow states and packet counts.
For example, a TCP conversation between 203.0.113.105:35370 and 10.0.0.5:23 shows a total of 9,125 packets transferred.
The total number of bytes transferred in this conversation is 5,256,000.
In the example conversation, continuation (C) and end (E) flow states have aggregate counts from the time of the previous flow's tuple record.
Packet and byte counts are essential for calculating bandwidth usage.
The log tuple example shows that byte and packet counts are aggregated from the previous flow's tuple record.
This means that the total number of packets transferred is the sum of individual packet counts.
Similarly, the total number of bytes transferred is the sum of individual byte counts.
Supported Scenarios
Troubleshooting can be a daunting task, especially when dealing with complex systems like Azure. Fortunately, Azure provides a wealth of information in its flow logs to help you identify and resolve issues.
One of the most important things to know is what scenarios are supported by flow logs. Here are some key points to keep in mind:
Virtual machine scale sets are supported, which means you can use flow logs to troubleshoot issues with these types of resources.
You can also use flow logs to troubleshoot VPN gateways, which are supported.
On the other hand, Azure API management, Azure Application Gateway, and VPN gateways are not supported for network security group flow logs.
Here are some specific scenarios that are supported for virtual network flow logs:
Log Details
The TunnelDiagnosticLog table is a treasure trove of information, allowing you to inspect the historical connectivity statuses of your tunnel. It shows you multiple columns, including TimeGenerated, which displays the timestamp of each event in UTC timezone.
The table also includes columns like OperationName, which shows the event that happened, and remoteIP_s, which displays the IP address of the on-premises VPN device.
You can use this table to troubleshoot past events about unexpected VPN disconnections. Its lightweight nature makes it easy to analyze large time ranges over several days with little effort.
One thing to look out for is a disconnection event on one gateway instance, followed by a connection event on a different gateway instance within a few seconds. This indicates a gateway failover, which can arise due to maintenance on a gateway instance.
Here's a breakdown of possible scenarios:
The IKEDiagnosticLog table, on the other hand, offers verbose debug logging for IKE/IPsec, making it useful for reviewing when troubleshooting disconnections or failure to connect VPN scenarios. It shows you multiple columns, including TimeGenerated, RemoteIP, LocalIP, and Event.
The Event column contains a diagnostic message useful for troubleshooting, which usually starts with a keyword and refers to the actions performed by the Azure Gateway.
Sources
- https://learn.microsoft.com/en-us/azure/vpn-gateway/troubleshoot-vpn-with-azure-diagnostics
- https://docs.fortinet.com/document/fortigate/6.2.16/cookbook/255100/ipsec-vpn-to-azure-with-virtual-network-gateway
- https://documentation.meraki.com/MX/Site-to-site_VPN/Configuring_Site_to_Site_VPN_tunnels_to_Azure_VPN_Gateway
- https://learn.microsoft.com/en-us/azure/network-watcher/vnet-flow-logs-overview
- https://www.eginnovations.com/documentation/Microsoft-Azure-Subscription/Azure-VPN-Gateway-Test.htm
Featured Images: pexels.com