Finally made some time to investigate and set-up IPv6 support on my Ubuntu (Digital Ocean) servers. Turns out, it’s not that hard. Here’s the TLDR.
- Take a snapshot. Or backup. Because.
- Now, get an address… In my case, that was as simple as clicking a button on my Digital Ocean droplet admin. Unfortunately, that meant an unscheduled machine reboot… as it can only be applied while the machine is turned off (or being newly provisioned). Oh well.
- SSH to your server.
- Then add your address:
sudo ip -6 addr add public_ipv6_address/64 dev eth0
- Followed by your gateway:
ip -6 route add default via public_ipv6_gateway dev eth0
I’ll admit I was confused initially by this step as I was accidentally adding the ipv6 address again. The gateway address is different.
sudo nano /etc/network/interfaces
- Add the following. Obviously, add your own v6 address (note, you do not add the
/64we entered when setting the address up initially) plus gateway. The dns addresses here are for Digital Ocean, so if you are using a different host, you’ll need to to change them.
iface eth0 inet6 static address primary_ipv6_address netmask 64 gateway ipv6_gateway autoconf 0 dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888 126.96.36.199
- Save the file. Reboot the server.
More info? Digital Ocean have an detailed article + comments.