Skip to content

Instantly share code, notes, and snippets.

@krhitoshi
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krhitoshi/9837105 to your computer and use it in GitHub Desktop.
Save krhitoshi/9837105 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Xen
#mac = [0x00, 0x16, 0x3e, Random.rand(0x7f), Random.rand(0xff), Random.rand(0xff)]
# QEMU or KVM
mac = [0x52, 0x42, 0x00, Random.rand(0x7f), Random.rand(0xff), Random.rand(0xff)]
puts (["%02x"] * 6).join(":") % mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment