Sub topic 5
Universal vs locally administered addresses
This chapter assumes you can read hexadecimal and binary, you know that a MAC address is a 48-bit identifier written as six octets, and you know the individual/group bit decides whether a destination is unicast or multicast. It covers the second flag bit in the first octet, the universal/local bit. It explains what the bit claims, who sets it, and how to use it when reading real addresses.
The two bits in the first octet
The first octet of a MAC address carries two flags in its two least significant bits:
- Bit 0 (mask
0x01) is the individual/group (I/G) bit.0means unicast and1means group (multicast or broadcast). - Bit 1 (mask
0x02) is the universal/local (U/L) bit.0means universally administered.1means locally administered.
A universally administered address (UAA) is assigned by a manufacturer from a block the IEEE registered to it. The first three octets are the OUI. A locally administered address (LAA) is assigned by someone else, such as an operating system, a hypervisor, a container runtime, or a network administrator. The IEEE does not guarantee that an LAA is globally unique. The person or software that picks it is responsible for avoiding duplicates on the LAN.
The U/L bit is a claim about who assigned the address. It is not a check. A UAA can be cloned onto another device, and a manufacturer can reuse an address by mistake.
Reading the bits from the hex digits
You do not need to convert the whole octet to binary. Only the second hex digit (the low nibble) of the first octet matters for these two flags. Its two lowest bits are the flags, and its two upper bits belong to the address itself.
| Second hex digit of first octet | U/L bit | I/G bit | Meaning |
|---|---|---|---|
| 0, 4, 8, C | 0 | 0 | Universal, unicast |
| 1, 5, 9, D | 0 | 1 | Universal, group |
| 2, 6, A, E | 1 | 0 | Local, unicast |
| 3, 7, B, F | 1 | 1 | Local, group |
For example, 02:00:5e:10:00:01 starts with 0x02, which is 00000010. The group bit is 0 and the local bit is 1, so it is a locally administered unicast address. The address 00:00:5e:00:01:01 starts with 0x00, so it is universal and unicast. It sits in an IANA-owned OUI that is used for VRRP virtual router addresses.
Edge cases in the group classes
The two bits are independent, so combinations that look odd are still valid:
- The broadcast address
ff:ff:ff:ff:ff:ffhas both bits set. Strictly, it is a locally administered group address, but it is a reserved special value. Do not treat it as "locally administered" when you classify addresses. - IPv4 multicast frames use
01:00:5e:xx:xx:xx. The first octet0x01has the group bit set and the local bit clear, so these are universal group addresses. The01:00:5eprefix belongs to IANA. - IPv6 multicast frames use
33:33:xx:xx:xx:xx. The first octet0x33is00110011, so both bits are set and the address is a local group address. This shows that a3in the second digit is normal for IPv6 multicast. - Bridge protocol traffic such as spanning tree goes to
01:80:c2:00:00:00. That is a universal group address.
Why bit 1 exists
Hardware assigns a universal address at the factory. Many situations need an address that has no hardware behind it, or that must change:
- A hypervisor creates a virtual NIC for each virtual machine. There is no chip, so no manufacturer assigned an address.
- A container runtime creates a virtual Ethernet pair for each container.
- A bonded or bridged interface needs one stable address independent of its member ports.
- A phone or laptop wants to use a different address on each Wi-Fi network for privacy.
- An administrator needs a replacement NIC to keep the old address so that static configuration (DHCP reservations, licensing, ACLs) still works.
Without the local bit, software-made addresses could collide with real manufacturer addresses. The bit moves them into a separate half of the address space. A software-generated address with the local bit set cannot match any OUI-based address that a manufacturer shipped, so a collision with real hardware cannot happen by accident.
Where you meet locally administered addresses
| Source | Typical pattern | Notes |
|---|---|---|
| Docker default bridge | `02:42:ac:11:00:02` | The last four octets encode the container's IPv4 address (`172.17.0.2`). |
| QEMU/KVM guests | `52:54:00:xx:xx:xx` | `0x52` has the local bit set. |
| Wi-Fi privacy mode | Random, second digit 2, 6, A, or E | Different per network or per period, depending on the operating system. |
| Linux `macvlan` and bridges | Random or copied | The kernel generates a random address with the local bit set when none is given. |
| Hand-set by an administrator | Anything with the bit set | Often `02:00:...` by convention. |
Several things follow from this table. Seeing 02:42 on a host tells you a Docker bridge is involved. Seeing an address with a locally administered first octet in the Wi-Fi client list of an access point usually means the client uses MAC randomization. A vendor lookup of an LAA returns nothing useful, because the first three octets are not a registered OUI.
Assigning and generating locally administered addresses
If you pick an address yourself, set the local bit and clear the group bit. The group bit must be clear on a source address. A frame whose source address has the group bit set is invalid, and many switches drop it or mishandle it.
import secrets
def random_local_mac() -> str:
"""Return a random locally administered unicast MAC address."""
octets = bytearray(secrets.token_bytes(6))
octets[0] = (octets[0] | 0x02) & 0xFE # set U/L bit, clear I/G bit
return ':'.join(f'{b:02x}' for b in octets)
def classify(mac: str) -> str:
first = int(mac.replace('-', ':').split(':')[0], 16)
scope = 'local' if first & 0x02 else 'universal'
kind = 'group' if first & 0x01 else 'unicast'
return f'{scope} {kind}'
mac = random_local_mac()
print(mac, '->', classify(mac))
print('00:1a:2b:3c:4d:5e ->', classify('00:1a:2b:3c:4d:5e'))
print('33:33:00:00:00:01 ->', classify('33:33:00:00:00:01'))The first line always prints local unicast, because the function forces both bits. The second prints universal unicast, and the third prints local group.
On Linux, you can set an address on an interface with ip. Use an address with the local bit set, and bring the interface down first if the driver requires it:
# Check the current and permanent (burned-in) addresses
ip -d link show dev eth0
# Replace the address with a locally administered unicast one
sudo ip link set dev eth0 down
sudo ip link set dev eth0 address 02:00:00:aa:bb:01
sudo ip link set dev eth0 upThe -d flag makes ip show extra details. Some drivers print a permaddr field with the burned-in address, which survives the change. The change does not persist across reboots unless your network manager configuration also sets it.
Interaction with IPv6 EUI-64
The U/L bit appears in another place. In the older modified EUI-64 scheme, an IPv6 interface identifier is derived from the MAC address. The MAC is split in half, ff:fe is inserted in the middle, and the U/L bit is inverted. In an IPv6 interface identifier, a 1 means universal and a 0 means local. This is the opposite of the MAC address convention, and the change makes it easier to write short manual identifiers such as ::1.
def mac_to_eui64(mac: str) -> str:
b = bytes(int(p, 16) for p in mac.split(':'))
iid = bytes([b[0] ^ 0x02]) + b[1:3] + b'\xff\xfe' + b[3:]
return ':'.join(f'{iid[i]:02x}{iid[i + 1]:02x}' for i in range(0, 8, 2))
print(mac_to_eui64('00:1a:2b:3c:4d:5e'))This prints 021a:2bff:fe3c:4d5e. The first octet changed from 00 to 02. Most modern systems no longer derive addresses this way, because it exposes the hardware address and allows tracking across networks. They use random or stable-privacy identifiers instead. You may still see EUI-64 addresses on older systems, on some embedded devices, and in link-local addresses.
Common errors and gotchas
- Treating the local bit as a "fake" flag. A locally administered address is fully valid. Virtualization and privacy features depend on it, and switches forward it like any other.
- Assuming universal means unique. Cloned virtual machines, duplicated NIC firmware, and manual overrides can all produce two devices with the same universal address. If two hosts on one VLAN share an address, the switch's MAC table entry flips between ports, and traffic reaches one host or the other unpredictably.
- Setting a random address with the group bit set. An address whose first octet is odd is a group address. Many operating systems refuse to set it, and others accept it and fail in confusing ways. Always clear bit 0.
- Relying on the OUI of a local address. Vendor lookups for an LAA either fail or return an unrelated vendor. Check the local bit first, and skip the lookup if it is set.
- Using the bit as a security check. Anyone can set any address on a NIC they control. You can use a set local bit as a hint that a device is virtual or is randomizing. You cannot use a clear bit as proof that the hardware is genuine.
- Mixing up the bit with the IPv6 convention. In the MAC,
1means local. In the modified EUI-64 interface identifier derived from it,1means universal.
Standardized local address allocation
The IEEE 802c standard describes a protocol for structuring the locally administered space, called SLAP. It divides locally administered unicast addresses into four groups by the second hex digit: 2 for extended local identifiers, 6 for standard assigned identifiers, A for administratively assigned identifiers, and E as reserved. Many deployments still pick local addresses without following it, so you should not assume a particular quadrant carries a particular meaning.
Exercise
Classify each address as universal or local, and unicast or group: 4c:cc:6a:01:02:03, 7a:11:22:33:44:55, 01:00:5e:00:00:fb, da:a1:19:00:00:01.
Show answer
4c:cc:6a:01:02:03 has first octet 0x4c, second digit C (1100), so both low bits are 0: universal unicast. 7a:11:22:33:44:55 has first octet 0x7a, second digit A (1010): local bit set and group bit clear, so local unicast. 01:00:5e:00:00:fb has first octet 0x01: group bit set and local bit clear, so universal group (an IPv4 multicast address). da:a1:19:00:00:01 has first octet 0xda, second digit A (1010): local unicast, which is typical of a randomized Wi-Fi address.
Exercise
You choose the address 13:37:00:00:00:01 for a virtual NIC. What is wrong with it, and what is the smallest change that makes it a valid locally administered unicast address?
Show answer
The first octet 0x13 is 00010011, so the group bit is set and the local bit is also set. A source address must not be a group address. Clear bit 0 and keep bit 1 set by changing the first octet to 0x12, which gives 12:37:00:00:00:01. Any first octet whose second digit is 2, 6, A, or E would also work.
Exercise
A switch shows the address 02:42:ac:11:00:05 on one of its ports. What does the first octet tell you about the device, and why would an OUI lookup be pointless?
Show answer
The first octet 0x02 has the local bit set and the group bit clear, so the address is locally administered unicast. It was assigned by software, not by a manufacturer. The 02:42 prefix is the pattern Docker uses for its container interfaces, so this is probably a container on the other side of that port. The first three octets are not a registered OUI, so a vendor lookup cannot return the real manufacturer.