• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

OpenVPN client-connect script: "mode server required" ?

OpenVPN
2
7
3.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N
    NDev
    last edited by Oct 9, 2018, 8:12 PM

    Hello!

    Im new to pfsense, and i just setup pfsense 2.4.4-RELEASE amd64.
    So far everything is working like a charm.
    I seriously love this firewall already! - Lots of advanced stuff and options!

    OpenVPN is also working and performing well, but i'd like to use the "client-connect" parameter to run a script to mount Windows shares on connect.
    But it always fails when i add it. The log says:

    Options error: --client-connect requires --mode server
    

    But "mode server" doesn't sound like the correct mode for a windows SSL VPN client, right?
    I see the topic has been discussed here:
    https://forum.netgate.com/topic/45652/openvpn-problems
    But that thread wasnt helpful in my case.

    Is there other option i am missing? Or do i really have to make it "mode server" for some reason?

    here is my client config:

    dev tun
    persist-tun
    persist-key
    cipher AES-128-CBC
    auth SHA256
    tls-client
    client
    resolv-retry infinite
    remote myDomain.org 1194 udp
    auth-user-pass
    ca mars-UDP4-1194-ca.crt
    tls-auth mars-UDP4-1194-tls.key 1
    remote-cert-tls server
    script-security 3
    client-connect C:\\openvpn-scripts\\up.bat
    client-disconnect C:\\openvpn-scripts\\down.bat
    

    Thanks in advance
    ND

    1 Reply Last reply Reply Quote 0
    • P
      Pippin
      last edited by Oct 9, 2018, 8:27 PM

      So, you are on Windows running a client to pfSense.
      You are in the wrong forum if that is the case.

      Here is a post I wrote on a Dutch form that describes what you need,
      can use an online translator:
      https://www.synology-forum.nl/vpn-server/openvpn-9-automatisch-share(s)-(ont)koppelen/msg225285/#msg225285

      I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
      Halton Arp

      1 Reply Last reply Reply Quote 0
      • N
        NDev
        last edited by Oct 9, 2018, 8:40 PM

        Hi Pippin!

        I used the installer-package on the windows-client, that was generated by pfsense itself. So i guess im in the right Forum :)

        Thanks for your link.
        But what u describe is just what i have configured.
        I still get the same error with this.

        Any other suggestions?
        ND

        P 1 Reply Last reply Oct 9, 2018, 8:44 PM Reply Quote 0
        • P
          Pippin @NDev
          last edited by Oct 9, 2018, 8:44 PM

          @ndev said in OpenVPN client-connect script: "mode server required" ?:

          But what u describe is just what i have configured.

          No it's not, please try to read carefully.

          I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
          Halton Arp

          1 Reply Last reply Reply Quote 0
          • P
            Pippin
            last edited by Oct 9, 2018, 8:49 PM

            You want to run a script as a client, that's why:

            Options error: --client-connect requires --mode server
            

            See now?

            I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
            Halton Arp

            1 Reply Last reply Reply Quote 0
            • N
              NDev
              last edited by Oct 9, 2018, 9:24 PM

              Yep you are right!
              I seen it now. client-connect is the wrong option in this case, its simply "up".
              I changed it now and its working.

              Thanks!
              Regards , ND

              1 Reply Last reply Reply Quote 0
              • P
                Pippin
                last edited by Oct 9, 2018, 9:32 PM

                Welcome.

                I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
                Halton Arp

                1 Reply Last reply Reply Quote 0
                • G Gertjan referenced this topic on Dec 18, 2024, 11:01 AM
                4 out of 7
                • First post
                  4/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.