{
  "id": 8973332,
  "title": "Self-Hosting Behind CGNAT",
  "url": "https://urgent.news/2026/09/21/self-hosting-behind-cgnat",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-21T17:53:28.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://david.alvarezrosa.com/posts/self-hosting-behind-cgnat/"
  },
  "original_language": "en",
  "account": "In the era of limited IPv4 addresses, self-hosting has become more complex. Routers now share the same IP within a neighborhood through carrier-grade NAT (CGNAT), where private addresses are translated by the carrier's network. This prevents traditional port forwarding from working. The author in the story runs their services on a mid-range machine at their mother's basement in northern Spain, using a cheap VPS bridge in a French data center to expose their services to the internet.\n\nTo achieve this, the author set up a bidirectional WireGuard tunnel. WireGuard, a fast, modern, and secure VPN tunnel, lives inside the Linux kernel. The tunnel forwards all packets in all ports from the bridge to the homelab box and vice versa. The tunnel is initiated by the homelab, so a static dedicated IP is not required at home. However, using a bridge adds 39 ms of RTT (Round Trip Time) latency.\n\nThe author provides instructions on setting up the bridge and configuring NAT and forwarding rules at the kernel level. Excluded ports include 2222 for SSH and 51820 for the VPN tunnel itself. All traffic is forwarded to the homelab, with the destination rewritten but not the source, allowing the homelab to see the real client IPs. Replies from the homelab are sent back down the tunnel.\n\nThe homelab's configuration is stored in the author's homelab repository. Replies from the homelab travel back through the bridge, while the homelab's own traffic remains on the home router. SSH connections to ssh.alvarezrosa.com on port 22 now land on the homelab, while port 2222 on the bridge serves a specific purpose. The author's mailing list remains free, occasional, and covers various topics, with a promise not to sell or share subscriber email addresses. Feedback can be sent to david@alvarezrosa.com.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}