How to find active interface, does it prefer WAN over 4G?

Is there an easy way to find the active interface connected to the Internet? I’ve got a puli with a 4G SIM and also connected to my DSL router via the WAN port.

If the WAN port disconnects, I see that the connection swaps to the 4G mobile connection (and the VPN re-connects). If I plug back in the WAN port to my DSL router, does the puli (or any other gl-inet device with dual WAN) switch back to the faster DSL.

I guess what I’m asking is if the WAN port takes precedence over the 4G connection when it is active? Also is there a way to check which WAN interface (WAN ethernet port or 4G) is active at any given time?

It’s configured in the package mwan3.

You can find the config file in /etc/config/mwan3

As you can see at “option matric” the default is;

  1. wan

  2. wwan

  3. thethering

  4. modem

         config member 'wan_only'
     	option interface 'wan'
     	option metric '1'
     	option weight '3'
    
     config member 'wwan_only'
     	option interface 'wwan'
     	option metric '2'
     	option weight '3'
    
     config member 'tethering_only'
     	option interface 'tethering'
     	option metric '3'
     	option weight '3'
    
     config member 'modem_only'
     	option interface 'modem'
     	option metric '4'
     	option weight '3'
    

You can edit this offcourse for your own needs. But if, for example, you have connected a wan cable and a tethering phone, they are both connected, but traffic goes over the one with the lowest metric number.

So if you disconnect the wan cable, the tethering phone connection takes over.

To see what connection is used, just do a traceroute on your client and see what route it takes.

traceroute openwrt.org on linux client
tracert openwrt.org on windows client

(this way you can also see if your connection is going over your vpn too)

1 Like

@alzhao
I agree it would be nice to see something like a checkmark on the active connection in the user interface.
So there is no need to use commandline options just to check what connection is the active one.

1 Like

Thanks all, I eventually did ssh into the router and looked at the “route” command and saw that the Eth/WAN connection had a higher preference than the modem when they were both connected. I also have a VPN connected on the router, so did a traceroute test when both were connected and when I disconnected and reconnected the wired WAN connection and all worked as expected.

I was hoping that there was something in the GUI, but I guess there is not. As long as I can see that it works as expected by default, I’m happy. I just didn’t want the router to use the more expensive/slower SIM card wireless unless that was the only available connection.

I am still hopeful that one day this will be added to the main GL.iNet UI to make it easy for us mere mortals to use & control.

Yes we will add. Do have plan for this. Wait for firmware 4.0

3 Likes

That’s is certainly an excellent piece of news.

At the very least, I’ve verified that adding an interface (second USB tethering or WiFi repeater) and load balancing work perfectly if I’ve set it up properly according to the mwan3 default settings.

  • difference in transfer volume is due to Metric and other intentional settings and is fine

However, many smartphones on the market have some restrictions to control routings, and it may be difficult for the GL UI to set up everything automatically because it is necessary to consider common troubles due to multi-WAN.

In my case, I’m using non-rooted Android 9 and 10, but I had to be aware of device-specific specifications and limitations on the USB tethering feature.
Moreover, the gateway, DNS server, and address ranges are nearly duplicated, which can be very cumbersome to control routing.
After all, I had to disable all QoS features (including SQM) to eradicate routing errors…

1 Like