Bash script: Change your MAC address

Handy script to change your MAC address. Useful for testing. Or bypassing time-limited WiFi’s in coffee shops.

Changing your MAC address is one command: sudo ifconfig "$INTERFACE" ether "$NEW_MAC".

But you need to remember the MAC address format, come up with a new address, and remember the old address if you want to restore it (without rebooting your machine).

The following script offers a simpler interface:

The complete code is below or can be downloaded from this github gist.