Viktor Jaep
Part of the Furniture
Hi All,
I'm using StrongVPN's openvpn service on my RT-AC3100, and is working great at this moment. Whenever I have VPN actively running, the ports that I had configured via the GUI to be forwarded to internal clients no longer seem to work, and ports appear "closed" when checking them from the outside.
My question is... what is the best way to enable port forwarding while using the VPN? I dug up this script from another thread, and wondering if something like this would work? Is there a way for this to automatically run when the router reboots, or am I out of luck? Is there anything easier or more straightforward than this? Please let me know if I'm missing anything...
iptables -I FORWARD -i tun12 -p udp -d 192.168.2.140 --dport 9958 -j ACCEPT
iptables -I FORWARD -i tun12 -p tcp -d 192.168.2.140 --dport 9958 -j ACCEPT
iptables -t nat -I PREROUTING -i tun12 -p tcp --dport 9958 -j DNAT --to-destination 192.168.2.140
iptables -t nat -I PREROUTING -i tun12 -p udp --dport 9958 -j DNAT --to-destination 192.168.2.140
Thank you,
Viktor
I'm using StrongVPN's openvpn service on my RT-AC3100, and is working great at this moment. Whenever I have VPN actively running, the ports that I had configured via the GUI to be forwarded to internal clients no longer seem to work, and ports appear "closed" when checking them from the outside.
My question is... what is the best way to enable port forwarding while using the VPN? I dug up this script from another thread, and wondering if something like this would work? Is there a way for this to automatically run when the router reboots, or am I out of luck? Is there anything easier or more straightforward than this? Please let me know if I'm missing anything...
iptables -I FORWARD -i tun12 -p udp -d 192.168.2.140 --dport 9958 -j ACCEPT
iptables -I FORWARD -i tun12 -p tcp -d 192.168.2.140 --dport 9958 -j ACCEPT
iptables -t nat -I PREROUTING -i tun12 -p tcp --dport 9958 -j DNAT --to-destination 192.168.2.140
iptables -t nat -I PREROUTING -i tun12 -p udp --dport 9958 -j DNAT --to-destination 192.168.2.140
Thank you,
Viktor