Network Infrastructure and Connectivity · Topic 6 of 9

IPv6 Practice: Address Types, Prefixes and EUI-64

Worked IPv6 practice: shorten and expand addresses, spot invalid ones, name unicast types, size /64 subnets and build modified EUI-64 interface IDs.

  • 6 min
In a nutshell
  • Drop leading zeros only, and use :: once for the longest zero run.
  • A valid address expands to eight groups of at most four hex digits.
  • Global unicast starts with 2 or 3, unique local with FC or FD, link-local with FE80.

What it is

IPv6 addressing is mostly rewriting and counting, and both are easy to get wrong without practice.

This page works through shortening and expanding, spotting invalid addresses, naming unicast types, sizing /64 subnets, and building modified EUI-64 interface IDs from MAC addresses. Every answer shows its steps.

Work each problem on paper first, then compare.

How it works

Shortening and expanding are the same two rules in opposite directions, and EUI-64 is three steps on a MAC address.

MAC00:1A:2B:3C:4D:5Esplit and insert FFFERaw ID001A:2BFF:FE3C:4D5Eflip bit 7 of the first byteInterface ID021A:2BFF:FE3C:4D5Eadd the prefixAddress2001:DB8:1:1:21A:2BFF:FE3C:4D5E

For shortening: drop leading zeros in every group, then replace the longest run of all-zero groups with ::, once only.

Problem 1: shorten 2001:0DB8:0000:0000:0042:0000:0000:0001

Dropping leading zeros gives 2001:DB8:0:0:42:0:0:1. There are two runs of two zero groups, the same length, so by convention you replace the first.

  • Answer: 2001:DB8::42:0:0:1

Problem 2: shorten 2001:0DB8:00A0:0000:0000:0000:0000:0100

Dropping leading zeros gives 2001:DB8:A0:0:0:0:0:100. The longest zero run is the four groups in the middle.

  • Answer: 2001:DB8:A0::100

Problem 3: expand 2001:db8::1 and FE80::A:B

Count the groups shown, fill the gap with zero groups until there are eight, and pad each group to four digits.

  • 2001:db8::1 shows 3 groups, so 5 are missing: 2001:0db8:0000:0000:0000:0000:0000:0001
  • FE80::A:B shows 3 groups, so 5 are missing: FE80:0000:0000:0000:0000:0000:000A:000B

Problem 4: which are invalid?

AddressValid?Reason
2001:DB8::1::2No:: appears twice
2001:DB8:G::1NoG is not a hex digit
2001:DB8:0:0:0:0:0:0:1NoNine groups, the maximum is eight
2001:DB8:12345::1NoA group has five digits, the maximum is four
2001:DB8::1YesOne ::, valid groups
Watch out

Trailing zeros are never dropped. The group 0100 shortens to 100, not to 1.

Problem 5: name the unicast type

AddressTypeHow you can tell
2001:DB8::1Global unicastStarts with 2, inside 2000::/3
3001:DB8::1Global unicastStarts with 3, inside 2000::/3
FE80::1Link-localFE80::/10
FD12:3456:789A::1Unique localFC00::/7, FD in practice
::1LoopbackOnly the last bit is 1

Only global unicast addresses are routed on the internet. Note that 2001:DB8::/32 is reserved for documentation, so it never appears on real networks.

Problem 6: subnets from 2001:DB8:ACAD::/48

A /48 leaves 16 bits, the fourth group, between the /48 and the /64 boundary. That is the subnet ID.

  • Number of /64 subnets: 2 to the power 16 is 65,536
  • VLAN 10 written in hex is A, so its subnet is 2001:DB8:ACAD:A::/64
  • VLAN 20 is 14 in hex, so its subnet is 2001:DB8:ACAD:14::/64, and a host with interface ID 5 is 2001:DB8:ACAD:14::5/64

Many designs reuse the decimal digits instead, so VLAN 20 becomes 2001:DB8:ACAD:20::/64. Either is valid if the plan is consistent.

Problem 7: counting subnets

Each 4 bits of prefix length gives 16 times as many /64 subnets.

  • A /56 holds 2 to the power 8, which is 256 subnets.
  • A /60 holds 2 to the power 4, which is 16 subnets.
  • A /52 holds 2 to the power 12, which is 4,096 subnets.

Problem 8: MAC 00:1A:2B:3C:4D:5E

  1. Split in the middle: 00:1A:2B and 3C:4D:5E.
  2. Insert FFFE: 001A:2BFF:FE3C:4D5E.
  3. Flip the seventh bit of the first byte: 00 becomes 02.
  • Interface ID: 021A:2BFF:FE3C:4D5E
  • With prefix 2001:DB8:1:1::/64: 2001:DB8:1:1:21A:2BFF:FE3C:4D5E
  • Link-local: FE80::21A:2BFF:FE3C:4D5E
Exam tip

The flip changes the second hex digit of the first byte by 2. Digits 0, 1, 4, 5, 8, 9, C and D add 2. Digits 2, 3, 6, 7, A, B, E and F subtract 2.

Problem 9: MAC 02:00:5E:10:00:01

The raw ID is 0200:5EFF:FE10:0001. The first byte 02 has second digit 2, which subtracts 2 to give 0.

  • Interface ID: 0000:5EFF:FE10:0001
  • With prefix 2001:DB8:1:1::/64: 2001:DB8:1:1:0:5EFF:FE10:1

Problem 10: MAC FC:99:47:75:CE:E0

The raw ID is FC99:47FF:FE75:CEE0. The first byte FC has second digit C, which adds 2 to give E.

  • Interface ID: FE99:47FF:FE75:CEE0

Problem 11: work backwards

Given the interface ID 0211:22FF:FE33:4455, find the MAC.

  1. Flip the bit back: 02 becomes 00.
  2. Remove FFFE from the middle.
  3. Rejoin: 00:11:22 and 33:44:55 give 00:11:22:33:44:55.

Problem 12: let the router build it

An interface has MAC address 0050.56aa.bbcc.

interface GigabitEthernet0/0
 ipv6 address 2001:DB8:1:1::/64 eui-64

The interface ID is 0250:56FF:FEAA:BBCC, so show ipv6 interface brief lists 2001:DB8:1:1:250:56FF:FEAA:BBCC.

Router# show ipv6 interface brief
GigabitEthernet0/0     [up/up]
    FE80::250:56FF:FEAA:BBCC
    2001:DB8:1:1:250:56FF:FEAA:BBCC

On many Cisco interfaces, the automatic link-local address is also built with EUI-64 from the interface MAC address.

Common mistakes

Flipping the wrong bit. It is the seventh bit of the first byte, which turns 00 into 02, not into 80.

Forgetting FFFE. The MAC has 48 bits and the interface ID needs 64.

Treating ::1 as global. It is the loopback address.

Counting the wrong bits. The number of /64 subnets comes from the bits between the allocated prefix and /64.

Mixing hex and decimal in a subnet ID. VLAN 100 is 64 in hex, but a design may also write it as 100.

What to remember for the exam

  • Drop leading zeros only, and use :: once for the longest zero run.
  • A valid address expands to eight groups of at most four hex digits.
  • Global unicast starts with 2 or 3, unique local with FC or FD, link-local with FE80.
  • In a /48, the fourth group is the subnet ID. /48 holds 65,536 /64s, /56 holds 256, /60 holds 16.
  • EUI-64 splits the MAC, inserts FFFE and flips bit 7 of the first byte.
  • The flip changes the second hex digit of the first byte by 2.
  • A link-local address is FE80:: plus the interface ID.

Check yourself

  • What type of address is FD00:1::5?

    Unique local.

  • What is the EUI-64 interface ID for MAC 00:50:56:AA:BB:CC?

    0250:56FF:FEAA:BBCC.

  • Which MAC address gives the interface ID 0000:5EFF:FE10:0001?

    02:00:5E:10:00:01.

Topic 6 of 9 in Network Infrastructure and Connectivity

Test yourself on Network Infrastructure and Connectivity

The full Cisco CCNA 200-301 v2.0 question bank has 1,242 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.