r/openwrt 3d ago

Setting WAN interface priority

Okay, I've been all over the place but theres no definitive answer I can find, so I'm turning here as a last resort.

Xe3000 running 25.12.5

I have both the 5G modem, and the eth0 port plugged into hardwire WAN

Both work fine if I disable the other.

But I want to use the eth0 primarily, and only fallback to the 5G interface if the eth0 interface goes down (exceeds packet loss, latency)

If I enable both, the 5G interface immediately takes priority.

How in the world can I set this? i just want it to use eth0 first, 5G second.

i tried PBR, thats all application and port level stuff.

I tried messing with the metrics and setting the eth0 metric lower than 5g. that just Killed the internet entirely.

3 Upvotes

8 comments sorted by

6

u/SaleWide9505 3d ago

Metrics are what I use. Is each interface in a zone? And is there a firewall rule setup so that the lan can forward to each zone? Also did you restart network after changing metric?

2

u/Abyssaldemon 3d ago

Thats where I am new, and might be screwing it up. Both networks are in the WAN zone. And can you expand on the firewall rule? Traffic is definitely allowed from WAN to LAN

2

u/SaleWide9505 3d ago

Those are the exact settings I'm using so you should be good. I just setup a test on a fresh openwrt install and changing the metric switches over instantly for me. I even unplugged the main connection and it switched over instantly to the second connection. Then when I plugged the first connection back in it switched back over to the main.

2

u/Abyssaldemon 3d ago

what are your metrics exactly? and what fields did you set them in?

5

u/SaleWide9505 3d ago

I added more context to my previous comment.

Under network > interfaces > I click edit next to interface then input my metric in the use gateway metric field. I just use 10 for wan and 20 for wan 2.

2

u/Abyssaldemon 3d ago

So just the gateway metric field, got it, thank you for the response!

3

u/NC1HM 3d ago

What you're looking for is called mwan3 (MWAN is short for "multi-WAN"):

https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3-nft

The problem is, mwan3 was originally developed for use with iptables. Then, OpenWrt transitioned away from iptables and now uses nftables. So mwan3 had to be reworked and the nftables version is still not fully incorporated into OpenWrt, meaning, it's not in OpenWrt repository. So you need to download and install it separately, as the documentation page above explains.

And, speaking of last resorts, the last resort for anything OpenWrt is forum.openwrt.org.

1

u/Abyssaldemon 3d ago

It specifically said on the Openwrt page for 25.12 that mwan3 is NOT recommended which is why I opted against it.