An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
Test the Azure VM’s private IP address, not the VPN gateway public IP or the VM public IP, and then verify that both sides have routes for the corresponding private subnets.
A successful ping to either public endpoint only confirms internet-facing reachability; Site-to-Site traffic should reach the VM through its private NIC address. Azure private IPs are specifically used for on-premises communication through VPN Gateway.^1^
1. Test a service on the VM’s private IP
From an on-premises host, test a port that is known to be listening:
# Windows client
Test-NetConnection [IP Address] -Port 3389
tracert [IP Address]
# Linux client
nc -vz [IP Address] 22
traceroute [IP Address]
Replace the address and port with the Azure VM’s private IP and actual service port.
On the Azure VM, confirm that the service is listening:
# Windows VM, run elevated
Get-NetTCPConnection -State Listen |
Where-Object LocalPort -in 3389,443
Get-NetFirewallProfile
# Linux VM
sudo ss -lntp
sudo nft list ruleset # or: iptables -S
sudo firewall-cmd --list-all 2>/dev/null || sudo ufw status
If the service is listening but the connection fails, temporarily permit only the required port and on-premises source subnet in the guest OS firewall. Do not disable the entire firewall. Microsoft notes that when routes are correct, firewall software inside the VM can still prevent communication.^2^
2. Verify routing in both directions
- On the on-premises router/firewall, verify that the Azure VNet prefix is routed into the IPsec tunnel.
- In Azure Portal, open Local network gateway → Configuration and verify that its address prefixes include the exact on-premises source subnet.
- Verify that the on-premises VPN traffic selectors or proxy IDs contain:
- Local network: the on-premises subnet.
- Remote network: the Azure VNet or VM subnet.
- Check the Azure VM’s return route:
- VM → Networking → Network settings → select the NIC
- Expand Help → Effective routes
- Find the on-premises prefix and confirm that it is Active and points to Virtual network gateway, rather than
Noneor an unintended virtual appliance.
The VM must be running before Azure can return its effective routes. Effective routes combine system, custom, and BGP-propagated routes; a custom route can override the expected VPN path.^3^
For CLI validation:
az network nic show-effective-route-table \
--resource-group <resource-group> \
--name <vm-nic-name> \
--output table
If an Azure route sends the on-premises prefix to an NVA, confirm that the appliance and its NIC have IP forwarding configured. If no correct return route exists, correct the associated route table or BGP advertisement rather than adding an unrelated default route.
3. Observe whether test traffic crosses the tunnel
Open Virtual network gateway → Connections → your connection and record Data In and Data Out. Generate traffic to the VM’s private IP for several minutes, wait briefly, and refresh; these counters are cumulative and might not update immediately.
- Neither counter changes: inspect on-premises routing, encryption domains/traffic selectors, and firewall policy.
- Data In increases but the VM does not respond: focus on Azure routing, effective security rules, the guest firewall, and whether the service is listening.
- Data Out increases without a reply on-premises: inspect the on-premises return path and firewall.
Run Network Watcher → VPN troubleshoot, select a Standard storage account, the gateway, and the connection, and start troubleshooting. Download the generated files from the storage account’s vpn container; the IKE logs can expose selector, authentication, or IPsec-policy failures.^4^
4. Confirm effective NSG handling without repeating the rebuild
Stripping one NSG does not necessarily account for rules inherited from both the NIC and subnet. Use Network Watcher → IP flow verify with:
- Direction: Inbound
- Protocol: the tested TCP or UDP protocol
- Local endpoint: VM private IP and service port
- Remote IP: on-premises test host
- Remote port:
*or its ephemeral source port
The result identifies the effective NSG rule allowing or denying the packet.^5^ This models NSG evaluation only; it does not prove that the packet crossed the VPN or that the guest service accepted it.
5. Conditional GatewaySubnet check
Because the tunnel is already connected, GatewaySubnet filtering is less likely than routing, selectors, or the guest firewall. Nevertheless, check whether GatewaySubnet has an NSG or route-table association. If it does, first review its rules and routes for traffic affecting the on-premises peer or default route.
Only if review indicates that association may be responsible, temporarily detach it for a controlled test. Record/export the existing configuration, obtain authorization, use a maintenance window, assess security and connectivity impact, and prepare an immediate rollback before changing either association. If traffic starts flowing, correct the offending rule or route before restoring the association. A connected-but-no-traffic case can result from GatewaySubnet UDR or NSG configuration.^6^
If packet captures show mismatched proxy IDs or the logs report TS_UNACCEPTABLE/error 13999, align the on-premises traffic selectors with the Azure and Local Network Gateway prefixes.^7^ Reset the gateway only after these routing, selector, and filtering checks fail.
References
- Private IP addresses
- Diagnose a virtual machine routing problem
- Diagnose a virtual machine routing problem
- Diagnose on-premises VPN connectivity with Azure
- Troubleshoot network security group misconfigurations blocking traffic in Azure virtual networks
- No traffic is passing between on-premises and Azure VMs. - Microsoft Q&A
- Troubleshoot Azure site-to-site VPN error codes