Skip to content

Instantly share code, notes, and snippets.

@nsisodiya
Created May 20, 2019 17:36
Show Gist options
  • Save nsisodiya/4af2fb8d6922040f1277ed0b60ba76cd to your computer and use it in GitHub Desktop.
Save nsisodiya/4af2fb8d6922040f1277ed0b60ba76cd to your computer and use it in GitHub Desktop.
changeMac
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