1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Openvpn (client) and port forwarding.

Discussion in 'Asuswrt-Merlin' started by mgs, Feb 17, 2020.

  1. mgs

    mgs New Around Here

    Joined:
    Feb 17, 2020
    Messages:
    4
    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?
     
  2. mgs

    mgs New Around Here

    Joined:
    Feb 17, 2020
    Messages:
    4
    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.
     
  3. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    11,622
    Uhm, I don't see two questions above? But maybe it's just me? :D
     
  4. mgs

    mgs New Around Here

    Joined:
    Feb 17, 2020
    Messages:
    4
    The second one was:
     
  5. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    11,622
    @mgs I still see it as one/fixed. :)
     
  6. mgs

    mgs New Around Here

    Joined:
    Feb 17, 2020
    Messages:
    4
    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 ;).