The constraint

I wanted to reach my lab from campus, from travel, and from my phone, without any open inbound ports on my home network. An open port is a standing invitation for internet-wide scanners. On top of that, at times my server has sat behind double NAT, where port forwarding isn’t even possible.

The design: two paths for two audiences

Public path (Cloudflare Tunnel). A small number of services need to be reachable by people who aren’t on my private network. Those go through a Cloudflare Tunnel: a connector inside my network makes an outbound connection to Cloudflare, and requests come back down that connection. Nothing listens on my WAN, and Cloudflare’s WAF and bot protection sit in front of everything.

Private path (Tailscale). Everything else, including admin interfaces, hypervisors, and the attack lab, is reachable only over Tailscale, a WireGuard-based mesh VPN. Those services have no public exposure at all.

Inside the network, Nginx Proxy Manager gives each service a friendly HTTPS hostname, and Pi-hole resolves those hostnames to the proxy internally.

I compared this to self-hosting the tunnel endpoint with Pangolin on a VPS, which would avoid routing traffic through Cloudflare. For mostly-HTTP services, Cloudflare Tunnel already covered what I needed. I also considered moving from Nginx Proxy Manager to Traefik. Once I mapped out how I actually use the proxy (a small, stable set of internal hostnames), Traefik’s main advantage, automatic discovery, didn’t buy me much. I decided to try it in the lab rather than migrate working infrastructure for its own sake.

Making private hostnames work remotely

I wanted to use the same hostnames on Tailscale as at home, without sending all my internet traffic through home. Two things were broken, and both are classic networking mistakes:

  1. Split DNS pointed at the wrong server. Tailscale’s split DNS rule for my domain sent queries to the server instead of Pi-hole, so internal hostnames never resolved.
  2. The subnet route was never approved. The server advertised the specific subnet the proxy lives on, but only a broader route was approved in the Tailscale admin console. Tailscale prefers the most specific matching route, so that difference mattered.

I worked it with tailscale status, tailscale ping, tailscale dns status, nslookup, Resolve-DnsName, Test-NetConnection, and route print, separating DNS failures from routing failures. Fixing both made remote access behave exactly like being at home.

A related lesson at home: a hostname that failed with “server not found” looked like a proxy problem but was a DNS problem. A direct query to Pi-hole worked, but the client was actually using a different resolver. Checking which resolver a client really uses, instead of assuming, saved a lot of time.

Performance: peeling back the layers

When I routed traffic home through a Tailscale exit node, I was getting 1 to 22 Mbps. I worked it layer by layer:

  1. Was the connection direct or relayed? It was relayed through Tailscale’s shared DERP servers, which are slow by design.
  2. Why no direct connection? The server was behind double NAT (my gateway behind a building-level NAT), and the client had no usable UDP or IPv6 path.
  3. Physical layer. My gateway’s WAN port had negotiated down to 100 Mbps Fast Ethernet. Forcing renegotiation brought it back to near-gigabit. This would have capped everything regardless of the VPN.
  4. Fixing the relay. Since a direct path wasn’t reliable, I deployed my own Tailscale peer relay on a small cloud VPS. That meant writing tailnet ACLs with a tag-based relay grant, provisioning SSH key access, and setting cloud firewall rules for only the relay port and SSH. Throughput went from about 22 Mbps to about 260 Mbps down.
  5. Ruling out CPU. iperf3 and top on all three machines showed no CPU bottleneck. The tunnel itself could do about 440 Mbps.

Next hardening step for the VPS: restricting SSH to my own address, so the relay port is the only thing open to the internet.

Catching my own exposure

While chasing a direct connection, I enabled IPv6 on the server. That gave it a globally routable address, which skips the protection NAT provides on IPv4. My first test seemed to show the server reachable from the internet. Then I realized that test was invalid, because the exit node was routing my “outside” test through the server itself.

I couldn’t get a clean external test from the networks available to me, so I didn’t assume it was safe. I disabled IPv6 on the server and made IPv4-only the plan until I could set it up deliberately behind proper IPv6 firewall rules.

Two lessons came out of it. Every change in one area (performance) needs a check in another (exposure). And a test is only as good as its path: if traffic doesn’t take the route you think, the result tells you nothing.

Takeaways

  • Zero open ports is achievable. Outbound tunnels for public services and a mesh VPN for private ones.
  • Separate DNS problems from routing problems before changing anything.
  • Work from the bottom up. A 100 Mbps link negotiation was hiding under a VPN problem.
  • Validate your tests. Know which path a test actually takes.

Skills demonstrated

VPN and Zero Trust access design · Tailscale (subnet routing, split DNS, ACLs, exit nodes, peer relays) · Cloudflare Tunnel · reverse proxy and internal DNS · NAT traversal · systematic network troubleshooting · Linux cloud server setup · IPv6 exposure awareness