Commute between servers with RouterBoard 750

Hi, my name is Federico. I’m fairly new to routeros and been trying to figure out a couple of things on my own, but i’d like some more “informed” input xD.

Here’s what i’m trying to do:

I have 2 identical servers (even IP addresses) on 2 networks, and i have to keep one alive and one on standby and switch both networks when the “active” server stops responding.

I have like 4 routerboard 750’s and was hoping to get that job done with those.

Here’s what i tried to do so far, with more or less success:

I have SRV1, SRV2, RB1, RB2, LAN1 and LAN2
Only one SRV must have access to both LAN’s and the other one shouldn’t.

i have this connections made:
RB1: ehter1 for maintenance, ether2 LAN1, ether3 RB2, ether4 SRV2 and ether5 SRV1
RB2: ether1 for maintenance, ether2 LAN2, ether3 RB1, ether4 SRV2 and ether5 SRV1

I have the following IP routes on RB1:
LAN1 ether 4, ether5 reachable
15.15.15.0 ether 3 reachable

I have the following IP routes on RB2:
LAN2 ether 4, ether5 reachable
15.15.15.0 ether 3 reachable

And i have a bridge with ether2, ether4 and ether5 on both routerboards.


and i have this script running every 2 minutes on both sides disabling ether 4 or 5 according to the situation:

:local i 0
:local j 0
:if (![/interface ethernet get ether4 disabled] && ![/interface ethernet get ether5 disabled]) do={/interface ethernet disable ether4; :delay 500ms;}
:do {:set i ($i + 1)} while=($i < 5 && ([/ping SRVonLAN1or2 interval=3 count=1]!=1))
:do {:set j ($j + 1)} while=($j < 5 && ([/ping 15.15.15.1or2 interval=3 count=1]!=1))

:if ($i=5) do={
:if ([/interface ethernet get ether4 disabled]) do={/interface disable ether5; :delay 500ms; /interface enable ether4; :delay 500ms; /interface disable ether3;} else={/interface disable ether4; :delay 500ms; /interface enable ether5; :delay 500ms; /interface enable ether3;}
} else={
:if ($j=5 && ![/interface ethernet get ether3 disabled]) do={
:if ([/interface ethernet get ether4 disabled]) do={
/interface disable ether5; :delay 500ms; /interface enable ether4;
}
}
}

SO, I ping the server’s adresses on each lan (and if it doesn’t respond i switch ether4 and 5) and if it responds well i check to see if the other routerboard is on secondary server (ether3 down) and go to secondary myself.

It has some flaws i know, but here’s the main problem:

Sometimes i lose ping to SRV1 and SRV2 on LAN2 (from the router, so it keeps commuting), just because… What can cause this? I solved it by rebooting the RB once it happened, but then it happened again…

Another problem i have is this (and i’ve never had it before) when i connect to the routerboard with my notebook, sometimes it doesn’t respond, and i solve it by disconnecting and connecting the network cable, and most of the times i make any change whatsoever to the interfaces, bridges, etc it stops responding again, and i have to plug off and on again the network cable to keep working. This could be related to the loss of ping to the SRVs right?

Anyways that’s my whole dilemma.
Thanks in advance for any help.