Community discussions

MikroTik App
 
nishadul
Member Candidate
Member Candidate
Topic Author
Posts: 161
Joined: Thu Dec 13, 2012 12:04 pm
Location: Bangladesh

Failover work with 8.8.8.8

Mon May 16, 2016 5:59 am

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
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Mon May 16, 2016 7:27 am

 
Senux
newbie
Posts: 34
Joined: Wed Jun 30, 2010 6:19 pm

Re: Failover work with 8.8.8.8

Mon May 16, 2016 12:05 pm

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.
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Mon May 16, 2016 12:28 pm

He most probably wanted to use the ip as checking destination to see if the Internet is accessible.
 
Senux
newbie
Posts: 34
Joined: Wed Jun 30, 2010 6:19 pm

Re:

Mon May 16, 2016 12:42 pm

He most probably wanted to use the ip as checking destination to see if the Internet is accessible.
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?
 
User avatar
Aveyer
Frequent Visitor
Frequent Visitor
Posts: 66
Joined: Thu Jun 24, 2010 11:17 pm

Re: Failover work with 8.8.8.8

Mon May 16, 2016 5:45 pm

Don't check against just 1 IP, I check 3.
This runs every 2 mins in scheduler.
: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";
	}
}
 
nishadul
Member Candidate
Member Candidate
Topic Author
Posts: 161
Joined: Thu Dec 13, 2012 12:04 pm
Location: Bangladesh

Re: Failover work with 8.8.8.8

Tue May 17, 2016 7:20 am

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.
My ISP's connection is as follows:

IIG>>>>>>>>>>ISP-0>>>>>>>>>>>>>>>>ISP-1>>>>>>>>>>>>>>>>>>>>>>>My Router
IIG>>>>>>>>>>ISP-2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>My Router

If ISP-1 and My Router connection disconnect then failover work
OR
If ISP-2 and My Router connection disconnect the failover work
BUT
If ISP-0 and ISP-1 connection disconnect then my router's failover NOT WORK because my router get ping of ISP-1. for this reason I want my router check ping for failover of google dns 8.8.8.8 or others IP. so that if any ISP's (ISP-0, ISP-1, ISP-2) connection fail then my router's failover work correctly.
Last edited by nishadul on Tue May 17, 2016 11:22 am, edited 1 time in total.
 
User avatar
aacable
Member
Member
Posts: 435
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Re: Failover work with 8.8.8.8

Tue May 17, 2016 7:27 am

you can use black hole approach in route section to make sure ping to x.x.x.x goes via specific wan link ONLY. just an idea to share
https://aacable.wordpress.com/2015/09/1 ... -approach/
 
dagelf
just joined
Posts: 9
Joined: Thu Dec 24, 2015 5:25 pm

Re: Failover work with 8.8.8.8

Wed Jul 18, 2018 6:11 am

Don't check against just 1 IP, I check 3.
This runs every 2 mins in scheduler.
: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";
	}
}
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.
 
nishadul
Member Candidate
Member Candidate
Topic Author
Posts: 161
Joined: Thu Dec 13, 2012 12:04 pm
Location: Bangladesh

Re: Failover work with 8.8.8.8

Wed Jul 18, 2018 9:21 am

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.
second DNS is OK but no internet connection because ISP's internet connection (cable) is disconnected from IIG.
 
User avatar
Aveyer
Frequent Visitor
Frequent Visitor
Posts: 66
Joined: Thu Jun 24, 2010 11:17 pm

Re: Failover work with 8.8.8.8

Fri Oct 11, 2019 4:03 am

Don't check against just 1 IP, I check 3.
This runs every 2 mins in scheduler.
: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";
	}
}
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.
That's exactly what I'm doing and it works.
But yes, I forgot to mention that you should have static routes for the addresses that you're checking.

Who is online

Users browsing this forum: Bing [Bot], GoogleOther [Bot], Renfrew and 42 guests