Community discussions

MikroTik App
 
Toby7
Member Candidate
Member Candidate
Topic Author
Posts: 100
Joined: Thu Jan 05, 2012 12:53 am

Problem on WAN failover without scripting

Sun Feb 09, 2014 4:58 pm

Hi all,

I am trying to do a WAN failover for my home network without any scripts/netwatch. My setup is adopted from this tutorial:
http://wiki.mikrotik.com/wiki/Advanced_ ... asic_Setup

There are two separate ADSL connections for failover. If I enable/disable the routes manually the failover is working but of course I want an automatic failover without scripting. Additionally the normal gateway check should be extended to check the ping to IPs 8.8.8.8 and 8.8.4.4 in order to detect an real down state of my PPPoE connections.
The main gateway has the IP 192.168.0.240, the backup PPPoE connection is directl attached to the router with name "PPPoE-TelekomDSL".

Main routes:

ros code

;;; Main route
 dst-address=0.0.0.0/0 gateway=8.8.8.8 
        gateway-status=8.8.8.8 recursive via 192.168.0.240 ether2_homenet check-gateway=ping distance=1 
        scope=30 target-scope=10 

dst-address=0.0.0.0/0 gateway=8.8.4.4 gateway-status=8.8.4.4 unreachable check-gateway=ping 
        distance=2 scope=30 target-scope=10
Here are my gateway checks:

ros code

dst-address=8.8.4.4/32 gateway=PPPoE-TelekomDSL gateway-status=PPPoE-TelekomDSL reachable 
        check-gateway=ping distance=1 scope=10 target-scope=10 

 dst-address=8.8.8.8/32 gateway=192.168.0.240 
        gateway-status=192.168.0.240 reachable via  ether2_homenet check-gateway=ping distance=1 scope=10 
        target-scope=10
With this setup enabling the backup route does not work automatically even if I disable the main route. The problem is related to the PPPoE-TelekomDSL gateway for dst address 8.8.4.4. If I put the IP from "Local Address" of the PPPoE connection here instead, it does work. But only for 20 seconds because then the route to 8.8.4.4 is marked unreachable agin. For your information, the PPPoE connection puts a DAC route(with "Local Address" from PPPoE as dst) in the routing table...

Again using gateway PPPoE-TelekomDSL marks my route to 8.8.4.4 as active but failover is not working. The backup default route then still has the gateway 8.8.4.4 unreachable set.

Here is my debug log when enabling the route:
Image

automatic disable after 20s
Image

Can anybody explain this behaviour to me? Thanks!
 
User avatar
rickfrey
Trainer
Trainer
Posts: 610
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Problem on WAN failover without scripting

Sun Feb 16, 2014 7:35 am

Its really less complicated than that. All you really need to do is add two default gateways. One will have a higher distance than the other. Both will have Check gateway by ping enabled. Then you will also need two NAT rules. That will work perfectly and without any problems.
Launch your company forward with professional training!
http://rickfreyconsulting.com/product-c ... raining-2/
 
nerdtron
Member Candidate
Member Candidate
Posts: 123
Joined: Sat Nov 30, 2013 7:49 am

Re: Problem on WAN failover without scripting

Mon Feb 17, 2014 3:28 pm

Its really less complicated than that. All you really need to do is add two default gateways. One will have a higher distance than the other. Both will have Check gateway by ping enabled. Then you will also need two NAT rules. That will work perfectly and without any problems.
Yes you can do this if only you disconnect the other WAN port. Even if you use check gateway ping option, as long as the gateway IP is up but its internet connection is down, your automatic failover will not work.
 
User avatar
rickfrey
Trainer
Trainer
Posts: 610
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Problem on WAN failover without scripting

Mon Feb 17, 2014 7:32 pm

Even if you use check gateway ping option, as long as the gateway IP is up but its internet connection is down, your automatic failover will not work.
That's true. Personally, I would netwatch to resolve that problem, but he doesn't want to do that. How would you configure it?
Launch your company forward with professional training!
http://rickfreyconsulting.com/product-c ... raining-2/
 
nerdtron
Member Candidate
Member Candidate
Posts: 123
Joined: Sat Nov 30, 2013 7:49 am

Re: Problem on WAN failover without scripting

Tue Feb 18, 2014 3:54 am

I prefer scripts like the netwatch II http://wiki.mikrotik.com/wiki/Improved_Netwatch_II
I also modified it to include a out interface on the ping command so that the ping will always check if connection on that interface is down.

Who is online

Users browsing this forum: andlil, babhitartani, cedie, CZFan, Kindis, sindy and 60 guests