Report this

What is the reason for this report?

OpenVPN with IPv4 and IPv6

Posted on October 12, 2020

I’m creating a server with OpenVPN to mask my IP address using this [article](https://www.digitalocean.com/community/tutorials/how-to-set-up-and-configure-an-openvpn-server-on -ubuntu-20-04-en) from DigitalOcean.

The setup worked perfectly when I configure Redirect All Traffic Through the VPN, all my accesses on sites with IPv4 display the Droplet’s IP.

The problem occurs when I access sites that accept IPv6, in these cases the displayed address is that of my ISP.

Below the line

net.ipv4.ip_forward = 1

I added the value

net.ipv6.conf.all.forwarding = 1

but nothing happened.

How do I also enable the use of the Droplet’s IPv6?



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

In order to enable the use of the Droplet’s IPv6 with OpenVPN, you need to configure your OpenVPN server to handle IPv6 traffic. Here are the steps:

  1. Add an IPv6 block for your Droplet through the DigitalOcean Control Panel if you haven’t done it already.

  2. Update /etc/openvpn/server/server.conf by adding the following lines:

server-ipv6 2001:db8:123::/64

Note: Replace 2001:db8:123::/64 with your own IPv6 block.

  1. Ensure that your OpenVPN server is started with the server-ipv6 flag.

  2. Update your OpenVPN client configuration file to include the following lines:

tun-ipv6 route-ipv6 2000::/3

Please restart your OpenVPN server and client after making these changes.

For more information on working with IPv6, refer to the DigitalOcean IPv6 documentation.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.