Skip to content

Instantly share code, notes, and snippets.

@Darkflib
Created April 25, 2018 14:55
Show Gist options
  • Select an option

  • Save Darkflib/a734ae08a8064e8e404b32fa465e1176 to your computer and use it in GitHub Desktop.

Select an option

Save Darkflib/a734ae08a8064e8e404b32fa465e1176 to your computer and use it in GitHub Desktop.
Mac switch MAC
To switch mac, you will need to be admin and disconnected from the wifi.
Before you begin, get your existing mac address and replace the placeholder in the reset-mac.sh file.
To disconnect, hold alt/option and right click the wifi icon in the top bar.
Click the disconnect under your connected wifi connection.
Once this is done, run switch-mac.sh as admin and then reconnect.
Reboot or run the reset-mac.sh script to reset.
#!/bin/bash
DEV=en0
ifconfig en0 ether 1c:15:29:63:7d:91 # original mac address
#!/bin/bash
DEV=en0
NEWMAC=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
echo "New MAC: $NEWMAC"
ifconfig en0 ether $NEWMAC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment