Community discussions

 
daras
newbie
Topic Author
Posts: 39
Joined: Thu Sep 17, 2015 3:32 pm

Dual WAN setup

Sat Aug 11, 2018 9:03 am

HI,


I have setup which consists of 1 LAN network and 2 WAN in two different ISP's, lets call it WAN1 (fast) and WAN2 (slow)

I ve added a default route for the 2 ISP's and the nework goes down.

I ve noticed that you cannot 've 2 default routes on the router so i 've changed the metric on one of them.


How can i ve both routes to the ISP being active can i use ECMP which checks which gw is up ?

I do not want to force upload traffic to select one of the 2 gateways.

Thanks
 
User avatar
Steveocee
Forum Veteran
Forum Veteran
Posts: 896
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: Dual WAN setup

Sat Aug 11, 2018 12:10 pm

Set your primary as distance 1 and enable check gateway.
Set secondary link as distance 2.

Router will go down primary until it cannot reach gateway where it will failover with no need for additional scripting.

Simple, but it works well.
Steve "Steveocee" Carter
PC Gamer, Airsofter, MikroTik Nerd
My Website - My MikroTik Tutorials
 
parsix
just joined
Posts: 2
Joined: Wed Jul 18, 2018 11:03 am

Re: Dual WAN setup

Sun Aug 12, 2018 1:09 pm

Set your primary as distance 1 and enable check gateway.
Set secondary link as distance 2.

Router will go down primary until it cannot reach gateway where it will failover with no need for additional scripting.

Simple, but it works well.
how to it check internet access for failover?
it only check gateway access
 
User avatar
TFyre
just joined
Posts: 14
Joined: Wed Jan 13, 2010 3:37 pm
Contact:

Re: Dual WAN setup

Sun Aug 12, 2018 6:01 pm

A netwatch works the best in a scenario like this.

Pick a static IP that is ALWAYS available via your specific gateway, BUT which you will never directly use (probably something like one of the x.root-servers.net)

1) Add this IP as a NULL route with distance 250 (if the interface goes down, this will be the route for the IP)
2) Add this IP as a normal route forcing it out gateway1
3) Add the default gateway with a comment via gateway1
4) Add the default gateway via gateway2 with a higher distance
5) Add a netwatch script to ping this IP with a script to disable/enable the default gateway

When the netwatch pings the IP and latency is higher than X, it assumes the gateway is offline, and disables the default gateway via gateway1, and let the 2nd default gateway take over.

Example script for UP:
:log info "GATEWAY1 up"
/ip route
:foreach ID in [find comment="GATEWAY1 Internet"] do={
  set $ID disable=no
}


Example script for DOWN:
:log info "GATEWAY1 down"
/ip route
:foreach ID in [find comment="GATEWAY1 Internet"] do={
  set $ID disable=yes
}
 
freemannnn
Long time Member
Long time Member
Posts: 620
Joined: Sun Oct 13, 2013 7:29 pm

Re: Dual WAN setup

Sun Aug 12, 2018 6:05 pm

use Recursive Failover... read the folloring artile.

http://www.prinmath.com/ham/mikrotik-failover.htm

Who is online

Users browsing this forum: No registered users and 15 guests