Windows Server routing through Wireguard VM to peer network

CharlesP 0 Reputation points

Hi everyone, I'm pulling my hair out with an issue and hoping someone can point me in the right direction.

I have two VMs in Azure:

  1. Wireguard Server VM (IP on the subnet)
  2. Windows Server VM (IP on subnet)

I have established a peer connection from an on-premise branch LAN ( to the Wireguard Server in Azure.

The Wireguard server can ping clients on on-premise LAN (the range) and clients on the on-premise LAN can connect through the Wireguard Server VM to the Windows Server VM just fine.

The issue is the Windows Server VM can ping the Wireguard Server VM but is not routing traffic properly through it to the on-premise LAN.

I created a route table as attached which I thought was all that was needed but it still isn't working. When I test the effective route through the Azure portal it does indicate that traffic from the Windows Server would route to the Wireguard Server to address the on-premise LAN.

I would greatly appreciate any suggestions on what I may be missing and thank you in advance.


Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
10,581 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 41,586 Reputation points

    Hello there,

    We might need to dig deep into your configuration to see if everything is set right.

    Try adding Table = 123 under [Interface] in Server1's WireGuard config. and then running the command ip rule add iif wg0 table 123.

    You need to run netfilter-persistent save even after running ufw commands for the firewall rules to be persistent across reboots even if ufw status says they are in place. If for some reason you reboot before saving, delete the UFW rules and add them again and then run netfilter-persistent save.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments