IPv6: why to get on with it
IPv4 addresses ran out years ago and now rent at a premium. What IPv6 concretely changes, what people fear about it without cause, and how to deploy without breaking what exists.
IPv6 carries a reputation as a subject for later. "We'll deal with it when we have to." The trouble is that we have had to for a while, and the cost of waiting keeps rising.
The problem, in one paragraph
IPv4 uses 32-bit addresses: roughly 4.3 billion combinations. That seemed enormous when the protocol was designed. With several connected devices per person on the planet, it is not.
Regional registries have exhausted their pools. You no longer receive IPv4 addresses because you need them: you lease them, buy them on a secondary market, or share them between customers. All three have a cost, and two of them have technical consequences.
IPv6 uses 128 bits. The space is so large that it stops being a resource to ration — which is the entire point.
What it actually changes
The end of address sharing
To cope with an exhausted pool, many operators place customers behind large-scale address translation: hundreds of subscribers share a single public address.
The consequences are real:
- Inbound connections stop working. Hosting anything from home becomes impossible.
- IP-based banning becomes collective. One subscriber getting banned from a service takes hundreds with them.
- Geolocation degrades, and with it the decisions that depend on it.
- Diagnosis becomes hard, because the address the server sees no longer identifies anyone in particular.
With IPv6, every device can hold a global address. The sharing disappears, and those four problems with it.
Simpler routing
IPv6 headers are fixed-size. Fragmentation no longer happens in intermediate routers. Optional mechanisms live in separate extension headers. For a router, handling an IPv6 packet is simpler than handling an IPv4 one.
Automatic configuration
IPv6 offers stateless autoconfiguration: a machine that plugs in listens to router advertisements and builds itself an address. No mandatory DHCP server.
What people fear, without cause
"The addresses are unreadable." They are longer, true. They are written in hexadecimal, with abbreviation rules: leading zeros are dropped, and one run of zero groups can be replaced by ::. You get used to it, and mostly you never type them — that is what DNS is for.
"You have to migrate everything at once." No. IPv4 and IPv6 coexist on the same machine, dual stack. Your services stay reachable over IPv4 while you add IPv6. There is no switchover day.
"It's less secure." It is different. There is no address translation any more — but address translation was never a firewall, it merely had that side effect. A properly configured IPv6 firewall gives exactly the same control. The real risk is forgetting to configure one: a machine can end up reachable over IPv6 while you were only protecting IPv4.
That is the mistake to avoid above all: your firewall rules must exist twice. An iptables rule does not protect IPv6; you also need ip6tables, or a tool that handles both families.
Deploying without breaking anything
1. Check what is already there
# Do my interfaces have a global IPv6 address?
ip -6 addr show scope global
# Do I actually reach the outside over IPv6?
curl -6 https://ifconfig.co
2. Publish an AAAA record
This is the step that makes your site reachable over IPv6. An A record for IPv4, an AAAA for IPv6, on the same name. Clients choose, and generally prefer IPv6 when it works.
Mind the consequence: from that moment, your IPv6 is in production. If it is misconfigured, visitors will hit it. Test before publishing, not after.
3. Listen on both families
Check your server really listens on IPv6, not only IPv4:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2; # without this line, IPv6 is not served
server_name example.com;
}
# Check what is actually listening
ss -tlnp | grep ':443'
4. Adapt anything that handles addresses
This is where the real application bugs hide:
- Storage. A column sized for 15 characters will not hold an IPv6 address. Allow 45.
- Logging and rate limiting. In IPv6, a single subscriber often holds an entire prefix. Limiting by exact address is ineffective: a client can change address at will within its prefix. Limit on a prefix instead — usually a /64.
- Allow lists. Rules written for IPv4 have no effect on IPv6 traffic.
- Log parsing. Regular expressions written for
\d+\.\d+\.\d+\.\d+will match nothing.
5. Test for real
The test that matters is not "does it answer over IPv6", it is "does it answer correctly, and does it fail cleanly if IPv6 is broken".
An unpleasant case: if your AAAA record points at an unreachable address, clients try IPv6 first, wait for a timeout, then fall back to IPv4. The site works, but slowly, and only for IPv6 visitors. You will not see it if your own machine is on IPv4.
Browsers implement a mechanism that limits this delay by trying both families almost simultaneously, but it does not catch everything. A wrong AAAA record is still an outage, merely a quiet one.
Addresses, concretely
A little address reading, because it is what trips people up most at first.
An IPv6 address is 128 bits, written as eight groups of four hexadecimal digits:
2001:0db8:0000:0000:0000:ff00:0042:8329
Two abbreviation rules shorten it:
- Leading zeros in each group are dropped:
0db8→db8. - One run of all-zero groups may be replaced by
::.
2001:db8::ff00:42:8329
The "one run only" restriction matters: with two ::, you could not tell how many zero groups belong on each side. The address would be ambiguous.
The prefixes worth recognising:
| Prefix | Role |
|---|---|
::1/128 |
loopback, the equivalent of 127.0.0.1 |
fe80::/10 |
link-local, valid only on one segment |
fc00::/7 |
unique local, the equivalent of private addresses |
2000::/3 |
globally routable addresses |
Link-local addresses often surprise people: every interface has one, generated automatically, valid only on its network segment. That is normal, and it is not a public address — seeing an fe80:: address does not mean the machine is reachable from the Internet.
Temporary addresses
By default, many systems generate temporary addresses that change regularly, to limit tracking. That is a good thing on the client side, and a source of confusion on the server side: the machine holds several addresses at once, and the one it uses outbound is not necessarily the one it listens on.
On a server you generally disable that behaviour and fix the address, because you want it stable and matching the AAAA record.
And for a network of your own
If you run your own network, IPv6 changes the scale of the reasoning. Assigned prefixes are vast: you stop counting addresses and start carving prefixes. A /64 per segment is the convention, and it is deliberately generous — autoconfiguration depends on it.
AS198402 announces its own IPv4 and IPv6 prefixes, with the corresponding objects published in the routing registries. That is the minimum for being a decent neighbour: your peers build their filters from those declarations.
What to take away
IPv6 is not a migration to plan for later, it is a second stack to add alongside the existing one. The cost is modest; most of the work is not forgetting anything: listen on both families, duplicate firewall rules, adapt whatever stores or filters addresses, and test before publishing the AAAA record.
The real risk is not deploying IPv6. It is having it half-deployed without knowing.
Tags
- Hosting
- Networking
- Security