Why IPv6?
IPv4 addresses (4.3 billion total) are exhausted. IPv6 provides 340 undecillion addresses, enough for the foreseeable future. Many hosting providers now include IPv6 with every VPS.
IPv6 Address Format
Full: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Short: 2001:db8:85a3::8a2e:370:7334 (consecutive zeros collapsed)
Loopback: ::1
All: ::Common Prefixes
| Prefix | Type |
|---|---|
2000::/3 | Global unicast (public) |
fe80::/10 | Link-local (auto-configured) |
fd00::/8 | Unique local (private) |
::1/128 | Loopback |
Check Your IPv6 Configuration
# View IPv6 addresses
ip -6 addr show
# Check IPv6 routing
ip -6 route show
# Test IPv6 connectivity
ping6 google.com
curl -6 https://ifconfig.coConfigure IPv6 on Ubuntu
Edit /etc/netplan/01-netcfg.yaml:
network:
version: 2
ethernets:
eth0:
addresses:
- 198.48.63.241/28
- "2001:db8::1/64"
routes:
- to: default
via: 198.48.63.1
- to: "::/0"
via: "2001:db8::1"sudo netplan applyDual-Stack Web Server
Nginx listens on both IPv4 and IPv6:
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name example.com;
}DNS for IPv6
Add AAAA records alongside your A records:
example.com. 300 IN A 198.48.63.241
example.com. 300 IN AAAA 2001:db8::1