Answers
How to SSH into a Raspberry Pi on a 4G LTE HAT or modem
Mobile carriers put SIMs behind CGNAT, so port forwarding on the modem does nothing. Ask for a public-IP APN, or have the Pi connect out.
Asked on Sixfab Community, December 2020: “Remotely logging in to Raspbery pi connected to Sixfab 3G/4G& LTE Base HAT”
Short answer
On cellular, the address your Pi gets is almost always private: the carrier shares one public address among many SIMs, so nothing from the internet can reach port 22. Either buy a SIM plan with a public or static IP, or make the Pi open the connection and reach it through that.
1. Look at the address the modem got
ip addr on the Pi (or the modem's status page) shows the cellular interface's address. An address in 10.0.0.0/8 or 100.64.0.0/10 is carrier NAT: port forwarding and dynamic DNS can't work there.
2. Choose a way in
- A public or static IP APN. Many carriers and IoT SIM resellers sell one. It's the only way to keep plain inbound SSH; then lock it down to keys only, since the port is open to the whole internet.
- Reverse SSH tunnel to a VPS with
autosshor a systemd unit. Cheap for one device; see keeping it alive on mobile. - Mesh VPN (Tailscale, ZeroTier). Works through CGNAT; budget a little data for its keepalives.
- Fieldhand. The agent connects out on 443 and learns how long the carrier lets the link stay idle, so its heartbeat costs about 2 to 13 MB a month. You get a shell in the browser, or your own ssh client with
fh ssh pi@my-pi(CLI).
Watch the data plan
Whatever you pick, idle keepalives run all month. Prefer tools that let the interval grow when the carrier allows it, and avoid ones that poll every few seconds. Install details are in Reach a Raspberry Pi behind 4G or CGNAT.
By Abner Souza, who builds Fieldhand. Updated 2026-10-23. Something wrong or out of date? Write to support@fieldhand.dev.
Something wrong or missing on this page? Tell us.