How to control multiple uplinks - one at a time

I am using OpenWrt on a x86/64 mini computer as a router for a motorhome.
There are 3 possible uplinks to get a connection to the internet:

  • Ethernet WAN (eth1)
  • wireless card Intel AX210NBW
  • L860GL 4G modem

Currently all 3 Interfaces are on in parallel. This is probably not the final solution (depending on the answers to my questions below).
What I want to achieve is to select one of the following:

  • eth1 WAN on, all others off
  • wireless on, all others off
  • 4G on, all others off
  • automatically switch between wireless and 4G, priority on wireless
  • automatically switch between wireless and 4G, priority on 4G

The selection mechanism could be manually via setup, or controlled automatically by parameters like availability of a internet source, connection speed, cost (=> 4G), etc.

What I do not need is distribution of internet traffic through multiple channels.
At home there is always a perfect connection to my home net available, wireless or cable. On the road probably only 4G is an option. Freestanding or at a campsite sometimes there is WiFi; if not, 4G must be used.
In any of these situations likely only one of the sources is available, hence no distributed traffic through multiple interfaces.

Please advice what would be the way to administer this situation.

The first set of questions:
Is the current setup (all 3 in parallel) good? Or possible at all?
(How) is it steered which interface is used?

If the current setup is not OK:
How can switching be controlled? Using scripts and some sort of setup user interface? Or do I need to install a package / packages?
Background information: a user interface, probably via a website, must be written in any case for other planned functionality, therefore that is most likely the easiest way to control it.

Look into the mwan3 and luci-app-mwan3 packages. Here's the documentation page. You can set up each of the wan interfaces, to be used in priority, and according to if they're up. While you can do load balancing with it, it isn't necessary. You can check latency as a condition of the link quality in the up/down status check, which may help you in getting the logic right for when both 4G and wireless are available.

I have a similar enough setup to yours: a wired wan to the cable modem, and a wwan that is a usb tethering interface for my phone, for if/when the cable internet pipe goes down.

In terms of disabling ('off') of interfaces when another is available, that it won't do. But if the wireless connection isn't joined to it's uplink SSID, or the 4G modem has no signal/service, you can make rules and metrics that will failover in order of eth > wifi > 4G or eth > 4G > wifi.

2 Likes

You can run user scripts on events with mwan3 which might get you the functionality you want regarding enable/disable of different interfaces.

2 Likes

@pp6000v2 and @evs
Thank you for your answers!
I am currently looking into the mwan3 documentation in order to learn how to use it and set it up for my purpose. Will be not easy for me as a beginner but I will try (and error) until I cannot get further. Then come back and ask...
As I see it now I probably will need to use mwan3 and develop some scripts to do the corresponding actions. That's a double burden, yet a double learning process in the end. So I'll go for it. :sweat_smile:
I'm pretty sure: talk to you later...

1 Like

Is there a particular reason you want the interfaces disabled, as opposed to just not connected to anything? I could see disabling the cellular card to ensure no metered data gets used when not intended, but if the ethernet wan jack isn't connected to anything, or the wifi interface used for uplink isn't connected to a network, they aren't going to do anything being either up or down.

No, I guess not.
The main situations to handle where multiple connections are possible (and one of them shall be chosen) are:

  1. at home there is ethernet and wlan accessible concurrently, both in quite good quality. I do not know how my home net would handle concurrent connections with or without load balancing.
  2. at some places outside there is a good free WLAN available. In this situation the 4G interface ( :money_with_wings:) should not be active although a good connection is probably available as well.
  3. I've been in many places out there (e.g. campsites) where free WLAN is available with good signal strength but extremely low performance due to too many connections. In this case 4G should be preferred although not free.

Maybe you could imagine more such situations.
Probably controlling the connection while not switching the interface off is sufficient in any situation. For me, being no networking expert, that is the same in the first place, looking just at the functionality, not at implementation method. Sorry for the way I expressed it...

Maybe not even the cellular modem needs to be switched off and on if the expected data transferred is small. At least with my current contract with 120 GB per month it wouldn't matter too much.
In fact I would care less about this topic anyway if I knew I would stay with this contract forever. But it was a deal and with the normal price not worth to be continued.
Also the speed (4G) is lower than a good WLAN connection.

Hmm. Might be worthwhile to see how they're doing the accounting for your internet connection. But yeah I only see enable/disable scripts mattering if it's something like very limited metered connections, or if it's a dependency thing. (For example (mechanically / electrically) switched/HA connections/dial on demand or multiple modems sharing the same link...)

But yeah been a while since I was doing metered 4G backup on my network. I recall something on the order or 300-700MiB per month in just latency, speed and connectivity tests per 4G modem. Kind of makes sense if you do 56 bytes times six (i.e. ipv6 + ipv4, for three ip targets for determining internet up+) every five seconds.

So if one was on something like prepaid 4G data for an entire year it might also be a thing? Similarly if you have a dial on demand, per second/minute connection... Or as OP said if it's trying to piggy back off of public wifi where you might only get a limited amount of data?

1 Like

@evs But yeah been a while since I was doing metered 4G backup on my network. I recall something on the order or 300-700MiB per month in just latency, speed and connectivity tests per 4G modem. Kind of makes sense if you do 56 bytes times six (i.e. ipv6 + ipv4, for three ip targets for determining internet up+) every five seconds.

That is good information to base a decision on whether to switch interfaces like cellular.
Another consideration is the time needed for starting up / shutting down an interface. It will matter a lot in situations where frequent switching between interfaces would occur.
On the other hand, in my situation it will definitely make sense to switch off 4G while at home.

I am still learning to handle wwan3, possibly in connection with scripts. Unfortunately I have also other things to do, so it will take time... :smile:

1 Like

I have installed and set up mwan3 and I believe it works.
However I may need some additional assistance.

First, here are the config files:

  • mwan3:
config globals 'globals'
        option local_source 'lan'
        option mmx_mask '0x3F00'

config interface 'wan'
        option enabled '1'
        list track_ip '1.0.0.1'
        list track_ip '1.1.1.1'
        list track_ip '208.67.222.222'
        list track_ip '208.67.220.220'
        option family 'ipv4'
        option reliability '2'

config interface 'wan6'
        option enabled '1'
        list track_ip '2606:4700:4700::1001'
        list track_ip '2606:4700:4700::1111'
        list track_ip '2620:0:ccd::2'
        list track_ip '2620:0:ccc::2'
        option family 'ipv6'
        option reliability '2'

config interface 'wwan'
        option enabled '1'
        list track_ip '1.0.0.1'
        list track_ip '1.1.1.1'
        list track_ip '208.67.222.222'
        list track_ip '208.67.220.220'
        option family 'ipv4'
        option reliability '1'

config interface 'wwan6'
        option enabled '1'
        list track_ip '2606:4700:4700::1001'
        list track_ip '2606:4700:4700::1111'
        list track_ip '2620:0:ccd::2'
        list track_ip '2620:0:ccc::2'
        option family 'ipv6'
        option reliability '1'

config interface '4gwan'
        option enabled '1'
        list track_ip '1.0.0.1'
        list track_ip '1.1.1.1'
        list track_ip '208.67.222.222'
        list track_ip '208.67.220.220'
        option family 'ipv4'
        option reliability '1'

config interface '4gwan_6'
        option enabled '1'
        list track_ip '2606:4700:4700::1001'
        list track_ip '2606:4700:4700::1111'
        list track_ip '2620:0:ccd::2'
        list track_ip '2620:0:ccc::2'
        option family 'ipv6'
        option reliability '1'
        option initial_state 'online'
        option track_method 'ping'
        option count '1'
        option size '56'
        option max_ttl '60'
        option timeout '4'
        option interval '10'
        option failure_interval '5'
        option recovery_interval '5'
        option down '5'
        option up '5'

config member 'wan_m1_w3'
        option interface 'wan'
        option metric '1'
        option weight '3'

config member 'wan6_m1_w3'
        option interface 'wan6'
        option metric '1'
        option weight '3'

config member 'wwan_m1_w3'
        option interface 'wwan'
        option metric '1'
        option weight '3'

config member 'wwan_m2_w3'
        option interface 'wwan'
        option metric '2'
        option weight '3'

config member 'wwan_m3_w3'
        option interface 'wwan'
        option metric '3'
        option weight '3'

config member 'wwan6_m1_w3'
        option interface 'wwan6'
        option metric '1'
        option weight '3'

config member 'wwan6_m2_w3'
        option interface 'wwan6'
        option metric '2'
        option weight '3'

config member 'wwan6_m3_w3'
        option interface 'wwan6'
        option metric '3'
        option weight '3'

config member '4gwan_m1_w3'
        option interface '4gwan'
        option metric '1'
        option weight '3'

config member '4gwan_m2_w3'
        option interface '4gwan'
        option metric '2'
        option weight '3'

config member '4gwan_m3_w3'
        option interface '4gwan'
        option metric '3'
        option weight '3'

config member '4gwan_6_m1_w3'
        option interface '4gwan_6'
        option metric '1'
        option weight '3'

config member '4gwan_6_m2_w3'
        option interface '4gwan_6'
        option metric '2'
        option weight '3'

config member '4gwan_6_m3_w3'
        option interface '4gwan_6'
        option metric '3'
        option weight '3'

config policy 'wan_only'
        list use_member 'wan_m1_w3'
        list use_member 'wan6_m1_w3'

config policy 'wwan_only'
        list use_member 'wwan_m1_w3'
        list use_member 'wwan6_m1_w3'

config policy '4gwan_only'
        list use_member '4gwan_m1_w3'
        list use_member '4gwan_6_m1_w3'

config policy 'wwan_4gwan'
        list use_member 'wwan_m1_w3'
        list use_member 'wwan6_m1_w3'
        list use_member '4gwan_m2_w3'
        list use_member '4gwan_6_m2_w3'

config policy '4gwan_wwan'
        list use_member '4gwan_m1_w3'
        list use_member '4gwan_6_m1_w3'
        list use_member 'wwan_m2_w3'
        list use_member 'wwan6_m2_w3'

config policy 'wan_wwan_4gwan'
        list use_member 'wan_m1_w3'
        list use_member 'wan6_m1_w3'
        list use_member 'wwan_m2_w3'
        list use_member 'wwan6_m2_w3'
        list use_member '4gwan_m3_w3'
        list use_member '4gwan_6_m3_w3'

config policy 'wan_4gwan_wwan'
        list use_member 'wan_m1_w3'
        list use_member 'wan6_m1_w3'
        list use_member '4gwan_m2_w3'
        list use_member '4gwan_6_m2_w3'
        list use_member 'wwan_m3_w3'
        list use_member 'wwan6_m3_w3'

config policy 'balanced'
        list use_member 'wan_m1_w3'
        list use_member 'wan6_m1_w3'
        list use_member 'wwan_m1_w3'
        list use_member 'wwan6_m1_w3'
        list use_member '4gwan_m1_w3'
        list use_member '4gwan_6_m1_w3'

config rule 'https'
        option sticky '1'
        option dest_port '443'
        option proto 'tcp'
        option use_policy 'wan_wwan_4gwan'

config rule 'default_rule_v4'
        option dest_ip '0.0.0.0/0'
        option use_policy 'wan_wwan_4gwan'
        option family 'ipv4'

config rule 'default_rule_v6'
        option dest_ip '::/0'
        option use_policy 'wan_wwan_4gwan'
        option family 'ipv6'
  • wireless:
config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:13.2/0000:03:00.0'
        option channel 'auto'
        option band '5g'
        option htmode 'HE40'
        option disabled '0'
        option cell_density '0'

config wifi-iface 'wifinet2'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option ssid 'xxxxxx'
        option encryption 'psk2'
        option key 'xxxxxx'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:14.0/0000:04:00.0'
        option channel 'auto'
        option band '2g'
        option htmode 'HE40'
        option disabled '0'
        option cell_density '0'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'xxxxxx'
        option encryption 'psk2'
        option key 'xxxxxx'
        option wpa_disable_eapol_key_retries '1'
  • network:
config globals 'globals'
        option ula_prefix 'fd5c:3e41:fe5e::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.57.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'
        option metric '10'

config interface 'wan6'
        option device 'eth1'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'
        option metric '10'

config interface 'wwan'
        option proto 'dhcp'
        option device 'phy0-sta0'
        option metric '20'

config interface 'wwan6'
        option device 'phy0-sta0'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'
        option metric '20'

config interface '4gwan'
        option device '/dev/ttyACM0'
        option proto 'xmm'
        option pdp 'ipv4v6'
        option apn 'internet'
        option delay '10'
        option auth 'auto'
        option metric '30'
  • dhcp:
config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'
  • firewall:
config defaults
        option syn_flood '1'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        list network 'lan'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        list network 'wan'
        list network 'wan6'
        list network 'wwan'
        list network 'wwan6'
        list network '4gwan'
        list network '4gwan_6'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

I have changed the interface (network) names from earlier to look more similar and straightforward. 4gwan_6 is an automatically created virtual interface (by using the settings Proto 'xmm' and PDP 'IPv4v6').
In the single network policies in mwan3 I used IPv4 and IPv6 of the same physical interface with the same metric and weight. Is that correct? Does it matter at all in this context?
In the policies for multiple networks I did set the IPv4 and IPv6 entries of the same physical interface to the same metric and weight while the metric determines the priority of a physical interface. As I stated already I do not need traffic distribution between different networks. Are the policies Ok this way?
For all rules I used only the policy 'wan_wwan_4gwan'. So now it uses ethernet cable, if not available wlan, and finally falls back to 4G. That is OK for development, but not later on the road. How can I now switch between the policies according to how I descibed it in my first post above?
I envision to have a website where the user can select which networks to use, and enter SSID and password for the wireless network or access data for ethernet if necessary. Depending on the selection I want to run instructions, maybe a script, to connect to the desired network. I can imagine that it will not be enough to just modify config files entries but there must be some initiation of the network change. I have no idea how to do this.

Interface status:
 interface wan is offline and tracking is paused
 interface wan6 is offline and tracking is paused
 interface wwan is online 01h:40m:17s, uptime 01h:40m:19s and tracking is active
 interface wwan6 is online 01h:40m:15s, uptime 01h:40m:18s and tracking is active
 interface 4gwan is online 00h:20m:34s, uptime 00h:20m:37s and tracking is active
 interface 4gwan_6 is online 00h:20m:31s, uptime 00h:20m:36s and tracking is active

Current ipv4 policies:
4gwan_only:
 4gwan (100%)
4gwan_wwan:
 4gwan (100%)
balanced:
 4gwan (50%)
 wwan (50%)
wan_4gwan_wwan:
 4gwan (100%)
wan_only:
 unreachable
wan_wwan_4gwan:
 wwan (100%)
wwan_4gwan:
 wwan (100%)
wwan_only:
 wwan (100%)

Current ipv6 policies:
4gwan_only:
 4gwan_6 (100%)
4gwan_wwan:
 4gwan_6 (100%)
balanced:
 4gwan_6 (50%)
 wwan6 (50%)
wan_4gwan_wwan:
 4gwan_6 (100%)
wan_only:
 unreachable
wan_wwan_4gwan:
 wwan6 (100%)
wwan_4gwan:
 wwan6 (100%)
wwan_only:
 wwan6 (100%)

Directly connected ipv4 networks:
192.168.57.0/24
10.240.123.100
192.168.1.28
10.240.123.255
127.255.255.255
224.0.0.0/3
192.168.57.1
127.0.0.1
192.168.57.255
192.168.1.0/24
10.240.123.0/24
127.0.0.0/8
192.168.1.255

Directly connected ipv6 networks:
fe80::/64
2a02:3038:2e0:6fa4::/64
fdae:3665:fcd5::/64
fd5c:3e41:fe5e::/64
fdae:3665:fcd5::/48
2a02:3038:2e0:1de6::/64
2a02:3038:2e0:a67::/64
2a02:810d:8240:117e::/63
2a02:810d:8240:117e::/64

Active ipv4 user rules:
   36  1910 S https  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 443 
 2109  113K - wan_wwan_4gwan  all  --  *      *       0.0.0.0/0            0.0.0.0/0            

Active ipv6 user rules:
   20  1440 S https  tcp      *      *       ::/0                 ::/0                 multiport dports 443 
 1358  182K - wan_wwan_4gwan  all      *      *       ::/0                 ::/0                 

Powered by LuCI openwrt-23.05 branch (git-24.264.56413-c7a3562) / OpenWrt 23.05.5 (r24106-10cc5fcd00) 

I'm having difficulty understanding sorry.

So you want to kill the wired ethernet connection? Or one of the others via scripting?

I've always been good with the ethernet -> wwan -> 4G flow. But for testing purposes you can ifdown/ifup different interfaces? I've done that for testing purposes?

Or you want to change ipv4 policies on the fly?

Other than using uci and a lot of script writing IDK?

This is a router in a motorhome.
The vehicle is standing in front of my house when I'm not on the road. There ethernet and my wlan is available in best quality. Normally I'm using wlan, except during development I shoot my wlan, then I have to use ethernet.
On the road 4G is the connection of choice. Occasionally there might be wlan available for a very short time driving by. This wlan should be avoided to connect to, since mostly there is no roaming for private or local public hotspots.
When standing out there on public parks or campsites often, but not always, free wlan with acceptable signal strengh is available which should be used while 4G ($$) should be avoided. But sometimes free wlan, despite good signal, cannot be used if transfer times get too long (too many people are on this network), then 4G is chosen.

There will be a user interface where, depending on the situation above, some options can be chosen (manually): either interface alone, wlan + 4G, either one preferred. And obviously the SSID and password needs to be entered. (open network with register landing page should work also).
No physical interface needs to be shut down (maybe except 4G at home). Just data transfer shall be routed through the desired interface. Ethernet may always have highest priority, doesn't matter if no cable is plugged in, and if a cable is plugged in it should be preferred, of course.

Currently all mwan3 rules are statically set to 'wan_wwan_4gwan'.
If possible this should be dynamically changed according to the user selection. Since at the same time the network information is entered the network needs to be connected as well. What else to do? I have no idea.
Please bear in mind that the reason I'm asking here for a solution is that I'm not an expert for networking. Maybe I have a "dangerous half-knowlegde". :grin: So if there is a completely different solution, go ahead with it.

Thanks for clarifying the use case.

I think one can just enable/disable the wifi client (wwan interface) in luci and you'll be fine?

i.e. keep the same ipv4 policy, just change which interfaces are enabled / configured? Plus wifi client mode isn't going to work if it's looking for an SSID thaht doesn't exist. Which would be the case if you travel somewhere and one isn't available, and you don't have wired. so therefore it would be on 4G already?

If you want a nice single menu to change ipv4 policies the only thing I can think of is rather than changing ipv4 policies on the client. Just set up three SSID's. Or do a multiple pre shared key wifi setup where you are just connecting to a different network on the client. The router then has three ip ranges with different IP policies.

Otherwise you're probably into creating a web interface that runs different scripts? Possible but not an easy solution. I wouldn't be able to help you with Luci development.

You also have hotplug ifdown/ifup in mwan3 menu i think too? I haven't done testing/setup on an mwan3 install in ages.

Thank you for your insight.

Seems there is a much simpler solution than I expected.Like you describe first.
I probably can leave mwan3 as it is set up now: wan_wwan_4gwan.
if an ethernet cable is plugged in it will use it. If not it falls back to wwan. If it can connect to the predefined SSID (my wireless home network) it will do so. If not (on the road) if will fallback to 4gwan (which should always work, except it is a spot without cellular reception). Then, after entering the SSID / password for a wireless network it will go back to wwan if successfully being able to connect to this network.

The only thing I need is a means to enter the wireless connection data.
I will need a webpage anyhow for other functionality. This x86 mini PC is (planned to be) not only a router but also an data hub for numerous ESP32 BLE devices which do monitor the systems of the motorhome. Currently I use a smartphone to monitor these data streams, in future the mini PC shall do that. For visualization I will need web pages, so it doesn't matter to have an additional one to control wan access.

Obviously, what you say is that one physical device (in this case wwan) can be connected multiple network interfaces. one active at a time. I didn't have this in mind. That means I can set up the wireless networks I know and one extra to be modified for unknown networks out on the road. I hope I am correct with this assumption.
Is it possible to modify SSID and password for this extra interface and make it active via a script? Maybe you could provide a quick and dirty sketch on which I can base on?

I will do some preliminary tests whether this scheme works: The web interface is to be developed later. Testing requires driving, so that is some effort, needs some time.

Finally, yes, mwan3 features the hotplug events, 4 of them I guess. By default you get notification into the logs. I think you can hook into them, probably via script.
I just saw it, didn't yet go into details.

1 Like