Huawei 4G dongle duplicate MAC addresses

Hello,

I am trying to use multiple Huawei E3372 USB dongles at the same time to provide multiple WANs. Using one works fine, I am configuring them to use the NCM protocol and everything works as I would expect with just one dongle plugged in.

Unfortunately it appears that all of my dongles actually have the same MAC address which is causing me no end of problems when multiple are connected to the router.

[ 4198.288763] option 2-1.2:1.0: GSM modem (1-port) converter detected
[ 4198.291158] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[ 4198.293426] option 2-1.2:1.1: GSM modem (1-port) converter detected
[ 4198.295801] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[ 4198.392647] huawei_cdc_ncm 2-1.2:1.2: MAC-Address: 00:1e:10:1f:00:00
[ 4198.394788] huawei_cdc_ncm 2-1.2:1.2: setting rx_max = 16384
[ 4198.407204] huawei_cdc_ncm 2-1.2:1.2: NDP will be placed at end of frame for this device.
[ 4198.409375] huawei_cdc_ncm 2-1.2:1.2: cdc-wdm0: USB WDM device
[ 4198.411608] huawei_cdc_ncm 2-1.2:1.2 wwan0: register 'huawei_cdc_ncm' at usb-0000:00:14.0-1.2, Huawei CDC NCM device, 00:1e:10:1f:00:00
[ 4198.417020] usb-storage 2-1.2:1.3: USB Mass Storage device detected
[ 4198.419205] scsi host2: usb-storage 2-1.2:1.3
[ 4198.421975] usb-storage 2-1.2:1.4: USB Mass Storage device detected
[ 4198.426410] scsi host3: usb-storage 2-1.2:1.4
[ 4198.429277] usb 2-1.1: USB disconnect, device number 21
[ 4198.722426] usb 2-1.1: new high-speed USB device number 23 using xhci_hcd
[ 4198.919727] option 2-1.1:1.0: GSM modem (1-port) converter detected
[ 4198.921870] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[ 4198.924054] option 2-1.1:1.1: GSM modem (1-port) converter detected
[ 4198.926122] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB3
[ 4199.046649] huawei_cdc_ncm 2-1.1:1.2: MAC-Address: 00:1e:10:1f:00:00
[ 4199.048660] huawei_cdc_ncm 2-1.1:1.2: setting rx_max = 16384
[ 4199.057788] huawei_cdc_ncm 2-1.1:1.2: NDP will be placed at end of frame for this device.
[ 4199.059866] huawei_cdc_ncm 2-1.1:1.2: cdc-wdm1: USB WDM device
[ 4199.062123] huawei_cdc_ncm 2-1.1:1.2 wwan1: register 'huawei_cdc_ncm' at usb-0000:00:14.0-1.1, Huawei CDC NCM device, 00:1e:10:1f:00:00

The above log shows me plugging in two dongles, both registered with the same MAC.

I have tried changing the MAC address via ifconfig, which does appear to change the MAC address of the device but it is then no longer recognized in OpenWrt.

I came across someone with a similar issue here but I'm not sure how I could apply a similar policy in OpenWrt.

Any help would be greatly appreciated.

Why is this a problem? The Mac address is only visible on the usb link to each modem. There is no conflict.

Sure, I can agree that using the same address everywhere is crazy. But so is trusting it for anything....

Use the usb port as modem ID. Ignore the Mac address.

Hi Bjorn, it becomes an issue when I setup a WAN on modem 1 (using the usb tty) which works great until I plug in another modem with the same MAC and then the connection I had on WAN 1 stops working.

https://openwrt.org/docs/guide-user/network/network_configuration?s=macaddr#section_device

That does not seem to do anything at all when using NCM protocol.

I still don't understand why there is any dependency between the two connections just because the Mac address happens to be the same. That doesn't make sense.

https://wiki.archlinux.org/index.php/MAC_address_spoofing#iproute2
Try this method and copy the output here.
Change the MAC address by one last digit.

I was just playing around with macchanger and both WANs seem to work if I spoof the MAC of one of them. Is iproute better to use? I guess my next question is how would I make sure this works when a device is hot plugged or the router is restarted.

https://openwrt.org/docs/guide-user/base-system/hotplug