KVM MAC Address Generator

  • This MAC address range is used by KVM.
  • All KVM MAC addresses begin with: 52:54:00:.
  • The MAC addresses generated are time based, so every MAC will be unique based on the second it was generated.
  • The final three pieces are substrings of MD5’s generated from the current time.

  //
  // https://github.com/brix/crypto-js
  //
  var CryptoJS = require("crypto-js");

  function generate_kvm_mac_address() {
    var n   = new Date().getTime();
    var m   = "" + CryptoJS.MD5("" + n);
    var mac = "52:54:00:" + m.substr(0, 2) + ":" +
                            m.substr(2, 2) + ":" +
                            m.substr(4, 2);
    document.getElementById("generated-mac-address").innerHTML = mac;
  } // function generate_kvm_mac_address

  generate_kvm_mac_address();
categories: kvm |