Wait after switching WAN to failover connection, in order to reduce link flapping.
This commit is contained in:
parent
36eafabbca
commit
fb9acf3fec
|
@ -1,5 +1,6 @@
|
||||||
config wanmonitor
|
config wanmonitor
|
||||||
option check_host '8.8.4.4'
|
option check_host '8.8.4.4'
|
||||||
|
option flapping '60'
|
||||||
option interval '5'
|
option interval '5'
|
||||||
option sleep '0'
|
option sleep '0'
|
||||||
option wan_primary 'wan1'
|
option wan_primary 'wan1'
|
||||||
|
|
|
@ -14,6 +14,7 @@ LOGGER_INFO=6
|
||||||
LOGGER_DEBUG=7
|
LOGGER_DEBUG=7
|
||||||
|
|
||||||
CHECK_HOST=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].check_host)
|
CHECK_HOST=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].check_host)
|
||||||
|
FLAPPING=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].flapping)
|
||||||
INTERVAL=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].interval)
|
INTERVAL=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].interval)
|
||||||
SLEEP=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].sleep)
|
SLEEP=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].sleep)
|
||||||
WAN_PRIMARY=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].wan_primary)
|
WAN_PRIMARY=$(/sbin/uci -q get wanmonitor.@wanmonitor[0].wan_primary)
|
||||||
|
@ -138,6 +139,7 @@ while true; do
|
||||||
/sbin/route add default gw ${GATEWAY_WAN_SECONDARY} metric ${WAN_SECONDARY_METRIC:-0} ${IFNAME_WAN_SECONDARY} &>/dev/null
|
/sbin/route add default gw ${GATEWAY_WAN_SECONDARY} metric ${WAN_SECONDARY_METRIC:-0} ${IFNAME_WAN_SECONDARY} &>/dev/null
|
||||||
fi
|
fi
|
||||||
WAN=2
|
WAN=2
|
||||||
|
sleep ${FLAPPING}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "${WAN}" = "0" ] || [ "${WAN}" = "2" ]; then
|
if [ "${WAN}" = "0" ] || [ "${WAN}" = "2" ]; then
|
||||||
|
|
Loading…
Reference in New Issue