An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
So the tunnel shows connected, but nothing from on-prem actually lands on the VM. That's a pretty common spot to be in after a fresh S2S build. A connected tunnel only tells you IKE/IPsec came up. It doesn't tell you the right traffic is being sent into it.
One thing first. The pings you mentioned are both going to public addresses, so they're going over the internet, not through the tunnel. S2S traffic should be aimed at the VM's private IP. Also, the VPN gateway itself doesn't reply to ICMP on its local address, so don't use it as a ping target.
Here's the order I'd work through it in.
1. Test the VM's private IP over TCP, not just ping
Ping is often blocked by the guest OS firewall, so a failed ping on its own doesn't prove much. I'd test a port you know is listening:
# From an on-prem Windows host
Test-NetConnection <VM-private-IP> -Port 3389
tracert <VM-private-IP>
# From an on-prem Linux host
nc -vz <VM-private-IP> 22
On the VM, check the service is actually listening and the OS firewall allows your on-prem subnet. Open just that port for that source range. No need to turn the whole firewall off.
- Verify the Port in Azure VM is in listening state.
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
Fix the port listening issue first if they are not in listening state.
3. Check the address spaces on both ends
- In the portal, open the Local network gateway and check its address space includes the exact on-prem subnet you're testing from.
- On your on-prem firewall, the Azure VNet prefix has to be routed into the tunnel, and the encryption domain / proxy IDs need to list your on-prem subnet as local and the Azure VNet (or VM subnet) as remote.
- If the gateway is policy-based, the prefixes have to match exactly on both sides. Microsoft's troubleshooting guide calls this out specifically.43. Look at the VM's effective routes
This shows you the return path. Go to VM > Networking > Network settings > NIC > Help > Effective routes. You want to see your on-prem prefix with next hop Virtual network gateway. The VM has to be running for this to show anything.
az network nic show-effective-route-table \
--resource-group <rg> \
--name <vm-nic-name> \
--output table
If a route table on the subnet is sending that prefix to an NVA or a firewall, the traffic goes there instead. In that case the NVA needs IP forwarding enabled or packets get dropped.
4. Watch the tunnel counters while you test
Open the virtual network gateway > Connections > your connection and note Data in / Data out. Run your test for a few minutes and refresh.
- Nothing moves: traffic isn't entering the tunnel. Look at on-prem routing and the proxy IDs.
- Data in goes up but no reply: the packets are reaching Azure. Focus on the VM side (routes, NSG, guest firewall).
- Data out goes up but on-prem sees nothing: check the return path on your side.
If it still isn't clear, run VPN troubleshoot in Network Watcher against the gateway and connection. It drops IKE logs into a storage account, and they'll show selector or policy mismatches.
5. Confirm the NSG picture with IP flow verify
NSGs can sit on both the subnet and the NIC, so removing one doesn't always clear everything. Run Network Watcher IP flow verify (inbound, VM private IP and port, on-prem source IP). It tells you which rule allows or denies the packet. For what it's worth, the default AllowVnetInBound rule uses the VirtualNetwork tag, and that tag includes connected on-prem address spaces. With the default rules in place, on-prem traffic should already be allowed.
Let me know what the counters and effective routes show and we can take it from there.
Reference documents
- Troubleshoot an Azure site-to-site VPN connection that can't connect
- Diagnose a virtual machine routing problem
- Diagnose a virtual machine network traffic filter problem
- IP flow verify overview
- VPN troubleshoot overview (Network Watcher)
- Azure service tags overview (VirtualNetwork tag) Please upvote if this helps you. Hi John, So the tunnel shows connected, but nothing from on-prem actually lands on the VM. That's a pretty common spot to be in after a fresh S2S build. A connected tunnel only tells you IKE/IPsec came up. It doesn't tell you the right traffic is being sent into it. One thing first. The pings you mentioned are both going to public addresses, so they're going over the internet, not through the tunnel. S2S traffic should be aimed at the VM's private IP. Also, the VPN gateway itself doesn't reply to ICMP on its local address, so don't use it as a ping target. Here's the order I'd work through it in.
1. Test the VM's private IP over TCP, not just ping
Ping is often blocked by the guest OS firewall, so a failed ping on its own doesn't prove much. I'd test a port you know is listening:# From an on-prem Windows host
Test-NetConnection <VM-private-IP> -Port 3389 tracert <VM-private-IP>
From an on-prem Linux host
nc -vz <VM-private-IP> 22
On the VM, check the service is actually listening and the OS firewall allows your on-prem subnet. Open just that port for that source range. No need to turn the whole firewall off.
__2. Verify the Port in Azure VM is in listening state.__
# 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
Fix the port listening issue first if they are not in listening state.
#### 3. Check the address spaces on both ends
- In the portal, open the __Local network gateway__ and check its address space includes the exact on-prem subnet you're testing from.
- On your on-prem firewall, the Azure VNet prefix has to be routed into the tunnel, and the encryption domain / proxy IDs need to list your on-prem subnet as local and the Azure VNet (or VM subnet) as remote.
- If the gateway is policy-based, the prefixes have to match exactly on both sides. Microsoft's troubleshooting guide calls this out specifically.43. Look at the VM's effective routes
This shows you the return path. Go to VM > Networking > Network settings > NIC > Help > __Effective routes__. You want to see your on-prem prefix with next hop __Virtual network gateway__. The VM has to be running for this to show anything.
```dockerfile
az network nic show-effective-route-table \
--resource-group <rg> \
--name <vm-nic-name> \
--output table
If a route table on the subnet is sending that prefix to an NVA or a firewall, the traffic goes there instead. In that case the NVA needs IP forwarding enabled or packets get dropped.
4. Watch the tunnel counters while you test
Open the virtual network gateway > Connections > your connection and note Data in / Data out. Run your test for a few minutes and refresh.
- Nothing moves: traffic isn't entering the tunnel. Look at on-prem routing and the proxy IDs.
- Data in goes up but no reply: the packets are reaching Azure. Focus on the VM side (routes, NSG, guest firewall).
- Data out goes up but on-prem sees nothing: check the return path on your side.
If it still isn't clear, run VPN troubleshoot in Network Watcher against the gateway and connection. It drops IKE logs into a storage account, and they'll show selector or policy mismatches.
5. Confirm the NSG picture with IP flow verify
NSGs can sit on both the subnet and the NIC, so removing one doesn't always clear everything. Run Network Watcher IP flow verify (inbound, VM private IP and port, on-prem source IP). It tells you which rule allows or denies the packet. For what it's worth, the default AllowVnetInBound rule uses the VirtualNetwork tag, and that tag includes connected on-prem address spaces. With the default rules in place, on-prem traffic should already be allowed.
Let me know what the counters and effective routes show and we can take it from there.
Reference documents
- Troubleshoot an Azure site-to-site VPN connection that can't connect
- Diagnose a virtual machine routing problem
- Diagnose a virtual machine network traffic filter problem
- IP flow verify overview
- VPN troubleshoot overview (Network Watcher)
- Azure service tags overview (VirtualNetwork tag) Please upvote if this helps you.