2>&1

"Setting IPv6 on a server" on https://aligot-death.space, available at https://aligot-death.space/wiki/ipv6-webserver-en

Setting IPv6 on a server

Setting up a modern web server with IPv6

Read it aloud: play pause stop

Potentially out of date

Based on this documentation from OVH adapted for my own uses, on a debian-nginx server

First, add to the file /etc/sysctl.conf:

1  net.ipv6.conf.all.autoconf=0
2  net.ipv6.conf.all.accept_ra=0

Then to apply changes:

1 sudo sysctl -p

add to /etc/network/interfaces (or /etc/network/interfaces.d/50-cloud-init.cfg for OVH):

1  iface eth0 inet6 static
2  address YOUR_IPv6
3  netmask 128
4 
5  post-up /sbin/ip -f inet6 route add IPv6_GATEWAY dev eth0
6  post-up /sbin/ip -f inet6 route add default via IPv6_GATEWAY
7  pre-down /sbin/ip -f inet6 route del IPv6_GATEWAY dev eth0
8  pre-down /sbin/ip -f inet6 route del default via IPv6_GATEWAY

For some reasons guides add a indentation but it seems to be counter productive (note to self, read documentation more carefully)

And finally to apply it (make sure to have a KVM on hand in case network interfaces fail to come back):

1 sudo /etc/init.d/networking reload

The reload command gives more verbose logs.

Then add AAAA record on registrar.

And finally add to website configuration (nginx):

1  listen [::]:443 ssl http2 default_server;

And to apply:

1 sudo service nginx reload