Community discussions

MikroTik App
 
gaso
just joined
Topic Author
Posts: 18
Joined: Thu Sep 15, 2011 11:16 pm

backup link, check-gateway

Thu Sep 15, 2011 11:41 pm

I have two Gateways.On LAN side, both gateways are always accessible, so the check-gateway=ping doesn't work for me to select right route. What I want to do is to check, if gateway has access to the internet.

Simple solution would be nslookup check on each gateway, how can that be implemented in RouterOS, instead of ping test to gateway's LAN IP.

The situation is:

(Public IP)
ISP1 GW
|
|
(DHCP public IP)
Client/gateway 1
(Fixed LAN1 IP)
|
RouterOS ----- LAN
|
|
(Fixed LAN2 IP)
Client/gateway 2
(DHCP Public IP)
|
|
ISP2 GW
(public IP)

Ping check isn't suitable form me, because each Client/gateway is accessible from RouterOS and each ISP gateway is accessible from the internet.
Out of RouterOS, I want to send nslookup to each client/gateway DNS server, that would solve my case.
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: backup link, check-gateway

Sat Sep 17, 2011 2:17 pm

Usually this is achieved by using scripts which would run at specific periods of time,
but I found this solution more simple and effective:

http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting
 
gaso
just joined
Topic Author
Posts: 18
Joined: Thu Sep 15, 2011 11:16 pm

Re: backup link, check-gateway

Mon Jun 04, 2012 6:15 pm

I configured as suggested above and it's working great, but I don't know how to make WAN1 priority, when both links are availabe.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: backup link, check-gateway

Mon Jun 04, 2012 6:18 pm

with help of 'distance' value
 
gaso
just joined
Topic Author
Posts: 18
Joined: Thu Sep 15, 2011 11:16 pm

Re: backup link, check-gateway

Mon Jun 04, 2012 6:21 pm

Thanks for fast reply.

Did you mean something like this?

/ip route
add dst-address=Host1 type=blackhole distance=10
add dst-address=Host2 type=blackhole distance=20
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: backup link, check-gateway

Mon Jun 04, 2012 10:50 pm

well, not blackhole, but default routes :)
 
gaso
just joined
Topic Author
Posts: 18
Joined: Thu Sep 15, 2011 11:16 pm

Re: backup link, check-gateway

Tue Jun 05, 2012 5:14 pm

All cleared, thanks. :D
 
gaso
just joined
Topic Author
Posts: 18
Joined: Thu Sep 15, 2011 11:16 pm

Re: backup link, check-gateway

Sat Aug 18, 2012 3:41 am

I have problem with my current configuration with dual wan, because it's not working right if one of my gateways doesn't have connection to internet, so I would need to check connectivity to some public servers for example 8.8.8.8 to check if WAN1 and WAN2 have connection to the internet, not just checking if WANs are connected to gateways.

I have messed with my configuration on remote location and it doesn't work at all now. I still have ssh connectivity to mikrotik router, and I asking for help if someone could point me or paste working configuration for this situation:
I have two gateways, which have public IP assigned by DHCP server and are connected to mikrotik on WAN1 the first gateway and on WAN2 the second. All I want to do is simple failover not load balancing, with WAN1 as priority. I have one server on LAN and dynDNS rOS 5.x script running on mikrotik, my clients on LAN are double NAT-ed and I am searching for some console commands which could suit my situation, I have to check some public IP for internet connectivity not just each gateway.
I have tried different things found on wiki, without success. On my device I heva rOS 5.17 installed.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: backup link, check-gateway

Thu Aug 23, 2012 1:10 pm

 
immortalkata
just joined
Posts: 14
Joined: Sun Nov 15, 2015 9:59 pm

Re: backup link, check-gateway

Wed Sep 07, 2016 6:31 pm

what mean host1 and host2?
how can i make it ping to 8.8.8.8 for example?
so if 8.8.8.8 is timed out switch to next route
???
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: backup link, check-gateway

Thu Sep 08, 2016 4:20 pm

what mean host1 and host2?
how can i make it ping to 8.8.8.8 for example?
8.8.8.8 is host1
 
immortalkata
just joined
Posts: 14
Joined: Sun Nov 15, 2015 9:59 pm

Re: backup link, check-gateway

Mon Sep 19, 2016 5:47 pm

/ip route
add dst-address=Host1 gateway=GW1 scope=10
add dst-address=Host2 gateway=GW2 scope=10

/ip route
add distance=1 gateway=Host1 routing-mark=ISP1 check-gateway=ping
add distance=2 gateway=Host2 routing-mark=ISP1 check-gateway=ping

/ip route
add distance=1 gateway=Host2 routing-mark=ISP2 check-gateway=ping
add distance=2 gateway=Host1 routing-mark=ISP2 check-gateway=ping
is this currect? or need somthing more?
its not work !
Capture.JPG
You do not have the required permissions to view the files attached to this post.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: backup link, check-gateway

Mon Sep 19, 2016 6:04 pm

its not work !
need more details. how do you mark necessary traffic, what do you expect and what goes wrong?
 
immortalkata
just joined
Posts: 14
Joined: Sun Nov 15, 2015 9:59 pm

Re: backup link, check-gateway

Mon Sep 19, 2016 6:57 pm

i want if main gateway's internet go off switch to second gateway
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: backup link, check-gateway

Tue Sep 20, 2016 1:19 am

and what happens instead?
 
paulct
Member
Member
Posts: 336
Joined: Fri Jul 12, 2013 5:38 pm

Re: backup link, check-gateway

Tue Sep 20, 2016 9:40 am

You could also use netwatch

Who is online

Users browsing this forum: No registered users and 55 guests