Need help with failover script

Hey,

I apologize for my noobness in advance.

I’ve been using a setup where I’ve set up 7 DSL connections with PCC load balancing, load balancing seems to work fine but I’m having trouble with my failover script.

I am running a script which checks 3 hosts, if even one host ping returns false then the route for that connection is disabled. I initially thought this would work but turns out that users on my network are still being sent to the connections whose routes have been disabled.

Does anyone have experience with this? Any help would be grateful.

Thank you

If the script does disable the route for that particular traffic, than you should have a backup route with bigger distance for that traffic, so that the router can switch the traffic through the other route. For example:

/ip route
add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1 routing-mark=connection1
add dst-address=0.0.0.0/0 gateway=pppoe-out2 distance=2 routing-mark=connection1

Thank you for the reply, here’s my routing section

/ip route
add check-gateway=ping comment=wan11 distance=1 gateway=192.168.160.1 routing-mark=to_wan1
add check-gateway=ping comment=wan21 distance=1 gateway=192.168.170.1 routing-mark=to_wan2
add chain-gateway=ping comment=wan31 distance=1 gateway=192.168.120.1 routing-mark=to_wan3
add chain-gateway=ping comment=wan41 distance=1 gateway=192.168.130.1 routing-mark=to_wan4
add chain-gateway=ping comment=wan51 distance=1 gateway=192.168.140.1 routing-mark=to_wan5
add chain-gateway=ping comment=wan61 distance=1 gateway=192.168.150.1 routing-mark=to_wan6

add check-gateway=ping comment=wan12 distance=1 gateway=192.168.160.1
add check-gateway=ping comment=wan22 distance=2 gateway=192.168.170.1
add check-gateway=ping comment=wan32 distance=3 gateway=192.168.120.1
add check-gateway=ping comment=wan42 distance=4 gateway=192.168.130.1
add check-gateway=ping comment=wan52 distance=5 gateway=192.168.140.1
add check-gateway=ping comment=wan62 distance=6 gateway=192.168.150.1

and here’s the link i used to setup load balancing: http://wiki.mikrotik.com/wiki/Manual:PCC

Let’s take the first route for example:

add check-gateway=ping comment=wan11 distance=1 gateway=192.168.160.1 routing-mark=to_wan1

If 192.168.160.1 is not reachable for any reason, traffic marked with routing-mark=to_wan1 has nowhere to go, because there is no backup route for it. So you need to add another route for backup, like:

add check-gateway=ping comment=wan11_backup distance=2 gateway=192.168.170.1 routing-mark=to_wan1

damn, didn’t think of that. That mean’s 49 routes, damn. Let me see if this works.

Thank’s a lot man, I owe you one.

Have you tried ECMP configuration? The problem with ECMP is that it will flush the connections table every 10 minutes or so, thus reseting all the connections. This behavior is problematic for connections which require authentication, but it might work in your case and is pretty straitght forward.

Yes I did try it, but the, as you said, the flushing part was bad. I was getting constant complaints from users so I decided to scrap it