Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Disconnect inactive clients after 2 hours

    Scheduled Pinned Locked Moved OpenVPN
    2 Posts 2 Posters 147 Views 2 Watching
    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 Offline
      shaunmccloud
      last edited by

      Hello,

      Where I work, we have a pfSense VM deployed just for OpenVPN connectivity (because I got tired of Windows updates breaking the client VPN functionality of our Meraki MX appliance). It works great, but due to customer requirements and the fact that we are working on our SOC2 Type II certification, we need to make sure clients disconnect after two hours of not using the VPN. Not a problem, I configured that, or so I thought. Windows, however, has other ideas. It is always active over the VPN, so it doesn't let the clients disconnect. Is there a way to configure OpenVPN on pfSense to differentiate between active client usage and passive client usage?

      Some examples of active client usage for us are

      • Connecting to lab phone and voicemail systems
      • Checking code in and out
      • Connecting via RDP to systems in the datacenter
      • Connecting to the web interface of systems in the datacenter
      • Browsing the internet over the VPN

      Passive client usage for us would be

      • End user locks their computer for the night, or more than two hours
        ** Windows starts downloading update files to pre-cache them
        ** Teams and Outlook are running
        ** Anything else

      I am really at a loss and getting tired of random notification emails in the middle of the night, saying they got locked out by Duo (or MFA provider). Or even worse, a Teams message at 5 am (before I'm even up) from a developer saying they can't connect to the VPN because they left their laptop connected to the VPN overnight against policy (which says turn your laptop off at the end of the day, but we all know no one listens to that). I would even take a config option in the file I install on everyone's laptop that won't automatically try to reconnect to the VPN endlessly if they get disconnected, but my Googlefu hasn't found that either.

      KOMK 1 Reply Last reply Reply Quote 0
      • KOMK Offline
        KOM @shaunmccloud
        last edited by

        @shaunmccloud You've tried the inactive switch on their client .ovpn configs?

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