Wireguard - access IP behind NAT

Hello all. I have a wiregaurd server running on a Ubuntu 20.04 server. The server IP is 192.168.189.6 (enp1s0) while the wireguard server is 10.100.10.1 (wg0).

My home network is 192.168.189.0/24 with the gateway/DNS being 192.168.189.2

As part of the post-up script, I have;

iptables -t nat -I POSTROUTING -s 10.100.10.0/24 -o enp1s0 -j MASQUERADE

This setup works well and I can ping / access all my network in the 192.168.189.0/24 subnet EXCEPT for the server IP where wireguard is running (192.168.189.6).

I have messing around with trying add the proper routes to the machine running the wireguard server so that I can reach that machine by the address 192.168.189.6. I need to be able to resolve this address as well as this machine is also a domain controller.

Any suggestions?

1 Like