Skip to content
GEEKnodes

Computing

IPv6 Explained Simply: Addresses, Prefixes and Types

What IPv6 is and why it exists: how to write and shorten an address, /64 prefixes, link-local, ULA, SLAAC, how to see your IPv6 and why the firewall matters.

You open your network settings and next to your usual IP there’s something like 2a0c:5a80:1f2:9e00::1b4. That’s IPv6, and you’re probably already using it without knowing. In this guide you’ll understand why it exists, how to read and shorten an address, what prefixes and the different types mean, and what changes in security now that NAT is no longer needed.

In short

  • IPv6 exists because IPv4 addresses ran out; it has so many that every device can have a public one.
  • An address has 128 bits in 8 hexadecimal groups, and it’s almost always written abbreviated.
  • Without NAT, protection comes from the router’s firewall, not from address translation.

Why IPv6 exists

IPv4 uses 32-bit addresses: about 4.3 billion in total. That seemed like a huge number in the eighties, but it isn’t enough for the phones, computers, TVs and light bulbs of the whole planet. The regional registries handed out their last free blocks in the 2010s.

The patch was NAT: your whole home shares one public IP and the router translates. It works, but it makes hosting services harder and forces ISPs to use CG-NAT, which is NAT on top of NAT.

IPv6 uses 128-bit addresses. The number is so large (about 3.4 times 10 to the 38th power) that scarcity disappears: your ISP typically assigns you a block with trillions of addresses just for your home.

IPv4IPv6
Length32 bits128 bits
FormatDecimal with dots: 192.168.1.10Hexadecimal with colons: 2001:db8::10
Possible addressesAbout 4.3 billionAbout 3.4 × 10^38
NAT at homeEssentialNot needed
Automatic configurationDHCPSLAAC (and optional DHCPv6)
Address in a URLhttp://192.168.1.10/http://[2001:db8::10]/

How an IPv6 address is written

It’s 8 groups of 4 hexadecimal digits (0–9 and a–f) separated by colons. Each group is 16 bits:

2001:0db8:0000:0000:0000:ff00:0042:8329

The 2001:db8::/32 range is reserved for documentation, which is why it shows up in every example.

The two rules for abbreviating

Abbreviating an IPv6 address in two steps: remove leading zeros and replace a run of zeros with ::
Remove leading zeros and replace a single run of all-zero groups with ::
  1. Remove the leading zeros in each group: 0db8 becomes db8, 0042 becomes 42, 0000 becomes 0.
  2. Replace a single run of all-zero groups with ::.
Full:         2001:0db8:0000:0000:0000:ff00:0042:8329
Rule 1:       2001:db8:0:0:0:ff00:42:8329
Rule 2:       2001:db8::ff00:42:8329

The :: can only appear once. If there were two, there’d be no way to know how many zeros are in each gap. When there are several runs of zeros, the standard (RFC 5952) says you shorten the longest one, and letters are written in lowercase.

Two curious cases: ::1 is the loopback address (the equivalent of 127.0.0.1) and :: on its own means “no address”.

Prefixes: the /64

Just like IPv4 with CIDR notation, an IPv6 address is split into network and host, and the number after the slash says how many bits belong to the network.

128-bit IPv6 address split into a 64-bit network prefix and a 64-bit interface identifier
On a local network, the first 64 bits are the network and the last 64, the host
2001:db8:1234:5678:a1b2:c3d4:e5f6:0789/64
|---- network prefix -----|-- interface -|
       first 64 bits         last 64 bits

In IPv6 the rule is that every local network is a /64: 64 bits to identify the network and 64 for the hosts. It may seem wasteful, but it’s what makes the autoconfiguration you’ll see below possible.

Your ISP doesn’t give you a single network, but a larger delegated prefix, usually a /56 or a /48. With a /56 you can create 256 /64 networks at home (for example, one for guests and another for smart home devices).

PrefixWhat it usually is/64 networks it contains
/48Assignment to a company or site65,536
/56Typical assignment to a home256
/64A local network (LAN, Wi-Fi)1
/128A single address—

Types of addresses you’ll see

The same device has several IPv6 addresses at once, and that’s normal. The ones you’ll come across:

TypeStarts withScopeWhat it’s for
Global unicast2 or 3 (range 2000::/3)The whole internetYour public address
Link-localfe80::Local link onlyTalking to the router and neighbors; always present
ULA (unique local)fd (range fc00::/7)Your private networkStable internal addresses, like 192.168.x.x
Loopback::1The device itselfLocal testing
MulticastffGroups of devicesReplaces IPv4 broadcast

The link-local fe80:: address is always there, even without an internet connection. If it’s the only one you have, your device speaks IPv6 but hasn’t received a prefix from the router. When you use it you’ll see something like fe80::1%en0: what comes after % indicates the interface, because the same address can exist on several.

SLAAC: addresses without a DHCP server

In IPv4, a DHCP server hands out the IPs. In IPv6 the main method is SLAAC (stateless address autoconfiguration):

  1. The device connects and creates its link-local address.
  2. The router periodically announces the network prefix (for example, 2001:db8:1:1::/64) through Router Advertisement messages.
  3. The device generates the 64 interface bits itself and appends them to the prefix.
  4. It checks that no one else is using that address and activates it.
SLAAC in four steps: link-local, prefix announcement by the router, interface generation and check
With SLAAC, the router announces the prefix and each device builds its own address

For privacy, current systems also generate random temporary addresses that change over time and use them to go out to the internet. That way websites can’t track your device by a fixed address. That’s why you’ll see several global addresses on the same interface.

How to see your IPv6 address

On Windows:

ipconfig

Look for “IPv6 Address”, “Temporary IPv6 Address” and “Link-local IPv6 Address” (the fe80:: one).

On macOS:

ifconfig en0 | grep inet6

On Linux:

ip -6 addr show

To check whether you reach the internet over IPv6:

ping -6 -c 4 google.com
curl -6 https://ifconfig.co

On Windows, ping -6 google.com. If it fails but you have a global address, the problem is usually the router or the ISP.

IPv6 and NAT: the firewall is still key

With IPv6 every device has a public address and is directly reachable. There’s no need to forward ports with translation: you just allow traffic to that address and that port.

This scares a lot of people, because in IPv4 NAT blocked incoming connections as a side effect. But NAT was never a security mechanism; what protects you is the stateful firewall. Home routers with IPv6 enabled come with a default rule that lets everything out and only lets in replies to connections you started. It’s the same behavior you had, without the translation.

What you should check:

  • That the router’s IPv6 firewall is turned on. Some older models had it disabled or allowed everything.
  • That when you open a service you do it for a specific address, not for the whole network.
  • That the device’s own firewall is on, because it’s now directly reachable if someone opens too much.

A practical detail: if you open a port in IPv4 and in IPv6, they’re two separate rules. Working one way doesn’t guarantee it works the other.

Common mistakes

ProblemCause
You only have an fe80:: addressThe router isn’t announcing a prefix: IPv6 is disabled or the ISP doesn’t offer it
Writing two :: in an addressIt’s invalid; you can only shorten one run of zeros
A URL with IPv6 won’t openThe address needs to be in square brackets: http://[2001:db8::10]:8080/
Your address changes every few hoursThose are the temporary privacy addresses; it’s expected
A service works over IPv4 but not IPv6The IPv6 firewall rule is missing or the service only listens on IPv4
Websites slow to loadMisconfigured IPv6 that the system tries before falling back to IPv4

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor