October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk11 min

How to Set Up an IPv6 OpenVPN Server on Ubuntu

A practical Ubuntu guide to running OpenVPN over IPv6 and routing IPv6 traffic through the tunnel, including PKI, server and client configuration, forwarding, firewalls, upstream routes and diagnostics.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can run OpenVPN over IPv6, carry IPv6 traffic inside the tunnel, or do both. Those are separate settings: proto udp6 controls how the client reaches the server, while a distinct routed IPv6 pool, IPv6 forwarding, firewall rules and upstream routing control whether tunneled clients can reach IPv6 networks and the public internet.

The reliable design is a routed TUN server on Ubuntu with its own provider-routed IPv6 prefix (normally a /64 for the VPN subnet), matching IPv6 transport settings, kernel forwarding enabled, and a firewall policy that permits forwarding between the tunnel and the IPv6 uplink.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What “IPv6 OpenVPN server” can mean

There are two independent IPv6 decisions:

  • IPv6 transport: the OpenVPN control and data packets between client and server use IPv6. Set matching proto udp6 values on both sides. OpenVPN 2.6 defines udp6 as IPv6-only UDP transport.
  • IPv6 inside the tunnel: clients receive IPv6 addresses on a VPN subnet and send selected or all IPv6 traffic through it. This requires an IPv6 pool, pushed routes, forwarding and a return path.

An IPv6 listener does not automatically give connected clients IPv6 internet access. A client can complete TLS authentication and show an IPv6 server endpoint while still lacking a usable route, forwarding permission or upstream return route.

Choose the topology before installing anything

Routed TUN (the normal IPv6 design)

Use a layer-3 TUN interface and a separate routed IPv6 block for VPN clients. The OpenVPN community IPv6 guidance says an on-link LAN prefix cannot be reused for a routed VPN network; the VPN subnet must be a unique routed range that reaches the Ubuntu host. A /64 is the usual size recommended for the OpenVPN subnet.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Your hosting provider or ISP must route that block to the Ubuntu machine. Obtaining the block and adding the provider-side route are outside OpenVPN configuration. Replace documentation-only examples such as 2001:db8::/64 with the real prefix assigned to you.

Public routed addresses versus NAT

A publicly routed client prefix lets each VPN address remain globally reachable, provided the upstream route points back to the server. Another design uses a private or unique-local IPv6 pool and translates it at the server’s IPv6 uplink with SNAT or masquerade. NAT can work when the provider will not route an additional public prefix, but it changes the address visibility and firewall model. Do not mix the two approaches accidentally.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Split tunnel versus full tunnel

  • Split tunnel: push only the IPv6 networks that should use the VPN, leaving ordinary internet traffic on the client’s local connection.
  • Full tunnel: push IPv6 default/unicast routes so all IPv6 internet traffic enters the VPN. This requires a working upstream route for the client pool or a deliberate IPv6 NAT policy.

Transport choices

Requirement Server/client transport What it does not provide
Reach a server that is accessible only through IPv6 proto udp6 It does not assign IPv6 addresses inside the tunnel.
Carry IPv6 applications through an IPv4-reachable server IPv4 transport can still be used; configure IPv6 tunnel addressing separately. It does not make the control connection IPv6.
Use IPv6 for both connection and tunneled traffic proto udp6 plus an IPv6 pool and IPv6 routes It still needs forwarding, firewall policy and an upstream return path.

Prerequisites and package installation

  • An Ubuntu host with a working global IPv6 address and a default IPv6 route.
  • A provider-routed IPv6 block for the VPN subnet, preferably a /64, unless you have intentionally selected an IPv6 NAT design.
  • IPv6 support on every client that will connect.
  • Permission to receive UDP traffic on the selected OpenVPN port (1194 is the common default) through provider and host firewalls.
  • A plan for split or full tunneling and for routed public addresses or NAT.

Confirm the host’s current state before changing OpenVPN:

ip -6 addr show
ip -6 route show
ping -6 -c 3 2606:4700:4700::1111

The final command is only a reachability check; use an IPv6 address that is reachable from your network if that test destination is filtered.

Install the server packages and certificate tooling:

sudo apt update
sudo apt install openvpn easy-rsa

Use the Easy-RSA workflow supplied with your Ubuntu release to create a certificate authority, a server certificate/key and one distinct client certificate/key per device. Never reuse a client private key between people or machines.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create the TLS material

OpenVPN uses the CA to validate certificates and a separate static key to protect the TLS control channel. Generate that key on the server:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo openvpn --genkey secret ta.key

Place ca.crt, the server certificate, the server private key, Diffie-Hellman material and ta.key in a protected directory referenced by the server configuration. Restrict private-key permissions so only root (or the account used by the service) can read them.

Reference the static key with tls-crypt ta.key on both server and client. Ubuntu documents tls-crypt for OpenVPN 2.4 and newer; systems older than Ubuntu 18.04 require the older tls-auth form and matching key-direction settings instead.

For each client, transfer only its own CA certificate, issued client certificate, private key and ta.key over a secure channel. A client configuration normally needs all four files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build the server configuration

Ubuntu’s sample configuration is a useful starting point. Save the adapted file as /etc/openvpn/server.conf. The following is a structural example; substitute your real routed prefix, certificate paths, port and interface assumptions.

port 1194
proto udp6
dev tun

user nobody
group nogroup
persist-key
persist-tun

topology subnet
server-ipv6 2001:db8:1234:5678::/64

ca /etc/openvpn/pki/ca.crt
cert /etc/openvpn/pki/issued/server.crt
key /etc/openvpn/pki/private/server.key
dh /etc/openvpn/pki/dh.pem
tls-crypt /etc/openvpn/pki/ta.key

keepalive 10 120
status /var/log/openvpn/status.log
verb 3

server-ipv6 assigns the IPv6 network used on the TUN interface. The 2001:db8::/32 documentation range in this example is not routable and must never be deployed unchanged. Use the IPv6 server/address directives supported by the OpenVPN version installed on your Ubuntu release.

To make IPv6 transport work, the client must also use proto udp6 and resolve or connect to an IPv6 address for the server. If the server has both address families, you may instead keep IPv4 transport and configure only the IPv6 tunnel network.

Push only the routes you intend to use

For split tunneling, push the specific IPv6 networks that should traverse the VPN:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
push "route-ipv6 2001:db8:abcd::/48"

Use your actual destination prefix, not the documentation prefix shown above. The OpenVPN manual defines route-ipv6 for IPv6 route installation; route-gateway behavior depends on the tunnel topology and installed release.

For a full-tunnel policy, push the IPv6 default/unicast routes required by your client software and policy. A broad route can capture all IPv6 internet traffic, so test it with an administrative path available in case the VPN’s upstream routing is incomplete. A full-tunnel route without a provider return route or a working SNAT rule produces a connected client with no usable IPv6 internet.

Do not add IPv4 redirect directives merely because the server carries IPv6. Keep IPv4 and IPv6 route policy explicit so clients know which traffic is intended to use the tunnel.

Enable IPv6 forwarding on Ubuntu

Linux must route packets between the TUN interface and the IPv6 uplink. Create a persistent sysctl drop-in:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo tee /etc/sysctl.d/60-openvpn-ipv6-forwarding.conf > /dev/null <<'EOF'
net.ipv6.conf.all.forwarding = 1
EOF
sudo sysctl --system

Verify the effective value:

sysctl net.ipv6.conf.all.forwarding

Ubuntu’s forwarding documentation also shows the equivalent IPv4 setting:

echo "net.ipv4.ip_forward = 1" | sudo tee /etc/sysctl.d/50-enable-ipv4-forwarding.conf
sudo sysctl -p /etc/sysctl.d/50-enable-ipv4-forwarding.conf

Enable IPv4 forwarding only if your VPN policy also routes IPv4. IPv6 clients still require the IPv6 setting even when the OpenVPN control connection uses IPv4.

Configure the firewall and upstream route

Allow the OpenVPN listener

Permit the selected UDP port in every layer: the hosting provider’s security group or edge firewall and Ubuntu’s local firewall. With UFW, the basic listener rule is:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
sudo ufw allow 1194/udp

Use your chosen port if it differs from 1194. Confirm that the rule applies to the IPv6 firewall family and that an upstream firewall is not still blocking UDP.

Permit forwarding

The firewall must allow new traffic from the TUN interface to the IPv6 uplink and established return traffic back. Interface names vary (eth0, ens3, or another name), and UFW, nftables and ip6tables have different rule syntax. Identify the actual interfaces first:

ip link show
ip -6 route show default

Then implement equivalent forward rules in the firewall system you administer. A routed public prefix should be forwarded without NAT, while a private or unique-local pool needs an IPv6 SNAT/masquerade rule on the uplink. Never copy a rule that names the wrong interface or pool prefix; it can either expose traffic or silently drop it.

Make the provider route the VPN prefix

For a routed design, the provider must send the VPN subnet back to the Ubuntu host. The host’s own default route is not a substitute for that more-specific return route. Ask the provider for the exact method—static route, delegated prefix, routed subnet or provider portal—and install the route exactly as documented. If the provider cannot route another public prefix, choose an intentional NAT design and document the egress address and firewall behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start the correct Ubuntu systemd service

Ubuntu uses templated OpenVPN units. A file named /etc/openvpn/server.conf is started as openvpn@server, not by the generic openvpn unit.

sudo systemctl start openvpn@server
sudo systemctl enable openvpn@server
sudo systemctl status openvpn@server

Read the service log immediately if it fails:

sudo journalctl -u openvpn@server -b --no-pager

Common startup failures include an incorrect certificate path, an unreadable private key, a directive unsupported by the installed OpenVPN version, a port already in use, or a malformed IPv6 prefix.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Create the client profile

Install OpenVPN on the client and copy its CA certificate, client certificate, client private key and ta.key. A minimal profile for an IPv6-only transport looks like this:

client
dev tun
proto udp6
remote vpn.example.net 1194

resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server

auth-nocache
verb 3

ca ca.crt
cert client-device.crt
key client-device.key
tls-crypt ta.key

Replace vpn.example.net with a hostname that has an AAAA record or use the server’s real IPv6 address. The client and server must agree on transport protocol, port and TLS protection. A normal client profile accepts pushed routes; adding route-nopull deliberately suppresses them and therefore requires you to install equivalent routes yourself.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep each profile private. The client key grants access until its certificate is revoked or expires, so remove it from lost devices and issue a replacement certificate.

Verify the setup in layers

1. Confirm service and certificate negotiation

On the server, watch:

sudo journalctl -u openvpn@server -f

On the client, look for successful certificate verification and Initialization Sequence Completed. A successful handshake proves authentication and transport, not internet forwarding.

2. Inspect the tunnel interface

ip addr show tun0
ip -6 addr show dev tun0
ip -6 route show

The client should have an address from the VPN IPv6 pool and routes corresponding to the server’s pushed policy. If no IPv6 address appears, inspect the server’s IPv6 pool directive and the client log before changing firewall rules.

3. Test the VPN gateway

Ping or otherwise connect to the VPN gateway’s IPv6 address from the client. Failure here usually indicates tunnel addressing, local firewall or forwarding problems rather than an external provider route.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Test an external IPv6 destination

After the gateway responds, test a known external IPv6 service or public-address endpoint from the client. The resulting public IPv6 address should match the routed client address or the server’s NAT egress address, depending on your chosen design. Test both DNS resolution and a literal IPv6 destination so a DNS problem is not mistaken for a routing failure.

Why a client connects but has no IPv6 internet

  1. The VPN pool overlaps the LAN. A routed TUN design needs a distinct routed prefix. Reassign the VPN subnet and arrange a provider route.
  2. IPv6 forwarding is disabled. Check sysctl net.ipv6.conf.all.forwarding and reload the persistent drop-in.
  3. The firewall permits UDP but not forwarding. Opening port 1194 only allows the tunnel handshake. Add forward and return rules between TUN and the IPv6 uplink.
  4. The upstream route is missing. Public client addresses need a provider route back to the VPN host. Verify this from outside the server’s local network.
  5. The client did not receive or install routes. Check ip -6 route, remove accidental route-nopull, and confirm the server pushed the intended split or full-tunnel routes.
  6. NAT is incomplete or attached to the wrong interface. A private/unique-local pool needs IPv6 SNAT or masquerade on the real default-route interface, plus return traffic allowed by the firewall.
  7. Transport and tunnel settings were confused. proto udp6 changes the OpenVPN connection’s address family; it does not create an IPv6 client subnet or route.
  8. The profile uses the wrong address family. An IPv6-only client transport cannot connect through a network that has no IPv6 path to the server. Provide an IPv4 transport profile or dual-stack endpoint when required.

Security and operational checks

  • Use a separate certificate and private key for every client; revoke compromised credentials instead of sharing a replacement key.
  • Keep private keys readable only by the service or intended user.
  • Limit pushed routes to the networks clients actually need. Full-tunnel IPv6 changes DNS, address exposure and bandwidth paths, so communicate that policy to users.
  • Keep OpenVPN and Ubuntu security updates current, and review the journal after upgrades because directive support and service packaging can change.
  • Monitor the provider’s routed-prefix and firewall settings separately from Ubuntu. A correct local configuration cannot repair a missing upstream route.
  • Test from an external IPv6 network as well as from the server itself; local success can hide an upstream filtering or return-path fault.

Community OpenVPN versus Access Server configuration

The procedure above describes the community OpenVPN package managed with configuration files and systemd. Access Server has its own management interface and IPv6 configuration keys, including separate choices for public routed pools, local pools with SNAT and NAT-disabled routing. Do not copy Access Server settings into a community configuration or assume that a key from one edition exists in the other. The underlying networking requirements—an address pool, forwarding, firewall policy and a return path—remain the same.

Final deployment checklist

  • The Ubuntu host has a global IPv6 address and a working default route.
  • The VPN subnet is a separate provider-routed prefix, or NAT has been deliberately configured for a private/unique-local pool.
  • Server and client use matching proto udp6 when IPv6 transport is required.
  • Certificates, keys, Diffie-Hellman material and tls-crypt files are present and protected.
  • IPv6 forwarding is enabled persistently.
  • The OpenVPN UDP port is allowed by upstream and local firewalls.
  • Forward and return rules cover the TUN and IPv6 uplink interfaces.
  • The service runs as openvpn@server for server.conf.
  • The client receives the intended split or full-tunnel IPv6 routes.
  • Logs, interface addresses, routes, gateway reachability and an external IPv6 endpoint have all been checked.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.