Re: Persistent network interface configuration for several wwan modems

On Mon, Oct 24, 2016 at 6:32 PM, Dan Williams <dcbw redhat com> wrote:
On Mon, 2016-10-24 at 17:35 +0200, Viktor S. Wold Eide wrote:
> Hi,
> I have several wwan usb modems connected to a single PC. Currently,
> the PC
> is running Ubuntu 16.10 which comes with network-manager-1.2.4. I
> would
> like to have a network interface configuration where all modems get
> up and
> running at all times, each with an IP address and a default route.
> Each
> wwan modem has a sim card, which requires specific apn and pin
> settings.
> What is the recommended way to configure these wwan modems in a
> persistent
> way?
> In contrast to other network interfaces, such as wired Ethernet and
> wlan,
> NetworkManager reports the cdc-wdmX device (cdc-wdm0, cdc-wdm1, cdc-
> wdm2,
> etc.), that is the control port for each wwan modem. The cdc device
> is
> dynamically associated to the modems, so that depending on which
> modem is
> plugged into the computer and in which order, cdc-wdm0 for example
> can
> refer to any of the modems.
> I have looked at the different settings available via "nmcli
> connection
> edit ...". The setting "connection.interface-name" seems to work only
> when
> the cdc device interface is specified, but as already mentioned that
> may
> change and hence can not be used directly.
> I have made a NetworkManager connection configuration for each wwan
> modem
> and been able to associate each specific connection to a specific
> wwan
> modem by using the setting "gsm.deivce-id", but I was wondering if
> this is
> the recommended way or if there are any better alternatives?

This is the recommended way.  The Device ID is meant to be a unique
device identifier using information reported by the WWAN device
firmware including the IMEI.

As you've discovered, the kernel does not assign persistent device
names (for various legitimate reasons) and many manufacturers don't
assign unique USB serial numbers to devices, so you can't use udev
rules to assign a specific name to the device either.

But Device ID is what you want, since it is computed after discovering
and talking to the modem to get the information needed to ensure

There's also the SIM identifier property (based on a hash of the IMSI)
that you can use if don't care what device the SIM is in, but still
want to tie a connection to a specific SIM/provider.


Thanks a lot for the quick reply and for confirming that this is the recommended way to handle it.

Using the default ubuntu 16.10 setup, the interface name displayed by "ifconfig" or "ip link" (not the cdc device) is persistent as long as the modem is plugged into the same USB port, due to the naming policy in systemd/udev. But of course, the interface name will change as soon as the wwan modem is plugged into a different USB port, so it is not really usable as you write.

Yes, the gsm.device-id seems to do the job. I also did some testing with gsm.sim-id to associate a SIM card to a connection, as you mention.

Again, thanks for the recommendation and suggestions.

Best regards
Viktor S. Wold Eide

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]