Skip to content

Instantly share code, notes, and snippets.

@rubiojr
Created June 2, 2009 09:09
Show Gist options
  • Save rubiojr/122150 to your computer and use it in GitHub Desktop.
Save rubiojr/122150 to your computer and use it in GitHub Desktop.
#! /usr/bin/python
# macgen.py script generates a MAC address for Xen guests
#
import random
mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
print ':'.join(map(lambda x: "%02x" % x, mac))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment