EUI-64 (Extended Unique Identifier) is a method we can use to automatically configure IPv6 host addresses. An IPv6 device will use the MAC address of its interface to generate a unique 64-bit interface ID. However, a MAC address is 48 bit and the interface ID is 64 bit. What are we going to do with the missing bits?
Here’s what we will do to fill the missing bits:
- We take the MAC address and split it into two pieces.
- We insert “FFFE” in between the two pieces so that we have a 64 bit value.
- We invert the 7th bit of the interface ID.
So if my MAC address would be 1234.5678.ABCD then this is what the interface ID will become:
Above you see how we split the MAC address and put FFFE in the middle. It doesn’t include the final step which is “inverting the 7th” bit. To do this you have to convert the first two hexadecimal characters of the first byte to binary, lookup the 7th bit and invert it. This means that if it’s a 0 you need to make it a 1, and if it’s a 1 it has to become a 0.
The 7th bit represents the universal unique bit. A “built in” MAC address will always have this bit set to 0. When you change the MAC address this bit has to be set to 1. Normally people don’t change the MAC addresses of their interfaces which means that EUI-64 will change the 7th bit from 0 to 1 most of the time. Here’s what it looks like:
Hi Rene,
Do Windows, Linux and Mac hosts calculate it some way ?
Hi Diego,
EUI-64 is described in the RFC, most hosts will use this for automatically assigning an address. Linux and MAC both use this.
Windows however seems to use something else. It seems Vista, 7/8/10 and Server 2008 create random interface IDs instead of EUI-64. I believe you can change this though.
Rene
Hi Rene,
According to the RFC 3513 we need to invert the Universal/Local bit (“U/L” bit) in the 7th position of the first octet. The “u” bit is set to 1 to indicate Universal, and it is set to zero (0) to indicate local scope.
1 – Universally Unique in Ethernet MAC
0 – Locally Unique addresses in Ethernet MAC
If this bit is already set to 1 in Mac address and we need to build a global address, should we invert the 7th bit to 0 ?
Thanks !
Hi Jose,
Let’s look at an example:
The 7th bit is in the first two hexadecimal characters:
fa = 1111 1010
As you can see, the 7th bit is set to 1 here. Now let’s check the IPv6 address:
Let’s write down the complete uncompressed address:
FE80:0000:0000:0000:F816:3EFF:FE60:0217
Let’s look only at the EUI-64 part:
... Continue reading in our forumF
Rene, I see you keep referring to FA as FFFF 1000. Is that correct or a typo? This was referenced twice that way. This is example on IPv6 EUI-64 explained.
Example from Notes:
Let’s look only at the EUI-64 part:
F816:3EFF:FE60:0217
We only care about the first two hexadecimal characters:
F8 = FFFF 1000
As you can see, the 7th bit has been inverted from 1 to 0.
2nd Example:
Here’s the EUI-64 part:
FA16:3EFF:FE60:0217
First two hexadecimal characters:
FA = FFFF 1000
As you can see, it got inverted. No matter if the 7th bit of the MAC address is a 0 or 1, it always gets inverted.