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

    OpenVPN peer-to-peer server status of "WAIT"

    2.1 Snapshot Feedback and Problems - RETIRED
    2
    3
    2.8k
    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.
    • S
      ssheikh
      last edited by

      Through a misconfiguration I created a situation where the OpenVPN client would have a status of "up" but the Server on the other side would be blank for its status.

      Would be good to display something like "waiting for connection" when the OpenVPN server is up but no client is connected to it instead of the status being just blank.

      So what I am proposing is to add:

      
                              if (strstr($line,"WAIT")) {
                                      $client['status']="waiting for connection";
                              }
      
      

      in the while (!feof($fp)) { … } section of function openvpn_get_client_status in openvpn.inc.

      Thanks,

      Shahid

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        When my server is just waiting for a connection from the client (before anything at all has been received from the client), the code goes straight through to:

        			/* parse end of output line */
        			if (strstr($line, "END") || strstr($line, "ERROR"))
        				break;
        

        It seems that this "if" could put something in $client array that indicates the server is just sitting, waiting.

        Do you also have a situation where the client has started to connect, the server has done some bit of the response and is somehow in an interim state where the server management daemon returns "WAIT" like in your code example?

        If so, then for that case it would be useful to put something like:

                                if (strstr($line,"WAIT")) {
                                        $client['status']="waiting for client to finalise connection";
                                }
        

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • S
          ssheikh
          last edited by

          You are right. It puts the same status in the client as well. Not only when there has been some initial transaction between the client and the server but also when the server is completely down and the client has not been able to contact the server.

          What was going through my mind when I saw the client status being up and the server status on the other end being blank was that the server was probably spitting out an unhandled status.

          Probably best to leave it as-is.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.