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

    OpenVPN - Making it more tolerant to packet loss without re-auth

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 4 Posters 376 Views
    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.
    • J
      Jake Biker
      last edited by

      Hi All,

      Could I get your view on the best quick win to make OpenVPN more tolerant to packet loss without constant re-authentication.

      I use MFA on users - which makes re-auth time consuming when just a few packets have been lost -

      Unfortunately not all networks are perfect.

      When they are - it'll stay connected for 8 hours straight no issues.

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        How does it fail? A gateway event?

        Steve

        J 1 Reply Last reply Reply Quote 0
        • J
          Jake Biker @stephenw10
          last edited by

          @stephenw10

          Hi Steve - I cant yet check but will tomorrow.

          Scenario is perfect network connection our end obviously OVPN stays connected 8 hours until reneg-sec

          Hotel Wi-Fi distant connection - some packet loss - and it drops requires re-auth -
          I will check logs when I can and get back to you,.

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            If you see timeouts in the server logs try adjusting the keepalive values in the settings it pushes to clients.

            J 1 Reply Last reply Reply Quote 0
            • J
              Jake Biker @stephenw10
              last edited by

              @stephenw10

              Hi Stephen -

              Now its not that - all clients 100% ..
              Just need to find a way of making it more tolerant when the user is on a dodgy connection - I don't think KeepAlive will help that will it?

              GertjanG 1 Reply Last reply Reply Quote 0
              • GertjanG
                Gertjan @Jake Biker
                last edited by

                @Jake-Biker said in OpenVPN - Making it more tolerant to packet loss without re-auth:

                I don't think KeepAlive will help that will it?

                Isn't keepalive a TCP thing ?
                Are you using UDP or TCP with your VPN ?

                To make a rock solid VPN, easy, cable up the user to the VPN server and I guarantee you : it will last forever (up until the power drops).

                On the other side : when things can go pretty bad fast : if the user uses a 4G/5G data connection, or even a messed up wifi (most of them are, people just don't notice) and is at the border of a 'cell', or is just mobile, then switching happens, packets arrive in disorder at the server, time stamps differ. The VPN process can handle some "total data madness" but as 'security' is part of the protocol (right ?), at some point the server can't be sure that the connection is still the same device/user, it has to re authenticate.

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

                JKnottJ 1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  If a client is using connection that's bad enough that it drops enough keep-alives the server will drop the connection.

                  But we really need to see the logs to see why it's dropping. Preferably from both ends.

                  1 Reply Last reply Reply Quote 0
                  • JKnottJ
                    JKnott @Gertjan
                    last edited by

                    @Gertjan said in OpenVPN - Making it more tolerant to packet loss without re-auth:

                    Isn't keepalive a TCP thing ?

                    Actually, it's an application thing and can be over TCP or UDP. IIRC, there is no keep alive function in TCP, only timeout.

                    Incidentally, several years ago, I tried an experiment. I was in a coffee shop and used the WiFi to set up a VPN. I noticed there was another open WiFi in the area. I was able to switch WiFi, without dropping the VPN. This is a result of using UDP to carry the VPN. So long as the other end is reachable, it doesn't care how it gets there. This is also why, with WiFi calling, you can transparently move between a WiFi and cell network connection.

                    BTW, that coffee shop was at the corner of Harbord and Grace in Toronto. That other WiFi's SSID was "GraceLAN". 😉

                    PfSense running on Qotom mini PC
                    i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                    UniFi AC-Lite access point

                    I haven't lost my mind. It's around here...somewhere...

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