IPv6 EUI-64 explained

This topic is to discuss the following lesson:

1 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:

R1#show interfaces GigabitEthernet 1 | include bia
  Hardware is CSR vNIC, address is fa16.3e60.0217 (bia fa16.3e60.0217)

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:

R1#show ipv6 interface GigabitEthernet 1 | include link-local
  IPv6 is enabled, link-local address is FE80::F816:3EFF:FE60:217

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:

F816:3EFF:FE60:0217

We only care about the first two hexadecimal characters:

F8 = 1111 1000

As you can see, the 7th bit has been inverted from 1 to 0.

Letā€™s see what happens when we change the 7th bit in the MAC address, right now it starts with fa:

fa = 1111 1010

Letā€™s make it:

f8 = 1111 1000

R1(config)#interface gigabitEthernet 1
R1(config-if)#mac-address f816.3e60.0217

Our IPv6 address has become:

R1#show ipv6 interface GigabitEthernet 1 | include link-local
  IPv6 is enabled, link-local address is FE80::FA16:3EFF:FE60:217

The complete uncompressed address is:

FE80:0000:0000:0000:0000:FA16:3EFF:FE60:0217

Hereā€™s the EUI-64 part:

FA16:3EFF:FE60:0217

First two hexadecimal characters:

FA = 1111 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.

Hope this helps!

Rene

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.

Rene, So when manually configuring an IPv6 say for link local, itā€™s not just stuffing the MAC address with FFFE in the middle - you have to pay attention to inverting the 7th bit in the 1st 2 hexadecimal numbers correct? I have seen some videos where there is no mention of inverting bit 7. Thanks

Hi Itai,

Oopsā€¦the FFFF is a typo indeed, that should be 1111. Just fixed it.

When you use EUI-64 to automatically use the MAC address as input for the ā€œhostā€ part then the 7th bit will be inverted, this is all done automatically though.

If you make up some IPv6 addresses of your own then you can pick whatever addresses you likeā€¦

Rene

Hi Rene, Do you have an example of an interface with EUI-64 and without EUI-64? I understand that EUI-64 modify the Link Local and Global Unicast.

What happen if I want to configure an Unique Local?

Hi Diana,

Hereā€™s an example:

R1#show ipv6 interface GigabitEthernet 0/1
GigabitEthernet0/1 is up, line protocol is up
  IPv6 is enabled, link-local address is FE80::F816:3EFF:FEE6:7777

Thatā€™s the IPv6 link-local address that uses EUI-64. You can configure it manually if you want:

R1(config)#int gi0/1                                                      
R1(config-if)#ipv6 address FE80:1111:1111:1111:ABCD:ABCD:ABCD:ABCD link-local
R1#show ipv6 interface GigabitEthernet 0/1 | include FE80
  IPv6 is enabled, link-local address is FE80:1111:1111:1111:ABCD:ABCD:ABCD:ABCD

Hereā€™s a global unicast address with EUI-64:

R1(config-if)#ipv6 address 2001:1111:1111:1111::/64 eui-64

R1#show ipv6 interface GigabitEthernet 0/1 | include 2001:
    2001:1111:1111:1111:F816:3EFF:FEE6:7777, subnet is 2001:1111:1111:1111::/64

If you donā€™t want to use EUI-64 then you can configure global unicast addresses yourself:

R1(config-if)#ipv6 address 2001:1111:1111:1111:ABCD:ABCD:ABCD:ABCD/64

R1#show ipv6 interface GigabitEthernet 0/1 | include ABCD 
    2001:1111:1111:1111:ABCD:ABCD:ABCD:ABCD, subnet is 2001:1111:1111:1111::/64 
    FF02::1:FFCD:ABCD

Thatā€™s it. Hope this helps.

Rene

Rene - If Iā€™m getting my head wrapped around this correct then the following grid maps all possible bit combinations at the 7th as discussed:

HEX DEC BINARY INVERSE HEX DEC
0 0 0000 0010 2 2
1 1 0001 0011 3 3
2 2 0010 0000 0 0
3 3 0011 0001 1 1
4 4 0100 0110 6 6
5 5 0101 0111 7 7
6 6 0110 0100 4 4
7 7 0111 0101 5 5
8 8 1000 1010 A 10
9 9 1001 1011 B 11
A 10 1010 1000 8 8
B 11 1011 1001 9 9
C 12 1100 1110 E 14
D 13 1101 1111 F 15
E 14 1110 1100 C 12
F 15 1111 1101 D 13

If that all holds true then the underlying form is +2/+2/-2/-2 transitioning on every fourth place (0,4,8,12):

HEX DEC FORM MARKS HEX DEC
0 0 +2 0 2 2
1 1 +2 3 3
2 2 -2 0 0
3 3 -2 1 1
4 4 +2 4 6 6
5 5 +2 7 7
6 6 -2 4 4
7 7 -2 5 5
8 8 +2 8 A 10
9 9 +2 B 11
A 10 -2 8 8
B 11 -2 9 9
C 12 +2 12 E 14
D 13 +2 F 15
E 14 -2 C 12
F 15 -2 D 13

So instead of breaking all the binary out, my CCNA brain dump sheet could look like this:

HEX FORM INVERSE
0 +2 2
1 +2 3
2 -2 0
3 -2 1
4 6
8 A(10)
C(12) E(14)

Or even:

HEX FORM
0 +2
1 +2
2 -2
3 -2
4
8
C(12)

Iā€™m just looking for a way to shortcut this so I donā€™t have to burn time in the test fiddling bits. Does this look like a reliable shortcut in your opinion?

Hi Joel,

First of all, I wouldnā€™t worry too much about this too much. The bit flipping is just one minor sub-topic of all IPv6 related stuff you can expect in the exam. Itā€™s possible that you donā€™t get any questions about it so donā€™t stress about it too much. You can expect a lot of regular subnetting questions so thatā€™s why I highly recommend a ā€œcheat sheetā€ for that.

It seems this list would work. It might be a quick method if youā€™d get 10 bit flipping questions but if you only would get 1 question, it might be just as fast to quickly calculate it?

hex > binary > flip 7th bit> hex

So for example:

hex: 12 =binary: 0001 0010

flip 7th bit:

binary: 0001 0000

back to hex:

10

And we are done.

1 Like

Hi Rene,
In the case of multiple IPv6 addresses on a single interface, is it still possible to use the EUI-64 and how?

Hello Nadav,

That is no problem, the prefix is different so you will have a unique 128-bit IPv6 address. Hereā€™s an example:

R1(config)#interface GigabitEthernet 0/1
R1(config-if)#ipv6 address 2001:DB8:1:1::/64 eui-64 
R1(config-if)#ipv6 address 2001:DB8:2:2::/64 eui-64 
R1(config-if)#ipv6 address 2001:DB8:3:3::/64 eui-64

Gets you:

R1#show ipv6 interface brief | include 2001
    2001:DB8:1:1:F816:3EFF:FE42:B409
    2001:DB8:2:2:F816:3EFF:FE42:B409
    2001:DB8:3:3:F816:3EFF:FE42:B409

Rene

1 Like

Hi Rene,
Just wanted to know how will the host compute itā€™s interface ID when the IPv6 router sending the RAā€™s has a subnet greater that /64 (say /80). How will the host compute itā€™s interface ID with EUI-64 enabled.
I check on some vendor equipment and found that they donā€™t support subnet greater than /64.
I just want to know how will the host behave in this case.

Br,

Hello Nadav

This is an excellent question. According to RFC 5375 in section B.2.4 EUI-64 ā€˜uā€™ and ā€˜gā€™ Bits, it states the following:

When using subnet prefix lengths other than /64, the interface
identifier cannot be in Modified EUI-64 format as required by
[RFC4291]. However, nodes not aware that a prefix length other than
/64 is used might still think itā€™s an EUI-64; therefore, itā€™s prudent
to take into account the following points when setting the bits.

The document continues to state several considerations that should be checked carefully. In general, depending primarily on the vendor, using a prefix other than /64 may be possible in conjunction with EUI-64 IPv6 address computation, however, because it may have unpredictable results, itā€™s a good idea not to implement it.

I hope this has been helpful!

Laz

2 Likes

Im a little bit confused. The lesson first says that ā€œThe 7th bit represents the universal unique bit. A ā€œbuilt inā€ MAC address will always have this bit set to 0ā€. But then we proceed looking at examples that all have MAC with this bit at ā€˜1ā€™. SO it can be either? Then why do we need to flip it at all? Seems depending on MAC we would be flipping it either to 0 or to 1. So what is it accomplishing? Seems at worst we stop having it been unique - original mac should be unique, if we change on bit it creates the (however remote) possibility that there is actually MAC deferring from out MAC by exactly one bit. In the end the question is what is this ā€˜universal unique bitā€™ anyway? Clearly no bit can be unique by definition (there are only 2 of them) nor could be their position of ā€˜7ā€™. So whats in its name and what exactly is the need for it?

Hello Vadim

MAC addresses can either be universally administered addresses (UAA) or locally administered addresses (LAA). A UAA is one that has been uniquely assigned to a device by its manufacturer using the appropriate OUI and a unique remainder of the address. This ensures uniqueness worldwide.

An LAA is one that is manually assigned by an administrator or a protocol. An example of such a MAC address is the virtual MAC used in HSRP.

So how do you know if a MAC is universally or locally administered? By looking at the 7th bit. This bit is actually called the Universal/Local bit or U/L bit. When it is set to ā€œ1ā€ the address is an LAA. When it is set to ā€œ0ā€ it is a UAA.

Now, when applied to IPv6 and the EUI-64 process, the meaning of the U/L bit is reversed. Specifically, 1 means universal and 0 means local. This is why, when determining the IPv6 address from the MAC address, this bit is flipped. The result is, if you see this bit as a 1 in the IPv6 address, you know that the original MAC address that it was derived from was a UAA. If you see this bit as 0 in the IPv6 address, you know that the original MAC address that it was derived from was an LAA.

All of this is just a convention, a methodology that is simply applied by definition.

Yes, it can be either. But what it is originally tells us if the MAC address was universally or locally administered.

I hope this has been helpful!

Laz

Ok, thanks, now it comes in a new light. Or rather just ā€˜in lightā€™ :slight_smile: . We simply have to flip the bit because IPV6 ā€˜thinksā€™ the 1 better than 0 identifies the address as unique. Thank you.

1 Like

Hi Guys - Iā€™ve read that EUI-64 ā€œautomatically assign itself a unique 64-bit IPv6 interface identifier without the need for manual configuration or DHCP.ā€

I appreciate that the unique address is automatically generated but surely manual configuration still has to take place for each interface on your device? Eg.

Router(config-if)#ipv6 address 2001:1234:5678:abcd::/64 eui-64

If I have 32 interfaces on my router I still have to enter this command 32 times no? DHCP would truly automatically assign 32 addresses in an instant?

Thanks,

Gareth.