This is the recommended way. The Device ID is meant to be a uniqueOn 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?
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
uniqueness.
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.
Dan