VPN Guide Cheat Sheet

Last Updated: November 21, 2025

VPN Protocol Comparison

Protocol Speed Security Use Case
WireGuard Fastest Excellent (modern crypto) Best overall choice for most users
OpenVPN (UDP) Fast Excellent (proven) General use, reliable
OpenVPN (TCP) Slower Excellent Restrictive networks, reliable delivery
IKEv2/IPSec Fast Very Good Mobile devices, auto-reconnect
L2TP/IPSec Moderate Good Legacy compatibility
PPTP Fast Weak (deprecated) Avoid - known vulnerabilities
SSTP Moderate Good Windows environments, firewall bypass

Top VPN Provider Comparison

Provider Jurisdiction No-Logs Policy Price/Month Best Feature
Mullvad Sweden (14-eyes) Audited $5.50 True privacy, anonymous accounts
ProtonVPN Switzerland Audited $4-10 Secure Core, open source
NordVPN Panama Audited $3-13 Large server network, features
ExpressVPN British Virgin Islands Yes $7-13 Speed, ease of use
Surfshark Netherlands (9-eyes) Audited $2-13 Unlimited devices, budget
IVPN Gibraltar Audited $6-10 Privacy-focused, transparent

VPN Selection Criteria

No-logs policy (audited)
Independently verified not to store user activity
Jurisdiction outside 5/9/14-eyes
Not subject to mass surveillance alliances
Strong encryption (AES-256, ChaCha20)
Military-grade encryption standards
Kill switch
Blocks traffic if VPN disconnects
DNS leak protection
Prevents DNS queries from leaking
WireGuard or OpenVPN support
Modern, secure protocols
Own DNS servers
No third-party DNS dependencies
RAM-only servers
No data persistence on hardware
Multi-hop/Double VPN
Route through multiple servers for extra security
Anonymous payment options
Cryptocurrency, cash accepted

WireGuard Setup (Linux)

sudo apt install wireguard
Install WireGuard (Debian/Ubuntu)
wg genkey | tee privatekey | wg pubkey > publickey
Generate key pair
sudo nano /etc/wireguard/wg0.conf
Create configuration file
sudo wg-quick up wg0
Start VPN tunnel
sudo wg-quick down wg0
Stop VPN tunnel
sudo wg show
Display VPN status
sudo systemctl enable wg-quick@wg0
Auto-start on boot

WireGuard Configuration Example

[Interface]
Client configuration section
PrivateKey = CLIENT_PRIVATE_KEY
Your private key (keep secret)
Address = 10.0.0.2/24
Client VPN IP address
DNS = 1.1.1.1, 1.0.0.1
DNS servers to use
[Peer]
Server configuration section
PublicKey = SERVER_PUBLIC_KEY
Server's public key
Endpoint = vpn.example.com:51820
VPN server address and port
AllowedIPs = 0.0.0.0/0
Route all traffic through VPN
PersistentKeepalive = 25
Keep connection alive (NAT)

OpenVPN Setup (Linux)

sudo apt install openvpn
Install OpenVPN client
sudo openvpn --config client.ovpn
Connect with config file
sudo openvpn --config client.ovpn --daemon
Run in background
sudo systemctl start openvpn@client
Start as service
sudo systemctl enable openvpn@client
Auto-start on boot

VPN Testing & Verification

curl ifconfig.me
Check your public IP address
curl https://am.i.mullvad.net/json
Check VPN connection (Mullvad)
Visit ipleak.net
Comprehensive leak test (DNS, WebRTC, IP)
Visit dnsleaktest.com
Test for DNS leaks
Visit browserleaks.com
Check WebRTC, IP, browser leaks
ping 1.1.1.1
Test latency through VPN
speedtest-cli
Test VPN speed (install first)

Common VPN Issues & Fixes

Issue Cause Solution
DNS Leak Using ISP DNS instead of VPN Enable DNS leak protection, use VPN's DNS
WebRTC Leak Browser exposing real IP Disable WebRTC or use browser extension
Slow Speed Server overload, distance, encryption Switch servers, try WireGuard, use closer location
Connection Drops Network instability Enable kill switch, try TCP instead of UDP
Can't Connect Port blocked, firewall Try different protocol, port, or obfuscation
IPv6 Leak VPN doesn't support IPv6 Disable IPv6 or use VPN with IPv6 support

VPN Kill Switch Setup

Built-in kill switch (most VPN apps)
Enable in VPN client settings
UFW firewall rules (Linux)
Block non-VPN traffic with iptables/ufw
sudo ufw default deny outgoing
Block all outgoing by default
sudo ufw allow out on tun0
Allow VPN interface only
sudo ufw allow out to VPN_SERVER_IP
Allow connection to VPN server

Split Tunneling Scenarios

Scenario Configuration Use Case
Exclude Local Network AllowedIPs = 0.0.0.0/0, !192.168.1.0/24 Access local printers, NAS
Route Specific Apps App-level split tunneling VPN only for browser, not games
Bypass Streaming Exclude Netflix, Hulu IPs Avoid VPN detection
Corporate + Personal Work traffic via VPN, personal direct Remote work setup

VPN for Different Use Cases

Use Case Recommended Setup Priority
Privacy/Anonymity Mullvad, IVPN with WireGuard, multi-hop No-logs, jurisdiction, payment anonymity
Streaming NordVPN, ExpressVPN Speed, server locations, unblocking
Torrenting Mullvad, ProtonVPN with port forwarding No-logs, kill switch, P2P-friendly
Gaming Closest server, WireGuard protocol Low latency, speed
Public WiFi Any reputable VPN, IKEv2 for mobile Auto-reconnect, encryption
Bypass Censorship Shadowsocks, obfuscation, multi-hop Stealth, obfuscation, reliability

VPN Security Best Practices

Always use kill switch
Prevent IP leaks on disconnection
Enable DNS leak protection
Use VPN provider's DNS servers
Disable IPv6
Prevent IPv6 leaks if VPN doesn't support it
Use WireGuard or OpenVPN only
Avoid deprecated protocols (PPTP, L2TP)
Regularly test for leaks
Use ipleak.net, dnsleaktest.com monthly
Don't use free VPNs
Free services often log and sell data
Choose servers wisely
Balance speed, location, and server load
Keep VPN software updated
Get latest security patches
Use multi-factor authentication
Protect VPN account access
Review privacy policy
Understand data collection and jurisdiction

Mobile VPN Setup

iOS: Settings > VPN > Add Configuration
Native VPN setup or use provider app
Android: Settings > Network > VPN
Add VPN configuration
IKEv2 recommended for mobile
Handles network switching better
Always-on VPN (Android/iOS)
Auto-connect on boot, block without VPN
WireGuard app (cross-platform)
Fast, open source mobile client
💡 Pro Tip: WireGuard is the best choice for most users - it's faster, uses modern cryptography, and has a smaller attack surface. Always test for DNS/IP leaks after connecting. Consider using a VPN with RAM-only servers for maximum privacy. For critical privacy needs, combine VPN with Tor (VPN → Tor) and use providers that accept cryptocurrency or cash payments!
← Back to Data Science & ML | Browse all categories | View all cheat sheets