IPv6 versus IPv4: what changes on a server

IPv4 has carried the internet since the early 1980s and its addresses have run out. IPv6 replaces it with a vastly larger space and a cleaner design, and today a well-run server speaks both.

What is the core difference?

Address size. An IPv4 address is 32 bits, about 4.3 billion possible addresses, written as four decimal numbers such as 203.0.113.25. An IPv6 address is 128 bits, written as eight groups of hexadecimal digits such as 2001:db8:4f2a:1c00::25. That is enough for every device on earth to have huge numbers of addresses of its own. Almost every other difference follows from that one: with plenty of addresses, IPv6 no longer needs the address-saving tricks IPv4 grew over the years.

FeatureIPv4IPv6
Address length32 bits128 bits
NotationDotted decimal, 203.0.113.25Hex groups, 2001:db8::25
HeaderVariable, with options and checksumFixed 40 bytes, extension headers
Address configurationManual or DHCPManual, SLAAC or DHCPv6
Neighbour lookupARPNeighbour Discovery over ICMPv6
FragmentationRouters may fragmentOnly the sender fragments
NATWidespreadNot needed

Why does NAT matter here?

Network address translation lets many devices share one public IPv4 address, which kept IPv4 going long after it ran short. It also breaks the end-to-end model: devices behind NAT cannot easily accept incoming connections, which complicates games, calls and peer-to-peer software. IPv6 restores direct addressing. That does not mean every device is exposed: a firewall with a default-deny inbound policy gives the same protection NAT appeared to give, without the side effects.

How do the headers differ?

The IPv6 header is simpler and fixed at 40 bytes. Optional information moved into extension headers that most routers skip, and the header checksum was removed because link and transport layers already check data. Routers no longer fragment packets; instead the sender discovers the path MTU through ICMPv6 messages and sizes packets accordingly. That is why blocking ICMPv6 breaks IPv6 connections in subtle ways, such as pages that start loading and then hang.

How do addresses get configured?

IPv6 hosts can configure themselves from router advertisements using SLAAC, or receive addresses from DHCPv6, or be set statically. Servers are usually configured statically, so addresses never change. Every interface also has a link-local address starting with fe80, used for neighbour discovery and routing on the local link. On our machines the IPv4 address is set up during installation; the IPv6 block is shown in the console, and Configure IPv6 shows how to add it to the network configuration of each distribution.

ip -4 addr show dev enp1s0f0
ip -6 addr show dev enp1s0f0 scope global
ip -6 route show default

Do firewall rules need to change?

They need to cover both families. With nftables, an inet table applies the same rules to IPv4 and IPv6, which avoids the classic mistake of a careful IPv4 firewall and a wide-open IPv6 side. Allow the ICMPv6 types for neighbour discovery and packet-too-big messages, and test from outside on both addresses.

nft add rule inet hostfw inbound icmpv6 type { nd-neighbor-solicit, nd-neighbor-advert, nd-router-advert, packet-too-big, echo-request } accept
curl -6 -sI https://www.example.org | head -1

Is IPv6 faster than IPv4?

Not by design, but sometimes in practice. Without NAT devices in the path and with simpler headers, IPv6 routes can be as fast or slightly faster, and mobile networks that run IPv6 natively avoid translation gateways. The main reason to enable it is reach: a large share of mobile and home users now connect over IPv6 first, and some networks are IPv6 only behind translation.

Will IPv4 disappear?

Not soon. IPv4 remains widely used, and translation services let IPv6-only networks reach IPv4 sites, so both will coexist for many years. What has changed is cost and scarcity: new IPv4 addresses are expensive to obtain, which is why providers ration them and why IPv6 carries the growth.

What does running both look like?

Dual stack: the server has an IPv4 and an IPv6 address, services listen on both, and DNS publishes an A record and an AAAA record. Clients use whichever works best. Each of our machines includes one IPv4 address and an IPv6 block, and we do not sell extra IPv4 addresses, so IPv6 is also the easy way to give separate services their own address. Reverse DNS for the IPv4 is set in our console; IPv6 and reverse DNS on your server covers naming, and IPv6 explained explains IPv6 addressing in more depth.

Related pages

IPv6 explained

How IPv6 addresses are written, shortened and divided, what prefixes like /64 mean, the address types you meet on a server and how to test reachability.

Read more

Configure IPv6

Bring up an address from your IPv6 block on Debian, Ubuntu or Enterprise Linux, add more addresses, test reachability and serve web traffic on both protocols.

Read more

IPv6 and reverse DNS on your server

Configuring the IPv6 block that comes with every machine and setting the reverse DNS name of its IPv4 address from the console.

Read more

What a firewall does

Firewalls explained from packets up: stateful filtering, default-deny policies, host and network firewalls, nftables examples and mistakes that lock you out.

Read more

Questions and answers

What is the main difference between IPv4 and IPv6?

Address size: IPv4 uses 32 bit addresses, about 4.3 billion in total, while IPv6 uses 128 bit addresses, enough to never run out.

Does IPv6 need NAT?

No. Every device can have a public address, and a default-deny firewall provides the protection NAT seemed to offer.

Why should I not block ICMPv6?

IPv6 relies on it for neighbour discovery and path MTU discovery. Blocking it causes hangs and failed connections.

Do your servers include IPv6?

Yes. Every machine includes one IPv4 address and an IPv6 block you can configure on the interface.

Should a server run IPv4 and IPv6 together?

Yes. Dual stack with A and AAAA records lets every client connect over whichever protocol works best for it.