By Pavel Dostál
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
tls-server
proto tcp-server
dev tun0
tun-ipv6
topology subnet
client-to-client
ifconfig 192.168.192.1 255.255.255.0
ifconfig-ipv6 2a03:b0c0:1:d0::7f:8002 2a03:b0c0:1:d0::7f:8001
client-config-dir /etc/openvpn/ccd
ifconfig-push 192.168.192.3 255.255.255.0 # 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"
net.ipv6.conf.all.forwarding=1
remote shark.pdostal.cz 1194
proto tcp
tls-client
dev tun1
tun-ipv6
proto tcp-client
remote-cert-tls server
pull
<certificates>
keepalive 10 30
comp-lzo
persist-key
persist-tun
verb 2
Do you have any idea what is wrong? Thanks you for your help!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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”
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 ANY_IP_V6::/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 YOUR_ANY_IP_V6/112 -j SNAT --to YOUR_SERVER_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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.