Hello,
I have two ISP connection with failover, now this failover work is ISP's gateway ping check but I need failover work will be with 8.8.8.8 or another IP. how to possible.
Regards,
Nishadul
Netwatch with scripts in Down tab will help. Search more information in the Internet. I do not use this, so can not provide scripts. Why do not use provider gateway if it works?He most probably wanted to use the ip as checking destination to see if the Internet is accessible.
:if ([/ip route get [find comment="GATEWAY"] disabled]=false) do={
:if ([/ping x.x.x.x count=3] = 0 && [/ping x.x.x.x count=3] = 0 && [/ping 8.8.8.8 count=3] = 0) do={
/ip route disable [find comment="GATEWAY"];
:log error "ISP DOWN";
}
}
:delay 5;
:if ([/ip route get [find comment="GATEWAY"] disabled]=true) do={
:if ([/ping x.x.x.x count=3] > 0 || [/ping x.x.x.x count=3] > 0 || [/ping 8.8.8.8 count=3] > 0) do={
/ip route enable [find comment="GATEWAY"];
:log warning "ISP UP";
}
}
My ISP's connection is as follows:I do not understand your question. 8.8.8.8 is google dns server. You can point dns servers in mikrotik as you want, for example: first is local dns server, second is internet provider dns server, third google dns 8.8.8.8. If first dns server do not respond, dns requests will be diverted to second dns server and etc.
You've got a logic error here... if the default gateway doesn't work, disable it. Then test it while its disabled, and if it works while its disabled, then re-enable it... You're clearly missing a step! Ie. set up static routes to those IPs.Don't check against just 1 IP, I check 3.
This runs every 2 mins in scheduler.Code: Select all:if ([/ip route get [find comment="GATEWAY"] disabled]=false) do={ :if ([/ping x.x.x.x count=3] = 0 && [/ping x.x.x.x count=3] = 0 && [/ping 8.8.8.8 count=3] = 0) do={ /ip route disable [find comment="GATEWAY"]; :log error "ISP DOWN"; } } :delay 5; :if ([/ip route get [find comment="GATEWAY"] disabled]=true) do={ :if ([/ping x.x.x.x count=3] > 0 || [/ping x.x.x.x count=3] > 0 || [/ping 8.8.8.8 count=3] > 0) do={ /ip route enable [find comment="GATEWAY"]; :log warning "ISP UP"; } }
second DNS is OK but no internet connection because ISP's internet connection (cable) is disconnected from IIG.I do not understand your question. 8.8.8.8 is google dns server. You can point dns servers in mikrotik as you want, for example: first is local dns server, second is internet provider dns server, third google dns 8.8.8.8. If first dns server do not respond, dns requests will be diverted to second dns server and etc.
That's exactly what I'm doing and it works.You've got a logic error here... if the default gateway doesn't work, disable it. Then test it while its disabled, and if it works while its disabled, then re-enable it... You're clearly missing a step! Ie. set up static routes to those IPs.Don't check against just 1 IP, I check 3.
This runs every 2 mins in scheduler.Code: Select all:if ([/ip route get [find comment="GATEWAY"] disabled]=false) do={ :if ([/ping x.x.x.x count=3] = 0 && [/ping x.x.x.x count=3] = 0 && [/ping 8.8.8.8 count=3] = 0) do={ /ip route disable [find comment="GATEWAY"]; :log error "ISP DOWN"; } } :delay 5; :if ([/ip route get [find comment="GATEWAY"] disabled]=true) do={ :if ([/ping x.x.x.x count=3] > 0 || [/ping x.x.x.x count=3] > 0 || [/ping 8.8.8.8 count=3] > 0) do={ /ip route enable [find comment="GATEWAY"]; :log warning "ISP UP"; } }