Multiple USB Modems - Binding cdc-wdmx to symlink
0
votes
0
answers
338
views
First question here, long story short I have 3 different USB Cellular(GSM) modems and I want to ensure the connection profiles for each SIM (as the APNs differ) always go to the same modem/sim combo. The issue here is that due to the nature of USB the interfaces cdc-wdmx change on reboot and as the nmcli connection are tied to the interface name the connections dont come up.
So I have created symlinks using udev rules to point to the physical USB ports, the idea being modem 1 will always be the device plugged into the first USB port. This works and the symlinks point correctly however, I cant use the symlinks for the connection profiles for some reason.
To clarify a bit take the following example:
Modem & SIM combo A is vodafone. on boot up modem SIM combo A is assigned cdc-wdm0, this is the name that shows in NMCLI. I create a connection profile for vodafone with the apn 'internet' pointing at cdc-wdm0.The connection works.
Modem and SIM combo B is O2. On boot up medem SIM combo B is assigned cdc-wdm1, this is the name that also shows in NMCLI. I create a connection profile for O2 with the APN 'mobile.o2.co.uk' pointing at cdc-wdm1.The connection works.
But after a system reboot:
- Moden and SIM combo A is now assigned cdc-wdm1
- Modem and SIM combo B is now assigned cdc-wdm0
As a result my connections now don't work as the wrong APN's are configured.
My udev rules for the modems are as below, and these do work:
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-1:1.4", SYMLINK+="3rd-mdm"
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-4.4", SYMLINK+="4th-mdm"
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-2:1.4", SYMLINK+="1st-mdm"
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-4.3", SYMLINK+="2nd-mdm"
and bthe symlink shows under a udevadm info:
[root@localhost rules.d]# udevadm info /dev/cdc-wdm1
P: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.3/1-4.3:1.4/usbmisc/cdc-wdm1
N: cdc-wdm1
**S: 2nd-mdm**
E: DEVLINKS=/dev/2nd-mdm
E: DEVNAME=/dev/cdc-wdm1
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.3/1-4.3:1.4/usbmisc/cdc-wdm1
E: ID_MM_CANDIDATE=1
E: MAJOR=180
E: MINOR=177
E: SUBSYSTEM=usbmisc
E: USEC_INITIALIZED=88077
Can anyone please advise how I can get round this please?
Asked by ConchMonster
(1 rep)
Dec 8, 2022, 06:02 PM
Last activity: Dec 15, 2022, 06:27 AM
Last activity: Dec 15, 2022, 06:27 AM