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:

We take the first two hexadecimal characters of the first byte which are “12” and convert those back to binary. Then we invert the 7th bit from 1 to 0 and make it hexadecimal again. The EUI-64 interface ID will look like this:

Now you know how EUI-64 works, let’s see what it looks like on a router. I’ll use a Cisco IOS router for this and use 2001:1234:5678:abcd::/64 as the prefix:
Router(config)#interface fastEthernet 0/0
Router(config-if)#ipv6 address 2001:1234:5678:abcd::/64 eui-64
In this I configured the router with the IPv6 prefix and I used EUI-64 at the end. This is how we can automatically generate the interface ID using the mac address. Now take a look at the IPv6 address that it created:
Router#show interfaces fastEthernet 0/0 | include Hardware
Hardware is Gt96k FE, address is c200.185c.0000 (bia c200.185c.0000)
Router#show ipv6 interface fa0/0
FastEthernet0/0 is up, line protocol is up
IPv6 is enabled, link-local address is FE80::C000:18FF:FE5C:0
No Virtual link-local address(es):
Global unicast address(es):
2001:1234:5678:ABCD:C000:18FF:FE5C:0, subnet is 2001:1234:5678:ABCD::/64 [EUI]
See the C000:18FF:FE5C:0 part above? That’s the MAC address that is split in 2, FFFE in the middle and the “2” in “C200” of the MAC address has been inverted which is why it now shows up as “C000”.
When you use EUI-64 on an interface that doesn’t have a MAC address then the router will select the MAC address of the lowest numbered interface on the router.
I hope this has been useful to understand EUI-64, if you have any questions feel free to leave a comment!
No comments:
Post a Comment