Load Balancing with 3 wan

Hi,

I have 3 mode of connections.

  1. DSL 20 Mb
  2. Wimax 2 Mb
  3. V-sat 2 Mb

I need to use Loadbalancing and failover. The problem i have is, dsl modem ip is 192.168.1.1. If the dsl isdown, the gateway ip is reachable and it will not do the failover.

Any body know how to solve this?


Regards,

Aslam

Try to ping the gateway directly, not DSL modem and put static IP route for that gateway(ip) through the correct interface, so it will only transfer data throug wanted gateway. So if the gateway is down, it will switch to the next distance gateway.

Its not clear for me.

What i did is, my gateway im MT for the dsl is 192.168.1.1 and put the option check gateway to ping. Is it right?


Regards,

Aslam

Yes it is, but you are pinging the wrong IP. you are pinging the local IP of the modem/router when you should be actually pinging the DSLAM ip on the other side. Also for that IP you need a static route that goes through this gateway (DSL).

Have a look at this too http://forum.mikrotik.com/t/checking-and-disabling-gateways/35512/1

Hi,

Could you please explain me, where do i can configure the ip to ping.


Aslam

:local Gateways “192.168.1.1,192.168.2.254”

These are the ips of the modems you want to monitor. Inyour case is only 1.

:local Gateways “192.168.1.1”

:local pingip [:resolve “sex.com”]

This is the domain you will use to check if you have internet. Make sure it is something that replies to pings, is always up (like google) but is not accessed by your customers (not like google).

Can somebody help me how to do the scripting for this scenario!!!

I’m tried some scripting http://wiki.mikrotik.com/wiki/ECMP_Failover_Script but no sucess. There is lot of errors
My MT version is 4.11 and most of the scripting tutorials are based on 3.XX

BTW there is no good scripting tutorials for the beginners.


Regards,

Aslam

http://wiki.mikrotik.com/wiki/Manual:Scripting
http://wiki.mikrotik.com/wiki/Manual:Scripting-examples

Applogize my illiterate.

In all the documents, it is not clear where the scripts has to apply.
Is it possible via Winbox?
It it is on CLI, do i can type directly? or type in notepad and put it in the file?

Regards,

Aslam

Second sentence in the manual:

"Scripts can be stored in Script repository or can be written directly to console. The events used to trigger script execution include, but are not limited to the System Scheduler, the Traffic Monitoring Tool, and the Netwatch Tool generated events. "

And of course you can add scripts from winbox. Go to System->Script and add new scripts.

Hi,

See the errors i’m getting,

admin@MikroTik] /system script> add name=“ecmp-startup” source=“:if ([/ping 82.205.224.9 count=1]=1 &&
syntax error (line 1 column 40)
[admin@MikroTik] /system script> [/ping 82.205.224.1 count=1]=1 && [/ip route get [find
expected command name (line 1 column 4)
[admin@MikroTik] /system script> comment="ECMP Route For HTTP"] disabled]=true) do={ :log info "Both gateways up”
syntax error (line 1 column 11)
[admin@MikroTik] /system script> \n/ip route set [find routing-mark=ecmp-http-route]
expected command name (line 1 column 4)
[admin@MikroTik] /system script> disabled=no}" policy=ftp,reboot,read,write,policy,test,winbox,password
syntax error (line 1 column 12)
[admin@MikroTik] /system script> add name=“ecmp-shutdown” source=“:if ([/ping 82.205.224.9 count=1]=1 &&
syntax error (line 1 column 41)
[admin@MikroTik] /system script> [/ping 82.205.224.1 count=1]=0) do={ :log info "Gateway down”
expected command name (line 1 column 4)
[admin@MikroTik] /system script> \n/ip route set [find routing-mark=ecmp-http-route]
expected command name (line 1 column 4)
[admin@MikroTik] /system script> disabled=yes}" policy=ftp,reboot,read,write,policy,test,winbox,password
syntax error (line 1 column 12)
[admin@MikroTik] /system script>


I’m trying this on 4.11. and from the tutorial http://wiki.mikrotik.com/wiki/ECMP_Failover_Script


Regards,

Aslam

/ system script 
   add name="ecmp-startup" source=":if ([/ping 1.1.1.12 count=1]=1 && \
   [/ping 1.1.1.13 count=1]=1 && [/ip route get [find \
   comment=\"ECMP Route For HTTP\"] disabled]=true) do={ :log info \"Both gateways up\" \
   \n/ip route set [find routing-mark=ecmp-http-route] \
   disabled=no}" policy=ftp,reboot,read,write,policy,test,winbox,password 
   add name="ecmp-shutdown" source=":if ([/ping 1.1.1.12 count=1]=1 && \
   [/ping 1.1.1.13 count=1]=0) do={ :log info \"Gateway down\"\
   \n/ip route set [find routing-mark=ecmp-http-route] \
   disabled=yes}" policy=ftp,reboot,read,write,policy,test,winbox,password

This script will not work in your case…

Does anybody made script working with 4.11? or else i have to giveup the idea for the scripting.


Aslam

I found the solution. It is very simple.

I use Netwatch to ping a IP and put the static route for the this IP via DSL.
Added one more Netwatch with different ip and put the static route for the IP via V-sat.

Whenver the IP is not reachable, it will disable the corresponding default route.

Regards,

Aslam

Which is exactly what my script does with the only difference that it uses 1 ip address which rotates for all gateway checks. It also checks if the modem is connect before pinging and logs all errors to a seperate log. Anyway, glad you figured it out!