Created script to kill voip states on failback of VOIP (Dual WAN)
-
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}
fiend
-
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
-
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
-
currently running 3.2.3 and Comcast cable connection with backup DSL
-
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 ;)
-
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.