Modified EUI-64 and IPv6 addressing
Modified EUI-64
One useful feature of IPv6 is that a host can generate its own IPv6 address. One common method is Modified Extended Unique Identifier 64 (EUI-64).
To build an IPv6 address this way, the host needs:
- A 64-bit network prefix (often learned from an IPv6 router), and
- A 64-bit interface ID (the host portion)
A host can also generate a link-local address using EUI-64. Since every IPv6 host already knows the link-local prefix, the main task is generating the 64-bit interface ID. With EUI-64, the host uses its MAC address as the starting point to derive that interface ID.
There’s one issue if you try to use the MAC address as-is.
Let’s say we want to generate a link-local IPv6 address for a NIC with this MAC address:
00:21:2A:B5:6E:10
It can help to rewrite the MAC address in an IPv6-like quartet format:
0021:2AB5:6E10
If the host tried to use that directly as the interface ID, the address would look like this:
FE80:0000:0000:0000:0021:2AB5:6E10:???
Notice the problem above? What is the issue here?
We are missing a quartet to complete the IPv6 address. There are 7 quartets instead of the 8 quartets required for a full IPv6 address.
The reason for this problem is that MAC addresses are 48 bits in length. If the prefix (network ID) is 64 bits and we add 48 bits from the MAC address for the interface ID (host) portion, . That gives a 112-bit address, so we’re missing 16 bits, which is exactly the size of one quartet.
EUI-64 solves this by inserting an additional 16 bits in the middle of the MAC address. Those 16 bits are 4 hex digits:
FFFE
Placing these 4 hex digits in the middle of the MAC-derived value completes the full 64-bit interface ID.
Before inserting those 16 bits, one more change is made. To support IPv6 features, the 7th bit within the MAC address is inverted. That means:
- If the 7th bit is 0, it becomes 1.
- If the 7th bit is 1, it becomes 0.
For example:
Image 242 Image Title - Inverting the 7th bit of the MAC address
The first two hex digits of the MAC address (00) represent 8 bits (4 bits per hex digit). Convert those 8 bits to binary, locate the 7th bit, and invert it. Converting back to hex changes the first two hex digits from 00 to 02.
So the modified value becomes:
0221:2AB5:6E10
Now insert FF:FE in the middle to create the full 64-bit interface ID:
Image 243 Image Title - Inserting FFFE in the middle of the MAC address to generate the 64-bit Interface ID
0221:2AFF:FEB5:6E10
The final link-local IPv6 address is:
FE80:0000:0000:0000:0221:2AFF:FEB5:6E10/64
Abbreviated with the double-colon technique:
FE80::221:2AFF:FEB5:6E10/64
IPv6 routing
IPv6 routing works very similarly to IPv4 routing (at least within the scope of the CCNA 200-301 v1.1 exam). The main difference is that IPv6 uses IPv6 addresses instead of IPv4 addresses.
IPv4 and IPv6 can also run at the same time on a router. This is called dual stack.
Enabling IPv6 on a Cisco Router
Before you configure IPv6 addresses and routes, you must enable IPv6 routing. In global configuration mode, enter:
After IPv6 routing is enabled, assign an IPv6 address to a router interface.
For example, suppose we want to use the global unicast prefix 2001:DB8:A:B::/64 and assign 2001:DB8:A:B::1/64 to the Gigabitethernet0/0 interface on R1.
On R1, enter interface configuration mode and use:
- The ipv6 address [IPv6 Prefix, Interface ID and /Prefix length] command assigns the IPv6 address.
- The no shutdown command enables the interface.
To verify the IPv6 address on the interface, use:
Image 244 Image Title - show ipv6 interface brief output on R1
Configuring Modified EUI-64 on a router interface
Instead of manually choosing the interface ID, you can have the router auto-generate it using EUI-64.
Using the same global unicast prefix 2001:DB8:A:B::/64, the router uses the MAC address on the Gigabitethernet0/0 interface to generate the full global unicast IPv6 address.
First, view the MAC address on Gigabitethernet0/0:
Image 245 Image Title - show interface gigabitethernet0/0 output on R1
Now, assuming the previous IPv6 address has been removed, configure EUI-64 on Gigabitethernet0/0:
The ipv6 address [IPv6 Prefix and /Prefix length] eui-64 command enables EUI-64 so the router can generate the interface ID from the interface’s MAC address.
Image 246 Image Title - configuring EUI-64 on the gigabitethernet0/0 interface on R1 and verifying