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

    OpenVPN not reliable, use VPNCHECK

    OpenVPN
    3
    5
    4.2k
    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
      s0nic
      last edited by

      I have two sites with 24h DAIP. After hours of troubleshooting, it was horrible for me to find out that openVPN doesn’t work properly.
      So I have build this simple loop to check the connection and perform a reconnect if it necessary.

      #!/bin/sh
      clear
      
      vcheck ()
      {
      echo "vcheck"
      PTEST=`ping -c 1 -t 1 192.168.0.254 | grep "100% packet loss" | awk '{print $1;}'`
      HPID=`cat /var/run/openvpn_client0.pid`
      
      if [ "X${PTEST}" != "X" ] ; then
      
              echo ""
              echo "No connection to Heinsberg!"
              echo ""
              kill $HPID
              sleep 5
              openvpn --config /var/etc/openvpn_client0.conf
         else
              echo ""
              echo "Connected to Heinsberg!"
              echo ""
      fi
      vwait
      }
      
      vwait ()
      {
      echo "vwait"
      sleep 30
      vcheck
      }
      
      

      How can I start that loop automatically, after reboot and established pppoe session?

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

        Try the latest snapshot.

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

          @sullrich:

          Try the latest snapshot.

          That will start my loop?  :D
          Ok in the latest snapshot are some improvements, I will give it a try. But how can I start my Script on boot?  ::) It should be starded as a daemon…  :'(

          1 Reply Last reply Reply Quote 0
          • H
            hoba
            last edited by

            You can start custom stuff on boot/filterreload by using hidden config.xml options: http://faq.pfsense.com/index.php?action=artikel&cat=10&id=38&artlang=en&highlight=hidden

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

              Look in the package area.  There is a rc.d thread that is a sticky.

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