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

    Auto restart VPN tunnel if down

    Scheduled Pinned Locked Moved OpenVPN
    1 Posts 1 Posters 994 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.
    • P Offline
      papafife
      last edited by

      Hello,

      I need help creating a way for pfSense to test my client VPN tunnel and restart the connection if it is down.  I have the following, which i found in these forums, in a shell file which will restart the tunnel but does not check the status.

      echo "" | php -q
      

      I would like a shell file that I can schedule within cron.  Ideally it would run every 5 minutes and if the status of the VPN tunnel is up then it will do nothing, but if it is down it will restart.  I need this because my current internet provider drops my connection quite often and the VPN does not automatically reestablish.  But if I just run the code I have every 5 minutes it will disconnect my working connection and then reconnect.

      Any help would be appreciated and details on what any script is doing is appreciated also but not required.  I can google the details on lines of code if needed.  Thanks in advance.

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