Basic support for multiple WANs (netifd & default gateway)

Rafał Miłecki zajec5 at gmail.com
Sat Sep 3 05:08:55 PDT 2022


On 3.09.2022 13:53, Stefan Kalscheuer wrote:
> I'm using a similar setup for quite some time with 2 WAN interfaces on OpenWrt 22.03 SNAPSHOT:
> * "wan" - statically routed, native dual stack fiber uplink
> * "wwan" - uqmi 4G upstream with dynamically assigned dual stack (DHCP)
> 
> Configured both interfaces with "use default gateway" and gateway metric ("metric") of 0 and 2000 respectively.
> 
> Results in default routing like this::
> default via 172.16.100.1 dev eth2 proto static
> default via 10.142.198.233 dev wwan0 proto static src 10.142.198.234 metric 2000
> default via 2001:****:... dev eth2 proto static metric 1024 pref medium
> default via 2a02:****:... dev wwan0 proto static metric 2000 pref medium
> 
> Works for me without additional changes. Traffic is routed over "wan" as long as it's up and automatically switches to "wwan" when I disable the interface or pull the cable.

Ah, I didn't realize that using different metrics will give me TWO
default gw-s. That's perfect. Should be enough for base usage.


> I decided against mwan3 for now, because I don't need advanced features either and I do have some scenarios, where I must route certain traffic over a specific uplink, so I got a hand full of static routes and scripts anyway.
> 
> There are some downsides, if the interface is not actually "down", but simply fails forwarding traffic or just one protocol (v4/v6) goes down.
> Also both interfaces have to stay up permanently, unless you add some trigger scripts.

Sounds good. I'm aware of plain metric-based solution. Users with more
requirements should just use mwan3.


Thanks Stefan & Jo (IRC) for your help.



More information about the openwrt-devel mailing list