Community discussions

MikroTik App
 
akarpas
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Tue Mar 20, 2018 4:46 pm

DUAL WAN no balance / possible errors with this routing config

Tue Jul 13, 2021 9:31 pm

I have found this configuration for dual wan with no balance and simplified it see below:

Method 2 - Dual WAN failover with MULTIPLE remote host ping check (ISP1 - Static IP; ISP2 - PPPoE)
We have two uplinks: MAIN (GW1 IP - 88.196.6.185) and BACKUP (GW2 - PPoE IP: 10.10.1.1) - usually those gateways are ISP routers.
So we need to monitor our gateways connectivity with external Hosts (those Hosts can be whatever you think is stable enough - some webpage/server addresses. I´m using Google DNS and OpenDNS servers as hosts.
GoogleDNS:
Host1A: 8.8.8.8
Host1B: 208.67.220.220
OpenDNS:
Host2A: 8.8.4.4
Host2B: 208.67.222.222
We are going to check Host1A and Host1B via GW1
Host2A and Host2B via GW2
1. First we create routes to thoe Hosts via corresponding gateways:
/ip route
add dst-address=Host1A(8.8.8.8) gateway=GW1(88.196.6.185) scope=10
add dst-address=Host1B(208.67.220.220) gateway=GW1(88.196.6.185) scope=10
add dst-address=Host2A(8.8.4.4) gateway=GW2(10.10.1.1) scope=10
add dst-address=Host2B(208.67.222.222) gateway=GW2(10.10.1.1) scope=10
2. Create "virtual" hops for those hosts (IP addresses of virual hops arent really important, im using 10.1.1.1 and 10.2.2.2 as example)
/ip route
add dst-address=10.1.1.1 gateway=Host1A(8.8.8.8) scope=10 target-scope=10 check-gateway=ping
add dst-address=10.1.1.1 gateway=Host1B(208.67.220.220) scope=10 target-scope=10 check-gateway=ping
add dst-address=10.2.2.2 gateway=Host2A(8.8.4.4) scope=10 target-scope=10 check-gateway=ping
add dst-address=10.2.2.2 gateway=Host2B(208.67.222.222) scope=10 target-scope=10 check-gateway=ping
3. Add default routes for our clients:
/ip route
add distance=1 gateway=10.1.1.1
add distance=2 gateway=10.2.2.2

------------------------------------------------------------------------------------------------------------------------
I have made this configuration a simplified version of other more complicated above:
-------------------------------------------------------------------------------------------------------------------------
# jul/13/2021 19:16:35 by RouterOS 6.48.3
# software id = IM7U-W6RH
#
# model = RB4011iGS+
/ip route
add distance=1 gateway=10.1.1.1
add distance=2 gateway=10.10.10.5
add distance=1 dst-address=1.1.1.1/32 gateway=10.10.10.1 scope=10
add distance=1 dst-address=8.8.8.8/32 gateway=10.10.10.1 scope=10
add check-gateway=ping distance=1 dst-address=10.1.1.1/32 gateway=1.1.1.1 \
scope=10
add check-gateway=ping distance=1 dst-address=10.1.1.1/32 gateway=8.8.8.8 \
scope=10
----------------------------------------------------------------------------------------------------------------
It works like a charm in my lab. Just want geeks to look and advise if they see any possible problems with this simplified configuration as at the moment it works great in the lab environment. Thanks in advance! It Checks two hosts 8.8.8.8 and 1.1.1.1 if 1.1.1.1 goes down it checks 8.8.8.8 if 8.8.8.8 goes down it switches to route with priority 2. If 1.1.1.1 or 8.8.8.8 is up or comes back up it switches back to the router with priority 1.

Who is online

Users browsing this forum: baragoon, BinaryTB, Google [Bot], raphaps, rplant and 61 guests