Windows Server routing through Wireguard VM to peer network

CharlesP 0 Reputation points
2023-09-02T04:39:34.87+00:00

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 10.0.10.100 on the 10.0.10.0/26 subnet)
  2. Windows Server VM (IP 10.0.10.50 on 10.0.10.80/28 subnet)

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

The Wireguard server can ping clients on on-premise LAN (the 192.168.1.0/24 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.

C

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

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,541 Reputation points
    2023-09-05T10:55:35.57+00:00

    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

Your answer

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