Skip to main content

a random 12-digit mac address generator

Project description

a utility that generates 12-digit mac addresses; either the NIC portion or full 12-digit MAC.

the optional -f argument will return a random 12-digit MAC address that can be identified by the locally administrated address (LAA) format. This means you will always see x2, x6, xA, or xE at the beginning of a MAC address generated by randmac.


to install with pip:

pip install randmac


Python >3.2 required.

mac address formats

Supported MAC address formats:


where M stands for the manufacturer or vendor, and S stands for the NIC specific portion.


you can from randmac import RandMac and use it like RandMac().

if you wish to change the mac address format. provide a sample mac so randmac knows what the output format should be.

you can from randmac import RandMac and use it like RandMac("0000.0000.0000").

from a terminal (if the the console scripts entry point randmac is in your path and executable) you can use randmac to get a generate a new 12-digit LAA address, or randmac 00:00:00:00:00:00 -p to generate a MAC with the same OUI, but a different NIC portion.

example usage

>>> from randmac import RandMac
>>> RandMac()
>>> RandMac("00:00:00:00:00:00", True)
>>> RandMac("0000:0000:0000", True)
>>> RandMac("0000:0000:0000")


> randmac
> randmac 00-00-00-00-00-00 -p


license can be found here.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

randmac-0.1.tar.gz (5.5 kB view hashes)

Uploaded source

Built Distribution

randmac-0.1-py2.py3-none-any.whl (6.5 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page