MAC Address Generator
Generate random, locally administered MAC addresses in colon, hyphen, or Cisco dotted notation. Safe for virtual machines, containers, and network lab environments.
Use MAC Address Generator in 4 Steps
What is MAC Address Generator?
MAC Address Generator creates random, syntactically valid MAC addresses in any format you need — with colons (AA:BB:CC:DD:EE:FF), hyphens (AA-BB-CC-DD-EE-FF), or dotted notation (AABB.CCDD.EEFF). Use this tool to generate test addresses for lab environments, network simulators, virtual machines, and development scenarios where real hardware MAC addresses would conflict or be inappropriate.
MAC Address Structure and Format
A MAC (Media Access Control) address is a 48-bit hardware identifier assigned to network interface controllers (NICs). It is expressed as 6 groups of 2 hexadecimal digits, totaling 12 hex characters. The IEEE divides the 48 bits into two halves: the first 24 bits are the OUI (Organizationally Unique Identifier) assigned to the manufacturer, and the last 24 bits are the device-specific serial number assigned by the manufacturer.
| Notation Style | Format Example | Where Used |
|---|---|---|
| Colon-separated | AA:BB:CC:DD:EE:FF | Linux, macOS, most Unix systems |
| Hyphen-separated | AA-BB-CC-DD-EE-FF | Windows Device Manager and ipconfig |
| Dotted (Cisco) | AABB.CCDD.EEFF | Cisco IOS, Catalyst switches |
| No separator | AABBCCDDEEFF | Some database fields and scripts |
The most significant bit of the first octet has two special meanings: the U/L bit (bit 1) indicates whether the address is universally administered (0) or locally administered (1), and the I/G bit (bit 0) indicates whether the address is for a unicast (0) or multicast (1) destination. Generated MAC addresses should set the U/L bit to 1 to mark them as locally administered and avoid collisions with registered OUIs.
Locally Administered vs. Universally Administered Addresses
Universally administered addresses (UAAs) are burned in at the factory and are globally unique. Locally administered addresses (LAAs) are manually assigned and intended for use in closed environments where you control the address space. When generating a random MAC for a VM or a test scenario, always generate a locally administered address by ensuring bit 1 of the first octet is set to 1.
; To mark a MAC as locally administered, the first octet must have bit 1 set.
; This means the first octet (in binary) ends in ...10 — for example:
; x2:xx:xx:xx:xx:xx
; x6:xx:xx:xx:xx:xx
; xA:xx:xx:xx:xx:xx
; xE:xx:xx:xx:xx:xx
; Valid locally administered unicast MAC examples:
02:00:00:00:00:01 ; Safe for VMs and containers
06:AB:CD:EF:12:34 ; Safe for lab environments
Common Use Cases for Generated MAC Addresses
- Virtual Machines: Hypervisors like VMware, VirtualBox, and KVM need unique MAC addresses for each virtual NIC. Many hypervisors auto-generate these, but manual generation is needed for scripted deployments or infrastructure-as-code tooling.
- Network Testing Labs: Testing spanning tree, bonding, or VLAN configurations requires multiple fake MACs without real hardware.
- Container Networking: Docker and Kubernetes bridge networks may require specific MAC assignments for reproducible network topologies.
- NAC Bypass Testing: Security researchers testing Network Access Control (NAC) systems use generated MACs to simulate spoofing scenarios in authorized lab environments.
- DHCP Pool Simulation: Load-testing DHCP servers requires generating large numbers of fake client MACs to verify pool exhaustion behavior.
CLI Commands for MAC Address Work
# Generate a random MAC address on Linux (locally administered):
python3 -c "
import random
mac = [random.randint(0, 255) for _ in range(6)]
mac[0] = (mac[0] & 0xfe) | 0x02 # Set locally administered, unicast
print(':'.join(f'{b:02x}' for b in mac))"
# Display the MAC address of a network interface on Linux:
ip link show eth0 | grep link/ether
# Display the MAC address on macOS:
ifconfig en0 | grep ether
# Display the MAC address on Windows (PowerShell):
Get-NetAdapter | Select-Object Name, MacAddress
MAC Address Spoofing for Authorized Testing
In authorized security testing and lab environments, temporarily changing a MAC address is a standard network debugging technique. Note that MAC address changes are not persistent across reboots unless made to the network configuration file.
# Temporarily change MAC address on Linux (requires root):
ip link set dev eth0 down
ip link set dev eth0 address 02:ab:cd:ef:12:34
ip link set dev eth0 up
# Verify the change took effect:
ip link show eth0 | grep link/ether
Always confirm you have explicit authorization before performing MAC address changes on production or shared networks. MAC address spoofing on networks you do not own or control may violate acceptable use policies.
Related Reference: OUI Vendor Lookup
The first 24 bits (first 3 octets) of a real MAC address identify the manufacturer via the OUI registry. Generated MACs using this tool do not correspond to any real manufacturer — they use the locally administered range to avoid OUI conflicts. To look up the manufacturer of a real device's MAC address, use our MAC Address Lookup tool, which queries the IEEE OUI database directly.
Frequently Asked Questions
Get guides like this by email
DNS, email auth, and security playbooks delivered when they publish. No spam.