# Simpler Failover for two Gateways I found working

**URL:** <https://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108>\
**Category:** Beginner Basics\
**Created:** [August 27, 2023, 10:54am UTC](https://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108 "2023-08-27T10:54:17Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![jaclaz](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/jaclaz/32/55652_2.png) [@jaclaz](https://forum.mikrotik.com/u/jaclaz)\
**Post date:** [October 8, 2024, 12:25pm UTC](https://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/19 "2024-10-08T12:25:15Z")

</div>

Only to keep things as together as possible I just “sold” this Filo’s approach to a new user, with a few changes.  
I got rid of the separate routing table and of the mangle by adding a “narrow” /32 route to the “canary” ip address in “main” table.  
And I didn’t use the “comment” as selector in the Netwatch script (this is a pet peeve of mine, comments may be changed accidentally six months or a year later, the setup would stop working and finding out what happened would be more difficult).  
Because of _some reasons_ (I suspect the address on ether1 coming from DHCP server instead of being static) when the ether1 is physically disconnected from the ISP router (think of the ethernet cable going bad or just the ISP router or its power supply failing) the “main” route becomes inactive, and the whole setup starts flapping each time the netwatch script runs.  
So I added a blackhole route to the same /32 address with distance 2.

The thread is here:

> [@Secondary WAN and failover setup hap ax2 (7.16) for a beginner](http://forum.mikrotik.com/t/secondary-wan-and-failover-setup-hap-ax2-7-16-for-a-beginner/179134/1):
>
> Hello all! I am new to network setup, just basic knowledge, I just bought a Mikrotik hap ax2 , and I want to setup dual WAN failover with ISP modem (already in bridge mode) and 4g/LTE mobile internet modem. The ISP modem connected to the ethernet1 (internet in) port and I am struggling to setup a secondary WAN to connect the LTE modem and transfer its internet through other ethernet ports. How should I start with it? I have factory defconfig in the Mikrotik, and from the basics, I would like to…

As it is a bit difficult to follow due to all the tests made, here it is the overall setup using the SAME IP addresses and structure of the original Filo’s post:

1. Prerequirements:

- Network with DHCP done by MicroTik (in this case: 192.188.1.0/24)
- Standard Gateway in DHCP will be the MikroTik (here: 192.188.1.1)
- Internet available at (for Example) 192.168.1.1 (in this case DSL)
- Internet available at (for Example) 192.168.1.250 (LTE-Modem)
- Both interfaces connected to the two devices above characterized as WAN in interface list and masqueraded in /ip firewall nat

1. Routing:

- Standard Route 0.0.0.0/0 set to 192.168.1.250 with Distance 1 comment=LTE-Failover → (keep it DEACTIVATED)
- Standard Route 0.0.0.0/0 set to 192.168.1.1 with Distance 2
- Narrow Route 8.8.4.4/32 set to 192.168.1.1 with Distance 1
- Narrow Blackhole route 8.8.4.4/32 with Distance 2

~~3. Go to ROUTING → TABLES~~  
~~- Create a Routing Table named (for Example) “DSL” - check FIB~~

~~4. Go To IP → ROUTES → Click +~~  
~~- Dst,Address: 0.0.0.0/0~~  
~~- Gateway: 192.168.1.1 (your Primary Gateway)~~  
~~- Routing Table: Select above created ROUTING TABLE (here: “DSL”)~~

~~5. Go to IP → FIREWALL → Tab MANGLE~~  
~~Create a MANGLE-Rule:~~  
~~- Tab → GENERAL~~  
~~– Chain: output~~  
~~– Dst.Address: 8.8.8.8~~  
~~– Protocol: 1 (icmp)~~  
~~- Tab → ACTION~~  
~~– Action: mark routing~~  
~~– New Routing Mark: Select above created ROUTING TABLE (here: “DSL”)~~

~~6.~~ 3.Go to TOOLS → NETWATCH  
-Tab → HOST  
– Create a Netwatch Host:  
— Host: ~~8.8.8.8~~ 8.8.4.4  
— Type: icmp  
— Interval: 00:00:30  
— Timeout: 5.00

-Tab → Down  
/ip route enable ~~[find comment=LTE-Failover]~~ [find dst-address=0.0.0.0/0 and gateway=192.168.1.250]

-Tab → Up  
/ip route disable ~~[find comment=LTE-Failover]~~ [find dst-address=0.0.0.0/0 and gateway=192.168.1.250]

It seems like it works nicely and it is simpler to implement.

EDIT: added the detail that interfaces should be WAN and masqueraded  
EDIT2: re-formatted the strikethrough that was lost in the board update

---

_[View the full topic](https://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108)._
