How to change the mac address (permanently ) or identify a 3G USB dongle?

1

I've bought two 3G usb dongles and they both have the same mac address. After some research I've found this is a common issue so buying new ones may not fix the issue.

I need to identity a specific device so my question is how can I identify the device if the mac is same for both the devices?

Is it possible to assign a new mac address to one device(permanently somehow as the device may loose power from time to time) or is there any unique identifier that I can use ?

Anthony Hunt

Posted 2015-01-27T15:45:29.663

Reputation: 201

Answers

1

There are couple ways of setting MAC address of a network interface. On windows you can edit settings in advanced view of the card. Or use powershell (be aware that Set-NetAdapter may not be available in older versions of Windows):

Set-NetAdapter –Name "Ethernet 1" -MacAddress "00-10-18-57-1B-0D"

On Linux you need to find a proper command or edit /etc/network/interfaces file in way similar to this:

auto eth0
iface eth0 inet dhcp
hwaddress ether 01:02:03:04:05:06

piotrektt

Posted 2015-01-27T15:45:29.663

Reputation: 11

1

It seems there is no way to change the mac "permanently". All the solutions found allow you to change it just until the device gets restarted. To change it permanently you need to have access to the drivers and even then it might not be possible (i.e. the manufacturer just doesn't provide this option).

Anthony Hunt

Posted 2015-01-27T15:45:29.663

Reputation: 201

0

I'm experiencing the same with E3372h. MAC address can be changed on HiLink firmwares: you have to get access to Android console (which is not trivial too) of the device and change the file like /app/config/lan/config.xml

For Stick firmwares I've not found the way to change MAC. I suppose it could be some command to write mac to some nvram cell like AT^NVWREX=bla-bla, but I'm failed to find it.

Another approach you can use on linux is to create udev rule based on USB device path. So interface name will be binded with specific USB port (but not the device itself which is preferable for sure). Create the file with the name like /etc/udev/rules.d/99-wwan.rules

## Rules to setup fixed interface and port names for usb dongles with identical MAC addresses
# To get MAC address of interface use:
#     N=0; ip addr show wwan${N}
# To get ID_PATH of current interface use (N is interface number, e.g. N=0 for wwan0):
#     N=0; udevadm info -q all -p /sys/class/net/wwan${N} | grep -m1 ID_PATH=
# To get devpath of cdc-wdm${N} use (see first parent):
#     N=0; udevadm info -a -n /dev/cdc-wdm${N}
# To get KERNELS and bInterfaceProtocol for ttyUSB${N} use (see first parent):
#     N=0; udevadm info -a -n /dev/ttyUSB${N}
# Ports configuration related to AT^SETPORT="FF;12,16,5,A1,A2"

# wwan0 on 1.4.1
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:10:1f:00:00", ENV{ID_PATH}=="platform-3f980000.usb-usb-0:1.4.1:1.1", KERNEL=="wwan*", NAME="wwan0"
SUBSYSTEM=="tty",     KERNELS=="1-1.4.1:1.0", ATTRS{bInterfaceProtocol}=="12", KERNEL=="ttyUSB*",  SYMLINK+="ttyUSB-wwan0"
SUBSYSTEM=="usbmisc", KERNELS=="1-1.4.1:1.1", ATTRS{bInterfaceProtocol}=="16", KERNEL=="cdc-wdm*", SYMLINK+="cdc-wdm-wwan0"
SUBSYSTEM=="tty",     KERNELS=="1-1.4.1:1.2", ATTRS{bInterfaceProtocol}=="05", KERNEL=="ttyUSB*",  SYMLINK+="ttyUSB-a_shell-wwan0"

# wwan1 on 1.4.3
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:10:1f:00:00", ENV{ID_PATH}=="platform-3f980000.usb-usb-0:1.4.3:1.1", KERNEL=="wwan*", NAME="wwan1"
SUBSYSTEM=="tty",     KERNELS=="1-1.4.3:1.0", ATTRS{bInterfaceProtocol}=="12", KERNEL=="ttyUSB*",  SYMLINK+="ttyUSB-wwan1"
SUBSYSTEM=="usbmisc", KERNELS=="1-1.4.3:1.1", ATTRS{bInterfaceProtocol}=="16", KERNEL=="cdc-wdm*", SYMLINK+="cdc-wdm-wwan1"
SUBSYSTEM=="tty",     KERNELS=="1-1.4.3:1.2", ATTRS{bInterfaceProtocol}=="05", KERNEL=="ttyUSB*",  SYMLINK+="ttyUSB-a_shell-wwan1"

# # wwan on ???
# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="???", ENV{ID_PATH}=="???", KERNEL=="wwan*", NAME="wwan???"
# SUBSYSTEM=="tty",     KERNELS=="???:1.0", ATTRS{bInterfaceProtocol}=="12", KERNEL=="ttyUSB*",  SYMLINK+="ttyUSB-wwan???"
# SUBSYSTEM=="usbmisc", KERNELS=="???:1.1", ATTRS{bInterfaceProtocol}=="16", KERNEL=="cdc-wdm*", SYMLINK+="cdc-wdm-wwan???"
# SUBSYSTEM=="tty",     KERNELS=="???:1.2", ATTRS{bInterfaceProtocol}=="05", KERNEL=="ttyUSB*",  SYMLINK+="ttyUSB-a_shell-wwan???"

Change values of ID_PATH, KERNELS, and address to your own values. You can also modify name, symlinks, and/or add additional udev options.

Mikhail

Posted 2015-01-27T15:45:29.663

Reputation: 1