Community discussions

MikroTik App
 
SirThor
newbie
Topic Author
Posts: 30
Joined: Sun Jul 17, 2011 3:12 pm

failover

Sat Aug 03, 2013 8:32 am

I'm using this http://wiki.mikrotik.com/wiki/Failover_Scripting. it does great at increasing the distance if ISP1 fails. though once it is restored it does not decrease the distance. the problem is that once the distance ISP1 is increased to 3 it will not ping anything on the internet. ISP2 has no problem with the ping. i can't figure out why ISP2 will ping regardless of what the distance it is set at(even a greater distance than ISP1). but ISP1 must be set to a lower distance than ISP2 or it will not ping. any clue?
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: failover

Sat Aug 03, 2013 1:49 pm

Setup a separate routing table for each ISP. In that routing table, have only a default route for that ISP.

Mangle on output, based on interface. So in mangle, if out-interface=ISP2, new-routing-mark=ISP2.
Do this for all ISPs.

What is currently happening for you I think is that you send traffic out a certain interface, but it goes to a wrong gateway.
Gateway gets chosen based on the main routing table, but interface is implicitely set in ping, so it doesnt work.

The method above should fix that.
 
SirThor
newbie
Topic Author
Posts: 30
Joined: Sun Jul 17, 2011 3:12 pm

Re: failover

Sun Aug 04, 2013 1:14 am

a little more info

i have in my routing table this 2 default routes

ISP1 0.0.0.0->66.xx.xx.xx distance=1
ISP2 0.0.0.0->172.xx.xx.xx distance=2

of course all traffic goes through ISP1. in this config i ping 208.67.222.222 specifying which interface. to make sure i also did a trace route and it would use
ISP1 & 2 as expected. if i change the distance on ISP1 to 3 or anything greater than ISP2 i can no longer ping or trace route through the ISP1 interface. i can't figure why ISP2 will work regardless of distance but ISP1 requires it to have a lower distance. it is the reason the above mentioned fail-over script does not correct itself once ISP1 is restored.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: failover

Sun Aug 04, 2013 1:57 am

Thats why I suggested the above as a way to get around that.

Mangling on output and forcing the correct routing table (from mangle) and interface (from the ping command in script) for the packets might help, try it.
 
SirThor
newbie
Topic Author
Posts: 30
Joined: Sun Jul 17, 2011 3:12 pm

Re: failover

Wed Aug 07, 2013 10:37 pm

do i need to copy the entire main routing table for each set?

Who is online

Users browsing this forum: DanMos79, frank333, parm, patrikg and 32 guests