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.
Command Anatomy: Generating a WireGuard Keypair
umask 077 && wg genkey | tee privatekey | wg pubkey > publickey
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.
/etc/wireguard/wg0.conf, sets routes, and brings
up the interface. Use down wg0 to stop.
Sample Client /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.
authorized_keys.
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).
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
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.
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.
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.