MAC address structure
A MAC (Media Access Control) address is 48 bits, typically expressed as six
colon-separated hex bytes: 00:1A:2B:3C:4D:5E. It's a unique identifier
assigned to each network interface, layer 2 of the OSI model.
The 48 bits split into two parts:
- OUI (Organizationally Unique Identifier): the first 24 bits (3 bytes). Identify the manufacturer. IEEE assigns OUIs to network-hardware companies.
- NIC (Network Interface Controller): the last 24 bits. The manufacturer assigns them sequentially to each device they produce.
That's 16.7 million addresses per OUI. Big companies have multiple OUIs to avoid running out of numbers.
Special bits in the first byte
The first byte of a MAC has two bits with special meaning:
- Least significant bit (I/G): 0 if unicast (single destination), 1 if multicast (multiple destinations).
- Second-least significant bit (U/L): 0 if universal (IEEE-assigned), 1 if locally administered (configured by the admin).
By convention, locally administered MACs are what you should use for tests and virtual machines, since they guarantee no collision with any existing real device. That means the first byte ends in 2, 6, A or E (in hex).
Common OUIs to recognize
- 00:1B:63, 00:23:DF, AC:DE:48: Apple.
- 00:1A:A1, 00:23:04: Cisco Systems.
- 00:14:22: Dell.
- 00:1F:29, 00:1A:4B: HP.
- 00:1B:21, 00:1B:77: Intel.
- 00:50:56: VMware (virtual machines).
- 52:54:00: QEMU/KVM.
- 08:00:27: VirtualBox.
- B8:27:EB, DC:A6:32, E4:5F:01: Raspberry Pi Foundation.
Sites like wireshark.org/tools/oui-lookup.html let you look up which company owns any OUI.
Privacy: MAC randomization
Since 2014, iOS and Android phones randomize their MAC when scanning Wi-Fi networks to prevent tracking. Without it, a store could repeatedly detect the same customer. Today, the OS generates a fresh MAC for each network it associates with (sometimes between associations).
If your system depends on MAC for device identification, remember that MAC may change. Combine with other stable identifiers.
Practical testing applications
- Switch MAC filters. Test allow/block lists with MACs from various vendors.
- DHCP with static reservations. Assign fixed IPs to specific MACs in your lab.
- Inventory tests. Simulate a fleet of 1,000 devices without owning them.
- Network simulation. Mininet, GNS3 and other simulators require MACs.
- MAC-based VLANs. Test VLAN-assignment logic by manufacturer.
Common mistakes with MACs
- Using made-up OUIs. If your MAC starts with
FF:FF:FF, that's broadcast, not a vendor. Use a real OUI or locally administered. - Generating all bits randomly. The first byte will likely be universal, which can collide with a real device in production.
- Confusing formats. Cisco uses
001a.2b3c.4d5e. Linux uses00:1a:2b:3c:4d:5e. Conversion is trivial but you have to do it. - Ignoring duplicates. Two equal MACs on a network break ARP. With random testing, the chance is tiny but non-zero.