IPv6
Core14
Why do we need IPv6, and what does it fix besides the number of addresses?
Say this first
IPv4 has about 4.3 billion addresses and the free pools are gone: IANA handed out its last blocks in 2011 and the regional registries ran dry after that. Every workaround (NAT, CGNAT, buying addresses) costs money and breaks end-to-end connectivity. IPv6 has 128-bit addresses, so address space stops being the constraint. It also cleans up the protocol: a fixed 40-byte header, no broadcast, built-in autoconfiguration with SLAAC, and no fragmentation by routers.
Go deeper
The address problem
- 2^32 is about 4.3 billion, and a large part of that is reserved (multicast, private, loopback, class E).
- IANA allocated its last /8 blocks in February 2011. APNIC hit its final-block policy in 2011, RIPE NCC in 2012 and ARIN ran out in 2015. New IPv4 space now comes from the transfer market.
What the workarounds cost
- NAT and CGNAT need state on a box in the path, run out of ports, and force you to log every port block if you must trace a user later.
- Inbound connections, peer-to-peer, some VoIP and games need extra tricks (port forwarding, STUN, ALGs).
- Mergers collide: two companies both using
10.0.0.0/8is a classic integration project. - Cloud providers now charge for public IPv4 (AWS has billed every public IPv4 address since 2024).
What IPv6 changes
Area IPv4 IPv6 Address size 32 bits 128 bits Header 20 to 60 bytes, checksum fixed 40 bytes, no checksum Options in the header extension headers Fragmentation routers and hosts source host only Address resolution ARP broadcast NDP over ICMPv6 multicast Host config DHCP or static SLAAC, DHCPv6 or static Where it stands
Mobile carriers run large IPv6-only networks with 464XLAT, and close to half of the users reaching Google do it over IPv6. Enterprises lag, mostly because IPv4 with NAT still works inside the building.
They will ask next
If NAT works, why should an enterprise bother?
Because the internet side is moving. Mobile users are often IPv6-native, CGNAT in front of them adds latency and shared-address problems, and cloud IPv4 costs money. Running dual-stack now means you learn it on your own schedule instead of during an acquisition or a cloud migration.
Is IPv6 more secure than IPv4?
No. IPsec support used to be a MUST for IPv6 nodes, but it was relaxed to a SHOULD (RFC 6434), and nobody turns it on by default anyway. IPv6 has a different attack surface (rogue RAs, NDP spoofing, extension headers) and needs the same care as IPv4.
Traps
- Saying IPv6 is more secure because of IPsec. That was a myth even when the RFC said MUST.
- Saying NAT is a security feature you lose. The stateful firewall does the protecting, not the address translation.
How did you do?Book 4.2 IP Version 6Own pageDescribe the format of an IPv6 address.
Say this first
128 bits written as eight groups of 16 bits (hextets), each as up to four hex digits, separated by colons. The prefix length follows a slash, like
2001:db8:acad:10::1/64. On a LAN the first 64 bits are the network prefix (global routing prefix plus subnet ID) and the last 64 bits are the interface ID.Go deeper
The pieces
Output 2001:0db8:acad:0010:0000:0000:0000:0001/64 |-- global routing prefix --|subnet|----- interface ID -----| 48 bits 16 bits 64 bits- Each hex digit is 4 bits (a nibble), so prefix lengths on multiples of 4 line up with digits. That is why address plans use /48, /52, /56, /60, /64.
- Letters are case-insensitive. Write them lowercase (RFC 5952). Cisco shows them uppercase anyway.
- There is no subnet mask. You always write the prefix length.
Where the notation bites
- URLs: wrap the address in brackets so the colons do not look like a port:
http://[2001:db8::10]:8080/. - Link-local: the same
fe80::address can exist on every interface, so hosts need a zone ID:ping fe80::1%eth0on Linux,ping fe80::1%12on Windows. - IPv4 inside IPv6: the last 32 bits may be written dotted, as in
::ffff:192.0.2.1or64:ff9b::192.0.2.33.
Quick numbers
Block Contains /32 65,536 /48s /48 65,536 /64s /56 256 /64s /64 2^64 addresses, about 1.8 x 10^19 They will ask next
How many /64 subnets does a site with a /48 have?
2^(64-48) = 2^16 = 65,536.
Why is the interface ID 64 bits?
SLAAC and EUI-64 were designed around a 64-bit interface ID (RFC 4291 requires it for most unicast space). Using a different LAN prefix length breaks SLAAC and surprises a lot of software.
Traps
- Calling the groups octets. They are 16 bits each.
- Writing an address in a URL without brackets.
How did you do?Book 4.2 IP Version 6Own pageWhat are the rules for shortening an IPv6 address?
Say this first
Two rules. First, drop leading zeros inside each hextet (
0db8becomesdb8,0000becomes0), never trailing zeros. Second, replace one run of consecutive all-zero hextets with::, and only once per address. The canonical form (RFC 5952) uses::on the longest run, the leftmost run if two are equal, never on a single zero hextet, and writes hex in lowercase.Go deeper
Worked example
Output 2001:0db8:0000:0000:0000:ff00:0042:8329 2001:db8:0:0:0:ff00:42:8329 leading zeros removed 2001:db8::ff00:42:8329 longest zero run replaced with ::Why
::only onceThe reader rebuilds the address by counting the hextets that are written and filling the gap with zeros until there are eight. With two
::there is no way to know how many zeros go in each gap.Expanding an address
Count the written hextets, then insert zeros for the rest.
Output 2001:db8:0:a::b:0 6 hextets written, so :: stands for 2 2001:0db8:0000:000a:0000:0000:000b:0000RFC 5952 canonical form
Any valid form is accepted as input. RFC 5952 defines the one form tools should print, so logs, configs and search results match:
- lowercase hex
- leading zeros removed
::on the longest run of two or more zero hextets, the first one on a tie- no
::for a single0hextet:2001:db8:0:1:1:1:1:1stays as is
They will ask next
Is 2001:db8:100:: the same as 2001:db8:1::?
No. The third hextet is
0100in the first and0001in the second. You may only drop leading zeros, so0100shortens to100, never to1.Does it matter which form you type into a router?
Not to the router, it parses all valid forms. It matters for people: compare and grep addresses in the canonical form, or you will miss matches in logs and IPAM.
Traps
- Removing trailing zeros.
0100is100, not1. - Using
::twice in one address. - Using
::to replace a single zero hextet. It is valid input but not canonical.
How did you do?Book 4.2 IP Version 6Own pageWhat types of IPv6 addresses are there, and what are their prefixes?
Say this first
Three kinds: unicast, multicast and anycast. There is no broadcast. Unicast splits into global unicast (
2000::/3, routable on the internet), link-local (fe80::/10, one link only, every interface has one), and unique local (fc00::/7, in practicefd00::/8, private). Multicast isff00::/8. Anycast has no prefix of its own: it is a unicast address configured on several nodes. Then the specials:::1loopback and::unspecified.Go deeper
The main table
Type Prefix Scope Used for Global unicast (GUA) 2000::/3internet normal addressing Link-local (LLA) fe80::/10(used asfe80::/64)one link NDP, routing protocol neighbors, next hops Unique local (ULA) fc00::/7,fd00::/8in useorganization private addressing, not routed on the internet Multicast ff00::/8by scope field one to many, replaces broadcast Anycast from unicast space any nearest of several nodes Loopback ::1/128the node same as 127.0.0.1Unspecified ::/128none source before an address exists (DAD), "any" in sockets Special ranges worth knowing
Prefix Meaning 2001:db8::/32documentation (RFC 3849) ::ffff:0:0/96IPv4-mapped, used inside dual-stack socket APIs 64:ff9b::/96NAT64 well-known prefix (RFC 6052) 2002::/166to4, deprecated 2001::/32Teredo fec0::/10site-local, deprecated by RFC 3879 Multiple addresses are normal
A typical laptop has a link-local, a stable global address, one or more temporary global addresses, and it has joined several multicast groups. Seeing five addresses on one interface is not a fault.
They will ask next
Why was site-local deprecated?
"Site" was never defined well enough to build routers and policies around it, and the addresses were ambiguous between organizations. ULA replaced it with a random 40-bit global ID that makes collisions unlikely.
Are ULAs routed differently from global addresses?
No. Routers treat them like any other unicast prefix. You just never advertise them to the internet and filter them at the edge.
Traps
- Saying IPv6 has broadcast. It does not;
ff02::1(all nodes) is the closest thing. - Treating ULA as the IPv6 RFC 1918 that must be NATed. That is not how IPv6 is meant to be run.
How did you do?Book 4.2 IP Version 6Own pageIPv6 has no broadcast. What does it use instead, and why is that better?
Say this first
Multicast. Anything that went to everyone in IPv4 goes to a specific group in IPv6: all nodes
ff02::1, all routersff02::2, and for address resolution the solicited-node group of the target. The gain is that a host's network card filters multicast in hardware, so only the few hosts that joined the group spend CPU on the packet. An ARP broadcast interrupts every host in the VLAN.Go deeper
What replaced each broadcast use
IPv4 broadcast use IPv6 replacement ARP request NS to the solicited-node group ff02::1:ffXX:XXXXDHCP discover DHCPv6 Solicit to ff02::1:2Router discovery RS to ff02::2, RA toff02::1Directed broadcast gone The real saving
A solicited-node group is built from the last 24 bits of the address, so on a normal LAN only one or two hosts are in each group. The NIC is told which multicast MACs (
33:33:ff:xx:xx:xx) to accept and drops the rest without bothering the operating system.What does not change
A switch without MLD snooping still floods multicast to every port in the VLAN, the same way it floods a broadcast. The bandwidth on the wire is similar. The saving is in host CPU and in not waking up devices that do not care.
They will ask next
Is ff02::1 just broadcast under another name?
In reach, nearly. The difference is that very little uses it: periodic RAs and unsolicited NAs. A handy trick is
ping ff02::1%eth0on Linux, which makes every IPv6 node on the link answer, a quick way to see who is there.Did removing broadcast kill directed-broadcast attacks like Smurf?
Largely. There is no subnet broadcast to amplify, and RFC 4443 says nodes must not send ICMPv6 errors in reply to packets sent to multicast, with only a couple of exceptions (Packet Too Big and some Parameter Problem cases).
Traps
- Saying anycast replaced broadcast. Multicast did.
- Claiming IPv6 multicast saves bandwidth on every switch. Only with MLD snooping.
How did you do?Book 4.2 IP Version 6Book 4.3 MulticastOwn pageWhat is a link-local address used for, and why does every IPv6 interface have one?
Say this first
A link-local address (
fe80::/10) works only on its own link and is never routed. Every IPv6 interface creates one as soon as IPv6 is enabled, because the protocol depends on it: NDP messages, router advertisements, the host's default gateway, and routing protocol neighbors and next hops all use link-local addresses. It lets a device talk on the link before it has, or even without, a global address.Go deeper
What uses link-local
- NDP: RS, RA, NS, NA and redirects are sourced from link-local addresses.
- Default gateway: a host's default route points at the router's link-local address, learned from the RA.
- Routing protocols: OSPFv3, EIGRP for IPv6 and RIPng form neighbors over link-local and install link-local next hops. BGP can too, though it usually peers on global addresses.
- DHCPv6: clients send from their link-local address.
Why next hops are link-local
The link-local stays the same when the global prefix is renumbered, so the routing table does not churn.
The zone ID
Every interface has an
fe80::address, so the destination alone does not say which link to use. Hosts need a zone:fe80::1%eth0on Linux,fe80::1%12on Windows. Routers need an exit interface for the same reason.On Cisco
Cisco IOS interface GigabitEthernet0/0/0 ipv6 enable ! link-local only, built with EUI-64 ipv6 address fe80::1 link-local ! or set an easy one by handSetting
fe80::1on every router interface is common. It is unique per link, which is all it needs to be.They will ask next
Can two routers on the same link both use fe80::1?
No. DAD catches the duplicate and the second one is marked duplicate. On different links it is fine, and that is exactly how many networks use it.
Do you need a global address on a router-to-router link?
Not for routing, the IGP works over link-local alone. Most people still add one (a /127) so that traceroute shows a reachable address and the link can be pinged and monitored from afar.
Traps
- Forgetting the zone ID when pinging a link-local address from a host with several interfaces.
- Thinking link-local addresses need DHCP or SLAAC. The host builds them itself.
How did you do?Book 4.2 IP Version 6Own pageHow does EUI-64 build an interface ID from a MAC address? Work an example.
Say this first
Split the 48-bit MAC in half, insert
fffein the middle to get 64 bits, then flip the seventh bit of the first byte, the universal/local bit. MAC00:1a:2b:3c:4d:5ebecomes001a:2bff:fe3c:4d5e, and flipping the bit turns00into02, so the interface ID is021a:2bff:fe3c:4d5e. With prefix2001:db8:acad:10::/64the address is2001:db8:acad:10:21a:2bff:fe3c:4d5e.Go deeper
Step by step
Output MAC 00:1a:2b | 3c:4d:5e Insert fffe 00:1a:2b:ff:fe:3c:4d:5e First byte 00 0000 0000 Flip the 7th bit 0000 0010 = 02 Interface ID 021a:2bff:fe3c:4d5e Address 2001:db8:acad:10:21a:2bff:fe3c:4d5eA second one you meet in labs
Lab routers often have MACs like
aabb.cc00.0100.Output aa = 1010 1010 flip 1010 1000 = a8 Interface ID a8bb:ccff:fe00:0100 Link-local fe80::a8bb:ccff:fe00:100Flipping fast
Only the second hex digit changes: 0 and 2 swap, 1 and 3, 4 and 6, 5 and 7, 8 and a, 9 and b, c and e, d and f. So
02:50:56:aa:bb:ccgives0050:56ff:feaa:bbcc: the bit goes from 1 to 0.Why flip at all
In a MAC, the bit set to 0 means "universally administered". IPv6 inverts it so that 1 means universal. That way hand-made interface IDs such as
::1carry a 0 and are correctly marked local.On Cisco
Cisco IOS interface GigabitEthernet0/0/0 ipv6 address 2001:db8:acad:10::/64 eui-64IOS also builds link-local addresses with EUI-64 unless you set one by hand.
Why hosts moved away from it
An EUI-64 address carries the MAC, so a laptop can be tracked across every network it joins. Windows uses random interface IDs, and many Linux and Apple systems use stable but opaque IDs (RFC 7217) plus temporary addresses. Routers and servers often still use EUI-64 or static IDs.
They will ask next
What does EUI-64 do on a serial interface with no MAC?
Cisco borrows the MAC of one of the router's Ethernet interfaces to build the interface ID. In practice you set the link-local address by hand on those links.
Is EUI-64 still required anywhere?
No. RFC 8064 recommends stable opaque interface IDs as the default for SLAAC. EUI-64 remains common on network gear because it is predictable.
Traps
- Flipping the wrong bit. It is the bit worth 2 in the first byte.
- Putting
fffeat the end instead of in the middle.
How did you do?Book 4.2 IP Version 6Own pageWhat prefix lengths do you use for LANs, point-to-point links and loopbacks in IPv6, and why?
Say this first
A /64 for every LAN segment, because SLAAC and many host stacks assume a 64-bit interface ID. A /127 on router-to-router links (RFC 6164), usually carved from a /64 reserved per link. A /128 for loopbacks. A site gets a /48, which is 65,536 /64s. ISPs commonly give homes a /56 or /48.
Go deeper
The usual sizes
Use Size Note Organization from an RIR /32 to /48 LIRs get /32 or more, end sites /48 Site /48 16 bits of subnet ID Home from an ISP /56 or /48 256 or 65,536 LANs LAN or VLAN /64 always Point-to-point /127 RFC 6164 Loopback /128 one address Why not smaller LANs
A /120 on a LAN breaks SLAAC, and some devices and features assume /64. IPv6 does not need you to save addresses. It needs you to have enough subnets.
Why /127 on links
- NDP exhaustion: on a /64 link, a scan of nonexistent addresses makes the router create an incomplete neighbor entry for each one. A /127 has two addresses, nothing to scan.
- Looping: on point-to-point links, old implementations bounced packets for unused addresses back and forth until the hop limit ran out.
- The old worry, that one of the two addresses is the subnet-router anycast address, is handled by RFC 6164: routers do not use that anycast address on a /127.
Many teams reserve a whole /64 per link and configure the /127 from its start. The plan stays tidy and you can change your mind later.
They will ask next
Isn't a /64 for a VLAN of 20 hosts wasteful?
Addresses are not the scarce resource in IPv6, subnets are. A /48 gives 65,536 of them. The /64 keeps SLAAC, privacy addresses and every host stack working.
What do you do if the ISP gives a site a single /64?
Push back and ask for a /56 or /48, usually through DHCPv6 prefix delegation. With one /64 you cannot subnet without breaking SLAAC, so people end up with ugly workarounds like ND proxying.
Traps
- Using /112 or /120 on LANs to "save space".
- Forgetting loopbacks are /128, not /64.
How did you do?Book 4.2 IP Version 6Own pageWhat is NDP and what are its message types?
Say this first
Neighbor Discovery Protocol (RFC 4861) does the jobs ARP, ICMP router discovery and ICMP redirect did in IPv4. It runs inside ICMPv6 with five messages: Router Solicitation (133), Router Advertisement (134), Neighbor Solicitation (135), Neighbor Advertisement (136) and Redirect (137). It handles address resolution, router and prefix discovery, duplicate address detection and neighbor reachability.
Go deeper
The five messages
Type Message Sent by Usually to Job 133 Router Solicitation (RS) host ff02::2ask routers for an RA now 134 Router Advertisement (RA) router ff02::1, or the host that askedprefixes, flags, default router, MTU, hop limit 135 Neighbor Solicitation (NS) any node solicited-node group, or unicast resolve a MAC, DAD, check reachability 136 Neighbor Advertisement (NA) any node the asker, or ff02::1if unsolicitedgive a MAC, announce a change 137 Redirect router host a better first hop, or "this destination is on-link" Useful details
- Hop limit 255. Every NDP message is sent with hop limit 255 and receivers drop any with less. A packet that crossed a router would have 254 or lower, so this proves the sender is on the link.
- NA flags. R says the sender is a router, S says the NA answers a solicitation, O says "override your cached MAC for me".
- Options. Source and target link-layer address, Prefix Information, MTU, Route Information, and RDNSS for DNS servers (RFC 8106).
Why this matters for filtering
NDP is ICMPv6. An ACL or firewall that drops all ICMPv6 drops address resolution with it and the link stops working. Cisco IPv6 ACLs carry implicit permits for NS and NA for this reason.
They will ask next
Is NDP secured?
Not by default. SEND (RFC 3971) adds signatures but almost nobody deployed it. Networks protect NDP with first hop security on the switch instead: RA Guard, ND inspection and device tracking.
When does a router send a redirect?
When it forwards a packet back out the interface it came in on, toward a next hop on the same link. It tells the host to send directly next time. Many teams disable redirects on routers with
no ipv6 redirectsbecause they add CPU work and can be abused.
Traps
- Saying NDP runs over UDP or directly over Ethernet. It is ICMPv6, IP next header 58.
- Forgetting Redirect, the fifth message.
How did you do?Book 4.2 IP Version 6Book 3.3 Internet (IP)Own pageWhat is duplicate address detection and how does it work?
Say this first
Before using any unicast address, a node marks it tentative, joins its solicited-node group and sends a Neighbor Solicitation for it from the unspecified address
::. If another node answers with an NA, or is doing DAD for the same address at the same time, the address is a duplicate and is not used. If nothing comes back within about a second, the address becomes usable. It runs for link-local, SLAAC, DHCPv6 and static addresses alike.Go deeper
The packet
Output NS src :: (no address yet) dst ff02::1:ff3c:4d5e (solicited-node of the tentative address) target 2001:db8:acad:10:21a:2bff:fe3c:4d5eUsing
::as source means nobody caches a mapping for an address that may turn out to be someone else's.Timing and knobs
- One NS by default (DupAddrDetectTransmits = 1), then wait RetransTimer, 1 second.
- IOS:
ipv6 nd dad attempts 1is the default;0disables DAD on the interface. - Optimistic DAD (RFC 4429) lets a host use the address while DAD runs, with restrictions, to save time.
- Anycast addresses skip DAD.
When it fails on a router
IOS logs
%IPV6_ND-4-DUPLICATEand marks the address[DUP]inshow ipv6 interface. The address is not used. If the duplicate is a link-local built from the hardware address, RFC 4862 says IPv6 on that interface should be disabled, because the MAC itself is probably duplicated.Common real causes
- Two routers configured with the same static address, or the same
fe80::1on one link. - Copy-pasted VM templates with static addresses.
- A looped port, where the node hears its own NS. RFC 7527 adds a nonce so a node can recognize its own message.
They will ask next
Does DAD guarantee there is no duplicate?
No. It only checks at the moment the address is configured, and only for nodes on the link at that moment. A host that was powered off during DAD will clash later. NUD and logs then show the conflict.
Can an attacker abuse DAD?
Yes. A node that answers every DAD NS stops all new hosts from getting addresses. First hop security features such as ND inspection on the switch limit this.
Traps
- Saying DAD is sourced from the address being tested. It uses
::. - Saying DAD only runs for SLAAC addresses.
How did you do?Book 4.2 IP Version 6Own pageExplain SLAAC step by step.
Say this first
Stateless address autoconfiguration (RFC 4862) lets a host build its own global address with no server. It creates a link-local address and runs DAD, sends a Router Solicitation, and gets a Router Advertisement with one or more /64 prefixes marked autonomous (A flag). It appends its own 64-bit interface ID, runs DAD again, and uses the router's link-local address from the RA as its default gateway. The router never knows which addresses the hosts picked.
Go deeper
The sequence
- Interface comes up. The host builds
fe80::plus an interface ID and runs DAD. - Host sends an RS from its link-local address to
ff02::2, instead of waiting for the next periodic RA. - Router answers with an RA. It contains:
- flags M and O (whether to use DHCPv6)
- router lifetime (non-zero means "use me as a default router")
- Prefix Information Options: prefix, L (on-link) flag, A (autonomous) flag, valid and preferred lifetimes
- optionally MTU and RDNSS (DNS servers)
- For each /64 prefix with A=1, the host appends an interface ID: EUI-64, a stable opaque ID (RFC 7217) or a random one, plus temporary addresses if privacy extensions are on.
- DAD for each new address.
- Default route via the RA's source link-local address.
Lifetimes
- Preferred lifetime: while it runs, the address is used for new connections. After it, the address is deprecated, still valid for existing sessions.
- Valid lifetime: after it the address is removed.
- IOS defaults: valid 2,592,000 s (30 days), preferred 604,800 s (7 days). RAs every 200 s, router lifetime 1800 s.
Router side on Cisco
Cisco IOS ipv6 unicast-routing interface GigabitEthernet0/0/0 ipv6 address 2001:db8:acad:10::1/64That is enough. With
ipv6 unicast-routingon, the interface sends RAs for its /64 with A=1.They will ask next
Where does a SLAAC-only host get DNS servers?
From the RDNSS option in the RA (RFC 8106), if the router sends it. Otherwise from stateless DHCPv6 (O flag), or from IPv4 DNS on a dual-stack network.
What happens if the prefix in the RA is a /56 with A=1?
Hosts ignore it for SLAAC, because the prefix plus a 64-bit interface ID must make 128 bits. No address is formed from it.
Traps
- Saying the router hands out the address. The host picks it.
- Forgetting that SLAAC needs
ipv6 unicast-routingon IOS, or the router never sends RAs.
How did you do?Book 4.2 IP Version 6Own page- Interface comes up. The host builds
What is the difference between stateful and stateless DHCPv6?
Say this first
Stateful DHCPv6 assigns addresses and keeps a binding for each client, like DHCP in IPv4. Stateless DHCPv6 hands out only settings such as DNS servers and domain name, while the host builds its address with SLAAC, so the server keeps no per-client state. Both use UDP ports 546 (client) and 547 (server), and clients send to
ff02::1:2. Neither gives a default gateway; that always comes from the RA.Go deeper
Message flow
Mode Exchange RA flags Stateful Solicit, Advertise, Request, Reply (Solicit and Reply with Rapid Commit) M=1, often A=0 Stateless Information-Request, Reply M=0, O=1, A=1 Identity
Clients identify themselves with a DUID (DHCP Unique Identifier) and an IAID per interface, not with a MAC. That makes MAC-based reservations awkward. RFC 6939 lets the first relay add the client's link-layer address for this reason.
Stateful on IOS
Cisco IOS ipv6 dhcp pool LAN20 address prefix 2001:db8:acad:20::/64 dns-server 2001:db8:acad:100::53 domain-name corp.example.com ! interface GigabitEthernet0/0/1 ipv6 address 2001:db8:acad:20::1/64 ipv6 nd managed-config-flag ipv6 nd prefix default no-autoconfig ipv6 dhcp server LAN20Stateless on IOS
Cisco IOS ipv6 dhcp pool LAN10-INFO dns-server 2001:db8:acad:100::53 domain-name corp.example.com ! interface GigabitEthernet0/0/0 ipv6 address 2001:db8:acad:10::1/64 ipv6 nd other-config-flag ipv6 dhcp server LAN10-INFOChoosing
Stateful gives you a lease table for audits and IPAM, but Android will not use it. Stateless with SLAAC works on every client; you then map addresses to devices from NDP tables or switch device tracking.
They will ask next
What is Rapid Commit?
A two-message exchange, Solicit then Reply, instead of four. The client asks for it with the Rapid Commit option and the server agrees by including it in the Reply. Fine when there is one server.
Which multicast address do DHCPv6 relays use toward servers?
Relays usually unicast to configured server addresses.
ff05::1:3(all DHCPv6 servers, site scope) exists for relays that multicast.
Traps
- Saying DHCPv6 uses broadcast. It uses
ff02::1:2. - Thinking stateless DHCPv6 means no server is needed. It still needs one, just without bindings.
How did you do?Book 4.2 IP Version 6Book 3.3 Internet (IP)Own pageWalk me through the IPv6 header. What was removed compared with IPv4, and why?
Say this first
It is a fixed 40 bytes with eight fields: Version, Traffic Class, Flow Label, Payload Length, Next Header, Hop Limit, and the 128-bit source and destination addresses. Compared with IPv4, the header length field, the header checksum, the fragmentation fields and options are gone. A fixed header with no checksum is cheaper for routers, fragmentation moved to an extension header used only by the source, and options moved to extension headers that most routers never look at.
Go deeper
The fields
Field Bits Notes Version 4 always 6 Traffic Class 8 DSCP (6 bits) and ECN (2 bits), same as IPv4 ToS Flow Label 20 marks packets of one flow, used for ECMP and LAG hashing Payload Length 16 bytes after the 40-byte header, extension headers included Next Header 8 next extension header or the upper layer: 6 TCP, 17 UDP, 58 ICMPv6 Hop Limit 8 the TTL, renamed; decremented at each router Source address 128 Destination address 128 What changed and why
IPv4 IPv6 Reason IHL (header length) gone header is always 40 bytes Header checksum gone layer 2 FCS and layer 4 checksums already cover errors; routers no longer recompute a checksum at every hop Identification, flags, fragment offset Fragment extension header only the source fragments Options extension headers keep the fast path simple Protocol Next Header can point to an extension header TTL Hop Limit name now matches what it does Consequences
- The UDP checksum, optional in IPv4, is mandatory in IPv6 (tunnel protocols have a narrow exception).
- Payloads above 65,535 bytes need the Jumbo Payload option in a Hop-by-Hop header. Almost nothing uses it.
They will ask next
What is the Flow Label used for in practice?
Load balancing. A router or switch can hash on source, destination and flow label instead of digging for TCP ports, which helps when the transport header is encrypted or sits behind extension headers. Tunnel endpoints can set it so traffic inside one tunnel spreads across paths.
Is the IPv6 header bigger than IPv4?
Yes, 40 bytes against a usual 20, almost all of it the larger addresses. In exchange it is fixed and simpler to process.
Traps
- Saying Payload Length includes the 40-byte header. It does not.
- Saying IPv6 removed TTL. It renamed it.
How did you do?Book 4.2 IP Version 6Own pageWhat is dual stack, and what problems do you hit running it?
Say this first
Dual stack means every interface, host and service runs IPv4 and IPv6 side by side, each with its own addresses, routing and policy. It is the standard way to deploy IPv6. Hosts prefer IPv6 when a name has both A and AAAA records, and Happy Eyeballs (RFC 8305) races the two so a broken IPv6 path costs a fraction of a second instead of a long timeout. The usual problems are security policy that exists only for IPv4, partly broken IPv6 paths, and twice the things to monitor.
Go deeper
On Cisco
Cisco IOS ipv6 unicast-routing ! interface GigabitEthernet0/0/0 ip address 10.10.10.1 255.255.255.0 ipv6 address 2001:db8:acad:10::1/64 ipv6 address fe80::1 link-localWithout
ipv6 unicast-routingthe router will not forward IPv6 or send RAs.How hosts choose
- RFC 6724 orders destinations; native IPv6 beats IPv4 by default.
- Happy Eyeballs v2 starts the IPv6 attempt, waits about 250 ms, then starts IPv4 in parallel and keeps whichever connects first.
Problems that come up
Problem Effect Firewall rules only for IPv4 IPv6 wide open, or IPv6 blocked and apps fall back slowly IPv6 path broken (rogue RA, PMTUD, missing route) slow page loads, some sites fail Monitoring and logs only for IPv4 half of the traffic invisible DNS AAAA records published before the service listens on IPv6 clients try IPv6 first and wait Two routing tables, two sets of ACLs more config and more mistakes Order of rollout
Core and routing first, then security policy and monitoring, then server and DNS, then users. Publishing AAAA records is the last step, not the first.
They will ask next
How do you test whether a client really uses IPv6?
Check it has a global address and a default route (
ip -6 addr,ip -6 route), thencurl -6to a known dual-stack site andcurl -4for comparison. Packet captures settle any doubt.What is the alternative to dual stack?
IPv6-only with translation for the remaining IPv4: NAT64 and DNS64 in the network, 464XLAT on clients. Mobile carriers and some large enterprises already run it.
Traps
- Forgetting to give IPv6 the same firewall policy as IPv4.
- Publishing AAAA records for services that do not answer on IPv6.
How did you do?Book 4.2 IP Version 6Own page
Working17
I am going to read you some addresses. Compress each one properly and tell me which ones are invalid.
Say this first
I apply the rules in order: strip leading zeros in each hextet, then put
::on the longest run of two or more zero hextets, leftmost on a tie, and never on a single zero. An address is invalid if it has two::, more than eight hextets, a hextet over four hex digits, or a non-hex character.Go deeper
Compress these
Written out Canonical Why 2001:0db8:0000:0000:0000:0000:0000:00012001:db8::1one long run 2001:0db8:0000:0001:0000:0000:0000:00012001:db8:0:1::1the run of three wins over the single zero 2001:0db8:0000:0000:0001:0000:0000:00012001:db8::1:0:0:1two runs of two, the leftmost wins 2001:0db8:0000:0000:0001:0000:0000:00002001:db8:0:0:1::the run of three at the end beats the run of two 2001:0db8:00a0:0000:0b00:0000:0000:0c002001:db8:a0:0:b00::c00only leading zeros go, 0b00keeps its zeros2001:0db8:0000:0001:0001:0001:0001:00012001:db8:0:1:1:1:1:1a single zero hextet never gets ::FE80:0000:0000:0000:0202:B3FF:FE1E:8329fe80::202:b3ff:fe1e:8329lowercase, 0202to2020:0:0:0:0:0:0:1::1loopback 0:0:0:0:0:0:0:0::unspecified Spot the invalid ones
Address Problem 2001:db8::5::1two ::2001:db8:1:2:3:4:5:6:7nine hextets 2001:db8:10000::110000is 17 bits2001:db8:acad:1g::1gis not hex2001:db8:1:2:3:4:5::6eight hextets written plus ::, which must stand for at least one moreHow I check out loud
"I count the hextets. If
::is there, it fills the gap up to eight. Then I check each group is at most four hex digits." Saying the method shows the interviewer you are not guessing.They will ask next
Expand 2001:db8:0:a::b:0 to the full form.
Six hextets are written, so
::is two zero groups:2001:0db8:0000:000a:0000:0000:000b:0000.How would you check this quickly on a laptop?
python3 -c "import ipaddress; print(ipaddress.ip_address('2001:0db8::0001:0000'))"prints the canonical form and raises an error for an invalid one.ipaddress.ip_address(...).explodedgives the full form.
Traps
- Putting
::on the first zero run even when a later run is longer. - Calling
2001:db8:0:1:1:1:1:1wrong. It is valid and already canonical.
How did you do?Book 4.2 IP Version 6Own pageWalk me through the IPv6 multicast address format and the well-known groups you see on a LAN.
Say this first
Multicast addresses start with
ff. The next 4 bits are flags and the 4 after that are the scope, soff02::is link scope andff05::is site scope. On a LAN you seeff02::1all nodes,ff02::2all routers,ff02::5andff02::6for OSPFv3,ff02::1:2for DHCPv6 and the solicited-node groupsff02::1:ffXX:XXXX. On Ethernet each group maps to MAC33:33plus the low 32 bits of the address.Go deeper
Format
Output | 8 bits | 4 bits | 4 bits | 112 bits | | ff | flags | scope | group ID |Flags: T=0 means a permanent, well-known group; T=1 a transient one. The P and R flags mark prefix-based and embedded-RP addresses used in multicast routing.
Scope value Scope 1 interface-local 2 link-local 4 admin-local 5 site-local 8 organization-local e global Groups worth knowing by heart
Address Group ff02::1all nodes ff02::2all routers ff02::5OSPFv3 all SPF routers ff02::6OSPFv3 DR and BDR ff02::9RIPng ff02::aEIGRP ff02::dPIM ff02::12VRRP ff02::16MLDv2 reports ff02::1:2all DHCPv6 relay agents and servers ff05::1:3all DHCPv6 servers (site scope) ff02::1:ff00:0/104solicited-node groups MAC mapping
33:33followed by the last 32 bits of the group.ff02::1becomes33:33:00:00:00:01, andff02::1:ff3c:4d5ebecomes33:33:ff:3c:4d:5e. Only 32 of the 112 group bits make it into the MAC, so several groups can share one MAC. The NIC lets them all in and the IP stack does the final check.They will ask next
Can a packet to ff02::2 cross a router?
No. Scope 2 is link-local. Routers never forward it, whatever the hop limit says.
What joins a router to ff02::2?
Enabling IPv6 routing. On Cisco that is
ipv6 unicast-routing. Without it the box behaves as a host, does not joinff02::2and does not send RAs.
Traps
- Saying
ff02::2reaches all routers in the network. Only the ones on the link. - Mixing up the IPv4 multicast MAC prefix
01:00:5ewith the IPv6 one33:33.
How did you do?Book 4.3 MulticastBook 4.2 IP Version 6Own pageWhat is a solicited-node multicast address and how do you derive it? Give me an example.
Say this first
It is the multicast group a node joins for each of its unicast and anycast addresses, and it is where neighbor solicitations go instead of an ARP broadcast. Take the prefix
ff02::1:ff00:0/104and append the last 24 bits of the unicast address. For2001:db8:acad:10:21a:2bff:fe3c:4d5ethe last 24 bits are3c:4d5e, so the group isff02::1:ff3c:4d5eand its Ethernet MAC is33:33:ff:3c:4d:5e.Go deeper
Derivation step by step
Output Unicast: 2001:db8:acad:10:21a:2bff:fe3c:4d5e Last 24 bits: 3c:4d5e Prefix: ff02::1:ff00:0/104 Group: ff02::1:ff3c:4d5e Ethernet MAC: 33:33:ff:3c:4d:5eMore examples
Unicast Solicited-node 2001:db8:acad:10::1ff02::1:ff00:12001:db8:acad:10::20ff02::1:ff00:20fe80::a8bb:ccff:fe00:100ff02::1:ff00:1002001:db8::abcd:1234:5678ff02::1:ff34:5678Write every hextet out to four digits before you take the last 24 bits.
fe00:100isfe00:0100, so the last 24 bits are00:0100.Why it exists
- Address resolution: to find the MAC of
2001:db8:acad:10::20, a host sends an NS toff02::1:ff00:20. Only nodes whose addresses end in00:0020have joined that group. - DAD: a node checks its tentative address by sending an NS to the same group.
On a router
show ipv6 interfacelists the groups under "Joined group address(es)". A router withfe80::1and2001:db8:acad:10::1shows a singleFF02::1:FF00:1, because both addresses share the last 24 bits.They will ask next
How does a node tell the switches it joined the group?
It sends an MLD report for the group. With MLD snooping the switch can then forward that group only to the ports that asked for it.
What if two hosts share the last 24 bits?
Both join the same group and both receive the NS. Each checks the target address inside the NS and only the owner answers. It costs a little CPU, nothing breaks.
Traps
- Taking the last 24 bits of the MAC address. That only matches when the address was built with EUI-64.
- Dropping leading zeros before taking the bits, which shifts the result.
How did you do?Book 4.2 IP Version 6Own page- Address resolution: to find the MAC of
How does anycast work in IPv6, and what is the subnet-router anycast address?
Say this first
An anycast address is an ordinary unicast address configured on more than one node. Nothing in the address marks it as anycast; routing delivers each packet to the nearest instance. Nodes skip DAD for it. The subnet-router anycast address is the subnet prefix with an all-zero interface ID, for example
2001:db8:acad:10::, and it reaches any one router on that subnet.Go deeper
How it works
Several nodes advertise or are configured with the same address. Routing protocols pick the best path, so each client reaches the closest one by metric. That is how DNS resolvers, root servers and CDNs spread load and survive site failures, in IPv4 and IPv6 alike.
On Cisco
Cisco IOS interface Loopback53 ipv6 address 2001:db8:acad:ff::53/128 anycastThe
anycastkeyword tells IOS to skip DAD for this address. The loopback is then redistributed or advertised from every site that hosts the service.Subnet-router anycast
RFC 4291 reserves the address with the interface ID all zeros on every subnet, and routers must answer to it. It is rarely used directly, but it explains two things:
- Why you should not assign
prefix::to a host on a /64. - Why /127 links were once discouraged: one of the two addresses is the subnet-router anycast address. RFC 6164 settles it by saying routers do not use subnet-router anycast on /127 links.
What anycast is not
The "anycast gateway" in data center fabrics is a different idea: the same gateway IP and MAC on every leaf switch, each serving its own locally attached hosts.
They will ask next
What breaks with anycast and TCP?
If routing shifts mid-session, packets start landing on a different instance that has no state for the connection and it resets. That is why anycast is most at home with short UDP exchanges like DNS, and why TCP anycast services keep routing stable.
Is there an IPv4 equivalent?
Yes, the same technique is used with IPv4: one prefix announced from many sites via BGP. IPv6 just names it as an address type and defines the subnet-router anycast address.
Traps
- Saying anycast addresses come from a special prefix.
- Confusing anycast with multicast. Anycast reaches one receiver, multicast reaches all that joined.
How did you do?Book 4.2 IP Version 6Own page- Why you should not assign
Walk me through how a host finds the MAC address of a neighbor in IPv6, and the neighbor cache states.
Say this first
The host checks the destination is on-link, then looks in its neighbor cache. On a miss it creates an INCOMPLETE entry and sends an NS to the target's solicited-node group, carrying its own MAC. The target answers with a unicast NA carrying its MAC, and the entry becomes REACHABLE. After about 30 seconds without confirmation it drops to STALE. When the host uses a STALE entry it goes to DELAY for 5 seconds, then PROBE with unicast NSs, and the entry is removed if nobody answers.
Go deeper
The exchange
Output PC1 2001:db8:acad:10::10 wants PC2 2001:db8:acad:10::20 NS src 2001:db8:acad:10::10 dst ff02::1:ff00:20 target 2001:db8:acad:10::20, source link-layer option = PC1's MAC NA src 2001:db8:acad:10::20 dst 2001:db8:acad:10::10 flags S=1 O=1, target link-layer option = PC2's MACPC2 also learns PC1's MAC from the NS, so it can answer without asking back.
Neighbor cache states
State Meaning INCOMPLETE NS sent, no answer yet REACHABLE confirmed recently, within ReachableTime (30 s base, randomized 15 to 45 s) STALE not confirmed lately; still used, no traffic sent to check DELAY a packet was sent to a STALE entry; wait 5 s for an upper-layer hint PROBE send up to 3 unicast NSs, 1 s apart; delete the entry if none is answered Neighbor Unreachability Detection
Reachability is confirmed two ways: an NA in reply to a unicast NS, or a hint from the upper layer, such as TCP seeing its data acknowledged. The DELAY state exists to give TCP that chance before sending a probe.
What you see
Output R1# show ipv6 neighbors IPv6 Address Age Link-layer Addr State Interface 2001:DB8:ACAD:10::20 0 0050.56aa.bb20 REACH Gi0/0/0 FE80::250:56FF:FEAA:BB20 3 0050.56aa.bb20 STALE Gi0/0/0Shell $ ip -6 neigh show dev eth0 fe80::1 lladdr a0:b4:3c:11:0a:01 router STALE 2001:db8:acad:10::20 lladdr 00:50:56:aa:bb:20 REACHABLEThey will ask next
How does the host decide the destination is on-link?
From Prefix Information Options in RAs with the L (on-link) flag set. A destination outside every on-link prefix goes to the default router, even if it happens to sit on the same wire.
Why is a STALE entry not a problem?
STALE does not mean wrong, only unconfirmed. The host keeps using it and verifies lazily, which keeps NDP traffic low.
Traps
- Saying the NS goes to
ff02::1. Address resolution uses the solicited-node group; reachability probes are unicast. - Treating STALE as a failure when reading a neighbor table.
How did you do?Book 4.2 IP Version 6Own pageExplain the M, O and A flags, and what a host does with each combination.
Say this first
M (managed) and O (other config) sit in the RA header. A (autonomous) sits in each Prefix Information Option. A=1 means "build a SLAAC address from this prefix". M=1 means "get addresses from DHCPv6". O=1 means "get other settings, like DNS, from DHCPv6". The gateway always comes from the RA, whatever the flags. Hosts treat the flags as hints, and Android ignores DHCPv6 entirely, which is the classic surprise.
Go deeper
The combinations
M O A Addresses DNS Typical name 0 0 1 SLAAC RDNSS in the RA, or none SLAAC only 0 1 1 SLAAC stateless DHCPv6 SLAAC plus stateless DHCPv6 1 any 0 stateful DHCPv6 DHCPv6 stateful DHCPv6 1 any 1 both SLAAC and DHCPv6 DHCPv6 both, two or more addresses 0 0 0 link-local only none gateway only With M=1, O does not matter: the stateful exchange returns options as well.
Things that catch people
- DHCPv6 has no gateway option. Even a fully managed network needs RAs with a non-zero router lifetime.
- DHCPv6 gives no prefix length. Clients install the leased address as a /128. They learn which prefix is on-link from the RA's Prefix Information Option with L=1. Without it, a host sends traffic for its own subnet through the router.
- Android does not implement DHCPv6 address assignment. On an M=1, A=0 network Android devices get only a link-local address.
- Windows starts DHCPv6 when M or O is set. Linux depends on the network manager in use.
Setting the flags on IOS
Cisco IOS interface GigabitEthernet0/0/0 ipv6 nd managed-config-flag ! M=1 ipv6 nd other-config-flag ! O=1 ipv6 nd prefix default no-autoconfig ! A=0 for the prefixes on this interfaceshow ipv6 interfaceconfirms with lines like "Hosts use DHCP to obtain routable addresses."They will ask next
What does the L flag do?
L=1 says addresses in this prefix are on the link, so the host talks to them directly with NDP. L=0 means "send it to a router". A and L are independent: you can have A=1 with L=0.
If M=1, why would you still keep A=1?
To give Android and other non-DHCPv6 clients an address. The cost is that DHCPv6-capable hosts end up with both a SLAAC and a DHCPv6 address, and your lease logs do not cover every address in use.
Traps
- Saying the M flag gives hosts their default gateway from DHCPv6.
- Assuming every OS honours the flags the same way.
How did you do?Book 4.2 IP Version 6Own pageHow does an IPv6 host learn its default gateway? Can DHCPv6 give it one?
Say this first
Only from Router Advertisements, or from static configuration. Any RA with a non-zero router lifetime adds the sender's link-local address to the host's default router list. DHCPv6 has no gateway option. If two routers send RAs, the host learns both, picks one using the router preference field (high, medium, low) and falls back to the other when NUD finds the first unreachable, which takes tens of seconds.
Go deeper
What the host stores
- Default router list: each router's link-local address and lifetime.
- The router lifetime in the RA, 1800 s by default on IOS, sets how long the entry lives without a new RA.
- A router lifetime of 0 means "I am not a default router", even though the RA can still carry prefixes.
Controls on IOS
Cisco IOS interface GigabitEthernet0/0/0 ipv6 nd router-preference high ! RFC 4191, default is medium ipv6 nd ra lifetime 0 ! advertise prefixes but never be the gatewayFailover without an FHRP
A host only notices a dead router through NUD: the entry must leave REACHABLE (up to 45 s), then DELAY (5 s) and PROBE (3 s). Expect tens of seconds. For faster failover use HSRPv2 for IPv6 or VRRPv3, which give a virtual link-local address that moves between routers.
Servers and routers as hosts
- Static:
ip -6 route add default via fe80::1 dev eth0on Linux. A link-local next hop always needs the device. - Linux ignores RAs when forwarding is on unless
accept_rais set to 2.
They will ask next
Why is the gateway a link-local address and not the router's global address?
The link-local address is always there, does not change when the prefix is renumbered, and is unique on that link, which is all a next hop needs.
How do you stop a server from learning a default route from any RA on the segment?
Set its gateway statically and turn off RA processing (
accept_ra=0on Linux), and protect the segment with RA Guard so rogue RAs never reach it.
Traps
- Answering "DHCPv6 option 3". That is DHCPv4.
- Forgetting that a router lifetime of 0 removes the router from the default list.
How did you do?Book 4.2 IP Version 6Own pageHow does DHCPv6 relay work, and what is DHCPv6 prefix delegation?
Say this first
A relay on the client's first-hop router catches the client's multicast to
ff02::1:2, wraps it in a Relay-Forward message and unicasts it to the server. The link-address field tells the server which subnet the client is on. On IOS that isipv6 dhcp relay destinationon the client-facing interface. Prefix delegation (IA_PD) hands a whole prefix, such as a /56, to a requesting router, which then carves /64s from it for its own LANs. It is how ISPs give IPv6 to home and branch routers.Go deeper
Relay
Cisco IOS interface GigabitEthernet0/0/1 ipv6 address 2001:db8:acad:20::1/64 ipv6 nd managed-config-flag ipv6 nd prefix default no-autoconfig ipv6 dhcp relay destination 2001:db8:acad:100::10- Relay-Forward carries the link-address (a global address of the client's link), the peer-address (the client's link-local), and often an Interface-ID option.
- The server answers with Relay-Reply. The relay unwraps it and sends the Reply to the client.
- You still set the RA flags on the relay interface. Without M=1 clients never start DHCPv6.
Prefix delegation
Output ISP router (delegating) ---> CPE (requesting router) IA_PD: 2001:db8:5600::/56 LAN1 2001:db8:5600:1::/64 LAN2 2001:db8:5600:2::/64On an IOS CPE:
Cisco IOS interface GigabitEthernet0/0/1 description WAN to ISP ipv6 address autoconfig default ipv6 dhcp client pd FROM-ISP ! interface GigabitEthernet0/0/0 ipv6 address FROM-ISP ::1:0:0:0:1/64FROM-ISPis a general prefix name. The LAN gets2001:db8:5600:1::1/64and follows automatically if the ISP changes the delegated prefix.The return route
Something upstream must route the delegated /56 to the CPE. Broadband gear and many relays install that route when they see the delegation. If nothing does, the CPE gets its prefix and nothing comes back.
They will ask next
Why put the relay on the first-hop router and not anywhere in the path?
Client messages go to a link-scope multicast address, so they never leave the link. Only a device on that link can catch them.
What happens to LAN addresses if the ISP changes the delegated prefix?
The CPE renumbers its LANs and advertises the new prefix. Hosts keep the old addresses until their lifetimes run out unless the CPE deprecates the old prefix. That is why stable PD matters to customers.
Traps
- Forgetting the M flag on the relay interface.
- Assuming the delegated prefix is routed to the CPE by magic.
How did you do?Book 4.2 IP Version 6Own pageWhat are IPv6 privacy addresses, and what do they mean for network operations?
Say this first
Temporary addresses (RFC 8981, which replaced RFC 4941) are SLAAC addresses with a random interface ID that changes regularly, about once a day. Hosts prefer them for outgoing connections, so websites cannot track a device by a fixed address. Alongside them hosts keep a stable address, often an opaque ID per network (RFC 7217) rather than EUI-64. For operations it means one host has several addresses that change, so per-host ACLs on addresses fail and logs need address-to-device mapping.
Go deeper
Two problems, two fixes
Problem Fix EUI-64 carries the MAC, trackable across every network stable opaque IDs (RFC 7217): fixed per network, different between networks One stable address per network lets websites track a session over weeks temporary addresses (RFC 8981): random, rotated Defaults today
- Windows, macOS, iOS and Android create temporary addresses and use them for outgoing traffic.
- Linux:
net.ipv6.conf.<if>.use_tempaddr(0 off, 1 create, 2 create and prefer) andaddr_gen_modefor stable-privacy IDs. Desktop distributions usually turn both on through NetworkManager. - Source address selection (RFC 6724, rule 7) prefers temporary addresses.
What changes for the network team
- Logging: the address in a firewall log may be gone tomorrow. Keep a history of NDP caches, or use switch device tracking (SISF on Cisco), to map address to MAC and port at any time.
- ACLs: write policies per /64 or per identity (802.1X, user-ID on the firewall), not per host address.
- Neighbor tables: more addresses per host means bigger NDP caches on gateways.
- Servers: give them static or stable addresses and turn temporary addresses off.
They will ask next
How would you find which user had an IPv6 address last Tuesday?
Correlate three records: the address-to-MAC binding (NDP cache exports or switch device tracking logs), the MAC-to-port record, and the port's authentication log (802.1X or NAC). Without the first one the address alone tells you only the subnet.
Do privacy addresses hide a device from the local network?
No. The MAC is still visible on the link. They only stop tracking by remote servers.
Traps
- Thinking a host has one IPv6 address you can whitelist.
- Confusing stable opaque IDs with temporary addresses. One stays per network, the other rotates.
How did you do?Book 4.2 IP Version 6Own pageWhat is RA Guard, and what other IPv6 first hop security features do you deploy on access switches?
Say this first
RA Guard (RFC 6105) drops Router Advertisements arriving on switch ports that are not meant to have a router behind them. It stops rogue RAs, from a misconfigured device or an attacker, that would hand hosts a new default gateway or prefix. The rest of the toolkit: DHCPv6 Guard against rogue DHCPv6 servers, a binding table built by snooping NDP and DHCPv6 (SISF device tracking on Cisco), ND inspection, IPv6 Source Guard and Destination Guard.
Go deeper
Why rogue RAs hurt
A laptop sharing its connection or a home router plugged in backwards sends RAs. Hosts add its link-local address as another default router and may build addresses from its prefix. Traffic either black-holes or goes through the attacker.
RA Guard on Cisco IOS-XE
Cisco IOS ipv6 nd raguard policy HOSTS device-role host ! ipv6 nd raguard policy UPLINK device-role router ! interface range GigabitEthernet1/0/1 - 46 ipv6 nd raguard attach-policy HOSTS interface GigabitEthernet1/0/48 ipv6 nd raguard attach-policy UPLINKDHCPv6 Guard
Cisco IOS ipv6 dhcp guard policy CLIENTS device-role client ! interface range GigabitEthernet1/0/1 - 46 ipv6 dhcp guard attach-policy CLIENTSThe rest
Feature What it does Device tracking (SISF) binding table of address, MAC, port and VLAN from NDP and DHCPv6 ND inspection drops NS and NA that contradict the binding table Source Guard drops traffic sourced from addresses not in the binding table Destination Guard drops traffic to addresses with no binding, limiting NDP cache exhaustion Evasion
Attackers hid RAs behind extension headers or fragments so the switch could not see the ICMPv6 type. RFC 7113 says RA Guard must parse the whole header chain and drop what it cannot parse, and RFC 7112 requires the whole chain in the first fragment. On Cisco a port ACL with
deny ipv6 any any undetermined-transportcloses the gap on older code.They will ask next
How do you find a rogue router quickly before RA Guard is in place?
Run
rdisc6 eth0(or checkshow ipv6 routerson a router) to list who is sending RAs and their link-local addresses. Turn the link-local into a MAC (EUI-64 or the NDP cache), thenshow mac address-table addresson the switch to find the port.Does RA Guard protect a wireless network?
Only if the wireless side does it too. Clients on the same SSID talk through the AP or controller, not through a wired access port, so enable the controller's RA filtering as well.
Traps
- Applying RA Guard with a host policy on the uplink to the real router.
- Forgetting DHCPv6 Guard, which is the same problem for DHCPv6.
How did you do?Book 4.2 IP Version 6Book 8.1 Trust and ThreatsOwn pageWhat is MLD and how does it relate to IGMP?
Say this first
Multicast Listener Discovery is how IPv6 hosts tell routers which multicast groups they want, the IPv6 version of IGMP. MLDv1 matches IGMPv2 and MLDv2 matches IGMPv3, including source-specific multicast. It runs inside ICMPv6, sent from link-local addresses with hop limit 1 and a Router Alert option. Even a network with no multicast applications uses MLD, because hosts report the solicited-node groups NDP depends on.
Go deeper
Messages
ICMPv6 type Message 130 Multicast Listener Query 131 MLDv1 Report 132 MLDv1 Done 143 MLDv2 Report (sent to ff02::16)Mapping to IGMP
IPv4 IPv6 IGMPv2 MLDv1 (RFC 2710) IGMPv3 MLDv2 (RFC 3810) IGMP snooping MLD snooping How it plays out
- A router on the link acts as querier; the one with the lowest IPv6 address wins.
- Hosts answer queries with reports for every group they want, including their solicited-node groups.
- The Router Alert option in a Hop-by-Hop header makes routers look at reports for groups they are not members of.
On switches
MLD snooping lets a switch forward each group only to ports that asked for it. Like IGMP snooping it needs a querier on the VLAN to keep its state fresh. Enable snooping and a querier together, or leave both off.
They will ask next
Why does MLD use hop limit 1?
Group membership is a per-link matter. Hop limit 1 guarantees the reports never get forwarded.
Do you need to allow MLD through host firewalls?
Yes, at least on the local link. Blocking MLD reports breaks solicited-node delivery when the switches snoop, which then breaks address resolution.
Traps
- Saying MLD is a separate IP protocol. It is ICMPv6.
- Thinking a network without multicast applications has no MLD traffic.
How did you do?Book 4.3 MulticastBook 4.2 IP Version 6Own pageWhat are IPv6 extension headers? Name the main ones and the order they go in.
Say this first
Optional headers between the IPv6 header and the payload, chained by the Next Header field: each one says what comes after it. The main ones are Hop-by-Hop Options (0), Routing (43), Fragment (44), ESP (50), AH (51) and Destination Options (60). Only Hop-by-Hop is meant for routers along the path, and only if they are configured to process it. The rest are for the destination, or for the nodes listed in a Routing header.
Go deeper
The chain
Output IPv6 header Next Header = 0 (Hop-by-Hop) Hop-by-Hop Next Header = 44 (Fragment) Fragment Next Header = 6 (TCP) TCP segmentThe headers
Value Header Who processes it 0 Hop-by-Hop Options routers on the path, if configured to (RFC 8200) 60 Destination Options the destination, or each listed hop when placed before a Routing header 43 Routing the nodes listed in it 44 Fragment the destination, at reassembly 51 AH the destination 50 ESP the destination 59 No Next Header nothing follows Recommended order (RFC 8200)
- IPv6 header
- Hop-by-Hop Options (must come first if present)
- Destination Options (for the hops in the Routing header)
- Routing
- Fragment
- AH
- ESP
- Destination Options (for the final destination)
- Upper layer (TCP, UDP, ICMPv6)
Each appears at most once, except Destination Options, which may appear twice.
Routing header types
- Type 0: source routing through a list of hops. Deprecated by RFC 5095 because a packet could bounce between two hosts many times and amplify traffic.
- Type 2: Mobile IPv6.
- Type 4: the Segment Routing Header used by SRv6 (RFC 8754).
They will ask next
How does a firewall find the TCP port in an IPv6 packet?
It walks the chain, header by header, following Next Header until it reaches the upper layer. That is slower than IPv4's fixed offset, and it is why RFC 7112 requires the whole chain to be in the first fragment.
Where is the Router Alert option carried?
In a Hop-by-Hop Options header. MLD reports use it so routers inspect them.
Traps
- Saying every router processes every extension header.
- Forgetting that ESP and AH are extension headers too.
How did you do?Book 4.2 IP Version 6Own pageHow does fragmentation work in IPv6?
Say this first
Routers never fragment IPv6 packets. If a packet is too big for the next link, the router drops it and sends an ICMPv6 Packet Too Big (type 2) with the link MTU back to the source. The source lowers its path MTU for that destination and resends, fragmenting itself if it must, using a Fragment extension header. Every link must carry at least 1280 bytes. This makes Path MTU Discovery essential, so blocking Packet Too Big breaks connections.
Go deeper
The Fragment header (8 bytes)
Field Bits Next Header 8 Reserved 8 Fragment Offset (8-byte units) 13 Reserved 2 M (more fragments) 1 Identification 32 The Identification field is 32 bits, against 16 in IPv4, so it wraps much more slowly.
Rules worth quoting
- Minimum link MTU is 1280 bytes. A host that never wants to think about PMTUD can send 1280-byte packets.
- Path MTU Discovery is RFC 8201. Packet Too Big messages are sent even in reply to multicast.
- Overlapping fragments must be dropped (RFC 5722).
- The first fragment must hold the whole header chain up to the upper layer (RFC 7112).
- Atomic fragments (a Fragment header on an unfragmented packet) are deprecated (RFC 8021).
Where it hurts
- PMTUD black holes: a firewall drops Packet Too Big, the source keeps sending full-size packets, and the session hangs after the handshake.
- Tunnels: a 6in4 tunnel over a 1500-byte IPv4 path carries 1480 bytes of IPv6; GRE carries 1476.
- Large UDP: DNS answers that need fragments are often dropped. DNS Flag Day 2020 recommended an EDNS buffer of 1232 bytes, which is 1280 minus the 40-byte IPv6 and 8-byte UDP headers.
Mitigations
Cisco IOS interface Tunnel0 ipv6 mtu 1400 ipv6 tcp adjust-mss 1340MSS clamping hides the problem for TCP. Letting Packet Too Big through fixes it for everything.
They will ask next
Why did IPv6 move fragmentation to the source?
Fragmenting costs routers CPU and complicates hardware. Making the source responsible keeps the forwarding path simple and pushes hosts to send the right size from the start.
Why is the MSS 1340 in that example?
IPv6 MTU 1400 minus 40 bytes of IPv6 header and 20 bytes of TCP header gives 1340.
Traps
- Saying routers fragment IPv6 if DF is not set. There is no DF bit; routers never fragment.
- Filtering ICMPv6 Packet Too Big at the firewall.
Can I block ICMPv6 at the firewall like many people do with ICMP in IPv4?
Say this first
No. IPv6 depends on ICMPv6. Neighbor Discovery, router discovery and MLD all run over it, so dropping it on an interface breaks the link. Packet Too Big is required for Path MTU Discovery because routers do not fragment, so dropping it in transit creates black holes. Follow RFC 4890: always allow the error messages (types 1, 2, 3 and 4), allow NDP and MLD on the local link, and decide on echo by policy, usually allowed and rate-limited.
Go deeper
What to allow (RFC 4890, simplified)
Type Message Through the firewall To the firewall itself 1 Destination Unreachable allow allow 2 Packet Too Big allow, always allow 3 Time Exceeded allow (traceroute, loops) allow 4 Parameter Problem allow allow 128, 129 Echo request and reply policy, usually allow and rate-limit allow, rate-limited 133 to 137 RS, RA, NS, NA, Redirect never crosses a router allow on the link 130 to 132, 143 MLD never crosses a router allow on the link The Cisco ACL trap
Every IPv6 ACL on IOS ends with three implicit lines:
Output permit icmp any any nd-na permit icmp any any nd-ns deny ipv6 any anyIf you write your own
deny ipv6 any any logat the end, it matches before the implicit permits and kills neighbor discovery on that interface. Add the NS and NA permits above your deny.An edge ACL that respects ICMPv6
Cisco IOS ipv6 access-list EDGE-IN permit icmp any any destination-unreachable permit icmp any any packet-too-big permit icmp any any time-exceeded permit icmp any any parameter-problem permit icmp any any echo-request permit icmp any any echo-reply permit icmp any any nd-ns permit icmp any any nd-na permit tcp any 2001:db8:acad:100::/64 eq 443 deny ipv6 any any logThey will ask next
Isn't allowing ICMPv6 a reconnaissance risk?
Echo is the only part that helps scanning, and scanning a /64 by ping is hopeless anyway. Rate-limit echo if you want. The error messages carry information the sender needs to work at all.
Why does Packet Too Big get special treatment?
Because without it nothing else fixes the problem. In IPv4 a router could fragment as a fallback; in IPv6 the source must learn the MTU or the connection stalls.
Traps
- Copying an IPv4 "deny icmp any any" habit to IPv6.
- Ending a Cisco IPv6 ACL with an explicit deny and no NS and NA permits above it.
How did you do?Book 4.2 IP Version 6Book 8.5 Example SystemsOwn pageWhat tunneling options exist for carrying IPv6 over IPv4, and how do you configure a 6in4 tunnel?
Say this first
6in4 (also called a manual or configured tunnel) puts the IPv6 packet directly inside IPv4 with protocol 41. GRE does the same with a 4-byte GRE header and can carry routing protocols and multicast. Older automatic methods (6to4, ISATAP, Teredo) are obsolete. Providers use 6rd to give IPv6 over an IPv4 access network, and DS-Lite or MAP to carry IPv4 over IPv6. On IOS 6in4 is
tunnel mode ipv6ip.Go deeper
The options
Method Encapsulation Status 6in4 (manual) IPv4 protocol 41 fine for static site links and tunnel brokers GRE IPv4, GRE, IPv6 fine, adds 4 bytes, carries multicast 6to4 protocol 41, 2002::/16addressesdeprecated, relays unreliable (RFC 7526) ISATAP protocol 41 inside a site obsolete Teredo UDP 3544 through NAT, 2001::/32obsolete, avoid 6rd (RFC 5969) protocol 41 with the ISP's own prefix ISP deployments DS-Lite (RFC 6333) IPv4 inside IPv6 to a carrier NAT IPv4 over IPv6-only access 6in4 on IOS
Cisco IOS interface Tunnel0 description 6in4 to ISP1 no ip address ipv6 address 2001:db8:ffff:100::2/64 tunnel source GigabitEthernet0/0/1 tunnel destination 203.0.113.9 tunnel mode ipv6ip ! ipv6 route ::/0 Tunnel0The IPv6 MTU over a 1500-byte IPv4 path is 1480. For GRE (
tunnel mode gre ip) it is 1476.Things that go wrong
- NAT in the path: protocol 41 has no ports, so PAT cannot track it. 6in4 through a home router's NAT usually fails; Teredo exists for that case.
- Firewalls: protocol 41 and UDP 3544 tunnels can carry IPv6 straight past IPv4-only policy. Block them at the edge unless you use them.
- MTU: Packet Too Big messages from the tunnel ingress must reach the sender.
They will ask next
Why prefer GRE over 6in4 between two of your own routers?
GRE carries multicast and many protocols, so the same tunnel can run OSPFv3, IPv4 and IPv6 together, and it is easy to wrap in IPsec. 6in4 has 4 bytes less overhead and nothing else.
How is a tunnel interface route different from an Ethernet interface route?
A tunnel is point-to-point, so
ipv6 route ::/0 Tunnel0works without a next hop. On Ethernet an interface-only route makes the router try neighbor discovery for every destination.
Traps
- Recommending 6to4 or Teredo for a new design.
- Forgetting that protocol 41 does not pass through PAT.
How did you do?Book 3.3 Internet (IP)Book 4.2 IP Version 6Own pageHow is OSPFv3 different from OSPFv2?
Say this first
Same SPF engine, areas, LSA flooding and neighbor states. The differences: OSPFv3 runs per link rather than per subnet, uses link-local addresses for hellos and next hops, and sends to
ff02::5andff02::6. The router ID is still a 32-bit number and must be set by hand on a router with no IPv4 address. Authentication is no longer in the protocol: it uses IPsec or the authentication trailer. Prefixes moved out of the router and network LSAs into new Link and Intra-Area-Prefix LSAs. Address families let it carry IPv4 too.Go deeper
Side by side
OSPFv2 OSPFv3 Carries IPv4 IPv6, and IPv4 with address families (RFC 5838) Runs on a subnet a link; several instances per link with Instance ID Neighbor source address interface IPv4 link-local Multicast 224.0.0.5, 224.0.0.6 ff02::5,ff02::6Router ID 32-bit, can be taken from an IPv4 address 32-bit, set by hand if no IPv4 exists Authentication in the packet header IPsec AH or ESP (RFC 4552), or authentication trailer (RFC 7166) Prefixes carried in router (1) and network (2) LSAs Intra-Area-Prefix LSA Must match on the link subnet and mask, area, timers, auth area, timers, Instance ID; no subnet check New LSAs
LSA Function code Role Router 0x2001 topology only Network 0x2002 topology only Inter-Area-Prefix 0x2003 replaces type 3 Inter-Area-Router 0x2004 replaces type 4 AS-External 0x4005 type 5 NSSA 0x2007 type 7 Link 0x0008 link-local scope: the router's link-local address and prefixes on the link Intra-Area-Prefix 0x2009 prefixes of routers and transit links Separating topology from prefixes means a prefix change does not force a full SPF run.
Config on IOS-XE
Cisco IOS ipv6 unicast-routing ! router ospfv3 1 router-id 1.1.1.1 address-family ipv6 unicast passive-interface GigabitEthernet0/0/0 exit-address-family ! interface GigabitEthernet0/0/1 ospfv3 1 ipv6 area 0The older form
ipv6 router ospf 1withipv6 ospf 1 area 0on the interface still works.They will ask next
Two routers on a link have different global prefixes. Will OSPFv3 form an adjacency?
Yes. OSPFv3 hellos carry no prefix or mask and neighbors talk over link-local addresses. That is a difference from OSPFv2, which refuses a subnet mismatch on broadcast links.
Why do OSPFv3 routes show FE80 next hops?
The next hop is the neighbor's link-local address, learned from its Link LSA and hellos. That is normal and stays stable if global prefixes change.
Traps
- Saying OSPFv3 router IDs are 128-bit.
- Forgetting to set a router ID on an IPv6-only router. The process will not start.
How did you do?Book 3.4 RoutingBook 4.2 IP Version 6Own pageHow do you configure a static IPv6 route to a link-local next hop, and why do you need the interface?
Say this first
ipv6 route 2001:db8:acad:20::/64 GigabitEthernet0/0/1 fe80::2. You must give the exit interface because every link has thefe80::/10prefix, sofe80::2alone does not say which link it is on. IOS rejects a link-local next hop without an interface. Link-local next hops are a good habit: they survive renumbering of the global prefix and match what routing protocols do.Go deeper
The three forms
Cisco IOS ! fully specified, link-local next hop ipv6 route 2001:db8:acad:20::/64 GigabitEthernet0/0/1 fe80::2 ! recursive, global next hop ipv6 route 2001:db8:acad:20::/64 2001:db8:acad:ff::2 ! interface only ipv6 route 2001:db8:acad:20::/64 GigabitEthernet0/0/1The interface-only trap
On Ethernet, an interface-only route makes the router treat every destination as on-link and send a Neighbor Solicitation for each one. The next router does not answer for addresses that are not its own, so the route fails. IPv4 often hides this mistake with proxy ARP; IPv6 does not. Use interface-only routes only on point-to-point interfaces like tunnels.
Floating static
Cisco IOS ipv6 route ::/0 GigabitEthernet0/0/1 fe80::2 ipv6 route ::/0 GigabitEthernet0/0/2 fe80::3 200The second route has administrative distance 200 and only installs when the first goes away.
Make next hops readable
Set link-local addresses by hand on router links (
ipv6 address fe80::1 link-local,fe80::2on the other end) so routes and neighbor tables are easy to read and do not change when a line card is swapped.Other platforms
Junos set routing-options rib inet6.0 static route 2001:db8:acad:20::/64 qualified-next-hop fe80::2 interface ge-0/0/1.0Shell ip -6 route add 2001:db8:acad:20::/64 via fe80::2 dev eth1They will ask next
Does a floating static to a link-local next hop go away if the neighbor dies but the link stays up?
Not by itself. The route stays while the interface is up. Add BFD for static routes or IP SLA tracking if the link can stay up with a dead neighbor behind it.
What does the route look like in the table?
S 2001:DB8:ACAD:20::/64 [1/0]followed byvia FE80::2, GigabitEthernet0/0/1.
Traps
- Leaving out the interface with a link-local next hop.
- Using interface-only static routes on Ethernet and expecting proxy ARP behaviour.
How did you do?Book 4.2 IP Version 6Own page
Expert7
Should we use ULA internally and NAT66 at the edge, the way we use RFC 1918 and NAT today?
Say this first
Usually no. The default IPv6 design is global addresses everywhere, with a stateful firewall at the edge for protection. ULA (
fd00::/8plus a random 40-bit global ID, RFC 4193) is useful for networks that never reach the internet, or alongside global addresses for stable internal names. NAT66 is not a standard; NPTv6 (RFC 6296) is a stateless prefix swap and only experimental. And there is a trap: hosts' default address selection prefers IPv4 over ULA, so a ULA-only network quietly keeps using IPv4.Go deeper
Why people ask
They want what RFC 1918 gave them: addresses that do not change when they change ISP, and a feeling of being hidden.
Better answers to the real needs
Need IPv6 answer Stable addressing across ISPs get provider-independent space from your RIR and run BGP, or use PA space and plan for renumbering Hide internal hosts stateful firewall, default deny inbound Isolated networks (OT, labs) ULA alone is fine Stable internal service addresses ULA alongside GUA, with care The address selection trap
RFC 6724's default policy table gives
fc00::/7a precedence of 3 and IPv4 (::ffff:0:0/96) 35. If a name has both an A record and a ULA AAAA record, hosts try IPv4 first. For internet destinations, a host with only a ULA source sees a label mismatch with the global destination and also prefers IPv4. So a ULA plus NAT66 design can be "deployed" and carry almost no traffic.If you do use ULA
- Generate the 40-bit global ID randomly.
fd00::/48is what everyone types and will collide in a merger. - Never advertise it to the internet, and filter
fc00::/7at the edge in both directions. - Expect to tune the policy table (
/etc/gai.confon Linux,netsh interface ipv6 show prefixpolicieson Windows) if you need hosts to prefer it.
They will ask next
What is the difference between NAT66 and NPTv6?
NPTv6 maps one prefix to another of the same length, 1:1 and stateless, adjusting bits so checksums stay valid. NAT66 usually means stateful many-to-one translation with ports, which IPv6 was meant to make unnecessary and which no RFC standardizes.
How unlikely is a ULA collision?
With a truly random 40-bit global ID, two organizations colliding is around one in a trillion. With
fd00::/48it is certain.
Traps
- Saying NAT provides security. The firewall does.
- Picking a non-random ULA prefix.
How did you do?Book 4.2 IP Version 6Own page- Generate the 40-bit global ID randomly.
Is IPv6 more or less secure than IPv4? What attacks are new, and how do you defend against them?
Say this first
Neither. It has a different attack surface. The old myths are that IPsec makes it secure and that /64s cannot be scanned. The new risks are NDP spoofing and rogue RAs, NDP cache exhaustion on routers, extension header and fragment tricks to slip past filters, tunnels that bypass IPv4 policy, and IPv6 running unmanaged on "IPv4-only" networks. The defense is policy parity with IPv4, first hop security on the switches, /127s on links, NDP cache limits and a deliberate ICMPv6 policy.
Go deeper
Myths
- IPsec: support was once a MUST for nodes, never use. It is a SHOULD now.
- Unscannable: a /64 is too big to sweep blindly, but addresses leak. Low numbers (
::1,::10), EUI-64 with a known vendor OUI, DNS records, and NDP caches on a compromised host all narrow the search.
New or changed attacks
Attack How it works Defense Rogue RA becomes the default gateway or adds a prefix RA Guard NA spoofing claims another host's address (override flag) ND inspection, SISF DAD denial answers every DAD probe ND inspection NDP cache exhaustion scans a /64 so the router fills its cache with incomplete entries /127 on links, ipv6 nd cache interface-limit, Destination GuardExtension header evasion hides the transport header beyond what the filter parses drop undetermined-transport, drop RH0, rate-limit Hop-by-Hop Tunnel bypass 6in4 (protocol 41) or Teredo (UDP 3544) carry IPv6 through IPv4 policy block them at the edge unless used The quiet one: IPv6 on an IPv4-only network
Windows prefers IPv6 and asks for DHCPv6 even when the network team never deployed IPv6. Tools such as mitm6 answer those requests, make themselves the DNS server and redirect traffic. Either deploy IPv6 properly with FHS, or block RAs and DHCPv6 server messages on access ports. Do not just hope it is unused.
Parity checklist
- Every IPv4 ACL and firewall rule has an IPv6 twin.
- Logging, NetFlow and IDS see IPv6.
- Management plane access lists cover IPv6 (VTY, SNMP, NTP).
They will ask next
Should we just disable IPv6 on Windows clients?
Microsoft does not recommend it and parts of Windows assume IPv6 is present. Controlling it on the network (RA Guard, DHCPv6 Guard, firewall policy) is the supported way.
Why does NDP cache exhaustion not happen with ARP?
It can, but an IPv4 /24 has 254 addresses and a /64 has 2^64. The router has to hold state while it resolves each scanned address, so a /64 can be used to fill the cache and starve real neighbors.
Traps
- Saying IPv6 cannot be scanned.
- Deploying IPv6 routing with no matching firewall policy.
How did you do?Book 4.2 IP Version 6Book 8.1 Trust and ThreatsOwn pageA host has five IPv6 addresses. How does it decide which one to use as the source?
Say this first
RFC 6724 defines the rules. For the source: prefer the same address as the destination, then matching scope, avoid deprecated addresses, prefer the outgoing interface, prefer a matching label from the policy table, prefer temporary addresses, then the longest matching prefix. The same RFC also orders destinations when DNS returns several, which is why IPv6 is normally tried before IPv4 and why ULA loses to IPv4.
Go deeper
Source address rules, in order
- Prefer the same address as the destination.
- Prefer the appropriate scope (link-local for link-local destinations, global for global).
- Avoid deprecated addresses (preferred lifetime expired).
- Prefer home addresses (Mobile IPv6).
- Prefer addresses on the outgoing interface.
- Prefer a matching label in the policy table.
- Prefer temporary addresses.
- Use the longest matching prefix.
Default policy table
Prefix Precedence Label ::1/12850 0 ::/040 1 ::ffff:0:0/96(IPv4)35 4 2002::/16(6to4)30 2 2001::/32(Teredo)5 5 fc00::/7(ULA)3 13 Destination ordering
With several AAAA and A records, rules such as "prefer matching label" and "prefer higher precedence" put native IPv6 above IPv4, and IPv4 above Teredo, 6to4 and ULA. Happy Eyeballs then races the attempts so a broken path costs only a short delay.
Where to change it
- Linux (glibc):
/etc/gai.conf. - Windows:
netsh interface ipv6 show prefixpolicies, andset prefixpolicyto change it.
They will ask next
Why might a dual-stack laptop use IPv4 to reach an internal server that has a ULA AAAA record?
ULA has precedence 3 and IPv4 has 35, so the A record is tried first. Changing the policy table, or using global addresses internally, fixes it.
The host keeps using an old address after renumbering. Why?
It is still valid. If its preferred lifetime has not expired, rule 3 does not push it down. Deprecate the old prefix by advertising it with a preferred lifetime of 0.
Traps
- Saying the host uses "its first address".
- Forgetting that applications can bind to a specific source and bypass the rules.
How did you do?Book 4.2 IP Version 6Own pagePackets with extension headers are often dropped on the internet. Why, and what does that mean for your filtering policy?
Say this first
Hardware forwards on a fixed number of header bytes. A long header chain pushes the TCP or UDP header past what the ASIC parses, so ACLs cannot match ports, and Hop-by-Hop options get punted to the CPU, which is a denial-of-service risk. Many operators drop or rate-limit those packets, and measurements (RFC 7872) show real loss on the internet. My policy: drop Routing type 0, rate-limit Hop-by-Hop to the control plane, drop packets whose transport header cannot be found, and allow ESP, AH and fragments where needed.
Go deeper
Why routers struggle
- Parse depth. Line cards look at a fixed window of the packet. If the transport header is beyond it, the ACL sees "unknown" and has to pick between dropping and permitting blind.
- Hop-by-Hop. Processing options means the slow path. RFC 8200 now lets routers ignore Hop-by-Hop unless configured to process it, but older gear punts it.
- Fragments. Non-first fragments carry no port numbers at all.
What this means for a filter
Traffic Edge policy Routing header type 0 drop (deprecated, RFC 5095) Hop-by-Hop rate-limit or drop at the edge unless a service needs it Transport header not found in the first fragment drop Fragment header allow, subject to the above, or large UDP like DNS breaks ESP, AH allow if you run IPsec Destination Options usually allow, watch for abuse On Cisco IOS a port or interface ACL entry
deny ipv6 any any undetermined-transportdrops packets whose upper-layer protocol cannot be determined.Design consequences
- New protocols that rely on extension headers (SRv6, some in-band telemetry) work inside one operator's network, not reliably across the internet.
- Security devices must parse the full chain or fail closed.
They will ask next
Why can an attacker use extension headers to bypass RA Guard?
By adding Destination Options or splitting the packet into fragments so the ICMPv6 type is not where the switch looks. RFC 7113 tells RA Guard to parse the full chain and drop what it cannot classify.
Should you just drop all packets with extension headers?
No. Fragments are legitimate (large DNS responses, some VPNs), and ESP is an extension header. Filter by type and by whether the transport header is visible.
Traps
- Assuming the ASIC sees the whole packet.
- Dropping all fragments and then wondering why DNSSEC answers fail.
How did you do?Book 4.2 IP Version 6Own pageHow do NAT64 and DNS64 work, and what breaks with them?
Say this first
They let IPv6-only clients reach IPv4-only servers. DNS64 answers an AAAA query for a name that has only an A record by building a synthetic AAAA: the IPv4 address embedded in a NAT64 prefix, usually the well-known
64:ff9b::/96(RFC 6052). The client sends to that address, and a stateful NAT64 (RFC 6146) translates the packet to IPv4, keeping port state much like PAT. It breaks anything that does not go through DNS: IPv4 literals, protocols that carry addresses inside the payload, and DNSSEC validation on the client. 464XLAT fixes most of that by adding a small translator on the client.Go deeper
The flow
Output 1. Client asks DNS64 for AAAA of app.example.com 2. DNS64 finds no AAAA, finds A 192.0.2.33 3. DNS64 returns AAAA 64:ff9b::c000:221 (192.0.2.33 = c000:0221) 4. Client opens TCP to [64:ff9b::c000:221]:443 5. NAT64 translates to 198.51.100.7:40001 -> 192.0.2.33:443 and keeps the mapping198.51.100.7is the NAT64's IPv4 pool address.What breaks
Case Why IPv4 literals ( http://192.0.2.33/)no DNS lookup, no synthesis Apps that open IPv4-only sockets the client has no IPv4 SIP, FTP and other protocols with addresses inside needs an ALG DNSSEC validated on the client synthetic AAAA records fail validation Logging and abuse handling many users share one IPv4, as with CGNAT 464XLAT (RFC 6877)
The client runs a CLAT: a local stateless translator that gives apps a private IPv4 address and turns their IPv4 packets into IPv6 toward the NAT64 (called the PLAT here). IPv4 literals and IPv4-only apps work again. Android has shipped a CLAT for years, and mobile carriers use this to run IPv6-only networks.
Finding the prefix
Clients can discover the NAT64 prefix by looking up
ipv4only.arpa(RFC 7050) or from the PREF64 option in RAs. Operators may use their own network-specific prefix instead of64:ff9b::/96.They will ask next
Why not just use NAT-PT?
NAT-PT combined translation and DNS rewriting in one box and was deprecated for its problems. NAT64 and DNS64 separate the two jobs and are what replaced it.
What is the difference between stateful and stateless NAT64?
Stateful NAT64 shares a small IPv4 pool among many IPv6 clients using ports, like PAT. Stateless (SIIT) maps addresses 1:1 with no state, which needs one IPv4 address per IPv6 host it serves.
Traps
- Saying DNS64 translates packets. It only synthesizes DNS answers.
- Forgetting that IPv4 literals bypass DNS64.
How did you do?Book 4.2 IP Version 6Own pageYou get a /48 for a site. How do you lay out the IPv6 addressing plan?
Say this first
I split the 16 bits of subnet ID on nibble boundaries so each level is one hex digit and summarizes cleanly. One block for infrastructure (loopbacks as /128s from one /64, a reserved /64 per link with a /127 used), then blocks per building or zone, and inside them a /64 per VLAN. I encode something readable, like the VLAN number, in the last digits, leave room to grow, and never encode IPv4 addresses into IPv6 ones. Everything goes into IPAM before the first address is configured.
Go deeper
Example: site prefix 2001:db8:a001::/48
The subnet ID is the fourth hextet, four hex digits:
Z B V V.Digit Meaning Z zone: 0 infrastructure, 1 to 9 buildings, f data center B floor or block inside the zone V V VLAN or segment index Prefix Use 2001:db8:a001:0::/64router and switch loopbacks, /128 each 2001:db8:a001:1::/64to2001:db8:a001:ff::/64one /64 reserved per point-to-point link, /127 configured 2001:db8:a001:1000::/52building 1, summarizable 2001:db8:a001:1110::/64building 1, floor 1, VLAN 10 2001:db8:a001:1120::/64building 1, floor 1, VLAN 20 2001:db8:a001:2000::/52building 2 2001:db8:a001:f000::/52data center VLAN 10 written as
10in hex is really 16, but people read it as ten, which is the point.Principles
- Nibble boundaries (/52, /56, /60, /64) keep prefixes readable and reverse DNS simple.
- Summarize by location so each building is one route in the core.
- Leave gaps: use 1, 2, 3 for buildings and keep the rest free.
- Do not embed IPv4 (
...:10:20:30:40). It ties the plans together and looks clever only until renumbering. - Gateways get
::1on each VLAN, or a fixed scheme you document. - Multi-site: a /48 per site from the organization's block (for example 2001:db8:a001::/48, 2001:db8:a002::/48) keeps sites summarizable.
They will ask next
How many /64s does that give each building?
A /52 holds 2^(64-52) = 4,096 /64s. With 16 possible zones that uses the whole /48, so keep spare zones unassigned.
PI or PA space?
Provider-independent space from the RIR if you multihome or want to change ISPs without renumbering. It costs a membership fee and you run BGP. PA space is free with the circuit but ties you to the provider.
Traps
- Using anything but /64 for LANs.
- Designing on non-nibble boundaries that nobody can read at a glance.
How did you do?Book 4.2 IP Version 6Own pageThe ISP changes the prefix it delegates to your site. What happens to the hosts, and how do you design for it?
Say this first
The router starts advertising the new prefix, and hosts form new addresses at once. They keep the old ones until the old prefix's lifetimes run out, unless the router deprecates it by advertising it with a preferred lifetime of 0. A host cannot be forced to drop the old address fast: it ignores attempts to cut the valid lifetime below two hours. Design for it with stable PD from the ISP, provider-independent space for important sites, names instead of literal addresses in configs, and policies written against prefixes held in one place.
Go deeper
What hosts do
- Preferred lifetime 0 on the old prefix: addresses become deprecated, kept for open sessions, not used for new ones. This is the graceful way.
- The two-hour rule (RFC 4862): an RA cannot reduce the remaining valid lifetime below two hours, so a forged RA cannot wipe addresses instantly. The old address stays valid at least that long.
- If the CPE simply stops advertising the old prefix (a reboot that forgets it), hosts keep using it until its preferred lifetime runs out. Outbound traffic from it is dropped upstream and users see failures.
What breaks in the network
Item Problem ACLs and firewall rules with literal addresses stop matching DNS AAAA records point at old addresses Static next hops with global addresses dead Monitoring targets dead Designing for it
- Ask the ISP for a stable, persistent delegation.
- Use provider-independent space (and BGP) at sites that cannot tolerate renumbering.
- Use link-local next hops, general prefixes on IOS (
ipv6 address FROM-ISP ::1:0:0:0:1/64) and object groups. - Use shorter lifetimes on prefixes you expect to change.
- Consider ULA alongside the global prefix for internal-only services that must not move.
They will ask next
Why does the two-hour rule exist?
Without it, one forged RA with a valid lifetime of 0 would remove every host's address on the link. Unauthenticated RAs can only shorten the lifetime to two hours.
How does a general prefix help on IOS?
Interfaces reference a named prefix learned by DHCPv6-PD, so when the delegation changes, every interface built from it updates without touching the config.
Traps
- Assuming hosts drop the old address as soon as the new prefix appears.
- Hard-coding global addresses in ACLs at sites with PA space.
How did you do?Book 4.2 IP Version 6Own page