HarryMuscle
Senior Member
I'm trying to add iptables rules to forward a port over my WireGuard client connection to a machine on the LAN. If I run a WireGuard client directly on the machine in question the port is forwarded, however, doing so through the router is proving difficult. Here are the rules I've added:
According to the counters these rules are getting executed by there's nothing reaching the 192.168.50.50 machine. I also tried adding these rules based on the suggestion from https://www.snbforums.com/threads/port-forwarding-on-wireguard-seems-unsupported-in-388-1.83486:
Also 192.168.50.50 is listed in VPN Director and routed through WGC1 and the machine accesses the internet via the VPN connection. But still https://www.yougetsignal.com/tools/open-ports/ reports that the port is closed.
Any suggestions on what to try next?
Thanks,
Harry
Code:
iptables -t nat -A PREROUTING -p tcp -i wgc1 --dport 12345 -j DNAT --to-destination 192.168.50.50:12345
iptables -t nat -A PREROUTING -p udp -i wgc1 --dport 12345 -j DNAT --to-destination 192.168.50.50:12345
According to the counters these rules are getting executed by there's nothing reaching the 192.168.50.50 machine. I also tried adding these rules based on the suggestion from https://www.snbforums.com/threads/port-forwarding-on-wireguard-seems-unsupported-in-388-1.83486:
Code:
iptables -I FORWARD -p tcp -d 192.168.50.50 --dport 12345 -m state --state NEW -j ACCEPT
iptables -I FORWARD -p udp -d 192.168.50.50 --dport 12345 -m state --state NEW -j ACCEPT
Also 192.168.50.50 is listed in VPN Director and routed through WGC1 and the machine accesses the internet via the VPN connection. But still https://www.yougetsignal.com/tools/open-ports/ reports that the port is closed.
Any suggestions on what to try next?
Thanks,
Harry