ECMP failover scripting question

I followed the wiki instructions and have ecmp set up and working on eth 1 and eth 2.

Eth1 address 10.1.10.150, gateway 10.1.10.1
Eth2 address 10.2.10.152, gateway 10.2.10.1

My ECMP setup is per the wiki.

My Netwatch is set up as such:
#1
Host: (off-network IP address #1)
interval: 00:00:30
timeout: 3000ms
On up: /ip route set [find comment=“Default Route to Internet”] gateway=10.1.10.1
On down: /ip route set [find comment=“Default Route to Internet”] comment=“” gateway=10.2.10.1 disabled=no
#2
Host: (off-network IP address #2)
interval: 00:00:30
timeout: 3000ms
On up: /ip route set [find comment=“SMTP Traffic Out”] gateway=10.2.10.1
On down: /ip route set [find comment=“SMTP Traffic Out”] gateway=10.1.10.1

/System Scripts

ECMP-shutdown

:if ([/ping 4.2.2.2 count=1]=0 || [/ping 208.67.222.222 count=1]=0) do=(:log info “Gateway Down” /ip route set [find routing-mark=“ecmp-http-route” disabled=yes)

ECMP-startup
:if ([/ping 4.2.2.2 count=1]=1 && [/ping 208.67.222.222 count=1]=1 && [/ip route get [find routing-mark=“ecmp-http-route”] disabled]=true) do=(:log info “Both Gateways are up” /ip route set [find routing-mark=“ecmp-http-route”] disable=no)

The scheduler runs the scripts every 30 seconds.

When I unplug Eth2 all traffic goes out eth1 no problem. When I unplug eth1 (with eth2 plugged in) no traffic goes anywhere.

Also, I can not tunnel into the mikrotik via winbox through eth2, even when both are plugged in.

Ideas?

Thanks

-Nate

edit C’mon, it’s not working for me and someone out there can see the hole in it …

Does anyone have any ideas?

Hi Nathan, looks like we are having the same problem, i saw now your post while I posted one else topic: Improved Netwatch

I think the second script wan’t work because with the first one you have disabled that route, so when the second script tries to ping through it, it can’t since it is disabled

this is my guess, or at least what happened to my config. while I simulated a Link down on the first WAN, and run the script it worked fine.But when I tried the second it wouldn’t. I entered the console and tried a ping from there and saw it gave time out on every count. When I re-enabled manually the first WAN the ping went fine

My best guess is I need to proxy all traffic to the two sites in question through specific gateways, as even when one goes down, the pings still complete and show as up.