Community discussions

MikroTik App
 
rainx
just joined
Topic Author
Posts: 2
Joined: Thu May 10, 2007 1:30 am

Router failover script

Thu May 10, 2007 2:02 am

Ok, I need some help. I have a RB153 and 2 ISP's and am trying to get it do do failover. I have tried the scripts I found in the wiki, but haven't been able to get any to work yet. This is the running config I have right now:

/ ip address
add address=216.57.xxx.xxx/24 network=216.57.xxx.0 broadcast=216.57.161.255 \
interface=ether1 comment="" disabled=no
add address=192.168.10.1/24 network=192.168.10.0 broadcast=192.168.10.255 \
interface=bridge1 comment="" disabled=no
add address=192.168.1.6/24 network=192.168.1.0 broadcast=192.168.1.255 \
interface=ether2 comment="" disabled=no
/ ip proxy
set enabled=no port=8080 parent-proxy=0.0.0.0:0 maximal-client-connecions=1000 \
maximal-server-connectons=1000
/ ip proxy access
add dst-port=23-25 action=deny comment="block telnet & spam e-mail relaying" \
disabled=no
/ ip route
add dst-address=0.0.0.0/0 gateway=216.57.xxx.x check-gateway=ping scope=255 \
target-scope=10 comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=5 scope=255 \
target-scope=10 comment="" disabled=no
/ ip firewall nat
add chain=srcnat out-interface=ether1 action=masquerade comment="" disabled=no
add chain=srcnat out-interface=ether2 action=masquerade comment="" disabled=no

I have found that if I am running a ping command in the MT and unplug ether1 the MT will continue to ping after a few seconds (going out ether2), but the PC will not. In order to get the PC to ping, I have to go in and disable ether1. If I disable and then re-enable right after, when the dead link comes back it will automatically switch back and the PC won't miss a beat with its pings. I am to the point now of trying to find a script that will automatically disable then re-enable the interface if x dies, but have been unable to figure out how. I have tried using netwatch, but it runs my script before the other interface comes on line. I have been fighting with this thing for a week now and would appreciate any help anyone has.
 
User avatar
maroon
Member Candidate
Member Candidate
Posts: 230
Joined: Thu Oct 07, 2004 11:15 am
Location: Lebanon
Contact:

Re: Router failover script

Sat May 26, 2007 5:59 pm

which example have you used?

the one in the wiki page? anyway there's an example for failover using netwatch and scripting. search in the forum about it.
 
User avatar
maroon
Member Candidate
Member Candidate
Posts: 230
Joined: Thu Oct 07, 2004 11:15 am
Location: Lebanon
Contact:

Re: Router failover script

Sat May 26, 2007 6:01 pm

concerning the distance, if you increase the distance that means ur increasing the hops??

Regards,
 
rainx
just joined
Topic Author
Posts: 2
Joined: Thu May 10, 2007 1:30 am

Re: Router failover script

Sat May 26, 2007 7:17 pm

The one on the wiki didn't really help much. I ended up spending too much time playing with it, but finally got it figured out.
 
User avatar
skillful
Trainer
Trainer
Posts: 552
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Router failover script

Sat May 26, 2007 7:32 pm

The one on the wiki didn't really help much. I ended up spending too much time playing with it, but finally got it figured out.
Rainx
I think you should update the Wiki with you findings so that the next person don't have to re-invent the wheel
 
User avatar
maroon
Member Candidate
Member Candidate
Posts: 230
Joined: Thu Oct 07, 2004 11:15 am
Location: Lebanon
Contact:

Re: Router failover script

Sat May 26, 2007 7:57 pm

would you please update the wiki or post your tunned configuration over here!!!

thank you in advance :)

Regards,
 
kanch
newbie
Posts: 41
Joined: Mon Mar 26, 2007 3:41 am
Location: USA/Brazil

Re: Router failover script

Sat Jun 02, 2007 7:50 am

Yes, please post, that would be very helpful to many
 
epproach_lyle
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Tue Jul 10, 2007 1:13 am
Location: North Carolina, USA
Contact:

Re: Router failover script

Tue Jul 24, 2007 7:16 pm

yes, i am doing almost the same thing. did you ever post?

Who is online

Users browsing this forum: No registered users and 7 guests