PHP error in OpenVPN Export



  • Not sure if anyone else has the same issue but heres mine
    When I try to export using the utility I only get a partial config.
    If I set the host name resolution to interface IP address it works fine but because the ip is an internal ip it will not connect on the outside. Or internally for that matter. Destionation unreachable (Different issue I will resolve later)
    But if I set it to either Automagic option the config file stops in the block:
    <tls-auth>#

    2048 bit OpenVPN static key

    –---BEGIN OpenVPN Static key V1-----

    I am missing part of the static key and the following
    -----END OpenVPN Static key V1-----</tls-auth>
    key-direction 1

    Now when I try to copy and paste it to complete it and try to import it to my phone I get
    option_Error: remote option not specified

    If some one could post the complete layout of the config for using the Automagic multi WAN IPS or the Automagic multi wan DDNS hostnames I think I could try and figure it out and solve it.
    BTW if I try to use the incomplete config as is I get that the tls-auth was not closed out properly, and it happens when I export using any configuration choice



  • Ok looking at it again I see that there is actually an error in the beginning of the config file:
    "
    Warning: Invalid argument supplied for foreach() in /usr/local/pkg/openvpn-client-export.inc on line 870
    "
    Here are the 2 differences in the beginning of the config files
    Interface IP Option
    dev tun
    persist-tun
    persist-key
    cipher AES-128-CBC
    auth SHA1
    tls-client
    client
    resolv-retry infinite
    remote 192.168.0.20

    1194 udp
    lport 0
    verify-x509-name "openvpnserver" name
    auth-user-pass
    ns-cert-type server
    comp-lzo

    Automagic Option:

    Warning: Invalid argument supplied for foreach() in /usr/local/pkg/openvpn-client-export.inc on line 870
    persist-tun
    persist-key
    cipher AES-128-CBC
    auth SHA1
    tls-client
    client

    lport 0
    verify-x509-name "openvpnserver" name
    auth-user-pass
    ns-cert-type server
    comp-lzo

    How can I work around this?? I have tried copying the beginning from one config to the other but that still tells me no remote option. Am I missing something obvious here?


  • Rebel Alliance Developer Netgate

    The foreach error is because you don't have any port forwards defined. I'll be adding a fix for that in the OpenVPN client export package today sometime.

    The "automagic" methods require port forwards. You bind the OpenVPN server to localhost or LAN, and then add port forwards to each WAN to forward in the traffic, or multiple port forwards on the same WAN.

    The automatic code locates the port forwards and adds a remote line for each one.



  • Ahhh ok I appreciate it and sorry for posting it originally in the wrong forum.
    And its working now using the autoadd rules from the wizard.
    I was able to Frankenstein the config and get it to close out tls auth
    Now I just need to figure out why my router is not forwarding the ports to it from outside the network
    Thanks again