
WireGuard VPN
Kernel-fast VPN tunnels with QuickBox CLI + dashboard control
WireGuard® on QuickBox Pro provides a lightweight VPN tunnel for routing server or application traffic through trusted endpoints. The QuickBox integration covers CLI automation, dashboard uploads, automatic MTU tuning, NAT rules, and stored keys for visual status. It includes app-scoped routing for isolating specific application traffic (Emby, Jellyfin, Plex) through WireGuard tunnels using Linux network namespaces. Plan firewall and routing rules accordingly for any additional traffic policies.
⚡ Kernel-speed tunnels
WireGuard modules with minimal overhead for low-latency VPN links
🖥️ Dashboard control
System → VPN Control lets you upload client .conf files, view keys, and toggle active peers
🧭 Auto MTU tuning
`qb manage wireguard calc --mtu` probes the endpoint to set a safe MTU before activation
🌐 Server or client
Generate server configs (NAT + IPv4/IPv6 forwarding) or ingest provider client profiles
🛰️ NordVPN helper
`nvpn_conf_gen` builds ready-to-use NordLynx WireGuard profiles into the QuickBox stash
📂 Config stash
All configs live under /etc/v4-dashboard/wg with location cache and dashboard previews
⏱️ Cron sync
Install adds a 30-minute cron to sync active profile names and keys to the dashboard
🛡️ Key visibility
Private/public keys are surfaced in VPN Control for quick copy-and-paste when needed
🔀 App-scoped routing
Route only Emby, Jellyfin, or Plex traffic through a WireGuard tunnel while other server traffic stays on the default route
🛑 Kill switch protection
Optionally stop a routed app's service when the VPN tunnel drops, with configurable auto-recovery
Installation
Prerequisites
Prerequisites
- QuickBox Pro v3 already installed
- Root/sudo shell access to run
qbcommands - UDP 51820 reachable from peers (or your chosen listen port)
- Outbound HTTPS allowed for ipinfo.io and NordVPN API (for location + generator)
What you get
- WireGuard kernel module with
linux-headersinstalled automatically - Systemd-managed tunnels via
wg-quick@<profile>.service - IPv4/IPv6 forwarding and NAT rules configured by installer
- Config stash at
/etc/v4-dashboard/wgwith dashboard integration - NordVPN profile generator (
nvpn_conf_gen) ready to use
Install via qb (CLI)
Services stay stopped after install
WireGuard install/reinstall writes configs but does not auto-start wg-quick. Activate a profile with qb manage wireguard check -cn <config> or via VPN Control when you are ready.
# Server setup with one client profile and NAT rules
qb install wireguard -u username -o server -lp 51820 -noc 1 -dns 1.1.1.1 \
-cidr 10.5.0.2/16 -cai "0.0.0.0/0,::/0" -ep vpn.example.com \
-pur "iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" \
-pdr "iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE"
# Client-mode installer (paste config when prompted)
qb install wireguard -u username -o client
# Reinstall in place (keeps stash under /etc/v4-dashboard/wg)
qb reinstall wireguard -u username -o server
# Remove WireGuard entirely
qb remove wireguard -u usernameInstall from the dashboard (VPN Control)
- Open System → VPN Control (admin only).
- Click Install WireGuard → choose Client (upload
.conf) or Server (enter listen port, client count, CIDR, allowed address, endpoint, DNS, PostUp/PostDown). - Submit. Uploaded configs are written to
/etc/v4-dashboard/wg/, server builds land in/etc/wireguard/and are synced back to the stash. - Use the peer table to toggle Active (starts/stops
wg-quick@<name>), view ping/location, and delete peers.
Firewall and downtime
- Allow UDP on your chosen listen port (default 51820) before activating.
- Switching default routes through a VPN can interrupt SSH/dashboard sessions—schedule a maintenance window.
Firewall rules are created automatically
When WireGuard activates, the PostUp rules create firewall entries for both IPv4 (iptables) and IPv6 (ip6tables): a FORWARD accept on the wg0 interface and a NAT MASQUERADE on the server’s default network interface. If app-scoped routing is enabled, additional rules appear for veth network namespaces (10.200.x.y subnets). You can verify all of these rules in the dashboard under Settings > Security > Firewall Rules tab — filter by the WireGuard origin to isolate VPN-related entries.
Basic Usage
Activate or swap a profile
# Sync a stored config to /etc/wireguard and start the service
qb manage wireguard check -cn nvpn_us1234
# Stop and remove the active client config
qb manage wireguard check --deactivate -cn nvpn_us1234
# Remove a stored profile and its service unit
qb manage wireguard remove -cn nvpn_us1234- Dashboard: toggle the Active checkbox for a peer in VPN Control to start/stop
wg-quick@<peer>. Location, ping, and redacted config preview come from/etc/v4-dashboard/wg/<peer>.confand the cached IP lookup. - CLI:
qb manage wireguard checkrewrites/etc/wireguard/<peer>.conf, enableswg-quick@<peer>, and updatesuser_software.software_alt_portso the dashboard stays in sync.
Add client or server configs (CLI)
# Add a client profile (paste config when prompted)
qb manage wireguard add --client -cn wg-client
# Add a server profile with custom CIDR, allowed IPs, and port
qb manage wireguard add --server -lp 51820 -cidr 10.5.0.2/16 \
-cai "0.0.0.0/0,::/0" -noc 3 -pur "iptables -A FORWARD -i %i -j ACCEPT" \
-pdr "iptables -D FORWARD -i %i -j ACCEPT"NordVPN config generator (built-in helper)
# Generate up to 5 NordVPN WireGuard profiles (stores as nvpn_<host>.conf)
nvpn_conf_gen -t "<nordvpn_token>" -c "United States" -L 5 -dns 103.86.96.100
# List available countries
nvpn_conf_gen -l
# MTU tuning is automatic per endpoint (calls qb manage wireguard calc --mtu internally)Configuration locations
CLI options
-o, --operationSet mode: server or client (install/reinstall)
-lp, --listen-portWireGuard listen port (default 51820)
-lp 51820-cidr, --cidrInterface address/CIDR for server
-cidr 10.5.0.2/16-cai, --client-allowed-ipAllowedIPs for peers
-cai '0.0.0.0/0,::/0'-dns, --dnsClient DNS resolver (default 1.1.1.1)
-dns 1.1.1.1-cn, --client-nameName multiple client configs (wg0-client, wg1-client, etc.)
-cn wg0-client-mtu, --mtuOverride MTU (auto-calculated if omitted)
-mtu 1420-ep, --endpointEndpoint hostname/IP for peers
-ep vpn.example.com-pur, --postup-rulePostUp iptables/ip6tables rules
-pur 'iptables -A FORWARD -i %i -j ACCEPT'-pdr, --postdown-rulePostDown rules to clean NAT/forwarding
-pdr 'iptables -D FORWARD -i %i -j ACCEPT'-noc, --number-of-clientsGenerate multiple client configs for a server
-noc 3qb manage wireguard addAdd client (--client) or server (--server) profiles
qb manage wireguard add --client -cn providerqb manage wireguard checkActivate profile, enable wg-quick@<name>
qb manage wireguard check -cn wg0-clientqb manage wireguard check --deactivateStop service and remove active config
qb manage wireguard check --deactivate -cn wg0-clientqb manage wireguard calcCalculate MTU or CIDR helper
qb manage wireguard calc --mtu --endpoint host --protocol ipv4nvpn_conf_genGenerate NordVPN WireGuard profiles
nvpn_conf_gen -t <token> -c 'Canada' -L 5Common workflows
- Install + generate server peers:
qb install wireguard -u username -o server -noc 3 ...writeswg0.confandwg{n}-client.confinto the stash; use VPN Control to download or activate a specific peer. - Import a provider profile: Upload
.confin VPN Control orqb manage wireguard add --client -cn providerand paste; MTU is injected if missing and permissions are normalized. - Activate/rotate endpoints: Use peer table toggle or
qb manage wireguard check -cn <peer>to bring up a tunnel; use--deactivateto tear down before switching regions. - Generate NordVPN sets:
nvpn_conf_gen -t <token> -c "United States" -L 5outputsnvpn_<hostname>.conffiles ready for activation. - Reinstall safely:
qb reinstall wireguard -u username -o serverrefreshes binaries and configs while keeping the stash in/etc/v4-dashboard/wg.
App-scoped routing
App-scoped routing lets you send only a specific application’s network traffic through a WireGuard tunnel while all other server traffic uses the default route. Each routed app runs inside its own Linux network namespace with a dedicated WireGuard interface, so there is complete traffic isolation with no interference between apps or the host.
Supported applications
| Application | Service Type | Service Unit | Notes |
|---|---|---|---|
Emby | Per-user (template) | emby-server@{username} | One routing profile per user instance |
Jellyfin | Per-user (template) | jellyfin@{username} | One routing profile per user instance |
Plex | System-wide | plexmediaserver | Single shared service — only one routing profile at a time |
How to enable from the dashboard
- Navigate to System > VPN Control (admin only).
- Upload at least one WireGuard client
.conffile if you have not already. - Scroll to the App-Scoped Routing card.
- Select the application you want to route (only installed apps with running services appear).
- If the app has multiple service instances (e.g., Emby installed for several users), select the instance.
- Choose a WireGuard peer config from the dropdown.
- Click Enable Routing.
The dashboard shows a live health indicator once routing is active, confirming that the namespace, WireGuard interface, and routing rules are all in place.
Plex and remote access
Plex authenticates through plex.tv and reports its public IP for remote access detection. When Plex traffic is routed through WireGuard, plex.tv will see the VPN exit IP instead of the server’s real IP. This is expected behavior and does not affect local access through the QuickBox dashboard or reverse proxy. If you rely on Plex remote access, be aware that the reported external address will change to match the VPN endpoint.
Plex is system-wide
Because Plex runs as a single system-wide service (plexmediaserver), only one user can enable app-scoped routing for Plex at a time. Emby and Jellyfin use per-user template services, so multiple users can each have independent routing profiles.
Kill switch protection
The kill switch is an optional safety net that fully stops the routed application’s service if the VPN tunnel degrades. This prevents any traffic from leaking outside the VPN.
- Trigger threshold: Configurable between 60 and 3,600 seconds (default 600 seconds / 10 minutes). The kill switch fires when the WireGuard handshake age exceeds this threshold.
- Auto-recovery: When enabled, the system attempts to restore VPN routing automatically after a kill switch event using exponential backoff (2 minutes, 4 minutes, 8 minutes, 16 minutes, 30 minutes) up to 5 attempts.
- Manual re-enable: If auto-recovery is disabled or all 5 attempts are exhausted, an admin must manually re-enable routing from VPN Control.
Configure the kill switch from the Kill Switch Protection panel that appears after routing is enabled for an app.
How it works (overview)
- A dedicated Linux network namespace is created for the app (e.g.,
qb_emby,qb_plex). - A WireGuard interface is configured inside the namespace using the selected peer config.
- A veth pair bridges the namespace to the host so the reverse proxy can still reach the app.
- The app’s systemd service is restarted inside the namespace.
- All traffic originating from the app exits through the VPN tunnel. Incoming requests from the dashboard’s reverse proxy reach the app through the veth bridge.
- When routing is disabled, the namespace is torn down and the service restarts on the normal host network.
A background health monitor polls every 30 seconds to verify the namespace, WireGuard interface, and routing rules are intact. If the kill switch is enabled and the tunnel handshake goes stale, the monitor takes protective action.
Best practices
Do
- Open UDP 51820 (or your chosen port) before activation; double-check upstream router NAT.
- Keep
/etc/v4-dashboard/wgbacked up — this holds all client/server profiles. - Use
qb manage wireguard calc --mtuwhenever endpoints change to avoid fragmentation. - If tunneling all traffic, ensure SSH/HTTPS fallback access (out-of-band console or LAN path).
- Review PostUp/PostDown rules to align with your firewall policy and interfaces.
- Enable the kill switch for app-scoped routing when VPN privacy is critical — it prevents traffic leaks if the tunnel drops.
- Test app-scoped routing with a single app first before routing multiple applications.
Don't
- Do not share private keys; dashboard masks keys but files remain sensitive on disk.
- Do not store unencrypted tokens in version control or shared directories.
- Do not delete a WireGuard peer config that has active app-scoped routing — disable routing for the app first.
Troubleshooting
Tunnel up but no traffic
- Confirm PostUp/PostDown MASQUERADE rules match your outbound interface (
ip route list default). - Verify
AllowedIPsis set (0.0.0.0/0,::/0for full tunnel or specific subnets for split tunnel).
MTU or handshake issues
- Run
qb manage wireguard calc --mtu --endpoint <host> --protocol ipv4and update the profile. - Check for ISP ICMP filtering; fall back to a conservative MTU like 1380 if probes fail.
Dashboard not showing peers
- Ensure the cron entry in
/etc/cron.d/quickboxexists and that/etc/v4-dashboard/wgexists with correct permissions for the v4-dashboard service. - Toggle a peer via
qb manage wireguard check -cn <peer>to refreshsoftware_alt_portand dashboard state.
Port blocked or double NAT
- Test reachability:
nc -u -v <public_ip> 51820from outside; open/forward UDP if closed. - Consider provider configs (e.g., NordVPN) if residential IP lacks consistent port forwarding.
App-scoped routing shows Degraded health
- The health monitor checks the namespace, WireGuard interface, iptables rules, ip rules, and ip routes every 30 seconds. A “Degraded” badge means one or more of these components is missing.
- If the app service was manually restarted outside the dashboard, it may have started on the host network instead of inside the namespace. Disable and re-enable routing to restore it.
Kill switch fired — service stopped
- Check the VPN Control card for the last error message. The kill switch fires when the WireGuard handshake age exceeds the configured threshold.
- If auto-recovery is enabled, the system will attempt to restore routing automatically (up to 5 times with exponential backoff).
- If recovery is exhausted or disabled, manually re-enable routing from the App-Scoped Routing card after verifying the VPN peer is reachable.
FAQ
plexmediaserver), so only one routing profile can be active at a time. Emby and Jellyfin use per-user template services, so each user can have their own independent routing profile.Additional resources
Join the Community
Media server operators sharing configs, getting support, and shaping the future of QuickBox Pro.