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

    Created script to kill voip states on failback of VOIP (Dual WAN)

    Scheduled Pinned Locked Moved Routing and Multi WAN
    6 Posts 3 Posters 1.9k 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.
    • K
      kapara
      last edited by

      Any feedback is appreciated.  I am going to test this tomorrow hopefully.  This is to resolve my issues with voip not failing back due to states still connected to secondary gateway.

      My voip are are on vlan so they are on their own subnet.

      Idea is to add as a CRON job…..And would be great if I could make the log info post to the gateway log in pfsense!

      upon further research it looks like the command needs to reference connections from the remote IP and not the local depending on where the traffic originates from.

      #!/bin/sh

      check_addr=8.8.8.8

      ping -t 1 -c 1 -S 96.82.66X.XXX ${check_addr} > /dev/null 2>&1
      wan1_resp=$?
      ping -t 1 -c 1 -S 70.36.14X.XXX ${check_addr} > /dev/null 2>&1
      wan2_resp=$?

      wan_resp=expr ${wan1_resp} + ${wan2_resp}

      if [ ${wan_resp} -eq 0 ]; then
          kill_log=mktemp /tmp/kill_log.XXX
          pfctl -i igb0 -k 192.168.65.0/24 > ${kill_log} 2>&1
          logger -f ${kill_log}
          rm ${kill_log}
      fi

      end

      Skype ID:  Marinhd

      1 Reply Last reply Reply Quote 0
      • luckman212L
        luckman212 LAYER 8
        last edited by

        Hi kapara, first off thank you for your contribution  ;)

        Can I ask you— is this script woring or you? Can you tell me what type of WAN connections you have, what version of pfSense and what hardware you're running?

        Thank you

        1 Reply Last reply Reply Quote 0
        • K
          kapara
          last edited by

          Still working on this.  Have just returned to it as I am hitting crisis mode with another client who needs this.  I will report back.  Hoping to perform a test tomorrow with someone who is helping me.  :o

          Skype ID:  Marinhd

          1 Reply Last reply Reply Quote 0
          • K
            kapara
            last edited by

            currently running 3.2.3 and Comcast cable connection with backup DSL

            Skype ID:  Marinhd

            1 Reply Last reply Reply Quote 0
            • luckman212L
              luckman212 LAYER 8
              last edited by

              @kapara:

              Still working on this.  Have just returned to it as I am hitting crisis mode with another client who needs this.  I will report back.  Hoping to perform a test tomorrow with someone who is helping me.  :o

              Ok I am tuned to this channel with full attention  ;)

              1 Reply Last reply Reply Quote 0
              • M
                misant
                last edited by

                I can say, that pfctl -i igb0 -k 192.168.65.0/24 is not working (not killing any states), if igb0 has ip not from 192.168.65.0/24 subnet.
                If it is WAN nic, it will have its own connections established as NAT states.

                There is several ways to solve that issue, but its stilll in test.

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