GL-X3000 Mutliwan Cellular Failover Error - Issue with IP Address Change Detection

Hi GL.iNet support team,

I'm experiencing an issue with my GL-X3000 involving cellular failover when using Multi-WAN with Cellular and WiFi. I have configured my device to prioritize the cellular connection over WiFi.

However, regularly, the cellular modem interface (modem_0001) goes into an error state and does not recover automatically. It appears that this happens whenever the cellular IP address changes. The problem seems to be that mwan3 does not properly detect the IP change, continuing to track the previous IP, which then causes a connection failure.

Here are some details:

  • I'm using both cellular and WiFi connections, with the cellular connection set to a higher priority.

  • When the IP address for the cellular network changes, mwan3 continues to track the old IP rather than the newly assigned one, which I suspect is causing the issue.

IP Routing Information:

After the IP change, you can see how the route updates (IP addresses have been redacted):

root@GL-X3000:/tmp/log# ip route show
default via 01.01.01.1 dev apcli0 proto static src 01.01.01.58 metric 20
default via 03.03.87.44 dev rmnet_mhi0 proto static src 03.03.87.43 metric 40
01.01.01.0/23 dev wgclient scope link
01.01.01.0/23 dev apcli0 proto static scope link metric 20
10.10.22.0/24 dev wgclient proto kernel scope link src 10.10.22.15
03.03.87.40/29 dev rmnet_mhi0 proto static scope link metric 40
192.168.9.0/24 dev br-guest proto kernel scope link src 192.168.9.1
192.168.12.0/22 dev wgclient scope link
192.168.15.0/24 dev br-lan proto kernel scope link src 192.168.15.1

mwan3 Tracking Before Fix:
mwan3track is still trying to monitor the old IP (02.02.1.109), which causes the cellular modem interface to fail:

root@GL-X3000:/tmp/log# ps  | grep mwan3
 7463 root      1460 S    /bin/sh /usr/sbin/mwan3track modem_0001 rmnet_mhi0 online 02.02.1.109 1.1.1.1 8.8.8.8 208.67.222.222 208.67.220.220
 9290 root      1584 S    /bin/sh /usr/sbin/mwan3rtmon
16984 root      1452 S    /bin/sh /usr/sbin/mwan3track wwan apcli0 online 01.01.01.58 1.1.1.1 8.8.8.8 208.67.222.222 208.67.220.220

Temporary Fix:

Manually running mwan3 ifup for the modem_0001 interface resolves the problem:

root@GL-X3000:/tmp/log# mwan3 ifup modem_0001
iptables: Chain already exists.
Command failed: Not found

After executing the command, mwan3track correctly picks up the new IP address (03.03.87.43):

root@GL-X3000:/tmp/log# ps  | grep mwan3
 9290 root      1584 S    /bin/sh /usr/sbin/mwan3rtmon
16984 root      1452 S    /bin/sh /usr/sbin/mwan3track wwan apcli0 online 01.01.01.58 1.1.1.1 8.8.8.8 208.67.222.222 208.67.220.220
21275 root      1460 S    /bin/sh /usr/sbin/mwan3track modem_0001 rmnet_mhi0 online 03.03.87.43 1.1.1.1 8.8.8.8 208.67.222.222 208.67.220.220

Logs Showing the IP Change:
I managed to record logs during the IP change. Most notably the ifdown event reports an "unknown" interface.

Thu Nov 14 13:45:15 2024 user.notice root: modem ip different, now regain ip ...
Thu Nov 14 13:45:15 2024 daemon.notice netifd: Interface 'modem_0001_4' has lost the connection
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: reading /tmp/resolv.conf.d/resolv.conf.auto
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain test
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain onion
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain localhost
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain local
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain invalid
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain bind
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain lan
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using nameserver 01.01.01.1#53
Thu Nov 14 13:45:15 2024 daemon.notice netifd: Interface 'modem_0001_4' is now down
Thu Nov 14 13:45:15 2024 daemon.notice netifd: Interface 'modem_0001_4' is disabled
Thu Nov 14 13:45:15 2024 daemon.notice netifd: Interface 'modem_0001_4' is enabled
Thu Nov 14 13:45:15 2024 daemon.notice netifd: Interface 'modem_0001_4' is setting up now
Thu Nov 14 13:45:15 2024 daemon.notice netifd: modem_0001_4 (24763): udhcpc: started, v1.33.2
Thu Nov 14 13:45:15 2024 daemon.notice netifd: modem_0001_4 (24763): udhcpc: sending discover
Thu Nov 14 13:45:15 2024 daemon.notice netifd: modem_0001_4 (24763): udhcpc: sending select for 03.03.87.43
Thu Nov 14 13:45:15 2024 daemon.notice netifd: modem_0001_4 (24763): udhcpc: lease of 03.03.87.43 obtained, lease time 7200
Thu Nov 14 13:45:15 2024 daemon.notice netifd: Interface 'modem_0001_4' is now up
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: reading /tmp/resolv.conf.d/resolv.conf.auto
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain test
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain onion
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain localhost
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain local
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain invalid
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain bind
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using only locally-known addresses for domain lan
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using nameserver 01.01.01.1#53
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using nameserver 212.27.40.240#53
Thu Nov 14 13:45:15 2024 daemon.info dnsmasq[8558]: using nameserver 212.27.40.241#53
Thu Nov 14 13:45:15 2024 user.notice mwan3[24739]: Execute ifdown event on interface modem_0001_4 (unknown)
Thu Nov 14 13:45:16 2024 user.notice firewall: Reloading firewall due to ifdown of modem_0001_4 ()
Thu Nov 14 13:45:16 2024 user.notice mwan3[25074]: Execute ifup event on interface modem_0001_4 (rmnet_mhi0)
Thu Nov 14 13:45:16 2024 user.notice mwan3[25074]: Starting tracker on interface modem_0001_4 (rmnet_mhi0)
Thu Nov 14 13:45:19 2024 user.info mwan3rtmon[9290]: Detect rtchange event.
Thu Nov 14 13:45:19 2024 user.notice firewall: Reloading firewall due to ifup of modem_0001_4 (rmnet_mhi0)
Thu Nov 14 13:45:21 2024 user.info mwan3track[7463]: Lost 8 ping(s) on interface modem_0001 (rmnet_mhi0)

I'm trying to understand why mwan3 doesn’t seem to recognize the new IP address on its own and fails to adjust accordingly. Is there a configuration or setting I might be missing that would enable automatic recognition of the IP address change without having to manually trigger mwan3 ifup each time?

Alternatively, is there any known issue or workaround related to mwan3 failing to detect changes in IP addresses for a cellular modem?

Thanks in advance for your help.

2 Likes

Nice job pulling all of this together for your post. You might add which version of firmware you are running on the router and which version of firmware is running on the modem (less important I think).

Thanks I've been tracking it for a few weeks.
And good point, it's running firmware 4.0 (0413release2, latest to date), the modem module is version RM520NGLAAR03A03M4G

Hi,

The latest firmware (beta v4.7.1) has updated to use the kmwan to instead of mwan3 to track the interface status, please try manually upgrading to this firmware:
https://dl.gl-inet.com/router/x3000/beta

If any issue, please let us know.

Thanks Bruce,

I installed the beta firmware, but I actually lost cellular from the multiwan interfaces

I had to reset the firmware completely when I had this happen where my cellular interface was screwy previously. Never did figure out what caused it exactly. But no issues since.

Thanks, I somehow managed to get the Cellular interface back into multiwan (I think after switching back and forth between Sim1 and Sim2)

@bruce the beta firmware has been working for almost 4 days now and cellular is still being used for wan. I have not noticed any interuption so it's definitely more stable.

Do you have an ETA for the release of the new version?

v4.7.1 has been released.
Although it is a beta, but is the latest version.

Are you asking about the stable version time? Maybe after a few beta iterations to reach stable requirements, it will be frozen into a stable version.