Skip to content

Instantly share code, notes, and snippets.

@bbirec
Created August 11, 2013 13:28
Show Gist options
  • Save bbirec/6204893 to your computer and use it in GitHub Desktop.
Save bbirec/6204893 to your computer and use it in GitHub Desktop.
A simple bash script to change MAC address in MacOS.
#!/bin/bash
MAC=${1:-`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`}
INF=${2:-"en0"}
echo "Set a new MAC address($MAC) for $INF"
ifconfig $INF lladdr $MAC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment