Created
March 24, 2014 18:53
-
-
Save vicapow/9746677 to your computer and use it in GitHub Desktop.
a small .bash_profile snippet to force renew a new local ip from a DHCP server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
random-mac() | |
{ | |
node -e "var v = [1,2,3,4,5,6,7,8,9,0,'a','b','c','d','e','f']; var r = function(){ return v[Math.floor(Math.random() * v.length)] }; console.log( '00:' + r() + r() + ':' + r() + r() + ':' + r() + r() + ':' + r() + r() + ':' + r() + r())" | |
} | |
new-ip() | |
{ | |
sudo ifconfig en0 ether `random-mac` | |
sudo ipconfig set en0 BOOTP | |
sudo ipconfig set en0 DHCP | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment