WireGuard VPN with DS-Lite and Proxmox LXC


I kept running into the same problem: how could I connect to my home network over IPv4 when my internet connection only offered public IPv6?

My connection uses DS-Lite, so I don't have an ordinary public IPv4 address at home. This was my approach back in 2021: DynDNS, ddclient, WireGuard and a small external server to bridge incoming IPv4 traffic to IPv6.

The external machine was an inexpensive VPS from 1Fire. WireGuard itself ran on Ubuntu 20.04 inside a Proxmox LXC container.

Historical setup from November 2021: Some installation scripts, Proxmox LXC settings and commands below are outdated. In particular, don't blindly execute third-party shell scripts and don't rely on a daily reboot as a stability fix. This article documents what I did at the time, not a tested current installation guide.

Get an IPv6-capable DynDNS hostname

First I needed dynamic DNS with IPv6 support. I found a free option at ddnss.de.

After creating the Ubuntu container and updating it, I installed curl and ddclient:

sudo apt update
sudo apt upgrade
sudo apt install curl ddclient

The hostname I chose was similar to tollerhost.ddnss.ch. My /etc/ddclient.conf looked roughly like this:

# /etc/ddclient.conf
protocol=dyndns2
usev6=if, if=eth0
if-skip=Scope:Link
server=ddnss.de
login=<your-login>
password='<your-password>'
tollerhost.ddnss.ch

Use your real DynDNS account and hostname, of course, and protect the configuration file because it contains credentials. The current ddclient syntax and provider requirements should be checked against their documentation.

Prepare WireGuard inside Proxmox LXC

Next came WireGuard. At the time, I had to adjust the LXC configuration because the container needed access to a TUN interface.

On the Proxmox host, I edited the container configuration at /etc/pve/lxc/123.conf (replace 123 with the actual container ID).

The original setup used these lines:

lxc.cgroup.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir

I also changed the ownership of /dev/net/tun to the mapped container user and restarted the container.

Important: These are historical cgroup/LXC settings. Modern Proxmox versions use different syntax and device-handling options, and changing ownership of host device nodes can affect other containers. Follow the current Proxmox and WireGuard documentation rather than copying the old settings.

Install WireGuard

Inside the container, I originally used a community installation script that I downloaded and ran directly. I won't recommend repeating that blindly today.

Use the distribution's WireGuard packages or a maintained, reviewed installer instead, and configure it with the DynDNS hostname.

At that point, my home network was reachable via IPv6.

Make it reachable from IPv4

The missing piece was a server on the public internet with both IPv4 and IPv6.

I installed socat there:

sudo apt install socat

Then I forwarded incoming UDP traffic on IPv4 to the IPv6 DynDNS hostname at home:

sudo socat UDP4-LISTEN:1194,fork,su=nobody UDP6:tollerhost.ddnss.ch:1194

The port and hostname are examples from my setup; both must match your WireGuard configuration.

This simple relay was enough for an initial test of IPv4 connectivity.

Keep the relay running

At the time I used root's crontab to start socat after reboot. I even scheduled a daily VPS reboot because the setup behaved more reliably that way.

Looking back, that's a workaround rather than a real fix. A dedicated systemd service with sensible restart behaviour and monitoring would be the better solution today.

And remember: exposing a VPN means opening a path into your network. Keep WireGuard keys protected, restrict firewall rules and make sure the relay only forwards the traffic you actually intend.

Sources and thanks

Thanks to Apfelcast and Helmut Karger for the groundwork that helped me build this solution:

The main lesson hasn't changed: with DS-Lite, an external dual-stack relay can give IPv4-only clients a way to reach a VPN hosted at home over IPv6. Just build it with current tooling and monitor it properly.

Previous Next