EUI-64 in IPv6

One of IPv6's key benefits over IPv4 is its capability for automatic interface addressing. By implementing the IEEE's 64-bit Extended Unique Identifier (EUI-64) format, a host can automatically assign itself a unique 64-bit IPv6 interface identifier without the need for manual configuration or DHCP. This is accomplished on Ethernet interfaces by referencing the already unique 48-bit MAC address, and reformatting that value to match the EUI-64 specification.

RFC 2373 dictates the conversion process, which can be described as having two steps. The first step is to convert the 48-bit MAC address to a 64-bit value. To do this, we break the MAC address into its two 24-bit halves: the Organizationally Unique Identifier (OUI) and the NIC specific part. The 16-bit hex value 0xFFFE is then inserted between these two halves to form a 64-bit address.

eui64_step1.png

Why 0xFFFE? As explained in the IEEE's Guidelines for EUI-64 Registration Authority, this is a reserved value which equipment manufacturers cannot include in "real" EUI-64 address assignments. In other words, any EUI-64 address having 0xFFFE immediately following its OUI portion can be recognized as having been generated from an EUI-48 (or MAC) address.

The second step is to invert the universal/local (U/L) flag (bit 7) in the OUI portion of the address. Globally unique addresses assigned by the IEEE originally have this bit set to zero, indicating global uniqueness. Likewise, locally created addresses, such as those used for virtual interfaces or a MAC address manually configured by an administrator, will have this bit set to one. The U/L bit is inverted when using an EUI-64 address as an IPv6 interface ID.

eui64_step2.png

Again, you're probably wondering why this is done. The answer lies buried in section 2.5.1 of RFC 2373:

The motivation for inverting the "u" bit when forming the interface identifier is to make it easy for system administrators to hand configure local scope identifiers when hardware tokens are not available. This is expected to be case for serial links, tunnel end-points, etc. The alternative would have been for these to be of the form 0200:0:0:1, 0200:0:0:2, etc., instead of the much simpler ::1, ::2, etc.

The important part to remember here is that the scope of the address never changes: global addresses are still global and local addresses are still local. Rather, the meaning of the bit is inverted for convenience, so the value of the bit must be inverted as well.

We can see this conversion in action when we assign an IPv6 address to a router interface. First, take note of the interface's MAC address (this is typically the same as its burned-in address, or BIA).

Router# show interface f0/0
FastEthernet0/0 is up, line protocol is down
  Hardware is Gt96k FE, address is 0012.7feb.6b40 (bia 0012.7feb.6b40)
...

After assigning an EUI-64-designated IPv6 address to the interface, we can verify that the interface ID has been drawn from the MAC address in the process described for both the assigned and the link local address:

Router(config)# interface f0/0
Router(config-if)# ipv6 address 2001:db8::/64 eui-64
Router(config-if)# do show ipv6 interface f0/0
FastEthernet0/0 is up, line protocol is down
  IPv6 is enabled, link-local address is FE80::212:7FFF:FEEB:6B40 [TEN]
  No Virtual link-local address(es):
  Global unicast address(es):
2001:DB8::212:7FFF:FEEB:6B40, subnet is 2001:DB8::/64 [EUI/TEN]
...

About the Author

Jeremy Stretch is a freelance networking engineer, instructor, and the maintainer of PacketLife.net. He currently lives in Fairfax, Virginia, on the edge of the Washington, DC metro area. Although primarily an R&S guy, he likes to get into everything, and runs a free network training lab out of his basement for fun. You can contact him by email or follow him on Twitter.

Comments

Just in one word that is Superb

Very solid write-up. As always, thanks much.

There is a privacy issue with this method: You can identify the computer (and with that probably the user as well) wherever it connects. To address those privacy concerns, RFC 3041 was written, which got obsoleted by RFC 4941 (Privacy Extensions for Stateless Address Autoconfiguration in IPv6)

ftp://ftp.rfc-editor.org/in-notes/rfc4941.txt

TREMENDOUS JOB OF EXPLAINING THIS NEW TOPIC THAT PERPLEXES EVERYONE !!! This is an excellent explanation. You should work for cisco !!!!!!!

Thanks a lot.

This is the good explanation that i read for IPV6 address presentations. It is easy and explains to the point.

Very good explanation. Thanks a lot

Thanks for very good and easy to understand explanation! The world become much more beautiful ;)

Explained better than the CCIE Internetwork Expert!!!

Nice work!!

Clear and concise explanation, this is great!!

This is a very clear, sharp, on the target explanation. Like it. Please keep up the good job.

thank you.

qbonita paginaa!! aprendi!! UL :p

Great article. I just wonder what if I have a MAC address beginning with somethings else than 00. Let's say AC:13:87:AF:B1:C7 ?

What do I have to do with the first byte?

Awesome.

Nice illustration..

re: first byte If I read this right, you invert that bit regardless. This can be acheived by xor'ing the first byte with 0x02.

I appredciate the explantion in simple terms. My query is what happens in serial links for which there is not MAC address. What will the EUI-64 interface identifier be ?

You know, this is the SECOND time I've used packetlife! You're bookmarked now!! (Really diggin' those big posters!). Your explaination of EUI-64 from MAC is awesome... I get it!! Thanks a bunch!!

Hey,

If anyone was wondering how the U/L bit is set to indicate global scope (the 7th bit from the InterfaceID portion is turned to 1)

First field from InterfaceID "0012" has 16bits so we know the 7th bit is there Each value being 4 bit long , 00 in hex = 0000 0000 in binary and when we turn 7th bit to 1 it will look like this: 0000 0010 which means 02 in hex So our first field from InterfaceID after we set the 7th bit will be 0212

or just add 0x02 as kjotte is saying but i didn't find an example with the actual calculation anywhere so i thougt to provide one ;-)

Better than Internetwork expert and nuggets - well done and thanks

not to be a pest but it confused me being new to ipv6 - it appears the address you made at the end is incorrect. That first E should be an F. No?

Great Stuff - you are bookmarked with other great bloggers I have found so far.

@Mike: No. It helps to read the article, particularly the paragraph which begins, "Why 0xFFFE?" ;)

WOW - I read that as all F's. Sorry - must of been late.

My bad!!!

Wondering about the /64 in the CLI statement "ipv6 address 2001:db8::/64 eui-64". In the Packet Tracer lab I have been doing to learn how to configure RIPng, Cisco has me use the following command: ipv6 address 2001:410:2:10::/65 eui-64

It seems to work, but I am having a hard time understanding exactly what the difference is between the /64 and /65 designation.

Thanks in advance for responding,

Elmer

@pottse: The /65 is most likely a typo. Autoconfigured EUI-64 addresses only work with /64 prefixes (as they're 64 bits in length).

Thankyou so much, perfect explanation!!!

The link you provide (http://standards.ieee.org/develop/regauth/tut/eui64.pdf) shows fffe and ffff in separated examples, can you elaborate on that?

Nice explanation. Very clear and concise.

Very good explanation. One question though, I am wondering about the following part,

Router(config)# interface f0/0
Router(config-if)# ipv6 address 2001:db8::/64 eui-64
Router(config-if)# do show ipv6 interface f0/0
FastEthernet0/0 is up, line protocol is down
  IPv6 is enabled, link-local address is FE80::212:7FFF:FEEB:6B40 [TEN]
  No Virtual link-local address(es):
  Global unicast address(es):
2001:DB8::212:7FFF:FEEB:6B40, subnet is 2001:DB8::/64 [EUI/TEN]
...

How did we get this IP address FE80::212:7FFF:FEEB:6B40?? I mean the initial 3 hex numbers, i.e. "FE8". I got the rest starting from 0212......

Also, what is the significance of Global Unicast Address (2001:DB8::212:7FFF:FEEB:6B40) and why it is different from link local address?

Which one is the interface IP for f0/0?

Please reply. Thanks in advance !

@Syed

Your answer lies here:
Router(config-if)# ipv6 address 2001:db8::/64 eui-64

This command sets the address of the interface to 2001:db8::/64, the parameter "eui-64" at the end of this command tells the router to generate the last 64 bits using EUI-64.

As to your other questions. Per IPv6 protocol, each interface MUST have a locally scoped IPv6 address (called a Link Local Address, or LLA). IANA has reserved FE80::/10 for this very purposes -- this network exists on EACH IPv6 link, all over the world, but is not allowed to be routed. Hence, when you enabled IPv6 on fe0/0 (by configuring an IPv6 address), your router automatically generated the (required) Link Local Address.

A Link Local Address is only valid on a particular link. Your router (using its Link Local Address) can speak to other machines on the same network (using their LLA), but it can't use its LLA address to speak across/beyond another router. To do that, it must use another type of address: Global Unicast address.

In short, a Link Local Address can only be used for local network communication, while a Global Unicast address can be used anywhere on the IPv6 Internet (to include the local network).

Hope this helps.

hi thanks a million i really like the way you've explained the EUI-64 :)

Router(config)#interface serial 0/0/0
Router(config-if)#ipv6 address 2001:db8:1:1::/64 eui-64

EUI-64 generate last 64-bit from MAC address BUT...
if I use this command on serial interface, since Serial interface doesn't has MAC address. Where it's came from??

Thanks!!!! It's what I was looking for!!!!

I am looking for example of connection two routers by ospfv3 with IPv6

Answer to Erdal

Cisco router takes lowest available MAC address for serial links.

Leave a Comment


Register to comment as a member. You'll look cooler.

Optional; will not be displayed publicly or given out.

No commercial links. Only personal (e.g. blog, Twitter, or LinkedIn) and/or on-topic links, please.
What is the decimal equivalent of 0x1809?