IPV6 PPTP & Nginx, IPV4 works, cant get IPV6 working.

September 12, 2014 5.4k views


I just updated my DNS, added 2a03:b0c0:2:d0::1 as AAAA.
Guess my website must be reacheable from IPV6, but doesnt work (Used multiple sites to test, dont got IPV6 connection here myself).
How can i setup Nginx to use IPV4 and IPV6 address?

Also i wanted to use a IPV6 Address with PPTP.
Got a working PPTP setup on my Ubuntu 14.04 server, but dont know how to get IPV6 working too.

Does someone know the answer, or a tutorial for this?
Im completly new to IPV6, and a beginner/medium ubuntu user.

EDIT: Seems my AAAA record is wrong to :(


1 comment
  • In Nginx you need this lines for both IPv6 and IPv4 support:

    listen 80;
    listen [::]:80;

    The first one is for IPv4 and the second line opens port 80 on all your ipv6 addresses. You can also specify a single IPv6 address inside the brackets if you want.

    You can test this with this:

    netstat -tulpan | grep nginx
    tcp        0      0    *               LISTEN      1102/nginx.conf
    tcp6       0      0 :::80                   :::*                    LISTEN      1102/nginx.conf

    Also the IPv6 Address 2a03:b0c0:2:d0::1 seems to be the DO gateway not your droplet. Your droplet has 16 IPv6 Addresses that yu can find under "Configurable address range". Just pick the first one. It should look something like this: 2a03:b0c0:1:d0::c2:e000

2 Answers

Nginx doesn't seem to be listening on port 80:

curl -g "http://[2a03:b0c0:2:d0::1]/"
curl: (7) Failed to connect to 2a03:b0c0:2:d0::1 port 80: Connection refused

You need to tell it to bind to the IPv6 address in your server block. You should already have a line that looks like:

listen 80 default_server;

under it, add:

listen [::]:80;

and restart Nginx:

sudo service nginx restart

Nginx is listenening now.

 netstat -tulpan | grep nginx
tcp        0      0    *               LISTEN      437/nginx
tcp6       0      0 :::80                   :::*                    LISTEN      437/nginx

DigitalOcean tells me this are my IPV6 IP`s:
Configurable address range: 2a03:b0c0:2:d0::14:a000 - 2a03:b0c0:2:d0::14:a00f

Can i just add 2a03:b0c0:2:d0::14:a000 as an AAAA so that IPV6 users will visit the website using IPV6?

And how can i test this?
Or how can i setup my PPTP to use IPV6 to so i can test it myself.

EDIT: For some reason 2a03:b0c0:2:d0::14:a000 (My first IP according to DO) didnt work.
With ifconfig it showed 2a03:b0c0:2:d0::14:a001, so changed my AAAA and seems to work.

IPv6 validation for

AAAA DNS record         2a03:b0c0:2:d0::14:a001
IPv6 web server         nginx/1.4.6 (Ubuntu)
IPv6 DNS server,

Thanks for the answers!
Hope someone can help me change my PPTP to use IPV6 too.


Have another answer? Share your knowledge.