juanantonio
Regular Contributor
Well, my VPN supplier allows me to forward ports between my local devices and the public ip they are giving meYou mean via your VPN Internet supplier? This is only possible if your VPN is opening ports to you which is usually not the case.
Any reason you are not running site2site between your trusted networks? That makes the networks more transparent and forwarding easier:
https://github.com/ZebMcKayhan/WireguardManager/blob/main/README.md#site-2-site
and
https://github.com/ZebMcKayhan/Wire...n/README.md#route-site-2-site-internet-access
I've just tried site2site.
Although seems to be a great solution, I think it cannot solve my problem, because in one of the endpoints I am using Android tethering to gain access to the Inet, and my router says there are no DDNS, because the WAN IP is not public (it's a private address in the range of 192.168.xxx.xxx), so at the moment of configure site2site it ask for the IP/DDNS of the two endpoints and I only have DDNS for one of them, the other is a random IP.
My setup is like follows:Anyhow, with your current setup portforwarding needs to be done in 2 steps, first forward (Port 8001?) from wg11 to your server client (10.50.1.2:8001?) Then to the final destination (192.168.50.123:8001?). Could look something like this:
VPN Supplier (Public IP) <---> RT-AX86U Wireguard Client (IP 10.151.13.172) <---> RT-AX86U Wireguard Server (IP 10.50.1.1) <---> RT-AC86U Wireguard Client (IP 10.50.1.6) <---> Local Area Network (IP 192.168.0.0).
I've tried with:
RT-AX86U:
Code:
iptables -t nat -I PREROUTING -i wg11 -p tcp --dport 20500 -j DNAT --to-destination 10.50.1.1:20500
iptables -I FORWARD -i wg11 -p tcp -d 10.50.1.1 --dport 20500 -m state --state NEW -j ACCEPT
RT-AC86U:
Code:
iptables -t nat -I PREROUTING -p tcp -i wg11 --dport 20500 -j DNAT --to-destination 192.168.0.238:20500
iptables -I FORWARD -p tcp -d 192.168.0.238 --dport 20500 -m state --state NEW -j ACCEPT
And also with:
RT-AX86U:
Code:
iptables -t nat -I PREROUTING -i wg11 -p tcp --dport 20500 -j DNAT --to-destination 10.50.1.6:20500
iptables -I FORWARD -i wg11 -p tcp -d 10.50.1.6 --dport 20500 -m state --state NEW -j ACCEPT
RT-AC86U:
Code:
iptables -t nat -I PREROUTING -p tcp -i wg11 --dport 20500 -j DNAT --to-destination 192.168.0.238:20500
iptables -I FORWARD -p tcp -d 192.168.0.238 --dport 20500 -m state --state NEW -j ACCEPT
With no luck.
maybee this is possible to setup in the GUI instead, but I'm not at home so cant check.
Really it is possible to do this through the GUI? It would be great news.
Thanks in advance.
Edit: Finally I got it working. The router needed a restart. I got a weird message while starting wg_manager, as follows:
Code:
juanantonio@RT-AX86U-6C38:/tmp/home/root# wgm
(wg_manager.sh): 16989 DEBUG= *********************************WTF!? Rogue RPDB IPv4 rule 220 FOUND?????!!!!!*******************************
IPv4 RPDB
0: from all lookup local
220: from all lookup 220
9810: from all fwmark 0xd2 lookup 210
9910: from all to 10.50.1.1/24 lookup main
9981: from 10.50.1.0/24 lookup 121
10210: from 192.168.1.14 lookup ovpnc1
10211: from 192.168.1.12 lookup ovpnc1
10212: from 192.168.1.137 lookup ovpnc1
10213: from 192.168.1.170 lookup ovpnc1
10214: from 192.168.1.237 lookup ovpnc1
10215: from 192.168.1.18 lookup ovpnc1
10216: from 10.10.0.0/24 lookup ovpnc1
10217: from 10.12.0.0/24 lookup ovpnc1
32766: from all lookup main
32767: from all lookup default
IPv4 Route Table 220
10.12.0.1 via 87.235.0.10 dev ppp0 proto static
Press y to Delete rogue RPDB PRIO 220 rules or press [Enter] to SKIP.
y
But now everything is working.
The only thing is that in the passthru node (RT-AX86U) you have to forward the port not at the wireguard server IP (10.50.1.1), but at the device client IP (10.5.1.6). This sounded to me a little strange, but that's it.
Many thanks for your advice.
Last edited: