What's new

Openvpn (client) and port forwarding.

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

mgs

New Around Here
Folks,

For over a long time I cannot get port forwarding work with openvpn on my RT-AC87u. If PPTP is engaged then all works but once openvpn is up all forwarding rules don't work until I write something like
iptables -t nat -A PREROUTING -p tcp -i tun<num_config> --dport <incoming_port> -j DNAT --to-destination <dst_client:dst_port>.
Is there an elegant way to avoid such an issue (seting all the rules manually upon starting/shutdown openvpn is not an option) or may be I'm doing something wrong?
If it's a bug can it be fixed?
 
First question is no longer important: solved by creating user-script:
/jffs/scripts/openvpn-event
----
#!/bin/sh
interface=$1

if [ "$script_type" = "down" ] ; then
iptables -t nat -D PREROUTING -i $interface -j VSERVER
fi

if [ "$script_type" = "up" ] ; then
iptables -t nat -A PREROUTING -i $interface -j VSERVER
fi
----
Second one still remains.
 
Uhm, I don't see two questions above? But maybe it's just me? :D
 
@mgs I still see it as one/fixed. :)
 
Well I do believe that it has to work the same way as PPTP i.e. without any additional clutch. But maybe it's just me ;).
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top