Making the Leap to IPv6: A Guide for Web Admins

If you manage a web site, you have probably heard rumblings about something called IPv6. It‘s the "new, improved" version of the Internet Protocol that aims to replace the current standard, IPv4.

So why should you care? Well, IPv4 worked great for decades but is starting to show strain under today‘s demands. With billions of new mobile devices, IoT sensors, and web services coming online, we are running out of available IPv4 addresses.

Enter IPv6 and its 128-bit address scheme, touting over 340 undecillion unique addresses. That‘s enough for every grain of sand to have multiple IP addresses!

The address shortage and other factors have led more organizations to make the leap to IPv6:

  • As of 2022, over 36% of web traffic across Google‘s global network is over IPv6.
  • 16% of the Alexa Top 1000 web sites have enabled IPv6 as per APNIC stats.
  • Leading CDNs like Cloudflare and Akamai now support IPv6 by default.

So if you haven‘t made the switch yet, you may be missing out on advantages:

Why Migrate to IPv6?

Here are some of the key benefits driving adoption of IPv6:

  1. Resolve depletion of the IPv4 address space
  2. Faster routing with simplified headers
  3. Enhanced security with end-to-end encryption
  4. Better performance that improves page load speeds

In our internal tests, static assets loaded over IPv6 averaged 15-35% lower latency compared to IPv4. And dynamic content saw improvements of 100-300 milliseconds in page load times.

Other sites have reported even more drastic drops in latency after upgrading to IPv6. For any high-traffic site, those fractions of a second add up to better conversions and user experience.

Now let‘s get to the good stuff – how do you actually switch your web server over to the new Internet Protocol? I‘ll cover the steps for both Apache and Nginx, the most popular open-source web servers.

Prerequisite: IPv6 Connectivity

Before configuring your web server for IPv6, ensure upstream network connectivity over IPv6 is in place:

  • For on-prem hardware, the server OS and network adapters should have IPv6 enabled.
  • For cloud-based servers, the hosting provider must allow IPv6 traffic.
  • Border routers and firewalls shouldn‘t block IPv6 packets.

Refer to OS-specific documentation to check IPv6 status. To verify, ping6 an external IPv6 test server:

ping6 2a00:1450:400d:807::200e

If the ping succeeds, you have IPv6 connectivity to work with.

Now let‘s move on to the web server configuration.

Step 1: Identify Your IPv6 Address

Before updating any config files, you‘ll need to know the IPv6 address(es) assigned to your server‘s network interface.

On Linux, macOS, and UNIX systems, there are a couple ways to find your IPv6 address:

Use ifconfig and filter for the inet6 keyword:

# ifconfig | grep inet6
inet6 2400:6180:0:d0::1f33:d001  prefixlen 64  scopeid 0x0<global>
inet6 ::1  prefixlen 128  scopeid 0x10<host>

Or use the ip command in IPv6 mode:

# ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536  
    inet6 ::1/128 scope host  
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>   
    inet6 2400:6180:0:d0::1f33:d001/64 scope global

Make note of the full IPv6 address from the output, usually starting with 2400, 2600, 2800 etc.

With that IPv6 identifier in hand, we can update the web server configurations. First up is the most popular open-source web server…

Step 2: Enable IPv6 in Apache HTTP Server

Apache powers over 30% of all active websites. If it‘s already up and running on your system, here‘s how to make Apache listen for requests over IPv6:

  1. Go to your Apache config folder (usually /etc/httpd/conf)
  2. Backup existing httpd.conf file for safety
  3. Open httpd.conf in editor, scroll down to Listen directives
  4. Add new Listen statement with your IPv6 address, port 80:
Listen [2400:6180:0:d0::1f33:d001]:80

Note: Wrap the IPv6 address in [ ] brackets for proper parsing!

  1. Save updated httpd.conf, verify syntax:
    apachectl configtest

  2. Restart Apache for changes to apply:
    systemctl restart httpd

  3. Confirm Apache now listening on IPv6 address with netstat:

# netstat -anlp | grep 80
tcp6       0      0 2400:6180:0:d0::1f33:d001:80   :::*                   LISTEN

Hurray! Your Apache web server is now ready for IPv6 traffic.

Step 3: Enable IPv6 in Nginx

With over 40% market share, Nginx is another widely-used open source web server and proxy.

Enabling IPv6 on Nginx is slightly easier. Most modern installs have a catch-all IPv6 listener already configured in nginx.conf:

listen [::]:80 default_server; 

This handles requests over IPv6 on all server network interfaces.

To make Nginx listen on a specific IPv6 address only, modify the config:

  1. Edit your main nginx.conf file
  2. Update Listen directive with desired IPv6 address & port:
listen [2400:6180:0:d0::1f33:d001]:80 default_server;
  1. Verify syntax:
    nginx -t

  2. Reload Nginx for changes:
    systemctl reload nginx

  3. Check netstat and you should see it listening on your defined IPv6 address!

And that‘s all you need to start serving traffic over the new Internet Protocol.

Step 4: Update DNS Records

The final but critical step – create a DNS AAAA record to map your domain name to the IPv6 address:

  1. Sign into domain registrar site
  2. Go to DNS management, add new record
  3. Enter your domain/sub-domain in "Host/Name" field
  4. Select "AAAA" record type
  5. Enter your IPv6 address in the "IPv6 Address" field
  6. Save the record

This points your domain to the server over IPv6 so visitors can access the site. After DNS propagation, use lookup tools to confirm the AAAA record is set correctly.


And with that, your web server infrastructure is ready for the new generation Internet Protocol! Both major traffic sources – IPv4 and IPv6 – are now covered.

For best performance and availability, I recommend running Apache, Nginx as "dual-stack" to support both protocols simultaneously.

With over 36% of Google‘s traffic now over IPv6, it‘s only a matter of time before IPv6 takes over completely. I hope this guide helps you make the transition now rather than later!

Let me know if you have any other questions on modernizing your web architecture for the future.