Skip to content

Instantly share code, notes, and snippets.

@alexmuller
Last active September 28, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmuller/1486669 to your computer and use it in GitHub Desktop.
Save alexmuller/1486669 to your computer and use it in GitHub Desktop.
Change MAC address
# Works on a MacBook Pro running OS X 10.6.8 up to 10.8.5 at least
# May break other stuff
# Take a note of your current MAC address to restore it later
ifconfig en1 | grep ether
# Disassociate from any connected Wi-Fi networks
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -z
# Set wireless MAC address to something random
# The Python comes from @pearfalse on Twitter
sudo ifconfig en1 ether $(python -c 'import random;print":".join(["%02x"%random.randint(0,255)for x in range(6)])')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment