Skip to content

Beginner · Subnetting practice and IPv6 · topic 20 of 57 · 35 min

IPv6 address types, EUI-64, SLAAC and NDP

Explanation

IPv6 has global unicast addresses (2000::/3), link-local addresses (fe80::/10) on every interface, unique local addresses (fd00::/8 in practice), loopback ::1, the unspecified address ::, multicast (ff00::/8) and anycast, but no broadcast. Devices can build their own address with SLAAC, using EUI-64 or a random interface ID, or get one from DHCPv6. NDP, built on ICMPv6, replaces ARP.

The address types

TypePrefixLooks likeIPv4 cousinUsed for
Global unicast2000::/32001:db8:acad:1::10Public addressReachable on the internet
Link-localfe80::/10fe80::1169.254.x.x (roughly)Talking on the local link only; never routed
Unique localfc00::/7 (fd00::/8 in practice)fd12:3456:789a:1::5RFC 1918 privateInternal addresses inside an organisation
Loopback::1/128::1127.0.0.1This device
Unspecified::/128::0.0.0.0"No address yet", e.g. during start-up
Multicastff00::/8ff02::1224.0.0.0/4One to a group

Global unicast addresses currently come from 2000::/3, which means they start with 2 or 3. Link-local addresses are created automatically on every IPv6 interface. They work only on that one link (the cable or Wi-Fi segment), and routers never forward them. Neighbour discovery and routing protocols such as OSPFv3 use them, and a router's link-local address is what hosts use as their default gateway.

Unique local addresses (ULA, RFC 4193) are the IPv6 version of private addresses. The defined range is fc00::/7, but only the fd00::/8 half is used, with a random 40-bit number after fd so that two companies that merge are unlikely to clash.

Multicast, anycast and no broadcast

IPv6 has no broadcast at all. Jobs that IPv4 did with broadcast are done with multicast, so only interested devices are disturbed. Well-known groups: ff02::1 is all nodes on the link, ff02::2 is all routers on the link. Each address also joins a solicited-node multicast group (ff02::1:ff followed by the last 24 bits of the address), which NDP uses instead of ARP broadcasts.

Anycast means the same unicast address is configured on several devices, and the network delivers a packet to the nearest one. Large DNS services use anycast so that users reach a server close to them. An anycast address looks exactly like a unicast address.

EUI-64: making an interface ID from a MAC address

A /64 network leaves 64 bits for the interface ID. A MAC address is only 48 bits, so modified EUI-64 stretches it: split the MAC in half, put fffe in the middle, and flip the 7th bit of the first byte (the universal/local bit, value 2).

  1. MAC address 00:1A:2B:3C:4D:5E.
  2. Split into halves: 001A2B and 3C4D5E.
  3. Insert FFFE: 001A2B FFFE 3C4D5E.
  4. First byte 00 is 00000000. Flip the 7th bit: 00000010, which is 02.
  5. Interface ID: 021a:2bff:fe3c:4d5e. With the link-local prefix this gives fe80::21a:2bff:fe3c:4d5e.

Second example: MAC 0c:5a:9e:12:34:56. First byte 0c is 00001100; flipping the 7th bit gives 00001110, which is 0e. Interface ID 0e5a:9eff:fe12:3456.

Tip: Cisco routers use EUI-64 for their link-local addresses by default. Windows, macOS, Android and iOS normally use random interface IDs instead, so that a phone's MAC address is not visible in every address it uses.

How hosts get an address: SLAAC and DHCPv6

  • SLAAC (Stateless Address Autoconfiguration): the router sends a Router Advertisement with the /64 prefix. The host adds its own interface ID (EUI-64 or random) and checks nobody else uses it. No server keeps track, which is why it is called stateless.
  • Stateless DHCPv6: the host makes its address with SLAAC, then asks a DHCPv6 server only for extra information such as DNS servers. The RA has the O (other configuration) flag set.
  • Stateful DHCPv6: a DHCPv6 server hands out addresses and remembers who has which, like DHCP in IPv4. The RA has the M (managed) flag set.

NDP: Neighbor Discovery Protocol

NDP uses ICMPv6 messages and replaces ARP and more. There are four messages to know, plus Redirect.

MessageICMPv6 typeSent byJob
Router Solicitation (RS)133Host, to ff02::2"Any routers here? Send me your prefix."
Router Advertisement (RA)134Router, to ff02::1 or the asking hostPrefix, default gateway, M and O flags
Neighbor Solicitation (NS)135Any device, to a solicited-node group"What is your MAC?" (like an ARP request); also used for duplicate address detection
Neighbor Advertisement (NA)136The owner of the address"Here is my MAC" (like an ARP reply)

Cisco IOS configuration

output
R1(config)# ipv6 unicast-routing
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ipv6 address 2001:db8:1:1::1/64
R1(config-if)# ipv6 address fe80::1 link-local
R1(config-if)# no shutdown
R1(config-if)# interface GigabitEthernet0/1
R1(config-if)# ipv6 address 2001:db8:1:2::/64 eui-64
R1(config-if)# no shutdown
R1(config-if)# interface GigabitEthernet0/2
R1(config-if)# ipv6 address autoconfig
R1(config-if)# end
R1# show ipv6 interface brief
GigabitEthernet0/0     [up/up]
    FE80::1
    2001:DB8:1:1::1
GigabitEthernet0/1     [up/up]
    FE80::21A:2BFF:FE3C:4D5E
    2001:DB8:1:2:21A:2BFF:FE3C:4D5E
Cisco IOS: ipv6 unicast-routing turns on IPv6 routing (and sending RAs). eui-64 builds the interface ID from the MAC; autoconfig makes the interface a SLAAC client. Output shortened.

Common mistakes

Careful: Forgetting ipv6 unicast-routing. Without it, the router has IPv6 addresses on its interfaces but does not route IPv6 packets between them or send Router Advertisements, so SLAAC hosts get no prefix or gateway.
  • Forgetting to flip the 7th bit in EUI-64: 00:1A:2B... gives 021a, not 001a.
  • Expecting to ping a link-local address without saying which interface: the same fe80:: prefix exists on every link, so the device must be told which one to use.
  • Looking for an IPv6 broadcast address. There is none; use multicast groups such as ff02::1.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

IPv6 address types, EUI-64, SLAAC and NDP · 1/8

IPv6 address types

IPv6 has several kinds of addresses. Let us meet them, then see how a device gets its address automatically.

Prefer a video by a teacher? Find free videos on “ipv6 address types eui-64 slaac ndp ccna” on YouTube ↗

In real life: Dual-stack Wi-Fi at a startup in Gurugram

A fintech startup turns on IPv6 next to IPv4 (dual stack) on its office Wi-Fi. The network engineer configures ipv6 unicast-routing and a /64 from the company's /48 on the Wi-Fi VLAN interface of the core switch. Laptops and phones receive the Router Advertisement, build their own addresses with SLAAC (random interface IDs, so no MAC addresses leak), and get DNS from stateless DHCPv6. When a developer cannot reach the staging server over IPv6, the engineer checks show ipv6 interface brief and finds the VLAN interface was shut down.

python
import ipaddress

for text in ["2001:db8:acad:10::25", "fe80::1", "fd3e:8a1c:44b2::9", "ff02::2", "::1"]:
    a = ipaddress.ip_address(text)
    print(text, a.is_global, a.is_link_local, a.is_private, a.is_multicast, a.is_loopback)
The ipaddress module also understands IPv6 address types.

Practice (0/4 done)

Task 1 · Code · Python

The key step of EUI-64 is flipping the 7th bit of the first byte (the bit worth 2). Write flip_u_bit(byte_hex) that takes the first byte as two hex digits and returns it with that bit flipped, as two lowercase hex digits. Example: "00" gives "02" and "0c" gives "0e". Hint: int(byte_hex, 16) ^ 2 flips the bit, and format(n, "02x") writes it back.

Task 2 · Code · Python

Write eui64(mac) that returns the modified EUI-64 interface ID as four groups of four lowercase hex digits joined by colons. The MAC may use ":" or "-" between bytes, or Cisco style dots (001a.2b3c.4d5e). Example: eui64("00:1A:2B:3C:4D:5E") returns "021a:2bff:fe3c:4d5e".

Task 3 · Code · Python

Write ipv6_type(text) that returns "loopback" (::1), "unspecified" (::), "multicast" (ff00::/8), "link-local" (fe80::/10), "unique-local" (fc00::/7), "global-unicast" (2000::/3) or "other". Use the ipaddress module and the in operator.

Task 4 · Question

Which NDP message does an IPv6 host send to find the MAC address of a neighbour, doing the job of an ARP request?

Quick quiz

Question 1

1.Which prefix do link-local addresses use?

Question 2

2.What replaces broadcast in IPv6?

Question 3

3.What is the EUI-64 interface ID for MAC 00:50:56:AB:CD:EF?

Question 4

4.Which IOS command must you enter before a router will route IPv6 and send Router Advertisements?

Question 5

5.With SLAAC, where does the host get its /64 prefix from?

Question 6

6.Which address is a unique local address?

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

Which prefix do link-local addresses use?

Answer: fe80::/10

Link-local addresses are in fe80::/10 and are never routed.

What replaces broadcast in IPv6?

Answer: Multicast

IPv6 has no broadcast. Multicast groups such as ff02::1 (all nodes) do that job.

What is the EUI-64 interface ID for MAC 00:50:56:AB:CD:EF?

Answer: 0250:56ff:feab:cdef

Split into 005056 and ABCDEF, insert FFFE, and flip the 7th bit: 00 becomes 02.

Which IOS command must you enter before a router will route IPv6 and send Router Advertisements?

Answer: ipv6 unicast-routing

ipv6 unicast-routing is the global command that turns on IPv6 routing.

With SLAAC, where does the host get its /64 prefix from?

Answer: A Router Advertisement

The router sends the prefix in a Router Advertisement; the host adds its own interface ID.

Which address is a unique local address?

Answer: fd00:1:2::10

Unique local addresses come from fc00::/7, and in practice start with fd.

Why do private addresses and NAT exist?Related

Answer: Because there are not enough public IPv4 addresses for every device

IPv4 has about 4.3 billion addresses, fewer than the number of devices. Private ranges are reused everywhere and NAT shares a few public addresses.

From IPv4 address structure and special ranges

A PC at 192.168.1.10/24 sends a packet to 172.16.5.5. Which MAC address will the frame carry as its destination?Related

Answer: The MAC of the default gateway

172.16.5.5 is in another network, so the frame goes to the gateway.

From ARP, the default gateway and ping

What is the Ethernet broadcast MAC address written in Cisco format?Related

Answer: ffff.ffff.ffff

Broadcast is all ones. 255.255.255.255 is the IPv4 broadcast, not a MAC address.

From Ethernet frames and MAC addresses

Is 192.168.0.255/23 a usable host address?Related

Answer: Yes, the subnet runs from 192.168.0.0 to 192.168.1.255

In a /23 the broadcast is 192.168.1.255. 192.168.0.255 is in the middle of the range, so it is a normal host.

From Network, broadcast and usable host range

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. This is the last topic of “Subnetting practice and IPv6”. The module exam comes next.
  2. Module 4 exam: Subnetting practice and IPv6 · 13 questions · 25 min, without help. 5 topics of this module still to finish first.
  3. Then the next module, Switching and VLANs. 57 topics left in the course before the final exam.

← Previous: IPv6 addresses: format and shortening rules