Skip to content

Instantly share code, notes, and snippets.

@thebaer
Last active February 13, 2016 01:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebaer/07d677779af826d95b9d to your computer and use it in GitHub Desktop.
Save thebaer/07d677779af826d95b9d to your computer and use it in GitHub Desktop.
Generate new MAC address for accessing time-limited hotspots
#!/bin/bash
# Generate new MAC address for accessing time-limited hotspots like Boingo
# Modification may be needed; tested on Chrome OS
# No warranty / guarantees made. Use at your own risk. This probably violates some Terms of Service.
sudo ifconfig wlan0 down
# Source: http://superuser.com/questions/218340/how-to-generate-a-valid-random-mac-address-with-bash-shell
sudo ifconfig wlan0 hw ether $(echo -n 00:60:2F; dd bs=1 count=3 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02X"')
# OS X:
# sudo ifconfig en0 ether $(echo -n 00:60:2F; dd bs=1 count=3 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02X"')
sudo ifconfig wlan0 up
echo Open an incognito window to your favorite HTTP site.
echo Turn wifi off and on again if it does not work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment