How to generate a random MAC address
- Choose how many addresses you need, from 1 to 500.
- Choose a format and letter case for your output.
- Use Locally administered and Unicast for virtual machines, containers and test data.
- To use a fixed prefix, choose a preset or enter one to five hex bytes. Then copy or download the list.
How a MAC address is built
A MAC address is 48 bits, written as six bytes in hexadecimal, such as 02:1A:2B:3C:4D:5E. The first three
bytes are normally the manufacturer's OUI (organisationally unique identifier), registered with the IEEE;
the last three identify the individual device. Two bits in the first byte have special meaning:
| Bit (first byte) | 0 means | 1 means | What to use |
|---|---|---|---|
| Lowest bit (I/G) | Unicast: one device | Multicast: a group | Unicast for any network card |
| Second-lowest bit (U/L) | Universally administered (from a manufacturer) | Locally administered (set by software) | Local for made-up addresses |
A unicast, locally administered address always has 2, 6, A or E as its second hex digit, for example
x2:…, x6:…, xA:… or xE:…. That's an easy way to spot a random or virtual address.
MAC prefixes used by virtual machines
| Platform | Prefix |
|---|---|
| VMware (manually assigned) | 00:50:56 |
| VMware (automatically generated) | 00:0C:29 |
| Oracle VirtualBox | 08:00:27 |
| Microsoft Hyper-V | 00:15:5D |
| QEMU / KVM | 52:54:00 |
| Xen | 00:16:3E |
| Docker containers | 02:42 |
Using a hypervisor's own prefix keeps generated addresses recognisable in DHCP leases and switch tables.
How to change your MAC address
- Windows: Device Manager > Network adapters > your adapter > Advanced > Network Address, or in PowerShell as administrator:
Set-NetAdapter -Name "Ethernet" -MacAddress "02-1A-2B-3C-4D-5E". Wi-Fi adapters on Windows only accept locally administered addresses. - Linux:
sudo ip link set dev eth0 down,sudo ip link set dev eth0 address 02:1a:2b:3c:4d:5e, thensudo ip link set dev eth0 up. The change lasts until reboot unless you set it in NetworkManager or systemd-networkd. - macOS:
sudo ifconfig en0 ether 02:1a:2b:3c:4d:5e. Recent versions also have a built-in Private Wi-Fi address setting per network. - Phones: iOS, iPadOS and Android already use a random, locally administered address for each Wi-Fi network by default.
Only change MAC addresses on networks and devices you're allowed to manage. Some networks register devices by MAC address, so a new one can disconnect you until it's registered again.
Comments 0
No comments yet.