IPv4/IPv6 Coexistence: Dual Stack, DS-Lite, NAT64, DNS64, 464XLAT and Teredo
How networks run IPv4 and IPv6 side by side and connect one to the other: dual stack, tunnels such as DS-Lite and 6rd, stateless and stateful IPv4/IPv6 translation, DNS64 address synthesis, 464XLAT and Teredo, each built and captured in a real lab, plus the classic attacks on firewalls and NATs.
kvi5hnuCode Sprout team member26 min readOn this page
When the last large blocks of IPv4 addresses were handed out in 2011, the plan was simple. Every host would run both protocols for a while (dual stack, RFC 4213), services would add IPv6, and IPv4 would fade away. Things didn't go that way. IPv6 now carries a large share of Internet traffic, roughly half of the traffic reaching some of the biggest services, but IPv4 is still everywhere, and it will be for a long time. Networks have to deal with every combination:
- dual-stack hosts on dual-stack networks;
- IPv4-only hosts and applications on networks that would rather run only IPv6;
- IPv6-only hosts that still need to reach IPv4-only servers.
There are two basic tools. Tunneling carries one protocol inside the other across a network that supports only the outer one. Translation converts packets from one protocol to the other, so an IPv6-only host can talk to an IPv4-only host. Translation is NAT across address families, which is why this topic belongs with firewalls and NAT.
Dual stack and Happy Eyeballs
On a dual-stack host, every application has a choice: when a name has both A (IPv4) and AAAA (IPv6) records, which address should it try? If it always tries IPv6 first and the IPv6 path is broken, users wait for a timeout. Happy Eyeballs (RFC 8305) fixes this. The client starts with IPv6, and if that hasn't connected after a short delay (250 milliseconds is the recommended value), it starts an IPv4 attempt in parallel and uses whichever connects first. Every major browser and operating system does this, which is why a broken IPv6 path today usually costs a fraction of a second instead of a failed page.
Dual stack is still the simplest and most common arrangement. Its drawback is that the network must run, address, secure and monitor two protocols, and the IPv4 side still needs NAT, often carrier-grade NAT (article 35). The rest of this article covers what operators do instead.
Tunnels: carrying one protocol across the other
IPv6 over IPv4: 6to4, 6rd and Teredo
Early tunnels carried IPv6 over the IPv4 Internet:
- 6to4 (RFC 3056) gave every public IPv4 address an IPv6 prefix,
2002:followed by the IPv4 address, and relied on public relays. Those relays were often far away or broken, and the anycast relay address was deprecated in 2015 (RFC 7526). - 6rd (IPv6 Rapid Deployment, RFC 5969) applies the same idea inside one ISP, with the ISP's own prefix and relays. It let some ISPs offer IPv6 quickly over an IPv4-only network. The mapping between a customer's IPv4 address and its IPv6 prefix is computed, so no per-customer state is needed.
- Teredo works through NATs and is described later in this article.
IPv4 over IPv6: DS-Lite
Many large ISPs went the other way: they run only IPv6 in their own network and carry customers' IPv4 inside it. Dual-Stack Lite (DS-Lite), RFC 6333, has two parts:
- the B4 ("basic bridging broadband") element, usually the home router;
- the AFTR ("address family transition router") in the ISP's network.
The B4 puts each IPv4 packet from the home network inside an IPv6 packet and sends it to the AFTR through an IPv4-in-IPv6 tunnel called a softwire. The AFTR removes the IPv6 header and applies carrier-grade NAT, so the home router needs no public IPv4 address, and it doesn't do NAT itself either. The home router learns the AFTR's name from DHCPv6 (the AFTR-Name option, RFC 6334). IPv6 traffic from the home goes out natively without a tunnel. The diagram follows one IPv4 packet from the home to the server, with its headers on each segment shown underneath:

The lab builds exactly this, with Linux ip6tnl tunnels in ipip6 mode at both ends. The tunnel's own IPv4 addresses are 192.0.0.2 (B4) and 192.0.0.1 (AFTR), from the 192.0.0.0/29 range reserved for this. The B4's routes send all IPv4 into the tunnel, while its IPv6 goes out normally:
default dev sw0 scope link
192.0.0.0/29 dev sw0 proto kernel scope link src 192.0.0.2
192.168.1.0/24 dev lan proto kernel scope link src 192.168.1.1
2001:db8:b4::/64 dev wan proto kernel metric 256 pref medium
default via 2001:db8:b4::1 dev wan metric 1024 pref medium
The first line is the IPv4 default route, pointing into the tunnel interface sw0; scope link means the destination is reached directly over that interface, with no next-hop router. The last line is the IPv6 default route, via the ISP's router on wan.
The ISP's core router in the middle has no IPv4 at all:
(core has no IPv4 routes at all)
Yet the home host can still reach an IPv4 web server:
home: curl http://203.0.113.10/ -> HTTP 200
On the core link, tcpdump shows each IPv4 packet inside an IPv6 packet. The outer IP6 part is the tunnel, and after it comes the inner IPv4 packet: the client's SYN (Flags [S], the first packet of a TCP connection) and the server's SYN-ACK ([S.], the dot meaning ACK):
IP6 2001:db8:b4::2 > 2001:db8:af::1: IP 192.168.1.10.38204 > 203.0.113.10.80: Flags [S], seq 164987095
IP6 2001:db8:af::1 > 2001:db8:b4::2: IP 203.0.113.10.80 > 192.168.1.10.38204: Flags [S.], seq 2517933634
And the raw bytes of the first one:
0x0000: 6003 5d9c 003c 0440 2001 0db8 00b4 0000
0x0010: 0000 0000 0000 0002 2001 0db8 00af 0000
0x0020: 0000 0000 0000 0001 4500 003c aca1 4000
0x0030: 3f06 915d c0a8 010a cb00 710a 953c 0050
0x0040: 09d5 80d7 0000 0000 a002 faf0 fdeb 0000
0x0050: 0204 05b4 0402 080a 61ff b2ef 0000 0000
0x0060: 0103 0307
The IPv6 header starts with 6. Its Next Header byte, the seventh byte (04 in 0440), is 4, meaning "IPv4". The inner IPv4 header starts at 4500 on the line labeled 0x0020. Inside, the addresses are still the private ones from the home network, c0a8 010a (192.168.1.10) to cb00 710a (203.0.113.10). Translation happens only at the AFTR, as its connection-tracking table shows. The entry has two halves: the first src=... dst=... is the packet as it arrived (from the private address), and the second is what replies look like, addressed to dst=203.0.113.1, the AFTR's public address. The server's web log confirms it sees only that public address:
TIME_WAIT src=192.168.1.10 dst=203.0.113.10 sport=38204 dport=80 src=203.0.113.10 dst=203.0.113.1 sport=80 dport=38204
203.0.113.1 - - [20/Nov/2026 20:08:27] "GET / HTTP/1.1" 200
Two practical points:
- Overlapping customer addresses. Every home might use 192.168.1.10. A real AFTR therefore keys its NAT table on the softwire's IPv6 source address as well as the inner IPv4 addresses and ports, so identical private addresses from different homes don't collide. The lab has only one home, so plain masquerade is enough.
- MTU. The tunnel adds a 40-byte IPv6 header, so the tunnel's MTU (first line below) is smaller than the link's (second line):
mtu 1460
mtu 1500
Look at the end of the hex dump: 0204 05b4 is the TCP MSS (maximum segment size, the largest TCP payload a host will accept in one segment) option with value 0x05b4 = 1460, which the home host chose for its 1500-byte Ethernet. Full-size segments wouldn't fit in the 1460-byte tunnel. Real B4s and AFTRs either clamp the MSS in passing SYNs or rely on path MTU discovery (article 47), and RFC 6333 recommends that the ISP's IPv6 network carry at least 1540-byte packets so the tunnel doesn't shrink anything.
Several later designs send IPv4 over IPv6 with less state in the ISP: lightweight 4over6 (RFC 7596) moves the NAT into the home router, and MAP-E and MAP-T (RFC 7597, RFC 7599) give each customer a share of a public IPv4 address, a fixed range of ports, computed from its IPv6 prefix, so the ISP's border routers keep no per-flow state. RFC 9313 compares these options.
Translation: IPv4-embedded IPv6 addresses
Tunnels only connect like with like: an IPv6-only host behind a tunnel still can't talk to an IPv4-only server. That requires translating the packets themselves. A first attempt, NAT-PT (Network Address Translation – Protocol Translation), translated packets and DNS answers in one box and was so fragile that it was deprecated (RFC 4966). Its replacement is a framework of separate pieces (RFC 6144):
- an address format;
- stateless and stateful packet translators;
- DNS64;
- ALGs (application-level gateways, article 35) where they are unavoidable.
The address format (RFC 6052, also in article 11) places an IPv4 address inside an IPv6 prefix. With a /96 prefix, the IPv4 address is simply the last 32 bits. Two kinds of prefix exist:
- The Well-Known Prefix (WKP)
64:ff9b::/96, which anyone can use, but only with global IPv4 addresses, not private ones. RFC 8215 adds64:ff9b:1::/48for translators used inside one organization. - A Network-Specific Prefix, taken from an operator's own IPv6 space. The lab uses
2001:db8:64::/96.
The WKP was chosen to be checksum-neutral. The TCP, UDP and ICMPv6 checksums include the IP addresses (the pseudo-header, article 45), so a translator that rewrites addresses normally has to fix the checksums. But if the 16-bit words of the prefix add up to 0xffff, which is zero in one's-complement arithmetic, adding the prefix doesn't change the sum at all. For the WKP, the nonzero words are 0x0064 and 0xff9b, and 0x0064 + 0xff9b = 0xffff. For 2001:db8:64::, 0x2001 + 0x0db8 + 0x0064 = 0x2e1d, which isn't. A quick check in the lab:
64:ff9b::/96 203.0.113.10 -> 64:ff9b::cb00:710a one's-complement sum of prefix words = 0xffff
2001:db8:64::/96 203.0.113.10 -> 2001:db8:64::cb00:710a one's-complement sum of prefix words = 0x2e1d
The WKP sums to 0xffff. The lab's prefix doesn't, so a translator using it has to adjust checksums, which is cheap and which every translator does. An operator can also choose a checksum-neutral Network-Specific Prefix.
The IPv4-embedded addresses used for this are called IPv4-converted addresses when they represent IPv4 hosts to IPv6 hosts, and IPv4-translatable addresses when an IPv6 host is given one so that it can be reached statelessly from IPv4.
Stateless translation: SIIT
Stateless IP/ICMP Translation (SIIT), now RFC 7915, translates each packet on its own, without remembering anything. It replaces one header with the other and maps addresses with the prefix, so each IPv6 host it serves needs an IPv4-translatable address with a matching IPv4 address. The main rules:
| IPv4 to IPv6 | IPv6 to IPv4 |
|---|---|
| Traffic class copied from the IPv4 DS field and ECN bits (article 25) | DS field and ECN copied from the traffic class |
| Flow label set to 0 | Identification generated by the translator |
| Payload length = total length − IPv4 header length | Total length = payload length + 20 |
| Next header = protocol, but ICMP (1) becomes ICMPv6 (58) | Protocol = next header, but ICMPv6 (58) becomes ICMP (1) |
| Hop limit = TTL − 1 | TTL = hop limit − 1 |
| IPv4 options are ignored, but a packet with an unexpired source route is dropped | Extension headers other than Fragment are not translated |
| A Fragment header is added for IPv4 fragments, and for packets with DF clear that are too big for IPv6's 1280-byte minimum MTU | DF (Don't Fragment) is set on packets larger than 1260 bytes, so path MTU discovery still works |
Like any router, the translator decrements the TTL or hop limit and sends a Time Exceeded error if it reaches zero. ICMP messages are translated too, including the copy of the original packet inside ICMP errors. Some ICMP types have no equivalent and are dropped (article 42). Because ICMP checksums don't cover a pseudo-header in IPv4 but do in IPv6, ICMP checksums are always recomputed.
One limit is fundamental: the IPv6 address space is far bigger, so IPv4 hosts can only ever reach the IPv6 hosts that have been given IPv4-translatable addresses.
Stateful translation: NAT64
Usually, the goal is the reverse: many IPv6-only clients reaching any IPv4 server, with only a few IPv4 addresses. NAT64 (RFC 6146) does this. It translates headers as SIIT does, but it chooses the IPv4 source address and port from a shared pool and keeps a table of bindings, like any NAPT. It must have endpoint-independent mapping, with endpoint-independent or address-dependent filtering (article 35), so STUN, TURN and ICE (article 36) work through it. Without them, connections can be started only from the IPv6 side. ICMP queries are tracked by their Identifier field, as with IPv4 NAT. Fragments must be handled even out of order, and a NAT64 may limit how long it keeps fragments waiting (at least 2 seconds) so they can't be used to exhaust its memory.
DNS64: making up AAAA records
An IPv6-only client looks up www.example.com and gets only an A record. It has no IPv4, so the answer is useless. DNS64 (RFC 6147) fixes this in the resolver. When a client asks for AAAA records and the name has none, the resolver looks up the A records and synthesizes AAAA records from them by putting each IPv4 address into the NAT64 prefix. The client then connects to that address, and the route for the prefix leads to the NAT64:

The lab builds the whole chain:
- an IPv6-only client
v6client(2001:db8:6::10); - a translator
nat64running BIND 9 (a widely used open-source DNS server) as a DNS64 resolver and TAYGA (a small open-source translator) as the translator; - an IPv4-only server
v4server(203.0.113.10), with a web server and the name server that holds theexample.comzone.
TAYGA is a stateless translator, so the lab makes it stateful the usual way. TAYGA maps each IPv6 client to an address from a private pool, 10.64.0.0/24, and nftables masquerades the pool to the public address 203.0.113.1. (The lab uses a Network-Specific Prefix because TAYGA, correctly, refuses to put documentation addresses like 203.0.113.10 into the WKP, which is only for global addresses.)
The client asks the DNS64 resolver for AAAA records of www.example.com, which has only an A record:
www.example.com. 300 IN AAAA 2001:db8:64::cb00:710a
That AAAA record exists nowhere except in the resolver's answer. An A query still returns the real record:
www.example.com. 300 IN A 203.0.113.10
And a name that has a real AAAA record gets that, with no synthesis:
dual.example.com. 300 IN AAAA 2001:db8:f::10
The client connects to the synthesized address:
HTTP 200 from [2001:db8:64::cb00:710a]
The translator's IPv6 side shows a normal IPv6 connection:
IP6 2001:db8:6::10.59052 > 2001:db8:64::cb00:710a.80: Flags [S], seq 1566015460, win 64800
IP6 2001:db8:64::cb00:710a.80 > 2001:db8:6::10.59052: Flags [S.], seq 3430565499, ack 1566015461
IP6 2001:db8:6::10.59052 > 2001:db8:64::cb00:710a.80: Flags [.], ack 1, win 507
IP6 2001:db8:6::10.59052 > 2001:db8:64::cb00:710a.80: Flags [P.], seq 1:89, ack 1
These are the handshake ([S], [S.], then [.], a plain ACK) and the request ([P.], data pushed to the application). After the SYNs, tcpdump shows relative sequence numbers, so seq 1:89 is the first 88 bytes of data; win is the receive window (article 6 introduced these fields). Its IPv4 side shows the same segments, with the same sequence numbers and ports, as IPv4:
IP 203.0.113.1.59052 > 203.0.113.10.80: Flags [S], seq 1566015460, win 64800
IP 203.0.113.10.80 > 203.0.113.1.59052: Flags [S.], seq 3430565499, ack 1566015461
IP 203.0.113.1.59052 > 203.0.113.10.80: Flags [.], ack 1, win 507
IP 203.0.113.1.59052 > 203.0.113.10.80: Flags [P.], seq 1:89, ack 1
The server sees an ordinary IPv4 client:
203.0.113.1 - - [20/Nov/2026 20:07:40] "GET / HTTP/1.1" 200 -
The translator's conntrack table shows the second, IPv4 NAPT step: TAYGA's pool address 10.64.0.252 masqueraded to 203.0.113.1. In the entry, tcp 6 is the protocol and its number, 114 the seconds left before the entry expires, and [ASSURED] means traffic was seen in both directions:
tcp 6 114 TIME_WAIT src=10.64.0.252 dst=203.0.113.10 sport=59052 dport=80 src=203.0.113.10 dst=203.0.113.1 sport=80 dport=59052 [ASSURED] mark=0 use=1
Some details of DNS64:
- Only the answer section is changed. CNAME chains (one name being an alias for another, article 52) are followed, and the result includes the chain.
- The resolver also answers reverse (PTR) lookups for addresses in its prefix, by looking up the embedded IPv4 address.
- It can be configured to exclude certain IPv4 ranges from synthesis, such as private addresses, and to ignore AAAA records in certain ranges.
- DNSSEC (DNS Security Extensions, which sign DNS records so resolvers can verify them) and DNS64 don't fit well together. A synthesized record can't carry a valid signature. A validating resolver doing DNS64 synthesizes only after validating the A record, and a client that validates by itself must do its own synthesis (article 84).
Finding the prefix, and the problem with literals
Applications sometimes need to know the NAT64 prefix, for example to build an address themselves. A host can discover it by looking up ipv4only.arpa, a name that has only the A records 192.0.0.170 and 192.0.0.171, and seeing what AAAA records come back (RFC 7050). Routers can also advertise it directly with the PREF64 option in router advertisements (RFC 8781).
DNS64 can't help when there is no DNS lookup, which happens when an application uses an IPv4 literal address or an IPv4-only socket API. In the lab, the IPv6-only client has no IPv4 route at all:
curl http://203.0.113.10/ failed (exit 7): no IPv4 route
464XLAT: IPv4 apps on an IPv6-only network
464XLAT (RFC 6877) handles the remaining IPv4-only applications by translating twice:
- A CLAT (customer-side translator) on the device gives applications a private IPv4 address and translates their IPv4 packets statelessly into IPv6, embedding the destination in the NAT64 prefix.
- The network's PLAT (provider-side translator), which is an ordinary stateful NAT64, translates them back to IPv4.
The application sees IPv4 the whole time, and the network carries only IPv6. Android, iOS, macOS and Windows have built-in CLATs, and most mobile networks that run IPv6-only use 464XLAT. Windows' CLAT was long limited to cellular links, and it became generally available for Wi-Fi and Ethernet too in Windows 11 25H2 in October 2026.
The lab added a CLAT to the IPv6-only client: a second TAYGA instance that maps the local IPv4 address 192.0.0.2 to a dedicated IPv6 address, 2001:db8:6::4646, and uses the same prefix. Now an IPv4 literal works:
default dev clat scope link src 192.0.0.2
curl http://203.0.113.10/ -> HTTP 200, local address 192.0.0.2
On the CLAT's interface, the same SYN appears twice: as IPv4 from the application, then as IPv6 after translation:
IP 192.0.0.2.33964 > 203.0.113.10.80: Flags [S], seq 4180085146
IP6 2001:db8:6::4646.33964 > 2001:db8:64::cb00:710a.80: Flags [S], seq 4180085146
On the link to the NAT64, it's ordinary IPv6:
IP6 2001:db8:6::4646.33964 > 2001:db8:64::cb00:710a.80: Flags [S], seq 4180085146
IP6 2001:db8:64::cb00:710a.80 > 2001:db8:6::4646.33964: Flags [S.], seq 2845109589
And the NAT64 gave the CLAT's IPv6 address its own pool address, a separate binding from the earlier connection:
TIME_WAIT src=10.64.0.252 dst=203.0.113.10 sport=59052 dport=80
TIME_WAIT src=10.64.0.121 dst=203.0.113.10 sport=33964 dport=80
A related development is the IPv6-only preferred option (DHCPv4 option 108, RFC 8925). A host with a CLAT that sees this option in a DHCPv4 offer declines the IPv4 address and runs IPv6-only. Networks can then serve IPv6-capable devices without IPv4 addresses, while older devices on the same network still get IPv4. This "IPv6-mostly" design is now used on large enterprise and conference networks.
Teredo: IPv6 through NATs over UDP
Teredo (RFC 4380, updated by RFC 5991 and RFC 6081) was designed for hosts that have only IPv4, behind a NAT, and want IPv6 anyway. 6to4 can't work there, because its packets (IPv6 directly inside IPv4, IP protocol number 41) have no ports, so most NATs can't map them. Teredo carries IPv6 packets inside UDP/IPv4 datagrams, which NATs handle like any other UDP. It has three kinds of nodes:
- Teredo clients are the hosts that want IPv6.
- Teredo servers, on UDP port 3544, help clients learn their NAT mapping and set up paths, like STUN servers.
- Teredo relays forward traffic between Teredo clients and the native IPv6 Internet, like TURN servers.
A client qualifies by sending an ICMPv6 router solicitation (the message an IPv6 host sends to find routers, article 42), inside UDP, to its server. The server replies with a router advertisement that also carries an origin indication, the IPv4 address and port the server saw, which is the client's NAT mapping. The client then builds its IPv6 address from these pieces, as the diagram shows field by field:

The port and address are stored with every bit inverted, for the same reason STUN XORs them (article 36): to stop NATs that rewrite payloads from "fixing" them. Teredo peers use small "bubble" packets to open NAT pinholes, which is hole punching, and when a direct path can't be made, traffic goes through a relay.
Teredo was built into Windows and was widely used around 2010, but it's now effectively gone: relays were often slow or far away, its tunnels bypassed firewalls that didn't look inside UDP, and native IPv6 became common. Microsoft disables it by default in current Windows, and many networks block UDP port 3544. Treat Teredo addresses (2001:0::/32) on a modern network as a sign of an old configuration or a policy bypass.
Attacks involving firewalls and NATs
Firewalls are built for security, so outright vulnerabilities in them are rarer than in ordinary hosts. Most real problems come from configuration:
- Overly broad NAT rules. A NAT rule that applies to all traffic, not just traffic leaving through the outside interface, can turn the router into a free relay for outsiders, hiding their real address. The lab shows this below.
- Stale rules. Port forwards and exceptions for services that no longer exist stay open for years. Review rules regularly, and give each one a comment saying why it exists and who asked for it, as article 37 did.
- Several copies of the rules. Some devices keep a running configuration and a saved one, and changes that weren't saved disappear at the next reboot, or a mistake that was saved comes back.
- Merged rule sets. Some tools add new rules to the existing ones rather than replacing them, so old rules survive unnoticed. nftables'
flush rulesetat the top of a file avoids this.
Lab: a NAT that hides attackers
The lab gateway has the shortest possible NAT configuration: masquerade everything, with no firewall rules:
table ip nat {
chain postrouting {
type nat hook postrouting priority srcnat;
masquerade
}
}
attacker: curl http://10.0.0.10/ -> HTTP 200
An attacker on the outside network (203.0.113.66) adds a route for the inside network via the gateway's outside address, and connects straight to an inside web server. Then, worse, the victim's log shows the connection coming from the gateway, 10.0.0.1, so the attacker's real address is hidden:
10.0.0.1 - - [20/Nov/2026 20:09:08] "GET / HTTP/1.1" 200 -
From the NAT's point of view this is normal: it masquerades whatever it forwards, whichever direction it's going. The fix is the pattern from article 37. Masquerade only traffic leaving through wan, and let the forward chain accept new connections only from lan:
attacker: curl http://10.0.0.10/ -> timed out
(victim's web log is empty)
Fragments
IP fragmentation (article 46) gives firewalls a structural problem: only the first fragment contains the TCP or UDP header with the port numbers. A filter looking at a later fragment can't tell which service it belongs to. Attackers have exploited this in two classic ways:
- Tiny fragments put the transport header itself across two fragments, so the first doesn't contain the port numbers or TCP flags.
- Overlapping fragments send a harmless first fragment that passes the filter, then a later fragment that overwrites the port numbers or flags when the receiver reassembles the packet.
The defenses (RFC 1858, RFC 3128) are to reassemble before filtering, which is what Linux does as soon as connection tracking is in use, and to drop fragments that are suspiciously small or overlap. IPv6 forbids overlapping fragments outright (RFC 5722) and requires the first fragment to contain the whole header chain, up to and including the transport header (RFC 7112). Reassembling costs memory, though, and floods of incomplete fragments can be used to exhaust it, which is why reassembly buffers have limits and timeouts. Some firewalls simply drop all fragments, which breaks legitimate large UDP traffic such as some DNS responses.
Common questions
Is NAT64 the same as the NAT in my home router?
It's the same idea, a stateful NAPT, but across address families. Your home router maps private IPv4 addresses to one public IPv4 address. A NAT64 maps IPv6 addresses to a pool of IPv4 addresses and also rewrites every header from IPv6 to IPv4 and back. Both keep per-flow state, have timeouts and follow the same mapping and filtering behavior rules.
Why not just run dual stack everywhere?
Running two protocols means twice the addressing plans, firewall rules, monitoring and troubleshooting, and the IPv4 half still needs public addresses or carrier-grade NAT. Large mobile and broadband networks found it cheaper to run only IPv6 internally and provide IPv4 as a service at the edge with DS-Lite, MAP or 464XLAT.
What breaks on an IPv6-only network with NAT64 and DNS64?
Anything that uses IPv4 without asking DNS: IPv4 literal addresses in URLs or configuration, software that opens IPv4-only sockets, and some VPNs and games. 464XLAT fixes most of these. DNSSEC-validating clients that do their own validation reject synthesized records unless they also do their own synthesis.
Why does the well-known prefix not work with private IPv4 addresses?
The WKP is meant to represent the public IPv4 Internet, so that IPv4-converted addresses mean the same thing everywhere. Private IPv4 addresses are only meaningful inside one network, so using them with the WKP would create IPv6 addresses that mean different hosts in different places. Organizations translating to private IPv4 should use a Network-Specific Prefix or the local-use prefix 64:ff9b:1::/48. The lab's translator refused documentation addresses with the WKP for the same reason.
Is DS-Lite the same as carrier-grade NAT?
DS-Lite includes carrier-grade NAT, at the AFTR, but the customer's IPv4 reaches it through an IPv6 tunnel, and the home router doesn't do NAT. With ordinary carrier-grade NAT over IPv4, there are usually two NATs (home router and ISP), and the ISP network still runs IPv4. Both share public IPv4 addresses among many customers and have the same drawbacks for inbound connections.
Should I block Teredo on my network?
On most networks, yes. Nothing modern depends on it, and it can tunnel IPv6 past firewalls that only inspect IPv4. Blocking outbound UDP to port 3544 stops clients from qualifying, and native IPv6 or an organization's own transition mechanism is a better way to provide IPv6.
Summary
- IPv4 and IPv6 will coexist for a long time. Dual stack, with Happy Eyeballs choosing quickly between them, is the simplest arrangement. Tunnels carry one protocol over the other, and translators convert between them.
- DS-Lite carries customers' IPv4 inside IPv6 to an AFTR that does carrier-grade NAT, so the ISP runs only IPv6. The lab showed an IPv4 packet with private addresses inside IPv6 on an IPv4-free core, and the smaller tunnel MTU. Lightweight 4over6, MAP-E and MAP-T need less state. 6rd and 6to4 carried IPv6 over IPv4.
- IPv4-embedded IPv6 addresses (RFC 6052) put an IPv4 address in the last 32 bits of a /96 prefix. The WKP
64:ff9b::/96is checksum-neutral and only for global IPv4 addresses. - SIIT (RFC 7915) translates headers statelessly. NAT64 (RFC 6146) adds NAPT so many IPv6-only clients can share a few IPv4 addresses.
- DNS64 synthesizes AAAA records from A records when a name has no AAAA. The lab's IPv6-only client reached an IPv4-only server by name. The prefix can be discovered through
ipv4only.arpaor PREF64. - 464XLAT adds a stateless CLAT on the device, so IPv4-only applications and literals work on IPv6-only networks. DHCPv4 option 108 lets capable hosts give up IPv4.
- Teredo carried IPv6 in UDP through NATs, using servers and relays like STUN and TURN, and is now obsolete.
- Most firewall and NAT problems are configuration mistakes. The lab showed an unrestricted masquerade rule letting an outsider reach an inside host with its address hidden. Fragments complicate filtering, because only the first carries ports.
Practice questions
1. What IPv6 address does the well-known prefix give for the IPv4 address 192.0.2.33? And what about with the prefix 2001:db8:64::/96?
Answer
192.0.2.33 in hex is c0 00 02 21, so the last 32 bits are c000:0221. With the WKP it's 64:ff9b::c000:221, and with the Network-Specific Prefix 2001:db8:64::c000:221. In practice, 192.0.2.33 is a documentation address and not global, so it shouldn't be used with the WKP.
2. A host on an IPv6-only network can open https://www.example.com but not https://198.51.100.20. Why, and what fixes it?
Answer
The name works because DNS64 synthesizes an AAAA record and NAT64 translates the connection. The literal IPv4 address involves no DNS lookup, and the host has no IPv4 route, so it can't connect. A CLAT (464XLAT) on the host fixes it: it gives the host an IPv4 address and translates IPv4 packets to IPv6 addresses in the NAT64 prefix. An application that discovers the prefix could also build the IPv6 address itself.
3. In the DS-Lite lab capture, the IPv4 addresses inside the IPv6 packet were 192.168.1.10 and 203.0.113.10. Where does the private address get translated, and how can the AFTR serve many homes that all use 192.168.1.10?
Answer
At the AFTR, after it removes the IPv6 header. The home router doesn't do NAT. The AFTR keys its translation table on the softwire's IPv6 source address (which identifies the home) as well as the inner IPv4 addresses and ports, so identical private addresses in different homes become different entries mapped to different public ports.
4. Why does a DNS64 resolver not synthesize an AAAA record for a name that already has one?
Answer
A real AAAA record means the server is reachable over IPv6 directly, which is better than going through the NAT64: no translation, no shared state, and no extra NAT. Synthesis is only a fallback for names that have only A records. (A resolver can be configured to ignore AAAA records in certain unusable ranges and synthesize anyway.)
5. A router's NAT configuration is masquerade in postrouting with no other conditions, and its forward chain accepts everything. What can someone on the outside network do?
Answer
They can route traffic for the inside network to the router and reach inside hosts directly, since nothing blocks forwarding from outside. Their packets are masqueraded with the router's inside address on the way in, so inside hosts and their logs see the router as the source, which hides the attacker. Restrict masquerade to oifname "wan" and use a forward chain with a drop policy that accepts new connections only from the inside.
6. Why is filtering IP fragments hard for a stateless packet filter?
Answer
Only the first fragment contains the transport header with the ports, so a stateless filter can't tell which service later fragments belong to. Attackers can also split the transport header across tiny fragments, or send overlapping fragments that change the port numbers after the filter has checked the first one. Filters must reassemble or track fragments, which takes state, or drop fragments and risk breaking legitimate large datagrams.
Review quiz
You've finished Part 6. Test yourself on firewalls, NAT behavior, NAT traversal, nftables and IPv4/IPv6 transition:
Previous: Writing Firewall and NAT Rules on Linux With nftables
Next: ICMP: Message Types, Encapsulation and the Rules for Sending Errors

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.