All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
WireGuard in unprivileged LXC / NAT VPS - 3 things that kept breaking it for me
Been setting up WireGuard on a bunch of unprivileged LXC containers (Incus) lately, mostly NAT boxes with a forwarded port range. Ran into the same 3 problems every single time so I figured I'd write them down. Tested on Ubuntu 24.04 and Debian 12 inside the container.
1. Module has to be on the host
Containers share the host kernel, so installing wireguard inside the container only gets you the tools. If the host never loaded the module you get RTNETLINK answers: Not supported and can waste an hour thinking your config is wrong (I did).
Quick check before installing anything:
ip link add wgtest type wireguard && ip link del wgtest && echo ok
If that fails only the host admin can fix it (modprobe wireguard + add it to modules-load.d). On a NAT VPS that's a ticket to your provider.
2. Turning on forwarding kills your own IPv6
You need ip_forward=1 and ipv6.conf.all.forwarding=1 to route client traffic. What nobody tells you: once forwarding is on, the kernel stops accepting router advertisements. So if your IPv6 comes from RA, your VPS quietly loses its own v6 a bit later. Fix:
net.ipv6.conf.eth0.accept_ra = 2
(use your WAN interface name). I put all of it in /etc/sysctl.d/99-wg.conf.
3. Handshake ok, no traffic = MTU
This one is nasty because wg show looks perfect, recent handshake on both sides, but nothing loads. Worked fine from my home connection, broke from my phone on mobile data. Setting this in the client config fixed it every time:
[Interface]
MTU = 1280
1280 is the IPv6 minimum so it gets through pretty much anything. Someone mentioned this to me in a comment a while ago and it saved me a lot of debugging since.
Config I use on NAT boxes
Pick a UDP port from your forwarded range, only those reach you on NAT.
Server:
[Interface]
Address = 10.66.66.1/24, fd66:66:66::1/64
ListenPort = 20001
PrivateKey = ...
PostUp = iptables -t nat -A POSTROUTING -s 10.66.66.0/24 -j MASQUERADE; ip6tables -t nat -A POSTROUTING -s fd66:66:66::/64 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -s 10.66.66.0/24 -j MASQUERADE; ip6tables -t nat -D POSTROUTING -s fd66:66:66::/64 -j MASQUERADE
[Peer]
PublicKey = ...
AllowedIPs = 10.66.66.2/32, fd66:66:66::2/128
Client:
[Interface]
PrivateKey = ...
Address = 10.66.66.2/32, fd66:66:66::2/128
DNS = 1.1.1.1
MTU = 1280
[Peer]
PublicKey = ...
Endpoint = your.nat.ip:20001
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25
The fd66 ULA + masquerade part gives clients IPv6 through the tunnel even if you only have a single v6 address.
If something doesn't work post your wg show (without keys) and I'll try to help.
Comments
Thanks ChatGPT but if I wanted this I would've just prompted it myself.
Fair enough lol, AI cleaned up my English. Here's the box I'm running it on, phone on mobile data right now with MTU 1280, handshake 10 sec ago:
Happy to help if anyone hits something not covered here.