Skip to content

Instantly share code, notes, and snippets.

@oiuww09fn
Created April 1, 2014 06:28
Show Gist options
  • Save oiuww09fn/9908757 to your computer and use it in GitHub Desktop.
Save oiuww09fn/9908757 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import random
def randomMAC():
mac = [ 0x52, 0x54, 0x00,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
return ':'.join(map(lambda x: "%02x" % x, mac))
print randomMAC()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment