TL;DR: Using the Huawei E3531i-2, I get plug-and-play 3G connectivity, no configuration required
Since posting this, I’ve found a much easier way to add 3G connectivity to a Lorank gateway: A Huawei Hi-link 3G stick.
“Normal” 3G modems offer a few serial ports and require the USB host to send some (not completely standardized) AT commands and set up a PPP connection. I’ve found that this is fragile, especially to guarantee proper reconnection on failures (I’ve tried Debian’s ifupdown and connman+ofono, neither of which were completely solid).
Some 3G modems from Huawei have “Hi-link”, which means they pose themselves as an USB ethernet adapter. The computer/Lorank can just do a DHCP request on that interface, which will then return an internal IP address. By navigating to the (internal) gateway address, the modem gives you a web interface to see the modem status and configure it.
The modem then takes care of setting up the 3G / PPP connection automatically, and also handles reconnection automatically. The internal IP does mean that there is an extra layer of NAT applied by the modem, but unless you really need a public IP, that shouldn’t really matter in practice.
Often, no configuration is needed at all: These modems seem to include a list of mobile providers with the needed APNs. If your provider is not listed, you might need to configure it manually (once, through the webinterface, afterwards it is remembered).
Configuration seems very limited and is mostly about the 3G side of things. The internal network is fixed to 192.168.8.x, and no port forwarding can be configured.
I’ve been testing this with a Huawei E3531i-2 (only €30), but similar things will apply to other Huawei Hi-link modems, and other manufacturers might have similar devices. Note that modem specifications in webshops often do not seem to mention that a modem uses Hi-link/usb ethernet, these things are really sold as black boxes it seems. Even the site of Huawei itself doesn’t seem to have this particular model listed…
As for using this modem with the Lorank: if the APN is autodetected or configured inside the modem, this is literally a matter of plug-and-play. The connman
running on the Lorank sees a new ethernet interface and automatically brings it up. Even switching between ethernet and 3G seems to work (though I’m not sure what priority is used if both are plugged in).
Note that I tested using a clean Debian stretch image, but the Debian installation supplied with the Lorank also uses connman, so I expect it also works. Really old versions of the Lorank used wicd, I’m not sure if that works in the same way.