Multi-WAN OpenVPN Client Export Fails

  • Dear forum,

    We have implemented:

    However, the client export fails:

    [1] Interface Address: -> remote 1194 udp
    [2] Automatic Multi-WAN IPs (port forward targets): -> [no remotes at all; empty line]
    [3] Automatic Multi-WAN DDNS Hostnames (port forward targets): -> [no remotes at all; empty line]

    We would expect 2 and 3 to have 2 remote entries; not zero.

    Please explain. Thanks.


  • LAYER 8 Global Moderator

    how would anything work trying to connect to loopback

  • Rebel Alliance Developer Netgate

    Did you add the port forwards exactly as described on the doc?

    The export package looks for port forwards with a target matching the OpenVPN server config, so if you set the OpenVPN server to bind to, you need a port forward on each WAN that forwards traffic coming to that WAN IP:1194 in to


    how would anything work trying to connect to loopback

    Read the linked doc. It doesn't do so directly.

  • LAYER 8 Global Moderator

    "[1] Interface Address: -> remote 1194 udp"

    I can see how you can port forward to loopback, but way I took his desc was he exported that the clients connected to loopback..  See attached - that would never work.

  • Rebel Alliance Developer Netgate

    Yes, I'm aware, but he wasn't expecting that to work, hence showing that 2 and 3 had no remote entries. Was for informational purposes to describe the behavior.

  • Please see attached screenshot for our Port Forward configuration:

    We use 2 OpenVPN Servers 1195 and 1194; and they work perfectly from each WAN's IP address:

    And it is to be noted, that we use 2x2 CARP WAN; as such, the WAN1/WAN2 addresses are wan-carp behind 2 DMZ Routers.

    ![Screen Shot 2016-01-20 at 17.35.31.png](/public/imported_attachments/1/Screen Shot 2016-01-20 at 17.35.31.png)
    ![Screen Shot 2016-01-20 at 17.35.31.png_thumb](/public/imported_attachments/1/Screen Shot 2016-01-20 at 17.35.31.png_thumb)

  • Rebel Alliance Developer Netgate

    Export package only understands single port rules. Use separate rules for 1194 and 1195.

  • Still the same problem:

    Multis are still empty:

    resolv-retry infinite

    lport 0

    Single ist still loopback:

    resolv-retry infinite
    remote 1195 udp
    lport 0

    ![Screen Shot 2016-01-20 at 18.17.11.png](/public/imported_attachments/1/Screen Shot 2016-01-20 at 18.17.11.png)
    ![Screen Shot 2016-01-20 at 18.17.11.png_thumb](/public/imported_attachments/1/Screen Shot 2016-01-20 at 18.17.11.png_thumb)

  • Rebel Alliance Developer Netgate

    The IP address method still wouldn't work in that scenario since the WANs have private IP addresses:

    By hostname it should still work if you have dyndns configured for both WANs, though

  • Hi Jimp,

    [1] Could you update the code to find the correct IP External Addresses being covered by the private addresses, by trying to contact the internet from such private IPs. E.g. detect the IPs shown for each WAN interface with "". That would true be "Automagic"!!! Feature Request  :)

    [2] We don't want to use DynDNS. So what should we put manually in the client export file?

    remote External_WAN1_IP 1195 udp
    remote External_WAN2_IP 1195 udp

    between "resolv-retry infinite"; and, "lport 0"?


  • Rebel Alliance Developer Netgate

    1. No, there is no accurate way to do that from the firewall itself in an automated manner for multiple WANs.

    2. That'll do. Anywhere in the file is fine (or use the advanced options box on the export package)

  • OK; tested the "advanced options" with the 2 remotes:
    [single] Does not work as that still adds in the loopback remote.
    [multi] Works as that had no remote to begin with.

    Would there be any way to store such settings for "Host Name Resolution: Automagic Multi-WAN IPs" and "Additional configuration options: remote 1 remote 2" with the OpenVPN Server's data? Otherwise, our admins might get somewhat confused for every export if they had to enter this all the time…



  • Rebel Alliance Developer Netgate

    Not currently. There is a redmine ticket out there already for it though. It would require some significant work to pull off.

Log in to reply