Community discussions

MikroTik App
 
jpineira
just joined
Topic Author
Posts: 3
Joined: Thu Feb 07, 2013 4:11 am

Dual WAN Failover with DHCP on WAN port.

Wed Jan 21, 2015 1:33 am

I need help with configuring internet failover on a Mikrotik. It's 2 WAN connections. Both connections are DHCP. I have gone through most tutorials but most failover scenarios are for WAN ports with static IPs and static gateways. The gateways on both of these connections will occasionally change. Any suggestions?
 
User avatar
rmmccann
Member Candidate
Member Candidate
Posts: 182
Joined: Tue Sep 25, 2012 11:15 pm
Location: USA

Re: Dual WAN Failover with DHCP on WAN port.

Wed Jan 21, 2015 7:13 pm

Rather than specifying an IP address as the gateway, can you simply specify the physical interface as the gateway? I just tried this on a PPPoE lab connection I have and it seems to work fine for the default route.

ie:
/ip route add distance=1 gateway=ether1-gateway
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. --Douglas Adams
 
InoX
Forum Guru
Forum Guru
Posts: 1969
Joined: Tue Jan 09, 2007 6:44 pm

Re: Dual WAN Failover with DHCP on WAN port.

Wed Jan 21, 2015 7:28 pm

Set dhcp client on both connections.
Add default route 1 and default route 2 for main and secondary wans.
Done.
Default gateway will be pinged for every connection but if the internet is not working and ping till gateway work, failover will not work.
You do not have the required permissions to view the files attached to this post.
 
thewickerman666
just joined
Posts: 7
Joined: Sun Sep 10, 2017 9:28 am

Re: Dual WAN Failover with DHCP on WAN port.

Mon Sep 11, 2017 6:38 am

InoX your solution worked awesomely well for me. This is on my hapAC (MikroTik RouterOS 6.40.3 (c) 1999-2017) dual wan failover with DHCP on wan ports.

I have ether1 (WAN1) connected to a TWC DOCSIS3.0 modem, and ether2 (WAN2) connected to a google fiber.
Selection_001.png
Selection_002.png
::For WAN1::
IP > DHCP Client > DHCP tab > interface: ether1; add default route : yes
IP > DHCP Client > Advanced tab > Default Route Distance: 1

::For WAN2::
IP > DHCP Client > DHCP tab > interface: ether2; add default route : yes
IP > DHCP Client > Advanced tab > Default Route Distance: 2

I had static routes set with scope and distance setting per some previous posts, I have now deleted them now. These are not needed if one uses InOX's solution.

Thanks InOX.

In addition i realised that without ping check the changeover is not very effective especially if you have unresponsive modem/gateway device. So found that adding this in the routing filter is helping:
/routing filter
add action=passthrough chain=dynamic-in disabled=no set-check-gateway=ping
the above is as suggested in here by tabate47: viewtopic.php?t=112532#

Would appreciate if people would post their finding and test observations. Thanks tabate47.
You do not have the required permissions to view the files attached to this post.
 
viktorcode
just joined
Posts: 1
Joined: Sat Sep 21, 2019 1:51 pm

Re: Dual WAN Failover with DHCP on WAN port.

Sat Sep 21, 2019 1:56 pm

I'm trying to fo roughly the same thing but with the difference being that one of my WAN connections is PPPoE and the other one is DHCP. My problem is when with the PPPoE connection setup I'm trying to add DHCP client to the corresponding ethernet port I get the following: "Couldn't add New DHCP Client - can not run on slave interface (6)"

How do I do it?

Who is online

Users browsing this forum: Google [Bot], inteq, Majestic-12 [Bot], panosdoulkaris, puzz and 67 guests