I do connect sites over GRE tunnels in a Spine Leaf topology, each site has 2 GRE Tunnels connection to a Tunnel Concentrator each, RSTP deal with looping
I made a script to test the WAN connection to each Concentrator and disable the GRE Tunnel if it has packet loss over X %
I'm making it avaiable so other people could use it as well
Any comments is appreciated
Code: Select all
#VARIABLES
:local totalpings 25
:local ipdest [interface pptp-client get <interface-name> connect-to]
#IF GRE TUNNEL 2 IS WORKING - RUN SCRIPT
:if ([/interface pptp-client get <interfac2-name> running]=true) do={
:local pings ([/ping count=$totalpings $ipdest interval=600ms] * 100 / $totalpings)
:put $pings
:log info ("Packet Loss:". (100 - $pings). "%")
#IF PING > 80%
:if ($pings > 80) do={
:if ([/interface pptp-client get <interface-name> running]=true) do={} else={
:interface pptp-client enable <interface-name>;
:log info ("<interface-name> Enabled");}
}
#IF PING < 80%
:if ($pings < 80) do={
interface pptp-client disable <interface-name>;
:log info ("<interface-name> Disabled");
}
}