Networking: Ping is not forwarded through Wireguard Gateway VM

David 0 Reputation points
2026-08-06T05:37:21.1133333+00:00

Hello,

I'm having trouble connecting from a VM in my Azure subscription to a machine in my home network over a WireGuard tunnel.

My setup consists of three machines:

  1. Home machine
    • Containerized WireGuard installed
    • WireGuard IP: 10.20.0.2
  2. WireGuard Gateway VM (Linux) in Azure subnet "Networking"
    • Containerized WireGuard installed
    • VNet IP: 10.0.1.4
  3. Test VM (Linux) in Azure subnet "AKS"
    • VNet IP: 10.0.6.4

Current connectivity:

  • ✅ Gateway VM (2) can successfully ping the home machine (1).
  • ✅ Test VM (3) can successfully ping the Gateway VM (2).
  • ❌ Test VM (3) cannot ping the home machine (1), even though traffic should be routed through the Gateway VM.

I've already verified the following:

  • User-defined route (UDR) and its association with the subnet.
  • Network Security Groups (NSGs).
  • IP forwarding is enabled on the Gateway VM.

I also ran several tests.

Test 1:

On Gateway VM:

sudo tcpdump -i eth0 icmp -n

On Test VM:

ping 10.20.0.2

Result (Gateway VM):

No ICMP packets appear on the Gateway VM. This suggests that the traffic never reaches it.

Test 2:

On Gateway VM:

sudo sysctl net.ipv4.ip_forward

Result (Gateway VM):

net.ipv4.ip_forward = 1

Test 3:

On Test VM:

sudo tcpdump -i eth0 icmp -n

On other session Test VM:

ping 10.20.0.2

Result (Test VM):

 sudo tcpdump -i eth0 icmp -n
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
04:59:21.765631 IP 10.0.6.4 > 10.20.0.2: ICMP echo request, id 1930, seq 1, length 64
04:59:22.777193 IP 10.0.6.4 > 10.20.0.2: ICMP echo request, id 1930, seq 2, length 64
04:59:23.801191 IP 10.0.6.4 > 10.20.0.2: ICMP echo request, id 1930, seq 3, length 64
04:59:24.825204 IP 10.0.6.4 > 10.20.0.2: ICMP echo request, id 1930, seq 4, length 64
04:59:25.849203 IP 10.0.6.4 > 10.20.0.2: ICMP echo request, id 1930, seq 5, length 64
04:59:26.873324 IP 10.0.6.4 > 10.20.0.2: ICMP echo request, id 1930, seq 6, length 64
04:59:27.897217 IP 10.0.6.4 > 10.20.0.2: ICMP echo request, id 1930, seq 7, length 64

The Test VM is clearly generating the ICMP requests.

Test 4:

On Test VM:

ip route get 10.20.0.2

Result (Test VM):

10.20.0.2 via 10.0.6.1 dev eth0 src 10.0.6.4 uid 1000
    cache

This appears to indicate that the route is being used as expected.

Since no packets arrive at the Gateway VM, I'm wondering if Azure is dropping the traffic before it reaches the NIC. Is there something I'm overlooking, such as Azure requiring additional configuration?

Any ideas or suggestions would be greatly appreciated.

Thanks!

Azure Virtual Network
Azure Virtual Network

An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.


1 answer

Sort by: Most helpful
  1. Allan Solomon Mejia 3,175 Reputation points
    2026-08-07T01:50:38.6066667+00:00

    Hello @David

    If the WireGuard tunnel is established but ICMP (ping) isn't forwarded, the issue is typically related to routing, IP forwarding, or firewall policies, rather than WireGuard itself.

    I'd recommend checking the following:

    1. IP forwarding

    • Ensure IP forwarding is enabled on the WireGuard gateway.
    • On Linux, verify: sysctl net.ipv4.ip_forward It should return 1.

    2. AllowedIPs configuration

    • Confirm that the peer's AllowedIPs includes the remote subnet you're trying to reach, not just the WireGuard tunnel IPs.
    • An incorrect AllowedIPs entry is one of the most common causes of traffic not being routed through the tunnel.

    3. Routing

    • Verify that both sides have routes for the remote network pointing to the WireGuard interface.
    • Check the routing tables (ip route on Linux or route print on Windows).

    4. Firewall / NSGs

    • If Azure VMs are involved, ensure:
      • Network Security Groups (NSGs) allow ICMP (or test with TCP if ICMP is intentionally blocked).
      • The guest OS firewall (Windows Firewall or iptables/nftables) permits ICMP.
    • Azure blocks some ICMP scenarios by default depending on the networking configuration, so a TCP connectivity test (Test-NetConnection or nc) can sometimes be a better validation.

    5. Source/Destination Check (Azure)

    If the WireGuard VM is acting as a router, verify that IP forwarding is enabled on the Azure NIC, otherwise Azure drops forwarded packets.

    Could you provide a bit more information?

    • Where is WireGuard running (Azure VM, Linux appliance, Windows, pfSense, etc.)?
    • Which direction is failing?
      • Client → Server
      • Server → Client
      • LAN ↔ LAN through the tunnel
    • Can the peers successfully complete the WireGuard handshake (wg show)?
    • Are only ICMP packets failing, or does TCP traffic (SSH, RDP, HTTP) also fail?

    That will help determine whether this is a routing issue, a firewall issue, or an Azure networking configuration issue.

    Please "Accept the Answer" if this information helped you. This will help us and others in the community as well.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.