Page 1 of 1
backup link, check-gateway
Posted: Thu Sep 15, 2011 11:41 pm
by gaso
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.
Re: backup link, check-gateway
Posted: Sat Sep 17, 2011 2:17 pm
by Caci99
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
Re: backup link, check-gateway
Posted: Mon Jun 04, 2012 6:15 pm
by gaso
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.
Re: backup link, check-gateway
Posted: Mon Jun 04, 2012 6:18 pm
by Chupaka
with help of 'distance' value
Re: backup link, check-gateway
Posted: Mon Jun 04, 2012 6:21 pm
by gaso
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
Re: backup link, check-gateway
Posted: Mon Jun 04, 2012 10:50 pm
by Chupaka
well, not blackhole, but default routes
Re: backup link, check-gateway
Posted: Tue Jun 05, 2012 5:14 pm
by gaso
All cleared, thanks.
Re: backup link, check-gateway
Posted: Sat Aug 18, 2012 3:41 am
by gaso
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.
Re: backup link, check-gateway
Posted: Thu Aug 23, 2012 1:10 pm
by Chupaka
Re: backup link, check-gateway
Posted: Wed Sep 07, 2016 6:31 pm
by immortalkata
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
???
Re: backup link, check-gateway
Posted: Thu Sep 08, 2016 4:20 pm
by Chupaka
what mean host1 and host2?
how can i make it ping to 8.8.8.8 for example?
8.8.8.8 is host1
Re: backup link, check-gateway
Posted: Mon Sep 19, 2016 5:47 pm
by immortalkata
/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
Re: backup link, check-gateway
Posted: Mon Sep 19, 2016 6:04 pm
by Chupaka
its not work !
need more details. how do you mark necessary traffic, what do you expect and what goes wrong?
Re: backup link, check-gateway
Posted: Mon Sep 19, 2016 6:57 pm
by immortalkata
i want if main gateway's internet go off switch to second gateway
Re: backup link, check-gateway
Posted: Tue Sep 20, 2016 1:19 am
by Chupaka
and what happens instead?
Re: backup link, check-gateway
Posted: Tue Sep 20, 2016 9:40 am
by paulct
You could also use netwatch