How to spoof a USB-Ethernet adaptor's MAC address in OS X
I've recently bought a usb-ethernet adapter (not apple) and I get internet connection. In my university we have to put a specific mac address but I can not change it.
I have tried with
sudo ifconfig en4 ether xx:xx:xx:xx:xx:xx
and with
sudo ifconfig en4 lladdr xx:xx:xx:xx:xx:xx
and with both I got the same result. The command doesn't return any error but when I run ifconfig
again the mac address is still the same.
I've also tried with Ubuntu and it worked. Do you know how can I do the same in OS X?
In Ubuntu the name of the adapter is eth0
but in OS X it's en4
instead of en0
.
The output of sudo ifconfig en4
:
en4: flags=8863 mtu 1500
ether 00:e0:4c:36:21:92
inet6 fe80::2e0:4cff:fe36:2192%en4 prefixlen 64 scopeid 0x9
nd6 options=1
media: autoselect (100baseTX )
status: active
sudo ifconfig en4 ether 10:0B:AD:C0:FF:EE
doesn't have any output.
The output of sudo ifconfig en4
again:
en4: flags=8863 mtu 1500
ether 00:e0:4c:36:21:92
inet6 fe80::2e0:4cff:fe36:2192%en4 prefixlen 64 scopeid 0x9
inet 192.168.1.38 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=1
media: autoselect (100baseTX )
status: active
Answering some questions, yes I have tried with sudo en4 down/up and I thing it's not a limitation because I can change it in Ubuntu. If I try to change the mac address of my Wi-Fi I can do it.
I'm using OS x Mavericks and my USB-Ethernet adapter is a Chinese one, the model is AX88772A
Solution 1:
I fixed this issue by installing my adapter's chipset driver on Mac Os X. After rebooting, the usual command (e.g. sudo ifconfig en6 ether xx:xx:xx:xx:xx:xx) works as expected. Below the details.
I had the same problem with a Tecknet UL688G USB 3.0 to 10/100/1000 Gigabit Ethernet adaptor.
On both Mac Os X 10.10.5 (Yosemite) and 10.11.4 (El Capitan) the command to change the MAC address was ignored, while it worked flawlessly on Ubuntu 15.10.
So no, not an hardware problem, at least in my case. After a few failed attempts with third party software and useless drivers, I found out that my adapter had the Realtek 8153 chipset, as confirmed by the system report of Mac Os X:
I found the chipset driver on another manufacturer's website, relative to a different product that uses the same RTL8153 chipset, installed it, rebooted, and voilà.. after that it was possible to change the MAC address from command line.
PS. the Realtek's website has the driver as well; it is probably the most updated version, although it gave me some errors during the installation. However, it also works as expected.
Solution 2:
Spoofing a MAC address in OSX isn't as simple as it is in Linux so you may want to try using a python script such as SpoofMAC.
Another way to configure/get info about network services in OSX is with the networksetup command.
Solution 3:
Stumbled upon changing mac addresses before~
Several answers to try:
- Try changing
en4
toen0
- http://www.macspoofer.com/
- http://sweetpproductions.com/wifispoof/ (this is for wifi - but it might help?)