Community discussions

MikroTik App
 
SeanR
just joined
Topic Author
Posts: 3
Joined: Tue Dec 23, 2014 6:37 pm

Failover trouble

Thu Dec 25, 2014 6:55 pm

Hi

I'm using this script for failover however when it fails it keeps the route for the existing connection
and since i'm running voip i need to reboot for new routes
I tried some mangle rules but im back to square 1 for now


# ------------------- header -------------------
# Script by Tomas Kirnak, version 1.0.7
# If you use this script, or edit and
# re-use it, please keep the header intact.
#
# For more information and details about
# this script please visit the wiki page at
# http://wiki.mikrotik.com/wiki/Failover_Scripting
# ------------------- header -------------------



# ------------- start editing here -------------
# Edit the variables below to suit your needs

# Please fill the WAN interface names
:local InterfaceISP1 WAN1
:local InterfaceISP2 WAN2

# Please fill the gateway IPs (or interface names in case of PPP)
:local GatewayISP1 WAN1
:local GatewayISP2 WAN2

# Please fill the ping check host - currently: resolver1.opendns.com
:local PingTarget 8.8.8.8

# Please fill how many ping failures are allowed before fail-over happends
:local FailTreshold 3

# Define the distance increase of a route when it fails
:local DistanceIncrease 2

# Editing the script after this point may break it
# -------------- stop editing here --------------



# Declare the global variables
:global PingFailCountISP1
:global PingFailCountISP2

# This inicializes the PingFailCount variables, in case this is the 1st time the script has ran
:if ([:typeof $PingFailCountISP1] = "nothing") do={:set PingFailCountISP1 0}
:if ([:typeof $PingFailCountISP2] = "nothing") do={:set PingFailCountISP2 0}

# This variable will be used to keep results of individual ping attempts
:local PingResult