Community discussions

MikroTik App
 
derolf
just joined
Topic Author
Posts: 7
Joined: Sat Apr 13, 2024 6:29 pm

Solution: Dead simple failover config for two ISPs (5G and DSL)

Wed Apr 17, 2024 12:52 pm

I have 5G ~500MBit/s and DSL ~50MBit/s, both using FritzBoxes. I have now finalised my failover solution that prefers 5G and switches to DSL when 5G fails.

My setup is as follows:
- HEX at 192.168.178.1, bridge mode, DHCP server enabled, acts as gateway
- Fritz5G at 192.168.178.3, DHCP server disabled, static IP
- FritzDSL at 192.168.178.4, DHCP server disabled, static IP, acts as wifi hotspot (for traditional reasons)

Solution inspired by "Simpler Failover for two Gateways I found working"(viewtopic.php?t=198999)

I have two routes:
/ip route
add check-gateway=none comment=WAN disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.178.3 pref-src="" routing-table=main suppress-hw-offload=no
add comment=5G-Ping disabled=no distance=1 dst-address=1.1.1.2/32 gateway=192.168.178.3 pref-src="" routing-table=main suppress-hw-offload=no

Basically, the 5G-Ping rule forces all traffic to 1.1.1.2 to always go through the Fritz5G.

I have a Netwatch rule that monitors 1.1.1.2 via ICMP and modifies the gateway of WAN depending on the 5G state:
/tool netwatch
add disabled=no down-script="/ip route set [find comment=WAN] gateway=192.168.178.4" host=1.1.1.2 interval=30s test-script="" timeout=5s type=icmp up-script="/ip route set [find comment=WAN] gateway=192.168.178.3"

WARNING: With this setup, you get the dreaded router triangle (client -> 192.168.178.1 -> 192.168.178.3 -> example.com -> 192.168.178.3 -> client), i.e. packets delivered downstream skip 192.168.178.1. I had massive issues (latency ~5s, low bandwidth) with the default stateful-firewall configuration and removed ALL rules since my HEX is anyway only living in the LAN.

Who is online

Users browsing this forum: mkrtksr and 11 guests