You have an OpenVPN gateway that works. You want to move to WireGuard for the faster handshake, smaller config, and kernel-mode performance. The migration is not technical risk — both protocols solve the same problem — but rollout risk: cutting users over without a “the VPN is down” support ticket per user. This runbook is the staged migration we run: stand up WireGuard alongside OpenVPN, migrate users by cohort, monitor, then decommission the old stack with an audit trail.
How to verify
Before starting, take inventory of what is actually in production.
ss -lunp | grep -E ':1194|:51820'
systemctl status openvpn-server@server
journalctl -u openvpn-server@server --since '7 days ago' | grep CLIENT_LIST | awk '{print $2}' | sort -u
ls /etc/openvpn/easy-rsa/pki/issued/ | wc -l
The list of recent connecting users vs the list of issued certs tells you who is active and who has a stale profile. A migration without that delta usually ends with a stale profile holdout months later.
What’s happening
OpenVPN and WireGuard solve the same problem with different tradeoffs. OpenVPN is mature, has wide client support, and integrates with EAP/SAML through plugins. WireGuard is smaller (4000 lines of kernel code), handshakes faster, has lower CPU overhead, and is now in every modern OS kernel. The migration matters operationally because:
- WireGuard does not have a concept of “user authentication” per se — every peer is identified by its public key. The user-identity mapping lives outside the protocol (in your config, ledger, or front-end like wg-portal).
- WireGuard has no native server logging — the audit pipeline must be rebuilt.
- Client distribution is different. OpenVPN
.ovpnfiles are well-understood; WireGuard configs are simpler but the mobile client UX (QR code, scan, connect) is different.
The staged migration avoids the breakage of a flag-day cutover. Run both gateways. Issue WireGuard profiles to a pilot cohort. Once stable, expand. Once everyone is on WireGuard, retire OpenVPN with a documented decision.
The procedure
-
Stand up WireGuard on the same gateway as OpenVPN. They listen on different ports (51820 vs 1194); they do not collide.
apt install -y wireguard umask 077 wg genkey | tee /etc/wireguard/private.key | wg pubkey > /etc/wireguard/public.key cat <<EOF > /etc/wireguard/wg0.conf [Interface] PrivateKey = $(cat /etc/wireguard/private.key) Address = 10.99.0.1/24 ListenPort = 51820 PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostUp = iptables -A FORWARD -i wg0 -j ACCEPT PostUp = iptables -A FORWARD -o wg0 -j ACCEPT PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE EOF ufw allow 51820/udp sysctl -w net.ipv4.ip_forward=1 systemctl enable --now wg-quick@wg0 wg showUse a different IP range than your OpenVPN pool to avoid kernel routing confusion.
-
Pick a pilot cohort. Three to five technically savvy users. Ideally engineers who can describe what they see if it breaks.
-
Generate per-user WireGuard configs with a script that maintains your audit ledger.
#!/bin/bash USER=$1 umask 077 PRIV=$(wg genkey) PUB=$(echo "$PRIV" | wg pubkey) IP="10.99.0.$(($(wc -l < /etc/wireguard/peers.csv) + 10))" cat <<EOF > /etc/wireguard/clients/${USER}.conf [Interface] PrivateKey = $PRIV Address = $IP/32 DNS = 10.99.0.1 [Peer] PublicKey = $(cat /etc/wireguard/public.key) Endpoint = vpn.example.org:51820 AllowedIPs = 0.0.0.0/0, ::/0 PersistentKeepalive = 25 EOF echo "$USER,$PUB,$IP,$(date -Iseconds)" >> /etc/wireguard/peers.csv wg set wg0 peer $PUB allowed-ips $IP/32 wg-quick save wg0Distribute via the same one-time link mechanism you used for OpenVPN.
-
Monitor the pilot for a week. Things to watch:
- WireGuard handshake counters (
wg show wg0 latest-handshakes). - User-reported issues (DNS, MTU on hotel Wi-Fi, IPv6 leaks).
- OpenVPN connection counts (some pilot users will fall back if WireGuard fails).
- WireGuard handshake counters (
-
Expand by cohort. Engineering -> support -> non-technical staff -> contractors. Each cohort gets a 1-week soak period. By week 4, most fleets are 80% on WireGuard.
-
Hold out for stragglers. Some users will not migrate without prompting. Set a deadline; communicate it twice; on the deadline, generate their profile and personally walk them through import.
-
Decommission OpenVPN with a decision record. Once usage drops to zero for two consecutive weeks:
systemctl stop openvpn-server@server systemctl disable openvpn-server@server ufw delete allow 1194/udpMove
/etc/openvpn/to/etc/openvpn.retired-YYYY-MM-DD/rather than deleting — the PKI may be relevant for audits. -
Update the audit pipeline. The WireGuard logging pattern from vpn-audit-logging-pattern replaces the OpenVPN log shipper. Confirm the auditor’s saved query still produces the expected output for the new schema.
Common pitfalls
- Sharing the same IP pool between OpenVPN and WireGuard — the kernel routes will conflict and one will silently fail. Always use distinct CIDRs.
- Forgetting to rebuild the user-identity mapping — WireGuard does not embed identity in the protocol. If your audit answer was “the cert subject is the user,” you need a new answer (the
peers.csvledger above). - Migrating in one weekend without a pilot — even technically clean migrations have idiosyncrasies (specific hotel Wi-Fi networks, specific corporate firewalls). The pilot finds them.
- Leaving the OpenVPN PKI on the gateway after cutover — if someone reactivates the service later, every stale cert still works. Move it off-host or rebuild from scratch when needed.
- Not communicating the cutover. Users notice when their VPN icon changes, even if the experience is “the same.” Two emails: one with the timeline, one when their profile is ready.
In the engagements we run, OpenVPN-to-WireGuard migrations are a Managed Operations ticket queue: communications, profile issuance, monitoring, and the audit-tracked decommission. The technical work is a fraction of the engagement; the user-onboarding and the audit trail are most of it.