Skip to content

Instantly share code, notes, and snippets.

@lancevo
Created May 20, 2019 18:03
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 lancevo/f6c0f1a5e07f13a22c38e0c0cd2165e0 to your computer and use it in GitHub Desktop.
Save lancevo/f6c0f1a5e07f13a22c38e0c0cd2165e0 to your computer and use it in GitHub Desktop.
change MAC address on Mac
function changeMac() {
local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
sudo ifconfig en0 ether $mac
sudo ifconfig en0 down
sudo ifconfig en0 up
echo "Your new physical address is $mac"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment