routeros/mikrotik: failover, ping external service and switch WAN« Wróć do listy pytań

script
Wysłane przez mrmucha
Zadane przez 03/12/2019 00:00
0

1. System -> Scheulder
2. add new
3. Interval 00:01:00
4. and paste

:if ([/ping 8.8.8.8 count=5 interface=MY_MAIN_WAN_INTERFACE ] = 0) do={
/ip address enable [find interface="MY_SECOND_WAN_INTERFACE"]
} else={
/ip address disable [find interface="MY_SECOND_WAN_INTERFACE"]
}
Console version
/system scheduler
add interval=1m name=wan-failover on-event=":if ([/ping 8.8.8.8 count=5 interface=MY_MAIN_WAN_INTERFACE  ] = 0) do={\r\
    \n/ip address enable [find interface=\"MY_SECOND_WAN_INTERFACE\"]\r\
    \n} else={\r\
    \n/ip address disable [find interface=\"MY_SECOND_WAN_INTERFACE\"]\r\
    \n}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=jan/30/2013 start-time=23:03:35
Wysłane przez mrmucha
Odpowiedziane 03/12/2019 00:05