I have been trying some time to get some form of failover between isps to work. I have tried all the different scripts on the mikrotik page I could find and all come back to the same problem.
I have ISP A on port 1 and ISP B on port 2. In my routes I have ISP A distance 1 and ISP B distance 2. Even if I unhook the ISP A form the incoming connection. My script will run and will change ISP A distance to 3 however it still get pings out of port 1 and thus runs the up script. Below is a copy of what script I have been trying to run. AS i said the scripts run and work but why can I still ping out a port that has no ISP connection? It gets a ping through about every 15th try. Then the next problem I see is if the ISP does come up I still do not get 5 pings in a row for the script to run to switch back the distance.
script 1:
:local i 0; {:do {:set i ($i + 1)} while (($i < 5) && ([/ping 64.233.169.99 interval=3 count=1]=0))};
:if ($i=5 && [/ip route get [find comment=“Default Route”] distance]=1) do={:log info “Main Gateway down”;
/ip route set [find comment=“Default Route”] distance=3}
script 2:
:local i 0; {:do {:set i ($i + 1)} while (($i < 5) && ([/ping 64.233.169.99 interval=3 count=1]=1))};
:if ($i=5 && [/ip route get [find comment=“Default Route”] distance]=3) do={:log info “Main Gateway up”;
/ip route set [find comment=“Default Route”] distance=1}
and this is still not working. Do I still need something more in /ip route or not?
Without this failover stuff I have default gateway and when I put this configuration and disable default gateway Internet stops. Please let me know what I am doint wrong? Thank you in advance.
But I supose that Host1 and Host2 cant’t be our gateways because they are not on our network, they can be Google and Yahoo, like author of wiki tutorial said. Instead, I think GW1 and GW2 should be used:
Hi, I don’t know if it’s the same (or similar) problem: I have a PC (IP=158.110.30.56) that can access to internet with gateway=158.110.30.2.
Now I would make a second connection (through a GPRS modem) when first connection is not available.
So I made this:
PC
ip address=158.110.30.56
gateway=158.110.30.57
router GPRS
ip address=192.168.33.1
Mikrotik Router:
eth1 = 158.110.30.58 (to connect to main router with gateway 158.110.30.2)
eth2 = 158.110.30.57 (to connect to PC)
eth3 = 192.168.33.2 (to connect to GPRS router)