Beginner · Subnetting practice and IPv6 · topic 20 of 57 · 35 min
IPv6 address types, EUI-64, SLAAC and NDP
Explanation
The address types
| Type | Prefix | Looks like | IPv4 cousin | Used for |
|---|---|---|---|---|
| Global unicast | 2000::/3 | 2001:db8:acad:1::10 | Public address | Reachable on the internet |
| Link-local | fe80::/10 | fe80::1 | 169.254.x.x (roughly) | Talking on the local link only; never routed |
| Unique local | fc00::/7 (fd00::/8 in practice) | fd12:3456:789a:1::5 | RFC 1918 private | Internal addresses inside an organisation |
| Loopback | ::1/128 | ::1 | 127.0.0.1 | This device |
| Unspecified | ::/128 | :: | 0.0.0.0 | "No address yet", e.g. during start-up |
| Multicast | ff00::/8 | ff02::1 | 224.0.0.0/4 | One 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).
- MAC address 00:1A:2B:3C:4D:5E.
- Split into halves: 001A2B and 3C4D5E.
- Insert FFFE: 001A2B FFFE 3C4D5E.
- First byte 00 is 00000000. Flip the 7th bit: 00000010, which is 02.
- 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.
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.
| Message | ICMPv6 type | Sent by | Job |
|---|---|---|---|
| Router Solicitation (RS) | 133 | Host, to ff02::2 | "Any routers here? Send me your prefix." |
| Router Advertisement (RA) | 134 | Router, to ff02::1 or the asking host | Prefix, default gateway, M and O flags |
| Neighbor Solicitation (NS) | 135 | Any device, to a solicited-node group | "What is your MAC?" (like an ARP request); also used for duplicate address detection |
| Neighbor Advertisement (NA) | 136 | The owner of the address | "Here is my MAC" (like an ARP reply) |
Cisco IOS configuration
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:4D5ECommon mistakes
- 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 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.
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)Practice (0/4 done)
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.
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".
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.
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
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Subnetting drills for exam speedSubnetting practice and IPv6 · same module
- VLSM: subnets of different sizesSubnetting practice and IPv6 · same module
- Ethernet frames and MAC addressesEthernet, MAC addresses and the Cisco CLI
- Network, broadcast and usable host rangeIPv4 addressing
- DHCP: automatic addressesIP services: DHCP, DNS, NAT and more
- Static and default routesRouting: static routes and OSPF
Questions people ask about this
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.
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.
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.
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.
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
- This is the last topic of “Subnetting practice and IPv6”. The module exam comes next.
- Module 4 exam: Subnetting practice and IPv6 · 13 questions · 25 min, without help. 5 topics of this module still to finish first.
- Then the next module, Switching and VLANs. 57 topics left in the course before the final exam.