With the exhaustion of IPv4 addresses coming closer to reality, I decided it was about time that I added IPv6 support to my server. This turned out to be quite an easy process (at least it was on Linode + Ubuntu 10.04). In this post I'll show you how to add IPv6 support to your own server in 4 easy steps.
The first step, of course, is to request an IPv6 address for your server. On Linode this was as simple as clicking the 'Enable IPv6' link and restarting the server. When the server came back online it automatically had an IPv6 address assigned to it and the IPv6 interfaces configured. This step might be more complicated on other hosts.
The second step is to allow the IPv6 ports through the firewall. If you're using UFW, you'll need to do the following:
IPV6=yes(I think that
IPV6=yesis now the default value starting Ubuntu 11.10).
- Disable and enable the firewall for the changes to take affect. A server restart may also be required.
- Re-add all your existing firewall rules so that the IPv6 rules get added.
The third step is to configure Apache to listen to both the IPv4 and IPv6 interfaces. All you need to do is make sure that Apache is using IP agnostic rules for both the Listen and VirtualHost directives, as Apache will then automatically listen to both of the interfaces. For example:
Listen 80 <VirtualHost *:80>
This is the default setup for Apache, so chances are you wouldn't need to change a thing! However, if you're using IP-based Virtual Hosts, you'll need to add your IPv6 addresses to your VirtualHost directives as well, which can be done like the following:
<VirtualHost 184.108.40.206:80, [2600:3c01::f03c:91ff:fe93:fafd]:80>
Don't forget to restart Apache if you made any changes.
Finally you'll need add AAAA records containing your IPv6 address to your DNS. These records should correspond to your existing A records.
Now it's time to test your new IPv6 setup! This can be a little difficult at the moment, since it's likely that your ISP doesn't support IPv6 yet, but you can use a service like https://ipv6-test.com/validate.php to validate your setup or you can try visiting your website through an IPv6 proxy. More information about IPv6 networking on Linode is available in the Linode Library.
The future of the internet relies on the adoption of IPv6, so take the initiative!