OpenVPN - IPv6 works only in local network

January 2, 2015 6.4k views

Hello everyone,

I have dual stack OpenVPN server:

IPv4 works fine, but IPv6 works only in local network.
I would like to access the IPv6 Internet through my VPN.

Server eth0 IP: 2a03:b0c0:1:d0::7f:8001/64
Server tun0 IP: 2a03:b0c0:1:d0::7f:8002/64
Client tun0 IP: 2a03:b0c0:1:d0::7f:8003/64



Chain INPUT (policy DROP 240 packets, 19200 bytes)
 pkts bytes target     prot opt in     out     source               destination         
   32  6574 ACCEPT     all      lo     *       ::/0                 ::/0                
  167 14920 ACCEPT     icmpv6   *      *       ::/0                 ::/0                
   36  3242 ACCEPT     udp      *      *       ::/0                 ::/0                 udp dpt:53
    6   481 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:53
    0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:22
    0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:1194
  246 28608 ACCEPT     all      *      *       ::/0                 ::/0                 state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT 15 packets, 1560 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 569 packets, 91798 bytes)
 pkts bytes target     prot opt in     out     source               destination  


mode server
proto tcp-server
dev tun0
topology subnet

ifconfig-ipv6 2a03:b0c0:1:d0::7f:8002 2a03:b0c0:1:d0::7f:8001
client-config-dir /etc/openvpn/ccd


ifconfig-push # vps
ifconfig-ipv6-push 2a03:b0c0:1:d0::7f:8003/64

push "route-ipv6 2a03:b0c0:1:d0::7f:8001/64"
push "route-ipv6 2000::/3"





remote shark.pdostal.cz 1194
proto tcp
dev tun1
proto tcp-client
remote-cert-tls server


Both server & client configs


keepalive 10 30


verb 2

Do you have any idea what is wrong?
Thanks you for your help!

  • Within a tcpdump look if you have neighbor solicitation asking on the client IP.

  • Yes, client receives address and routes properly.
    Also connection in local network works normally.
    Only connection to the Internet is broken.

  • So what's your plan ? Just waiting help or testing some stuff ?

  • I'm still testing and as I said, local network works normally.

  • Ok let me know if you can make ipv6 work.

4 Answers

Anyone solved this problem?

Okay, I solved this problem. Tested on clean OpenVPN installed by that tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-14-04

We need to create another subnet(?) for OpenVPN, so in /etc/openvpn/server.conf add:
server-ipv6 ANYIPV6::/112

I used my server IP replacing two colons in it for one and adding at the end :80::/112

Now create rule:
ip6tables -t nat -A POSTROUTING -s YOURANYIPV6/112 -j SNAT --to YOURSERVER_IP

And remember, in /etc/sysctl.conf uncomment:
net.ipv6.conf.all.forwarding = 1

Restart, reconnect and check test-ipv6.com. This site shows problem with big MTU, but I don't know now how to solve it

BTW sorry for my bad english.

by James
OpenVPN is a full-featured open source Secure Socket Layer (SSL) VPN solution that accommodates a wide range of configurations. In this tutorial, we'll set up an OpenVPN server on a Droplet and then configure access to it from Windows, OS X, iOS and Android. This tutorial will keep the installation and configuration steps as simple as possible for these setups.
  • So you recommend me to hide all my IPv6 clients behind the NAT?

    I'll try it, but at the end I'd like to have public IPv6 address on every client.

  • DigitalOcean provide only 16 public IP's for each droplet. I think this is too small to make each client public IP, but i'm not an expert.

  • Thank you so much for this. Your instructions are actually working perfectly (test-ipv6 is happy for me). Excellent interim solution until DO gets their act together and properly supports real IPv6 subnets.

    I would recommend adding the following to your openvpn server configuration file:
    push "redirect-gateway ipv6" #For iOS9
    (helps with iOS 9 problems and does not seem to hurt for other clients)

In CCD do

iroute-ipv6 2a03:b0c0:1:d0::7f:8001/64
iroute-ipv6 2000::/3

instead of
push "route-ipv6 2a03:b0c0:1:d0::7f:8001/64"
push "route-ipv6 2000::/3"

Have another answer? Share your knowledge.