Bypass CGNAT: Reach Your Home Server or Raspberry Pi from Anywhere
Описание и применение
Проблема: домашний сервер за CGNAT недоступен через порт‑форвардинг. Решение: открыть обратный SSH‑туннель к free.pinggy.io, получив публичный HTTPS‑URL или SSH‑доступ, и запустить его как systemd‑службу для постоянного соединения.
Задача
Home servers or Raspberry Pi behind a Carrier‑Grade NAT cannot be reached via traditional port forwarding.
Результат
By establishing an outbound SSH reverse tunnel to free.pinggy.io, the Pi becomes reachable over HTTPS or SSH from any network, eliminating the need for port forwarding and bypassing CGNAT.
Рабочий процесс
- Confirm CGNAT by comparing router WAN IP to public IP and checking for 100.64.0.0/10 range.
- Enable SSH on the Pi and secure it with key‑based authentication.
- Create an outbound SSH reverse tunnel:
ssh -p 443 -R0:localhost:8080 free.pinggy.iofor HTTP services orssh -p 443 -R0:localhost:22 [email protected]for SSH. - Run the tunnel as a systemd service with
Restart=alwaysandServerAliveInterval=30to keep it alive. - Optionally use the Pinggy CLI or configure a custom domain on a paid plan for a persistent URL.
- Apply security best practices: disable password logins, use TLS tunnels, keep software updated, and monitor traffic via Pinggy’s web debugger.
Доказательства
If your ISP uses Carrier‑Grade NAT (CGNAT), your router never gets a publicly reachable IP address.
Run ssh -p 443 -R0:localhost:8080 free.pinggy.io on the Pi to get a public HTTPS URL, or ssh -p 443 -R0:localhost:22 [email protected] to expose its SSH port.
A tunnel started in a terminal dies when the session closes, and the free plan has a 60‑minute time limit per tunnel.
- Дата записи: 2026-10-02T15:55:42.577Z