DEV Community

Cover image for How to spoof your MAC address on macOS
Dan Curtis
Dan Curtis

Posted on

How to spoof your MAC address on macOS

I upgraded to Monterey recently. For some reason spoofing my MAC address to extend the time on the free WiFi priced into my $5 coffee has become a lot harder.

Before I had one magic ifconfig command to do it, now I have to run four different commands:

Disconnect from the wifi

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z
Enter fullscreen mode Exit fullscreen mode

Change my lladdr

My interface is always en0, and I just change the last digit of my MAC address. Holding option while clicking on the wifi menubar tray shows both my interface and MAC address.

sudo ifconfig <interface> lladdr <new MAC address> 
Enter fullscreen mode Exit fullscreen mode

Change my ether

sudo ifconfig <interface> ether <new MAC address> 
Enter fullscreen mode Exit fullscreen mode

Run ifconfig to see if the ether value for my interface changed

ifconfig
Enter fullscreen mode Exit fullscreen mode

Now I can reconnect to my favorite insecure wifi. The wifi menubar tray still shows my old MAC address, but the public network sees the spoofed value from ifconfig.

Discussion (0)