skillfed

randmac

a random 12-digit mac address generator

randmac v0.1 78.1K downloads/30d#14,469 on PyPI8
Permissive license MIT Abandoned released

What it is and what it does

randmac is a lightweight utility for generating random MAC addresses in multiple formats. It can produce either full 12-digit addresses or preserve the manufacturer (OUI) portion while randomizing the NIC-specific portion. The package supports five common MAC address formats: colon-separated (MM:MM:MM:SS:SS:SS), hyphen-separated (MM-MM-MM-SS-SS-SS), dot-separated (MM.MM.MM.SS.SS.SS), Cisco format (MMMM.MMSS.SSSS), and unformatted (MMMMMMSSSSSS).

The main use case is generating test or mock MAC addresses for network testing, device simulation, or security research. It includes a command-line interface for quick generation and a Python API for programmatic use. The optional LAA (locally administrated address) mode ensures generated addresses are marked as locally administered by constraining the first hex digit to x2, x6, xA, or xE, which is useful when you need addresses that won't collide with real hardware vendors.

Use it for:

  • Generate mock MAC addresses for network testing and device simulation scenarios
  • Create test data for network monitoring or DHCP server testing
  • Randomize NIC portions while preserving a specific OUI for vendor-specific testing
  • Generate LAA-compliant addresses for local network administration and testing
  • Quick command-line MAC address generation without writing code

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates random 12-digit MAC addresses in multiple formats, with optional support for locally administrated address (LAA) format compliance.

Yes, if you need a simple, dependency-free MAC address generator for testing or development. The low install friction and permissive license make it a low-risk addition. However, the abandoned maintenance status and Alpha classification mean it's best suited for non-critical tooling; do not rely on it for production systems. Verify LAA format correctness for your specific use case before deploying.

Install

randmac on PyPI

pip

pip install randmac

uv

uv add randmac

poetry

poetry add randmac

Installing randmac

Before you install

Low install friction with no runtime dependencies. Package is abandoned (last release 2020-09-13, last commit 2023-05-25) and classified as Alpha, so expect no active maintenance or bug fixes.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions.

Quickstart

from randmac import RandMac

# Generate a random LAA-format MAC address
mac = RandMac()
print(mac)  # e.g., 'a6:9b:6b:8e:b3:42'

# Generate with custom format
mac_custom = RandMac("00:00:00:00:00:00", True)
print(mac_custom)  # e.g., '00:00:00:3f:8a:06'

Requires Python >3.2

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.2 despite the classifier listing only 3.2
  • Whether the LAA format generation (x2, x6, xA, xE prefix guarantee) is consistently correct across all output formats

Package facts

License MIT (permissive)
Python support supports the current Python release (>3.2,)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,161 days since the last release
Last repo commit
First released
Downloads 78,104/month — #14,469 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: randmac-0.1-py2.py3-none-any.whl

Keywords: randmac, random mac, random mac address

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: System AdministratorsNatural Language :: EnglishProgramming Language :: Python :: 3.2Topic :: Utilities

Tags

random mac address generatormac address generationnetwork mac randomizerLAA format mac addressesmac address utilitynic address generator
mac-addressnetwork-testingtest-data-generation

More Utilities packages