Maintaining connectivity between multiple devices

Aleksander Morgado aleksander at
Mon Feb 6 09:09:23 UTC 2017

On Sun, Feb 5, 2017 at 10:31 PM, Kasper Holtze <kasper at> wrote:
> Sorry if this is the wrong place to ask. I'm working on a solution which has
> multiple interfaces for Internet connection. Two QMI modems (MC7304), a LAN
> interface and a WiFi interface. The questions is primarily regarding the
> modems.
> Each modems has two SIM cards, and I've build a small piece of software to
> switch between these, and all of the interfaces. All the switching is
> working fine. I am switching between modems/interfaces by opening/closing
> the interfaces (ifup/ifdown), and that way making sure the right interface
> is in use. Only the interface which "should be used right now", is active.

How does the switching between SIM cards work in your setup? Do you
have a GPIO to select one or the other?

> However, I am seeing issues getting connectivity through the modems -
> sometimes I cannot get an IP address from the modem, even though I can see
> that the modem is connected and has an address.

Beware when using raw-ip; your DHCP client may not know how to setup
the IP address in the ethernet-header-less interface. I.e. you could
manually configure the IP settings you got in
--wds-get-current-settings instead of relying on HDCP.

> I have recently switched from 802-3 to raw-ip, by upgrading Linux from 4.4
> to 4.9. That seems to work fine, and /sys/class/net/wwanX/qmi/raw_ip is
> always set to Y (is echo'ing Y to this the right way to go?).

Yes, or just:

$ qmicli -d /dev/cdc-wdmX --set-expected-data-format=raw-ip

> I configured the modems to use autoconnect, so that even if there's issues
> with the software, the modems itselfes will connect to the internet.
> So, in the hunt of the most stable solution, my questions are:
> - I'm wondering if the approach is the best, or if I should not open/close
> the interfaces all the time, and just switch the default gateway? Or using
> libqmi connect functions, and disable autoconnect...

I'm still curious about how you manage multiple SIM cards on the same device...

Anyway, I'm assuming that autoconnect will internally try to keep the
modem connected, even if there's no traffic flowing through, so I
guess it doesn't matter how you maintain the connection.

> - If I just connect the modems at boot, using autoconnect, will the modems
> reconnect if they are out of coverage for a while? Will the DHCP client
> automatically fetch the new IP address when the connection is restores? What
> if it moves cross-border, will it restore connectivity automatically? I
> guess I could just test this, but it would be nice to know some theory about
> it.

I don't have much experience with autoconnect in those situations, but
I guess that's what should happen.


More information about the libqmi-devel mailing list