Sujahath Siddeek
All work

TeardownNov 2026Solo project

A public IP behind CGNAT

My ISP blocks every inbound connection. A hand-built WireGuard tunnel to a free Oracle Cloud VM now serves HTTPS from my home server.

The 50-second explainer from the repo: one HTTPS request, hop by hop.
a month, instead of about Rs 18,400 for a static IP
Rs 0
keepalive that holds the CGNAT mapping open
25 s
write-ups, including a troubleshooting journal with real output
8

Send a request through the tunnel

Step one HTTPS request from a browser to my home server and watch the headers change at each hop. Then turn the tunnel or the keepalive off.

WireGuard tunnelISP CGNAT, 198.51.100.23Browser192.0.2.50DuckDNSfree domainOracle VM203.0.113.10Home server10.8.0.2

Step 1 of 7

Look up the domain

The browser asks DuckDNS for the domain and gets the Oracle VM's public IP.

A record: 203.0.113.10

The problem

My home connection sits behind carrier-grade NAT, so nothing on the internet can reach my home server and router port forwarding does nothing. A static IP from the ISP costs about Rs 18,400 a month.

How I built it

The home server dials out to an Oracle Cloud Always Free VM over a hand-configured WireGuard tunnel, with a keepalive every 25 seconds to hold the CGNAT mapping open. No Tailscale, on purpose: I wanted to understand the layer underneath.

On the VM, iptables DNAT sends public ports 80 and 443 down the tunnel, and MASQUERADE makes the replies come back the same way.

Caddy on the home server gets Let's Encrypt certificates for a free DuckDNS domain. The setup and verify scripts are shellcheck-clean and never print private keys.

What happened

  • HTTPS from my home machine with a valid certificate, and the setup survives reboots.
  • A troubleshooting journal with real command output for every failure: a missing UDP 51820 rule, NAT rules that weren't loaded, and a DuckDNS token spotted in a screenshot and rotated before publishing.
  • What I learned: CGNAT only blocks inbound connections, cloud VMs have two firewalls, DNAT alone isn't enough, and a config file isn't the running config.

Architecture

ISP CGNATBrowserDuckDNSOracle VMpublic IP, DNATHome serverCaddy, Let's Encryptlookup443WireGuard tunneldials out, keepalive 25 s
  • Linux
  • WireGuard
  • iptables
  • Oracle Cloud
  • Caddy
  • Bash

Next teardown

GridTwin-HIL

AI agents crash-test an energy controller