IPv6 addressing: longer numbers, simpler rules
Why 128 bits, how to shorten an address without breaking it, the address types that replaced broadcast, how a host configures itself with SLAAC, and what neighbour discovery does that ARP used to.
On this page
IPv6 looks intimidating for about twenty minutes, mostly because the addresses are long and written in hex. Underneath, it is a simpler protocol than IPv4: the header has fewer fields, routers never fragment, there is no broadcast, and a host can configure itself without a server. The length is the point — 128 bits is enough that you can stop rationing addresses and go back to designing networks.
The map
Read this first when short on time. Every branch is a section below.
Why a second internet protocol exists
IPv4 has 32 bits, so 4.3 billion addresses, and the free pool ran dry in 2011. The world did not stop, because NAT let thousands of hosts share one public address — but NAT bought time at a price that gets steeper the longer you pay it.
- There is no end-to-end path. A device behind NAT cannot be reached from outside unless something forwards a port, which is why peer-to-peer software carries elaborate hole-punching machinery.
- The middle keeps state. Every translation is a row in a table with a timer. Reboot the router and every conversation through it dies.
- Layers get violated. NAT rewrites layer 3 addresses and layer 4 ports, so any protocol that mentions its own address inside the payload — FTP, SIP — needs a special helper to work at all.
IPv6 uses 128 bits. That is 340 undecillion addresses, a number with 39 digits, and the practical consequence is that address scarcity stops being a design constraint. Every subnet gets a /64 whether it holds two hosts or two thousand, and nobody counts.
Along the way the header was cleaned up. The IPv6 header is a fixed 40 bytes with eight fields, against IPv4's variable header with fourteen. The checksum is gone, because layer 2 and layer 4 already check integrity. Fragmentation by routers is gone: if a packet is too big, the router drops it and sends back an ICMPv6 packet too big, and the sender adjusts. Options moved out into optional extension headers that routers can skip.
- Mobile carriers deployed IPv6 first and hardest, because a network adding millions of always-on phones runs out of private space, never mind public.
- Facebook and LinkedIn run IPv6-only inside their data centres and translate at the edge, on the grounds that maintaining one protocol internally is cheaper than two.
- Cloud providers charge for IPv4 addresses now — AWS bills every public IPv4 address by the hour — which has done more for adoption than a decade of advocacy.
Reading and writing an address
An IPv6 address is 128 bits written as eight groups of four hexadecimal digits, separated by colons. Each hex digit is 4 bits, so 32 digits make 128 bits.
2001:0db8:0000:0000:0000:ff00:0042:8329Nobody writes them that way, because two rules shorten almost every address dramatically.
Rule 1: drop leading zeros within each group. 0db8 becomes db8, 0000 becomes 0, 0042 becomes 42. Note "leading" — ff00 stays ff00, because those zeros trail.
2001:db8:0:0:0:ff00:42:8329Rule 2: replace one run of consecutive all-zero groups with ::.
2001:db8::ff00:42:8329The double colon may appear only once per address. If it appeared twice, there would be no way to know how many zero groups belong to each gap — the whole point is that a reader can count the groups that are present and infer the rest. When two runs of zeros are equally long, convention shortens the first.
| Full | Shortened | Note |
|---|---|---|
| 2001:0db8:0000:0000:0000:0000:0000:0001 | 2001:db8::1 | The usual look of a server address |
| fe80:0000:0000:0000:021b:44ff:feaa:bbcc | fe80::21b:44ff:feaa:bbcc | A link-local address |
| 0000:0000:0000:0000:0000:0000:0000:0001 | ::1 | Loopback, the IPv6 127.0.0.1 |
| 0000:0000:0000:0000:0000:0000:0000:0000 | :: | Unspecified, the IPv6 0.0.0.0 |
Prefix length works exactly as in IPv4: a slash and a count of leading network bits. The difference is that in practice you only ever see a few lengths.
/64— one subnet. Effectively mandatory, because SLAAC assumes 64 host bits./48— the block a site typically receives, which contains 65,536/64subnets./56— a common allocation to a home from an ISP: 256 subnets./128— a single address, used for loopbacks.
2001:db8::/32 is reserved for documentation, exactly as 192.0.2.0/24 is for IPv4. Any address starting 2001:db8 in a book, a diagram or an exam is guaranteed not to belong to anyone.
Address types, and the death of broadcast
IPv4 has unicast, multicast and broadcast. IPv6 drops broadcast entirely and replaces it with well-known multicast groups, so a host that does not care about a message never has to process it.
| Type | Starts with | Scope | What it is for |
|---|---|---|---|
| Global unicast | 2000::/3 (2 or 3) | The internet | The public address of a host |
| Unique local | fc00::/7, in practice fd | Your organisation | Private addressing, the RFC 1918 equivalent |
| Link-local | fe80::/10 | One link | Neighbour discovery, routing protocol adjacencies, next hops |
| Multicast | ff00::/8 | Varies by flag | One-to-many, and everything broadcast used to do |
| Anycast | Looks like unicast | Wherever advertised | Many hosts share an address, nearest one answers |
| Loopback | ::1/128 | This host | The IPv6 127.0.0.1 |
| Unspecified | ::/128 | — | "I have no address yet" |
Link-local is not optional
The one that surprises people: every IPv6 interface has a link-local address, always, whether you configured anything or not. It is generated the moment the interface comes up, it starts with fe80::, and it is never routed off the link.
This is not a curiosity. Link-local addresses are what neighbour discovery uses, what routers use to advertise prefixes, and what routing protocols use as the next-hop address. An OSPFv3 adjacency forms over link-local addresses, so two routers can exchange routes before either has a global address configured. In IPv4 nothing works until addressing is done; in IPv6 the link works first and addressing follows.
The consequence is that one interface normally carries several addresses at once — a link-local, one or more global addresses, and membership in several multicast groups — and that is completely normal rather than a misconfiguration.
The multicast groups worth memorising
| Group | Means |
|---|---|
| ff02::1 | All nodes on this link — the closest thing to a broadcast |
| ff02::2 | All routers on this link |
| ff02::5 and ff02::6 | OSPFv3 routers and designated routers |
| ff02::1:ff00:0/104 | Solicited-node — used by neighbour discovery to reach one specific host |
The solicited-node group is the clever part. Instead of shouting at everyone the way ARP does, a host derives a multicast group from the last 24 bits of the address it is looking for and sends there. Statistically almost no other host shares those 24 bits, so almost nobody else's network card even wakes up. Broadcast replaced by targeted multicast is one of the quiet wins of IPv6 on a busy network.
- Public DNS resolvers use anycast heavily — Cloudflare's
2606:4700:4700::1111answers from whichever data centre is nearest, exactly as its IPv4 counterpart does. - Unique local addresses are used for management and storage networks that must never be reachable from outside, keeping global addresses for things that should be.
- Windows and Linux both show the pile of addresses on one interface — run
ip -6 addrand you will see a link-local, a SLAAC address and usually a temporary privacy address alongside it.
- Global unicast
- A publicly routable IPv6 address, currently allocated from
2000::/3. - Unique local address
- Private IPv6 space,
fc00::/7. Thefdhalf is used with a randomly generated 40-bit site identifier so two organisations that merge rarely collide. - Solicited-node multicast
- A group derived from the low 24 bits of a target address, used by neighbour discovery so only the intended host is disturbed.
How a host gets an address without a server
IPv4 hosts wait for DHCP. IPv6 hosts can configure themselves, and the mechanism is SLAAC — stateless address autoconfiguration.
sequenceDiagram autonumber participant H as Host participant R as Router H->>R: Router solicitation to ff02::2 R-->>H: Router advertisement to ff02::1 Note over H,R: prefix 2001:db8:acad:7::/64, A flag set Note over H: builds its own 64-bit host part H->>H: Duplicate address detection on the new address Note over H: silence means nobody else has it, address goes live
- The interface comes up and immediately gets its
fe80::link-local address. - The host sends a router solicitation to the all-routers group,
ff02::2, rather than waiting for the next scheduled advertisement. - A router replies with a router advertisement: here is the prefix on this link, here is my link-local address as your default gateway, here is the MTU, and here are flags saying how you should get the rest.
- The host builds a 64-bit host part and appends it to the prefix.
- It runs duplicate address detection — a neighbour solicitation for its own new address. No answer means the address is free.
Where the host part comes from
Two methods, and modern hosts use both at once.
EUI-64 derives the host part from the interface MAC address: split the 48-bit MAC in half, insert fffe in the middle, and flip the seventh bit of the first byte. A MAC of 00:1b:44:aa:bb:cc becomes 021b:44ff:feaa:bbcc. It is deterministic, which is convenient for a server and terrible for a laptop — the MAC-derived half of your address follows you between networks and identifies you across all of them.
So hosts also generate privacy addresses: a random host part, regenerated periodically, used as the source address for outbound connections. This is why a phone or laptop typically shows several global addresses at once — a stable one and one or more temporary ones.
The flags that decide everything
Three bits in the router advertisement control how the host proceeds, and troubleshooting IPv6 addressing almost always comes down to reading them.
| Flag | Set means | Result |
|---|---|---|
| A (autonomous) | Use this prefix with SLAAC | Host builds its own address |
| O (other config) | Get other settings from DHCPv6 | Stateless DHCPv6: address from SLAAC, DNS from DHCPv6 |
| M (managed) | Get your address from DHCPv6 | Stateful DHCPv6, closest to IPv4 behaviour |
The combination in most networks is A and O: hosts self-assign addresses and ask a DHCPv6 server only for DNS servers and a search domain. Stateful DHCPv6 (M) is used where an organisation needs a record of which host holds which address.
A rogue router advertisement is more damaging than a rogue DHCP server, because hosts accept advertisements from any router on the link and will happily add a second default gateway. Switches implement RA guard to drop advertisements arriving on access ports for exactly this reason.
Neighbour discovery: ARP's replacement
IPv4 finds a MAC address with ARP, a protocol of its own that broadcasts to the whole link. IPv6 folds the same job — and several others — into neighbour discovery, which runs on top of ICMPv6.
| ICMPv6 message | Job | IPv4 equivalent |
|---|---|---|
| Neighbour solicitation | Who has this address? | ARP request |
| Neighbour advertisement | I do, here is my MAC | ARP reply |
| Router solicitation | Any routers here? | None |
| Router advertisement | Here is the prefix and gateway | DHCP, partly |
| Redirect | Use this other router instead | ICMP redirect |
Neighbour solicitation is sent to the solicited-node multicast group rather than to everyone, so only the target host — and possibly one or two unlucky others sharing its last 24 bits — is interrupted. The same message type also performs duplicate address detection: a host asks for its own address and takes silence as permission.
Firewall rules copied from IPv4 habit often block all ICMP. On IPv6 this breaks the network outright: neighbour discovery stops, so hosts cannot resolve each other's MAC addresses, and packet-too-big messages stop, so large transfers hang. ICMPv6 is not optional the way ICMP arguably was.
- Cisco IOS replaces
show arpwithshow ipv6 neighbors, and the states there (REACH, STALE, DELAY, PROBE) expose a lifecycle that ARP entries never had. - Linux shows the same table with
ip -6 neigh, and a permanently INCOMPLETE entry is the IPv6 version of an unanswered ARP. - Enterprise switches ship RA guard and DHCPv6 guard as first-hop security features, because the equivalent IPv4 attacks moved over immediately once IPv6 was enabled by default on clients.
Turning it on, and running both at once
Almost nobody runs IPv6 alone. The normal deployment is dual stack: every interface has both an IPv4 and an IPv6 address, both protocols run independently, and applications choose.
On IOS, IPv6 routing is off until you enable it, which is the single most common reason a correctly addressed router refuses to forward anything.
Router(config)# ipv6 unicast-routing
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ipv6 address 2001:db8:acad:1::1/64
Router(config-if)# ipv6 address fe80::1 link-local
Router(config-if)# no shutdownSetting the link-local address by hand to something short like fe80::1 is a common convention, because that address becomes the default gateway every host on the link will use, and it is far easier to recognise in output than an EUI-64 value.
The checking commands mirror their IPv4 counterparts:
Router# show ipv6 interface brief
Router# show ipv6 route
Router# show ipv6 neighbors
Router# ping 2001:db8:acad:2::1On the client side, dual stack raises the question of which protocol to use for a name that resolves to both. Browsers implement happy eyeballs: start both connections a few milliseconds apart, keep whichever completes first, and drop the other. It means a broken IPv6 path costs a small delay instead of a total failure, which is what made turning IPv6 on safe enough to do by default.
What happens to NAT
NAT was a response to scarcity, and scarcity is gone, so IPv6 hosts normally carry globally routable addresses end to end. This worries people who had come to think of NAT as a security feature. It is worth being precise about that: NAT never provided security, it provided the side effect that unsolicited inbound traffic had nowhere to go. A stateful firewall provides that property directly, deliberately, and with rules you can read. IPv6 networks run stateful firewalls at the edge that default to denying inbound connections; what they no longer do is rewrite addresses to achieve it.
- Home ISPs in many countries now hand out a
/56, so a household has 256 subnets while its IPv4 side still shares one address with the neighbours. - Kubernetes supports dual-stack services, giving pods both families, which mostly exists so clusters can talk to legacy systems while being addressable natively.
- NAT64 and DNS64 let an IPv6-only client reach IPv4-only servers by synthesising an IPv6 address that maps to a translator — the migration tool used by mobile carriers running IPv6-only networks.
- SLAAC
- Stateless address autoconfiguration: the host builds its own address from a prefix advertised by the router, with no server keeping records.
- EUI-64
- The method of deriving a 64-bit interface identifier from a 48-bit MAC by inserting
fffeand flipping the universal/local bit. - Dual stack
- Running IPv4 and IPv6 simultaneously on the same interfaces, with applications choosing per connection.
- Happy eyeballs
- The client algorithm that races IPv4 and IPv6 connections and keeps whichever answers first, so a broken path costs latency rather than availability.
Recap
- IPv6 has 128 bits because IPv4's 32 ran out and NAT's costs compound over time.
- The header is simpler: fixed 40 bytes, no checksum, and routers never fragment.
- Addresses are eight groups of four hex digits; drop leading zeros, and collapse one run of zero groups with
::. - The double colon may appear only once, or the number of hidden groups would be ambiguous.
/64is the standard subnet,/48a site allocation,/56a home allocation,/128a single host.- Global unicast starts with 2 or 3, unique local with
fd, link-local withfe80, multicast withff. - There is no broadcast;
ff02::1is all nodes andff02::2is all routers. - Every interface always has a link-local address, and routing protocols use it as the next hop.
- SLAAC lets a host build its own address from a router advertisement; EUI-64 derives the host part from the MAC, privacy addresses randomise it.
- The A, O and M flags in the advertisement decide whether DHCPv6 is involved and how much.
- Neighbour discovery replaces ARP using ICMPv6 and solicited-node multicast, so blocking ICMPv6 breaks IPv6 entirely.
- Dual stack is the normal deployment, and NAT disappears because a stateful firewall provides the protection people credited NAT with.
Questions
Say the answer out loud before opening it.
Shorten 2001:0db8:0000:0000:0abc:0000:0000:0001 correctly.
2001:db8::abc:0:0:1.
- Leading zeros go from every group: 0db8 to db8, 0abc to abc, 0001 to 1.
- There are two runs of zero groups; only one may be replaced by
::, and the longer run wins — here the first, of two groups. - The remaining zero groups must be written out as
0.
Writing 2001:db8::abc::1 would be invalid, because a reader could not tell how many zero groups belong to each gap.
Why is /64 the standard subnet size when it wastes so many addresses?
Because SLAAC is designed around a 64-bit interface identifier, and because address space is abundant enough that waste is not a cost.
- EUI-64 produces exactly 64 bits, so a shorter host part breaks self-configuration.
- Uniform /64s make address plans readable and summarisation trivial.
- A site with a /48 still has 65,536 subnets to spend.
Point-to-point links are the one place where /127 is sometimes used, to avoid a neighbour-discovery exhaustion attack against the router's own subnet.
What is a link-local address and why does every interface have one?
An address in fe80::/10, generated automatically when the interface comes up, valid only on that link and never routed.
- Neighbour discovery, router advertisements and duplicate address detection all use it.
- Routing protocols form adjacencies over link-local addresses and install them as next hops.
- It exists before any global address is configured, so the link is usable immediately.
Because link-local addresses are ambiguous across interfaces, tools require a zone identifier — ping fe80::1%eth0 — to say which link you mean.
Explain SLAAC in a few sentences.
The router advertises a /64 prefix on the link, and each host appends its own 64-bit interface identifier to build a complete address without any server keeping state.
- A host can wait for the periodic advertisement or trigger one with a router solicitation to ff02::2.
- The interface identifier comes from EUI-64 or from a random privacy value.
- Duplicate address detection checks the result before it is used.
The router advertisement also supplies the default gateway and MTU, so SLAAC replaces most of what DHCP did in IPv4 with no server at all.
What is the difference between stateful and stateless DHCPv6?
Stateful DHCPv6 assigns the address itself and records the lease; stateless DHCPv6 supplies only extra settings such as DNS while the address comes from SLAAC.
- The M flag in the router advertisement selects stateful.
- The O flag alone selects stateless, which is the most common configuration.
- Stateless avoids running a lease database while still centralising DNS configuration.
Stateful DHCPv6 is chosen when an organisation needs an authoritative record of which device held which address at which time, typically for audit purposes.
How does EUI-64 build a host part, and why do phones avoid it?
It splits the 48-bit MAC in half, inserts fffe in the middle, and inverts the seventh bit; phones avoid it because the result is a permanent identifier that follows the device between networks.
- 00:1b:44:aa:bb:cc becomes 021b:44ff:feaa:bbcc.
- Any site the device visits sees the same lower 64 bits, which makes tracking trivial.
- Privacy extensions generate random host parts that are rotated regularly.
Servers usually keep a static or EUI-64 address deliberately, because predictability is a feature when other systems must reach them.
Why does IPv6 have no broadcast address?
Because multicast does the same job more precisely, waking only the hosts that subscribed to the relevant group.
- ff02::1 reaches all nodes and covers the rare case where you truly mean everyone.
- ff02::2 reaches only routers, so host software is never interrupted by router traffic.
- Solicited-node groups let neighbour discovery reach one host without disturbing the rest of the link.
On a large flat network this measurably reduces the interrupt load on every host, which was one of the practical motivations for the change.
What replaces ARP in IPv6, and what else does it do?
Neighbour discovery, carried in ICMPv6, which handles address resolution plus router discovery, prefix advertisement, duplicate address detection and redirects.
- Neighbour solicitation and advertisement replace ARP request and reply.
- Router solicitation and advertisement have no IPv4 equivalent and carry the work DHCP used to do.
- Solicitations are sent to a solicited-node multicast group rather than broadcast.
Because it runs on ICMPv6, a firewall policy that blocks all ICMP disables address resolution and takes the link down entirely.
Why is blocking ICMPv6 more dangerous than blocking ICMP in IPv4?
Because core functions depend on it: neighbour discovery, router advertisement and path MTU discovery all ride on ICMPv6.
- Block neighbour solicitations and hosts cannot resolve each other's MAC addresses at all.
- Block router advertisements and hosts get no prefix and no default gateway.
- Block packet-too-big and large transfers hang, because IPv6 routers never fragment.
The correct policy is to permit the neighbour discovery and error types and rate-limit echo, rather than to drop the protocol wholesale.
What must be enabled on a Cisco router before it forwards IPv6, and why is it a common mistake?
ipv6 unicast-routing, which is off by default; without it the router accepts addresses and answers pings but forwards nothing and sends no router advertisements.
- Interfaces can be addressed and appear correct in
show ipv6 interface brief. - Hosts on the link get no advertisement, so they never learn a prefix or a gateway.
- The symptom looks like an addressing problem, which sends people to the wrong place.
IPv4 routing is enabled by default on a router, so the asymmetry catches people who expect the two protocols to behave the same way.
What is dual stack, and what does happy eyeballs do?
Dual stack means running both protocols on the same interfaces; happy eyeballs is the client algorithm that races connections over both and keeps whichever answers first.
- A name that resolves to both an A and an AAAA record gives the client a choice.
- Starting the second attempt a short delay after the first avoids doubling load for no benefit.
- The result is that a broken IPv6 path costs a few hundred milliseconds rather than a failure.
Without it, early IPv6 deployments produced long timeouts on misconfigured networks, which is exactly why enabling IPv6 used to be considered risky.
Does removing NAT make an IPv6 network less secure?
No, provided a stateful firewall is doing the job explicitly instead of relying on translation as a side effect.
- NAT blocked unsolicited inbound traffic only because there was no translation entry to match it against.
- A stateful firewall achieves the same by policy, and the policy can be read and audited.
- What changes is that internal hosts are individually addressable, which is a feature for troubleshooting and a requirement for direct peer-to-peer connections.
The real risk during migration is a network that enables IPv6 without extending the firewall rules to it, leaving hosts globally reachable with only IPv4 protected.
What is a unique local address and when would you use one?
Private IPv6 space from fc00::/7 — in practice fd followed by a randomly generated 40-bit site identifier — used for networks that must never be reachable from the internet.
- Management, storage and out-of-band networks are the natural fit.
- The random site identifier makes collisions between merging organisations unlikely.
- Unlike RFC 1918 space, it is not intended to be NATed to a global address.
Using unique local addresses as a general substitute for global ones recreates the IPv4 problems IPv6 set out to remove, so it belongs on specific segments rather than everywhere.
Why can one interface hold several IPv6 addresses at once?
Because the design expects it: a link-local for on-link functions, one or more global addresses from prefixes advertised on the link, and temporary privacy addresses for outbound traffic.
- Multiple routers can advertise multiple prefixes, and the host takes an address from each.
- Renumbering works by advertising a new prefix and deprecating the old one, so both coexist during the transition.
- Source address selection rules decide which one is used for a given destination.
This is what makes IPv6 renumbering far less painful than IPv4's, where changing a subnet means changing every host's single address at once.
What is a rogue router advertisement and how is it stopped?
A router advertisement sent by a device that is not supposed to be a router, which makes hosts install it as a default gateway; switches stop it with RA guard.
- It can be accidental — a laptop with connection sharing enabled — or deliberate, as a way to intercept traffic.
- Hosts accept advertisements from any router on the link, so there is no protocol-level defence.
- RA guard drops advertisements arriving on ports configured as host-facing, permitting them only on uplinks.
It is the IPv6 counterpart of a rogue DHCP server, and the mitigation belongs in the same family of first-hop security features as DHCP snooping.