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

    [Solved] Force a reconnect of a vpn client

    Scheduled Pinned Locked Moved OpenVPN
    5 Posts 2 Posters 3.5k 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.
    • T Offline
      trumee
      last edited by

      Hello
      I want to force a reconnection of a vpn client at a given time. I could do it for all vpn sessions by setting in a cron the command

      
      killall -HUP openvpn
      
      

      This will affect all the openvpn sessions, however i want to do it for only one client session. Is there anyway to do this?

      1 Reply Last reply Reply Quote 0
      • jimpJ Offline
        jimp Rebel Alliance Developer Netgate
        last edited by

        /usr/local/sbin/pfSsh.php playback svc restart openvpn client X
        

        Where X is the OpenVPN ID of the connection (e.g. ovpnc2 interface means client ID 2)

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • T Offline
          trumee
          last edited by

          –-short version---
          Is there any other scheduler except cron which might be killing my vpn?
          -------end-------

          Here is the long version. I setup a cron rule by directly editing /etc/crontab to restart the vpn client. However, after a router restart the cron rule disappeared from crontab. Strangely, i am still seeing the vpn client being restarted at the same time. I suspect that there might be something else restarting the vpn.

          1 Reply Last reply Reply Quote 0
          • T Offline
            trumee
            last edited by

            Poking  further at the logs it seems the connection is up however pfsense stops routing on the vpn interface. My C2758 supermicro board uses igb drivers. I did not face this issue in 2.2.6, it is only occuring in 2.3

            1 Reply Last reply Reply Quote 0
            • T Offline
              trumee
              last edited by

              Removed 'ping-restart' and other 'ping-xxx' options from the config and now the vpn client doesnt die.

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