On Wed, 2019-09-04 at 21:59 +0200, Einar Jón wrote:
On Wed, 4 Sep 2019 at 17:11, Thomas Haller <thaller redhat com> wrote:On Wed, 2019-09-04 at 16:46 +0200, Einar Jón via networkmanager- list wrote:Hello A bit of a newbie question, but is it possible to set up NetworkManager to use (one of) multiple SIM cards? We have an embedded (headless) device that can use a few different operators. Only one will be used at a time, but I can't be certain which one. So having them all somehow available would be preferred. Basically, I'd like to set up a connection that has 5 blocks of values of gsm.sim-operator-id=12345 gsm.apn=myapn gsm.username=user gsm.password=hunter2 Everything else should be the same. Then it connects using the APN of the sim-operator-id that matches the "operator id" that I get from "mmcli -m <number>" What is a sensible way to handle multiple mobile operators in NetworkManager? I have access to nmcli and nmtui, but no graphical tools.Hi, I think that is not possible, you would need a different connection profile for each operator.I was thinking of doing that, creating profiles modem12345.nmconnection modem22334.nmconnection modem556677.nmconnection etc... But grabbing IMSI=$(mmcli -m XX| awk /operator id/ ...) and calling nmcli c do-stuff modem$IMSI seems to be the wrong way to use NetworkManager.
Hi, I think you would create each profile only once. Afterwards, you should be able to nmcli device connect $MODEM and then (depending on the SIM), only one of the profiles is a suitable candidate to activate. You can set properties in the profile that tie to the operator, can't you? The only problem is that you have a larger number of profiles, and that you need to create them (once).
Note there is merge-request [1]. If that gets merged, the APN settings would be automatically read from the mobile-broadband-provider-info file. That should solve your issue in a different way. [1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/98That might work. If I can put my own apns and passwords in the mobile-broadband-provider-info file I'd get the same result. I guess I could just play around with the patches a bit.best, Thomas-- Regards Einar Jón
Attachment:
signature.asc
Description: This is a digitally signed message part