Skip to content

Instantly share code, notes, and snippets.

@mekza
Last active December 16, 2015 05:58
Show Gist options
  • Save mekza/5387745 to your computer and use it in GitHub Desktop.
Save mekza/5387745 to your computer and use it in GitHub Desktop.
Mac address Generator
#!/usr/bin/env python
import random
def GenMac(number):
mac_list = []
for i in range(number):
mac = [ 0x52, 0x54, 0x00,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
temp = ':'.join(map(lambda x: "%02x" % x, mac))
mac_list.append(temp)
return mac_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment