Steven's Knowledge

VPN & Zero Trust Network

Tailscale, WireGuard, Cloudflare Tunnel - private networking for remote teams and services without exposing them to the public internet

VPN & Zero Trust Network

Your team needs to reach internal services (staging, dashboards, databases, ssh) without exposing them to the public internet. The old answer was a corporate VPN — a gateway you connected to, then routed traffic through. The modern answer is zero trust networking: every connection authenticated and authorized individually, no implicit "inside the network" trust.

Two Generations of Solutions

Old (perimeter VPN)New (zero trust)
One VPN gateway; everyone inside is trustedEvery connection authenticated and authorized per-resource
Hub-and-spoke: traffic to / from gatewayMesh: direct peer-to-peer between authorized devices
Hairpin routing through corporate officeLatency-optimal direct paths
Static credentials, manual revocationTied to identity provider; revoke = remove from IdP
Bridge two networksAuthenticate per app / resource
OpenVPN, Cisco AnyConnectTailscale, Cloudflare Access, Twingate, Pomerium

Zero trust is faster, easier to operate, and more secure. For new deployments, don't build a traditional VPN.

The Players

Mesh VPN (peer-to-peer, all-purpose)

ToolNotes
TailscaleBuilt on WireGuard; identity-aware; "it just works"; free for personal + small business
TwingateSimilar to Tailscale; more enterprise-leaning
NetbirdOpen-source Tailscale alternative
HeadscaleOpen-source Tailscale control plane (use with the Tailscale client)
ZeroTierOlder mesh; pre-dates Tailscale; still solid
WireGuardThe protocol underneath; build your own with this

Reverse Tunnel (expose internal HTTP)

ToolNotes
Cloudflare Tunnelcloudflared; origin has no public IP; first-class with Cloudflare CDN
ngrokOriginal dev-tool tunnel; now broader enterprise features
frpOpen-source reverse proxy; self-host
inletsSelf-host alternative to ngrok

Zero Trust Access (per-app authentication)

ToolNotes
Cloudflare AccessPer-app SSO; works with Tunnel or any backend
Tailscale + Tailscale FunnelTunnel + SSO via the mesh
PomeriumOpen-source zero-trust proxy
TeleportStrong for ssh, K8s, DBs; identity-aware bastion
Google IAP (Identity-Aware Proxy)GCP-native zero trust
AWS Verified AccessAWS-native equivalent

The lines blur. Tailscale + Cloudflare Tunnel together cover 90% of the use cases for small-to-mid teams.

What These Replace

ProblemOld approachModern
Engineers SSH into prodVPN + bastion hostTailscale: ssh by hostname
Internal dashboard (Grafana, Argo CD)VPN + DNS rewriteCloudflare Access + Tunnel
Demo env for prospects"Send them the VPN config"Tunnel with email-based access
Mobile dev tests against stagingConnect to office VPNTailscale on phone
Office printer / NASLocal network onlyTailscale mesh, anywhere
Self-hosted Git, CI, monitoringDMZ + reverse proxyTunnel; no public IP

When to Use What

ScenarioBest fit
Engineers reaching internal services / SSH from anywhereTailscale
Exposing one internal web app to specific external usersCloudflare Tunnel + Access
Many internal services to many users with SSOCloudflare Access or Pomerium
Site-to-site (connecting two cloud VPCs)Tailscale (subnet router) or WireGuard direct
Replacing OpenVPN / Cisco AnyConnectTailscale
Strict audit / record SSH sessionsTeleport
Per-pod identity in K8s for service-to-serviceService Mesh (Istio / Linkerd)
Air-gapped, no SaaS dependencyHeadscale + Tailscale clients or WireGuard direct

Learning Path

How Mesh VPNs Work

Laptop                                                    Server in AWS
 │                                                        │
 ▼                                                        ▼
Coordination server (Tailscale)                       Same coordination server
  - issues identity (auth via your IdP)                  - issues identity
  - distributes ACLs                                     - distributes ACLs
  - holds public keys for peer-to-peer                   - holds public keys

Both peers learn each other's public keys + endpoint

─── direct WireGuard tunnel (peer-to-peer) ─────────────►
    (or NAT-traversed via DERP relay if direct fails)

The coordination server holds metadata — identity, public keys, ACLs. It never sees the encrypted traffic itself. Tailscale, Twingate, Netbird all follow this shape.

When two peers can't establish a direct connection (NAT, firewalls), traffic falls back through a relay. Slower but always works.

How Cloudflare Tunnel Works

Internal service              Your local machine               User
on a private network          (or container)                   on the internet
─────────────────────         ────────────────────             ─────────────
                              cloudflared connects out
                              ──────────────────────► Cloudflare's edge

                                                       ◄─── HTTPS request
                              user.example.com routes
                              through tunnel back ──────────────► User browses
                              to your local machine

cloudflared makes an outbound connection to Cloudflare. Cloudflare routes inbound HTTPS through that tunnel. Your network has no inbound ports open, no public IP needed for the internal service. Combined with Cloudflare Access, you can require SSO / device posture before traffic even reaches your service.

Zero trust networking and Service Mesh overlap conceptually — both authenticate every connection. Service mesh operates inside a cluster (service-to-service); zero trust operates at the boundary (user-to-service, service-to-internet). Many teams use both: mesh inside, zero trust at the edge.

On this page