OPNsense Forum

English Forums => 26.7 Series => Topic started by: JoeFromNowhere on October 22, 2026, 09:08:17 AM

Title: Failover switching with automatic 4G backup connection
Post by: JoeFromNowhere on October 22, 2026, 09:08:17 AM
Hello everyone,
I just switched from pfsense with squidguard to Opnsense with adguard and mostly everything works well !

I just have something about gateways failover that worked with pfsense and not with opnsense.

My wan network looks like this :
WAN1 : 7Gb/s fiber connection with a 4G backup behind that switch automatically to 4G if fiber is down.
WAN2 : 1Gb/s fiber connection
WAN1 has priority 1 and WAN2 has priority 2.

Automatic switching to 4G backup when WAN1 fiber is down goes like this :
First packets losses for a small time. Then connection goes ok with higher latency (Fiber : 15ms, 4G : 30ms)

So the only thing Opnsense really knows when WAN1 switch to 4G backup is higher latency.

What I would like from Opnsense :
- When WAN1 fiber connection is down, switch to WAN2.
- When WAN1 and WAN2 fiber connection are down, switch back to WAN1 with backup 4G connection (higher latency).

I successed making it work with pfsense, but with Opsense :
- it doesn't switch to WAN2 fiber link if I set WAN1 high latency threshold high (WAN1 in warning state).
- it doesn't switch back from WAN2 to WAN1 backup 4G when WAN1 and WAN2 fiber links are down if I set WAN1 high latency threshold low (WAN1 in down state).

I tried with and without gateway groups, always allowing gateway switching in general settings.

Someone has a solution ?
Thanks !
Title: Re: Failover switching with automatic 4G backup connection
Post by: Seimus on October 22, 2026, 10:08:18 AM
By default the system picks a GW depending on the priority and "upstream flag"

Better Priority or "Upstream" flag always wins.
So set your primary GW with better prior and the other with worse one (lower priority = better candidate, but the Upstream overrides it If I remember correctly.)
This settings is to choose from GWs that are flagged as UP.


In regards of GW monitoring there are 2 parameters with 2 thresholds each.
Latency & Packet loss, each of them has low and high threshold.
The LOW threshold once reached flags the GW as either Packets loss Occurrence or Latency Occurrence
The HIGH threshold once reached flags the GW as DOWN.

You need to fine to this to your needs if the defaults values do not fit for you.
The defaults are. But usually they are enough.

Have a look at
https://docs.opnsense.org/manual/how-tos/multiwan.html

Regards,
S.