Remote Computing Quick Reference

WireGuard, OpenVPN, Tailscale & Zero Trust Remote Access

Replace slow legacy VPN concentrators with kernel-speed WireGuard tunnels, route only what you need with AllowedIPs, and lock down Windows RDP behind identity-aware Zero Trust.

โฑ๏ธ 7 min ref๐ŸŸข Beginner Friendly๐Ÿ“… Updated: 2026

Command Anatomy: Generating a WireGuard Keypair

Generate Private & Public Key in One Pipeline
umask 077 && wg genkey | tee privatekey | wg pubkey > publickey
Permissions umask 077 Owner-only read/write (600)
Generate wg genkey Creates Curve25519 private key
Save & Pipe tee privatekey Writes file + passes to next step
Derive Public wg pubkey Shareable public key output
TRADITIONAL HUB-AND-SPOKE VPN ๐Ÿ’ป Laptop OpenVPN/IPSec ๐Ÿข VPN Hub Single Bottleneck Flat LAN Trust App 10.0.1.10 RDP 10.0.1.30 All traffic hairpins through one central gateway WIREGUARD MESH / ZERO TRUST ๐Ÿชช Identity & Keys (SSO) ๐Ÿ’ป Laptop 100.64.0.2 ๐Ÿ–ฅ๏ธ Server 100.64.0.9 Direct UDP 51820 Direct encrypted peer-to-peer + per-device ACLs
Traditional VPNs route everything through one central hub; WireGuard/Zero Trust builds direct encrypted tunnels verified by identity and keypair.

1 WireGuard Config (wg0.conf) & CLI

WireGuard uses simple INI-style config files in /etc/wireguard/. Every device has its own [Interface] section and one or more [Peer] sections.

wg genkey | tee privatekey | wg pubkey
Generate WireGuard Keys Creates your private key (keep secret) and prints the matching public key to share with peers.
sudo wg-quick up wg0
Start Tunnel Interface Reads /etc/wireguard/wg0.conf, sets routes, and brings up the interface. Use down wg0 to stop.
sudo wg show
Inspect Live Handshakes Shows active peers, latest handshake timestamp (should be < 3 mins), endpoint IP, and transfer bytes.
sudo systemctl enable --now wg-quick@wg0
Auto-Start WireGuard on Boot Enables the systemd service so the VPN reconnects automatically after a server reboot.

Sample Client /etc/wireguard/wg0.conf

/etc/wireguard/wg0.conf
[Interface]
PrivateKey = <CLIENT_PRIVATE_KEY>
Address = 10.8.0.2/24
DNS = 1.1.1.1

[Peer]
PublicKey = <SERVER_PUBLIC_KEY>
Endpoint = vpn.example.com:51820
AllowedIPs = 10.8.0.0/24, 10.0.1.0/24
PersistentKeepalive = 25

2 Full Tunnel vs. Split Tunnel (AllowedIPs)

In WireGuard, the AllowedIPs line controls which IP ranges travel inside the encrypted tunnel versus straight out your normal internet connection.

Mode AllowedIPs Value What Goes Through VPN? Best For
Full Tunnel 0.0.0.0/0, ::/0 100% of Traffic (web, DNS, private LAN) Untrusted hotel/cafe Wi-Fi, privacy, strict corporate egress
Split Tunnel 10.0.0.0/8, 192.168.1.0/24 Private Subnets Only (web stays direct) Daily DevOps/sysadmin work, fast Zoom/video calls, cloud VPCs
NAT Keepalive PersistentKeepalive = 25 Sends a tiny packet every 25s Clients behind home/mobile NAT so the server can reach back

3 WireGuard vs. OpenVPN vs. IPSec/IKEv2 vs. Tailscale

Choose the right tunnel technology for your environmentโ€”from raw Linux kernel speed to zero-config SSO mesh networking.

Solution Protocol / Port Encryption Speed & Overhead Best Use Case
WireGuard 51820 / UDP ChaCha20-Poly1305 Fastest (Kernel) Modern Linux/cloud VPNs, site-to-site links, homelabs
OpenVPN 1194 / UDP or 443 / TCP TLS / AES-GCM Moderate (Userspace) Bypassing strict firewalls that only allow TCP port 443
IPSec / IKEv2 500, 4500 / UDP AES-GCM / SHA-2 Fast (Hardware) Enterprise hardware firewalls (Cisco, Palo Alto, Fortinet)
Tailscale WireGuard + NAT Traversal ChaCha20 + SSO Fast (Mesh) Zero-config team mesh, NAT punch-through, Zero Trust ACLs

4 Zero Trust Remote Access & RDP-over-VPN

Traditional VPNs assume everyone inside the network is trusted. Zero Trust verifies who you are (SSO + MFA), device health, and grants access only to the exact service you need.

tailscale up --ssh
Join Zero Trust Mesh with Identity SSH Authenticates your device via SSO/MFA and enables Identity-based SSH without managing static authorized_keys.
ssh -N -L 13389:10.0.1.30:3389 ops@bastion
Tunnel Windows RDP Safely Never expose port 3389 publicly. Connect your VPN or SSH tunnel first, then point your RDP client to localhost:13389.

RDP Security Checklist Must Have

Block 3389 on public firewalls, require Network Level Authentication (NLA), enforce MFA on the VPN/SSO gateway, and restrict RDP to VPN/bastion IPs only.

Least-Privilege ACLs Zero Trust

Instead of giving developers access to 10.0.0.0/8, tag servers by role (tag:prod-db) and allow only specific ports (e.g., 5432 or 22).

๐Ÿง  Memory Trick (AllowedIPs Does Double Duty): In WireGuard, AllowedIPs is both your routing table (which outgoing IPs go into the tunnel) AND your firewall ACL (which source IPs are accepted coming back).

5 The Danger Zone

โš ๏ธ VPN & WireGuard Mistakes That Break Connectivity or Security
1. Setting AllowedIPs = 0.0.0.0/0 Without Server NAT / IP Forwarding

If a client routes all internet traffic through your WireGuard server, but the server lacks net.ipv4.ip_forward=1 and an iptables/nftables MASQUERADE rule, the client's internet will die the instant the VPN connects.

2. Reusing the Same WireGuard Private Key Across Devices

WireGuard identifies each peer strictly by its public key. If your laptop and phone share the same private key, the server constantly overwrites the endpoint IP between themโ€”causing packet drops and broken connections. Generate one unique keypair per device.

3. Leaving Admin UIs or RDP Bound to 0.0.0.0

Installing a VPN does not automatically hide services already listening on public interfaces. Bind RDP, database ports, and web admin panels to your VPN IP (e.g., 10.8.0.1) or block public access in your firewall.