Sub topic 12
Interface identifiers and privacy
This chapter assumes you can read compressed IPv6 notation and understand the 64-bit prefix split from earlier chapters. It also assumes you know what a MAC address is.
What the interface identifier is
An IPv6 address on a normal subnet has two halves. The first 64 bits are the network prefix. The last 64 bits are the interface identifier (IID), which tells hosts apart on that link. The IID can be built in several ways, and the method affects both your configuration and your privacy.
Modified EUI-64
The oldest method derives the IID from the interface's 48-bit MAC address:
- Split the MAC into two 3-byte halves.
- Insert
ff:febetween them. - Flip the universal/local bit, which is the second-lowest bit of the first byte.
The same steps in Python:
import ipaddress
def eui64_link_local(mac):
b = bytearray(int(x, 16) for x in mac.split(":"))
b[0] ^= 0x02 # flip the universal/local bit
iid = bytes(b[:3]) + b"\xff\xfe" + bytes(b[3:])
return ipaddress.IPv6Address(b"\xfe\x80" + bytes(6) + iid)
print(eui64_link_local("00:1a:2b:3c:4d:5e")) # fe80::21a:2bff:fe3c:4d5eYou can spot an EUI-64 address by the ff:fe in the middle of the IID.
The privacy problem
A MAC address does not change, so an EUI-64 IID is the same on every network you join. Any server you contact can recognize your device by the low 64 bits, even when the prefix changes. The MAC also reveals the hardware vendor.
Privacy extensions and stable opaque IDs
Modern systems use two other methods:
- Temporary addresses (RFC 4941) are random IIDs that the host generates and replaces on a schedule, often daily. The host uses them for outgoing connections, so remote servers see a changing address.
- Stable opaque IIDs (RFC 7217) are produced by hashing the prefix, the interface, and a secret key. The IID stays the same on one network, so the address is predictable there. It differs on every other network, so it can't be used to track you across networks.
A host often holds several global addresses on one interface at once: a stable one for incoming connections and temporary ones for outgoing connections.
ip -6 addr showIn the output, addresses marked temporary are privacy addresses. mngtmpaddr marks the stable address from which the temporary ones are generated.
Common mistakes
- Assuming the MAC is visible in every address. Most current operating systems default to temporary or opaque IIDs, so no
ff:feappears. - Forgetting the bit flip. The first byte
00becomes02, not00. - Writing firewall rules or DNS records for a temporary address. These addresses expire. Use a stable address, or DHCPv6 or manual assignment, for servers.
- Expecting a /64 IID rule to hold on other prefix lengths. SLAAC needs a 64-bit IID, so subnets smaller than /64 break it.
Exercise
A host has MAC address 52:54:00:12:34:56. What is its modified EUI-64 link-local address, in compressed form?
Show answer
Flip the universal/local bit of the first byte (0x52 XOR 0x02 = 0x50) and insert ff:fe in the middle. The IID is 5054:00ff:fe12:3456, so the address is fe80::5054:ff:fe12:3456.
Exercise
Why does a stable opaque IID not let a website track you across networks, while an EUI-64 IID does?
Show answer
An EUI-64 IID comes from the fixed MAC address, so it is the same on every network. A stable opaque IID is a hash that includes the network prefix and a secret key, so it differs on each network.