How to Set Up IPv6 on Your VPS

IPv6 adoption continues to grow, and many VPS providers now offer IPv6 addresses alongside IPv4. This guide covers configuring IPv6 correctly on your server for dual-stack operation.

Why IPv6 Matters

  • IPv4 address exhaustion makes IPv6 increasingly important for future-proofing
  • Some networks/ISPs are IPv6-preferred or IPv6-only, and having both ensures maximum reachability
  • Often provided free alongside IPv4 by hosting providers, with no reason not to enable it

Step 1 — Check Whether Your VPS Has an IPv6 Address Assigned

ip -6 addr show

If nothing appears, check your hosting provider's control panel — IPv6 may need to be explicitly enabled/assigned for your instance.

Step 2 — Configure the IPv6 Address (If Not Automatic)

sudo nano /etc/netplan/50-cloud-init.yaml
network:
  ethernets:
    eth0:
      addresses:
        - 2001:db8::2/64
      gateway6: 2001:db8::1
      nameservers:
        addresses: [2606:4700:4700::1111]

Use the exact IPv6 address, prefix, and gateway values provided by your hosting provider.

sudo netplan apply

Step 3 — Verify Connectivity

ping6 google.com

Step 4 — Add an AAAA DNS Record

In your domain's DNS settings, add an AAAA record pointing to your VPS's IPv6 address, alongside the existing A record for IPv4 — see How to Point a Domain to Your VPS (A/AAAA Records).

Step 5 — Configure Nginx/Apache to Listen on IPv6

server {
    listen 80;
    listen [::]:80;
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name yourdomain.com;
}

The [::]: syntax specifies the IPv6 wildcard address — without this, your web server only accepts IPv4 connections even if the DNS AAAA record exists.

Step 6 — Configure the Firewall for IPv6

UFW automatically applies most rules to both IPv4 and IPv6 if IPV6=yes is set in /etc/default/ufw (the default in most modern distributions) — verify this:

sudo cat /etc/default/ufw | grep IPV6

Testing IPv6 Access to Your Website

curl -6 https://yourdomain.com

Or use an online IPv6 connectivity checker to confirm your site is reachable over IPv6 from the public internet.

Common Errors

Site unreachable over IPv6 despite AAAA record — verify the web server is explicitly listening on [::], not just the IPv4 wildcard.

IPv6 configured but no connectivity — verify the gateway address and prefix length exactly match what your provider specified; a small typo in IPv6 addressing is a very common cause of connectivity failure.

Best Practices

  • Enable IPv6 if your provider offers it at no additional cost — there's little downside
  • Ensure firewall rules apply consistently to both IPv4 and IPv6
  • Test connectivity explicitly over IPv6, don't assume dual-stack works just because IPv4 does

Continue Reading

Browse more articles in Advanced Networking & VPN.

  • ipv6 configuration, dual stack networking, ipv6 vps, aaaa record
  • 0 Bu dökümanı faydalı bulan kullanıcılar:
Bu cevap yeterince yardımcı oldu mu?

İlgili diğer dökümanlar

How to Set Up a VPN Server with WireGuard

WireGuard is a modern, fast, and simple VPN protocol — significantly easier to configure...

How to Set Up an OpenVPN Server on a VPS

OpenVPN is a mature, widely-supported VPN protocol — a solid choice when you need broad...

How to Configure a VPS as a Forward Proxy with Squid

A forward proxy routes outbound requests through your VPS, useful for accessing geo-restricted...

How to Bond Multiple Network Interfaces for Redundancy

Network interface bonding combines multiple physical/virtual network interfaces into a single...

How to Set Up a Site-to-Site VPN Between Two VPS Servers

A site-to-site VPN creates a persistent, secure tunnel between two servers (or entire networks),...