[Solved] Connect to 3g network on demand

Hi all,
got myself a GL.iNet MiFi router as a travel kit and managed to install latest LEDE FW on it and get everything to work, including connection to the 3G network (minus NCM, because the /dev/cdc-wdm device that's there with the original lede-based FW is not there, for whatever reason ... but I won't let that worry me, now, because the /etc/config/network section I got looks exactly the same as the one the manufacturer's UI built.)

Now, I configured a 3G connection as a manual connection, because I obviously don't want to use it, when I have some other WAN connection. But now I have to log in to the device to bring the modem connection up, when I want to.
Are there recommendations about how to make the device bring up the modem connection automatically, if there is no other WAN connection?

One of these:



1 Like

Ahh .. multiwan is the search key, thanks.
I'll look into these. I thought that maybe the a higher route metric for the 3G connection and the demand option would get me there, but they don't. I'll look into those articles.

I have zero experience with the 3g modems on OpenWrt routers, but have you considered a simple hotplug script to bring up 3g modem when wan is down and shut down 3g modem when wan is up? There was a sort of similar question on shutting down WiFi based on WAN condition recently.

1 Like

Hi, that is also a good, valid suggestion.
I've just gone and combined both ... mwan3 (which also ties in hotplug scripts via the LuCi add-on) ... but that alone didn't bring my 3g interface up when the other wan interface wasn't available. So, yes, I added a little section to the mwan3 hot plug template that just does an ifup for the 3g device, if the wire based connection goes down and and if down, if eth0 comes up.
Atm, I'm still hoping mwan will also put the eth0 device down, if pinging a remote address fails, and thus trigger the hotplug script to fire up the modern, even if the cable is not removed. I still have to test that. If that does not work, I might eliminate mwan3 again, altogether.

Suddenly had an idea about how to test this real quick, and it works like a charm.
Got the GL.iNet device hooked up to my home router via eth0, 3g modem is down. Then I disconnect my home router from the internet, after a while mwan3 notices eth0 is gone, takes it down and the hotplug script starts the 3g modem. When I bring my home internet back, mwan3 will notice after some time (however it does that on a downed interface beats me, but hey), eth0 will come back up and 3g goes down.

Done here ... I can go to bed, now ... thanks everybody.

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