I just setup a new Wireguard server (as vanilla as it gets) that is connected to two different subnets, eth0 goes out to the internet and eth1 is connected to a local/private network.
When I connect with my Wireguard client, I can effectively go out to the internet through the IP tied to eth0 as you would expect, but I'm not able to access anything in the 192.168.1.0/24 subnet on eth1.
I'm assuming this is because /etc/wireguard/wg0.conf is set to route everything from wg0 to eth0:
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
Is there a way to set the forwarding rules so that a given IP range is forwarded through eth1 and everything else is sent through eth0?
Any pointers would be appreciated.