Hello and thank you all for your help!
The last post about scripting was very interesting, I am currently trying to implement the script in my router to test it.
Whould it be best to schedule the first failover script to run every minute, 5min or more.. any thoughts?
The reverse script is more complicated in my own eyes, you would have to check if the first script was active and if you are currently using the backup route, am I right? Then IF you are, the script must constantly check if the first IP is pingable, right?
Could someone help me with a revers script for this one?
The only thing I could come up with is this:
:if ([/ping 192.168.10.2 count=10]=0) do {:log info "main server down"; /ip firewall nat set [find comment="server1.example.com DST"] disabled=yes; /ip firewall nat set [find comment="server1.example.com SRC"] disabled=yes; /ip firewall nat set [find comment="server2.example.com DST"] disabled=no; /ip firewall nat set [find comment="server2.example.com SRC"] disabled=no}
:if ([/ping 192.168.10.2 count=10]=1) do {:log info "main server up"; /ip firewall nat set [find comment="server2.example.com DST"] disabled=yes; /ip firewall nat set [find comment="server2.example.com SRC"] disabled=yes; /ip firewall nat set [find comment="server1.example.com DST"] disabled=no; /ip firewall nat set [find comment="server1.example.com SRC"] disabled=no}
Or is this good enough? My mind is not working right now
Best regards,
Mattia