Network Bytes · Episode 85 · CCNA 1.9
"IPv6 EUI-64: an address from your MAC"
An IPv6 address is a 64-bit network half plus a 64-bit interface ID. Modified EUI-64 builds that interface ID from a 48-bit MAC address by putting FFFE in the middle and flipping the seventh bit of the first byte.
Two halves of an IPv6 address
A typical IPv6 unicast address (see EP25 to EP27) is 128 bits split down the middle. The first 64 bits are the network prefix, the part that says which network the device is on. It usually comes from the router, for example 2001:db8:acad:1::/64. The last 64 bits are the interface ID, which identifies this one device on that network.
The router doesn't have to hand out the interface ID. A device can make it up itself, and one way to do that is from the MAC address it already has.
The sandwich: 48 bits plus FFFE
A MAC address is only 48 bits, 16 short of 64. Modified EUI-64 fills the gap in the middle:
- Split the MAC into two 24-bit halves. The first half is the OUI, the maker's code.
- Put the 16 bits
FFFEbetween them.
With the example MAC 00:1A:2B:3C:4D:5E:
`` 00:1A:2B + FF:FE + 3C:4D:5E → 001A:2BFF:FE3C:4D5E ``
The halves are the bread and FFFE is the filling. That's why an EUI-64 interface ID always has ff:fe sitting in its middle.
Flipping the seventh bit
There's one more step. Write the first byte in binary and invert the seventh bit from the left, the one worth 2. This is the universal/local (U/L) bit.
`` 00 = 0000 0000 flip bit 7 → 0000 0010 = 02 ``
So the interface ID becomes 021A:2BFF:FE3C:4D5E. Put the network half in front and the full address is 2001:db8:acad:1:21a:2bff:fe3c:4d5e (the leading zero of 021a is dropped when the address is shortened). "Flip" means invert: if the bit is 0 it becomes 1, and if it is 1 it becomes 0, so a first byte of 02 would turn into 00.
On a Cisco router you can ask for exactly this:
`` interface g0/0 ipv6 address 2001:db8:acad:1::/64 eui-64 ``
Cisco routers also use EUI-64 by default to build their link-local (fe80::) addresses.
Why many phones don't use it
An EUI-64 interface ID carries your MAC, so it stays the same on every network you join, which makes your device easy to track. Many modern operating systems use random or stable private interface IDs instead (RFC 8981 and RFC 7217). The network half still comes from the router; only the interface ID is different.
Try it yourself
On your computer, list your IPv6 addresses: ipconfig on Windows, ifconfig on macOS, or ip -6 addr on Linux. Look at the last 64 bits of each address, especially the fe80:: link-local one. If you see ff:fe in the middle, compare it with your own MAC address (getmac on Windows, ifconfig or ip link elsewhere) and check whether the halves match and whether the first byte differs by the U/L bit. If there's no ff:fe, your system is using a random or stable private ID for privacy.
Good to know
- CCNA 1.9 lists modified EUI-64 among the IPv6 address types; EP25 to EP27 cover IPv6 basics, address types and shortening.
- RFC 4291 (section 2.5.1 and Appendix A): insert
FFFEbetween the first 24 bits (the OUI) and the last 24 bits of the MAC, then invert the universal/local bit, the seventh bit from the left of the first byte (value0x02). - "Flip" means invert, so a first byte of
02becomes00. - The interface ID joins a /64 prefix, which can come from router advertisements (SLAAC) or be configured, for example
ipv6 address 2001:db8:acad:1::/64 eui-64on Cisco IOS. - Cisco routers use EUI-64 by default for their link-local addresses; many modern operating systems use random or stable private interface IDs instead (RFC 8981, RFC 7217), shown in the video as "random IDs for privacy".
2001:db8::/32is the IPv6 documentation prefix (RFC 3849), and the MAC is an example.- "Sandwich" is an analogy.
For CCNA learners
CCNA exam topic 1.9 is describe IPv6 address types, and it names modified EUI-64. Be able to build an interface ID from a MAC by hand: split, insert FFFE, flip the seventh bit of the first byte.
Answer to the comment question
0E. The first byte 0C is 0000 1100 in binary. Flipping the seventh bit from the left (the one worth 2) gives 0000 1110, which is 0E in hex.
Test your knowledge
Quick quiz: "IPv6 EUI-64: an address from your MAC"
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- IETF, "RFC 4291, IP Version 6 Addressing Architecture": 64-bit interface identifiers in modified EUI-64 format; Appendix A describes building one from a MAC address
- Cisco Community, "Understanding IPv6 EUI-64 Bit Address": worked example of splitting the MAC into two 24-bit halves and inserting FFFE
- IETF, "RFC 8981, Temporary Address Extensions for Stateless Address Autoconfiguration in IPv6": random interface IDs for privacy
- Cisco, "CCNA 200-301 v1.1 exam topics": 1.9 describe IPv6 address types (unicast, anycast, multicast, and modified EUI 64)
- IETF, "RFC 3849, IPv6 Address Prefix Reserved for Documentation": 2001:db8::/32 used on screen
Video transcript
How can an IPv6 device build its own address from its MAC address?
An IPv6 address has two halves: the network part from the router, and a 64-bit interface ID the device can make itself.
But a MAC is only 48 bits. So the device builds a sandwich: the MAC's two halves as bread, FFFE as the filling.
Then it flips one bit, the seventh bit of the first byte. 00 becomes 02.
Add the network half in front, and the address is complete. That's modified EUI-64. Many phones use random IDs instead, for privacy.
A MAC address starts with 0C. After flipping the seventh bit, what does that first byte become? Comment your answer below!
That's your byte.
More from Network Bytes
- EP83"DHCP relay: ip helper-address"
- EP84"Dynamic ARP Inspection"
- EP86"VRFs: one router, separate routing tables"
- EP87"Containers vs virtual machines"