Mwan3 does not failov

Hi,
I'm new to OpenWRT and I installed it on my LTE router to have a backup connection when my ISP goes down.

I configured mwan3 following the wiki guide, but it doesn't seem to work as I expect it to. When my primary connection goes down it doesn't automatically switch to LTE, even though the router is able to ping on LTE interface.

Here is my configuration:

here is output from cat /etc/config/network

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

config globals 'globals'
	option ula_prefix 'fd2d:31a8:fd1e::/48'
	option packet_steering '1'

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

config interface 'wan_eth'
	option proto 'dhcp'
	option device 'lan1'
	option metric '10'

config interface 'wan_lte'
	option proto 'qmi'
	option device '/dev/cdc-wdm0'
	option apn 'telenor.fwa'
	option pincode '4714'
	option auth 'none'
	option pdptype 'ipv4v6'
	option metric '20'

config interface 'lan'
	option proto 'static'
	option device 'br-lan'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'


Here is my MultiWan configuration:


Any ideas on what may be wrong?

If I'm reading your screenshot correctly, the wan_lte mwan3 member is actually using the wan_eth interface instead of the wan_lte interface you configured for LTE. And it should probably use the wan_lte_4 interface.
That wan_lte_4 interface also doesn't seem to be in the right firewall group.

1 Like

It went a bitt too quick to re-create my setup :slight_smile: I've changed the interface and uploaded updated screenshot.

Here is also the output from /etc/config/mwan3

config globals 'globals'
	option mmx_mask '0x3F00'
	option logging '1'
	option loglevel 'info'

config interface 'wan_eth'
	option initial_state 'online'
	option family 'ipv4'
	option track_method 'ping'
	option reliability '1'
	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'
	option interface 'wan_eth'
	option metric '10'
	option weight '1'
	option enabled '1'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	list track_ip '1.1.1.1'

config policy 'eth_lte'
	list use_member 'wan_eth'
	list use_member 'wan_lte'
	option last_resort 'unreachable'

config rule 'all'
	option proto 'all'
	option sticky '1'
	option use_policy 'eth_lte'

config member 'm_wan_eth'
	option interface 'wan_eth'
	option metric '10'
	option weight '1'

config member 'm_wan_lte'
	option interface 'wan_lte'
	option metric '20'
	option weight '1'

config interface 'wan_lte'
	option enabled '1'
	option initial_state 'online'
	option family 'ipv4'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	option track_method 'ping'
	option reliability '1'
	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'

I'm not able to set firewall group for wan_lte_4, it was created by uqmi together with wan_lte

I don't see mwan3 trying to switch over to wan_lte after I disconnect wan_eth:

Wed Dec 27 19:14:26 2023 user.notice mwan3track[16048]: Interface wan_eth (lan1) is online
Wed Dec 27 19:14:26 2023 user.notice mwan3track[16049]: Interface wan_lte (wwan0) is online
Wed Dec 27 19:15:00 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 10
Wed Dec 27 19:15:04 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 10
Wed Dec 27 19:15:08 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 10
Wed Dec 27 19:15:12 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 10
Wed Dec 27 19:15:16 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 10
Wed Dec 27 19:15:20 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 10
Wed Dec 27 19:15:24 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 10
Wed Dec 27 19:15:24 2023 user.notice mwan3track[16048]: Interface wan_eth (lan1) is disconnecting
Wed Dec 27 19:15:34 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 9
Wed Dec 27 19:15:38 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 9
Wed Dec 27 19:15:42 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 9
Wed Dec 27 19:15:46 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 9
Wed Dec 27 19:15:50 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 9
Wed Dec 27 19:15:54 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 9
Wed Dec 27 19:15:58 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 9
Wed Dec 27 19:16:07 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 8
Wed Dec 27 19:16:11 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 8
Wed Dec 27 19:16:15 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 8
Wed Dec 27 19:16:19 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 8
Wed Dec 27 19:16:23 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 8
Wed Dec 27 19:16:27 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 8
Wed Dec 27 19:16:31 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 8
Wed Dec 27 19:16:40 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 7
Wed Dec 27 19:16:44 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 7
Wed Dec 27 19:16:48 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 7
Wed Dec 27 19:16:52 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 7
Wed Dec 27 19:16:56 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 7
Wed Dec 27 19:17:00 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 7
Wed Dec 27 19:17:04 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 7
Wed Dec 27 19:17:13 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:17:17 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:17:21 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:17:25 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:17:29 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:17:33 2023 user.info mwan3track[16048]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:17:37 2023 user.info mwan3track[16048]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:17:37 2023 user.notice mwan3track[16048]: Interface wan_eth (lan1) is offline
Wed Dec 27 19:17:38 2023 user.notice mwan3-hotplug[16598]: Execute disconnected event on interface wan_eth (lan1)
Wed Dec 27 19:18:59 2023 user.info mwan3track[16048]: Check (ping) success for target "1.1.1.1" on interface wan_eth (lan1). Current score: 0
Wed Dec 27 19:18:59 2023 user.info mwan3track[16048]: Lost 49 ping(s) on interface wan_eth (lan1). Current score: 0
Wed Dec 27 19:18:59 2023 user.notice mwan3track[16048]: Interface wan_eth (lan1) is connecting
Wed Dec 27 19:19:05 2023 user.info mwan3track[16048]: Check (ping) success for target "1.1.1.1" on interface wan_eth (lan1). Current score: 1
Wed Dec 27 19:19:10 2023 user.info mwan3track[16048]: Check (ping) success for target "1.1.1.1" on interface wan_eth (lan1). Current score: 2
Wed Dec 27 19:19:15 2023 user.info mwan3track[16048]: Check (ping) success for target "1.1.1.1" on interface wan_eth (lan1). Current score: 3
Wed Dec 27 19:19:20 2023 user.info mwan3track[16048]: Check (ping) success for target "1.1.1.1" on interface wan_eth (lan1). Current score: 4
Wed Dec 27 19:19:20 2023 user.notice mwan3track[16048]: Interface wan_eth (lan1) is online

You should be consistent in member naming convention in the mwan3 policy and member settings.

config policy 'eth_lte'
	list use_member 'wan_eth'
	list use_member 'wan_lte'
	option last_resort 'unreachable

Correct the above names to what you have defined in members. E.g.
m_wan_eth
m_wan_lte

thanks for pointing this out. Here is my updated setup:

config globals 'globals'
	option mmx_mask '0x3F00'
	option logging '1'
	option loglevel 'debug'

config interface 'wan_eth'
	option initial_state 'online'
	option family 'ipv4'
	option track_method 'ping'
	option reliability '1'
	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'
	option interface 'wan_eth'
	option metric '10'
	option weight '1'
	option enabled '1'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	list track_ip '1.1.1.1'

config policy 'eth_lte'
	option last_resort 'unreachable'
	list use_member 'm_wan_eth'
	list use_member 'm_wan_lte'

config rule 'all'
	option proto 'all'
	option sticky '1'
	option use_policy 'eth_lte'

config member 'm_wan_eth'
	option interface 'wan_eth'
	option metric '10'
	option weight '1'

config member 'm_wan_lte'
	option interface 'wan_lte'
	option metric '20'
	option weight '1'

config interface 'wan_lte'
	option enabled '1'
	option initial_state 'online'
	option family 'ipv4'
	list track_ip '1.1.1.1'
	list track_ip '8.8.8.8'
	option track_method 'ping'
	option reliability '1'
	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'

still not switching over to lte, here are the logs:

.......
Wed Dec 27 19:26:09 2023 user.info mwan3track[19095]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:26:13 2023 user.info mwan3track[19095]: Check (ping) failed for target "8.8.8.8" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:26:17 2023 user.info mwan3track[19095]: Check (ping) failed for target "1.1.1.1" on interface wan_eth (lan1). Current score: 6
Wed Dec 27 19:26:17 2023 user.notice mwan3track[19095]: Interface wan_eth (lan1) is offline
Wed Dec 27 19:26:17 2023 user.notice mwan3-hotplug[19634]: Execute disconnected event on interface wan_eth (lan1)

Define three policies: m_wan_eth only, m_wan_lte only and balanced if you want it also. Set m_wan_eth only policy as first, lte as a second and balanced as a third. And define a default rule to use one of the policies. Do not forget sticky rule for https connections.

config policy 'wan_only'
        list use_member 'm_wan_eth'

config policy 'wanb_only'
        list use_member 'm_wan_lte'

config policy 'balanced'
        list use_member 'm_wan_eth'
        list use_member 'm_wan_lte'



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

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

Then restart mwan3. For failower working you need to wait approx 5 seconds after a failed ping.

it worked :slight_smile: Thank you so much for your help!
I tried so many different setups in last days, and your config with policies and rules solved it! Thanks again!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.