default gateway failover

I would like to create a scheduled script for default gateway failover?
Any ideas where to start?

You can create a script for changing the default gateway whenever you want, but surely you mean a script for when the link goes down? Is netwatch not what you are referring to?

Do you mean removing a specific gateway with load balancing, sorry maybe I am missing the point here.

hi yogi,

thanks for the reply I will look into netwatch.

/ tool netwatch 
add host=3.3.3.3 timeout=1s interval=1m up-script="/ip route set \[find comment=Default\] gateway=1.1.1.1" \
    down-script="/ip route set \[find comment=Default\] gateway=2.2.2.2" comment="" disabled=no

just add the comment Default to your route in question

You should also add a static route to the host that you’re checking…ie

/ip route
add dst-address=3.3.3.3 gateway=1.1.1.1 comment="Always use this default gateway for netwatch IP"

I had to do this to prevent netwatch from thrashing about when the primary connection was down.

i have rb 750 os 4.13 and dont work this script ?