The Deska blog
CGNAT Is Blocking Your Remote Access
Learn why CGNAT is blocking your remote access and how to bypass it using relays and local-first tools like Deska for secure developer workflows.
10 min read
If you have ever tried to host a simple web server or SSH into your home machine only to find that your public IP address is not actually yours, you have likely encountered a situation where CGNAT is blocking your remote access. Carrier Grade NAT is an intermediary layer implemented by Internet Service Providers to conserve IPv4 addresses. While it works for standard browsing, it creates a massive barrier for developers who need to reach their local environments from the outside world.
Understanding the CGNAT Architecture
The core of the problem lies in the shortage of IPv4 addresses. To keep up with demand, ISPs place thousands of customers behind a single public IP. Your router receives a Private IP address in the 100.64.0.0/10 range, which then undergoes another round of translation at the provider level before hitting the public internet.
This double NAT configuration means that traditional port forwarding is impossible. Even if you open port 22 or 80 on your home router, the ISP gateway above you will still drop any unsolicited incoming traffic because it has no rule to route that traffic specifically to your internal network. This architecture effectively turns your workstation into a silent island that can talk to the world, but cannot be spoken to directly.
Common Workarounds for Remote Access
Developers have historically used several methods to punch through these carrier walls. Each approach has trade-offs regarding security, latency, and complexity.
Reverse SSH Tunnels
A classic method involves using a middleman server with a public IP. You initiate an outgoing connection from your machine behind CGNAT to a VPS. By using the -R flag, you tell the VPS to forward a specific port back through that established tunnel to your local machine.
While effective, this requires maintaining a Linux server, managing SSH keys, and dealing with tunnel instability. If the connection drops, you lose access until the local script reconnects.
VPN and Mesh Networks
Tools like WireGuard, Tailscale, or ZeroTier create virtual private networks. They often use techniques like UDP hole punching to establish direct peer-to-peer connections even through NAT. If a direct path cannot be found, these services fall back to relay servers to pass traffic.
These tools are excellent for network-level connectivity. They differ in approach compared to application-specific relays because they typically expose the entire network stack of the remote machine, which might be more exposure than a developer needs for simple task monitoring.
Traditional Relay Services
Services like Ngrok or Cloudflare Tunnel create a secure bridge. You run a small agent locally that connects to the provider cloud. The provider gives you a public URL that maps back to your local port. This is the gold standard for testing webhooks, though it often involves a subscription if you want persistent URLs or high bandwidth.
The Local-First Approach to Remote Productivity
When your workflow involves sensitive code and active terminal sessions, the way you bridge the CGNAT gap matters. A local-first philosophy suggests that your data and sessions should remain on your hardware, not in the cloud.
Deska provides a different perspective on this problem. Instead of trying to expose your entire network or a specific port to the public internet, it uses a secure relay to connect its desktop application to its mobile counterpart. This allows you to monitor and continue work from your phone through a secure relay where devices pair directly. There are no ports exposed to the internet, and no complex firewall rules to manage.
Managing the Workspace Through the Relay
For a developer, remote access is often about more than just a terminal. It is about the context of the work. If you are using an infinite canvas to organize your project, you want to see that same layout regardless of where you are.
Deska facilitates this by keeping the heavy lifting local. The desktop app runs on Mac, Windows, or Linux. Within this environment, you can arrange various panels side by side.
- Terminals for running build scripts or servers.
- A code editor based on Monaco for quick fixes.
- Browser panels for documentation or web previews.
- Notes for tracking todo items.
When CGNAT is blocking your remote access via traditional means, the relay system allows you to check these terminals and sessions via the mobile app. Since the connection is outbound from your machine to the relay, the ISP gateway does not block it.
Integrating AI Agents in a NAT Environment
Modern development often includes AI assistance. When you are working behind CGNAT, you might assume that running autonomous agents would require a complex setup. However, tools like Claude Code, Codex CLI, and OpenCode can run as agents directly within your local workspace.
Because Deska is a local-first environment, these agents operate on your files and run commands in your local terminals. When you access your workspace remotely via the mobile app, you can see the progress of these agents. You can use the voice features or the ask-deska assistant to query the status of an agent or run a new command, all while the relay handles the connectivity hurdles created by your ISP.
Security Considerations for Relay Connections
Whenever you bypass a NAT, security is the primary concern. Traditional port forwarding is risky because it leaves a door open for anyone to scan. Relays are generally safer because they require authenticated handshakes.
- Device Pairing: Ensure your remote access tool uses a pairing mechanism to trust specific devices.
- End-to-End Encryption: Data moving through the relay should be unreadable to the relay provider.
- Minimal Exposure: Only the specific application data should be sent over the relay, rather than the entire subnet.
For developers concerned with privacy, checking the data and storage policies of your tools is essential. Keeping files and session logs on your own machine rather than a third-party server significantly reduces the attack surface.
Comparison of Remote Access Strategies
| Method | Ease of Setup | CGNAT Bypass | Security Level |
|---|---|---|---|
| Port Forwarding | Hard | No | Low |
| Reverse SSH | Medium | Yes | Medium |
| Mesh VPN | Medium | Yes | High |
| Deska Relay | Easy | Yes | High |
Frequently Asked Questions
How to tell if I am behind CGNAT?
Check your router WAN IP address. If it falls within the range of 100.64.0.0 to 100.127.255.255, you are behind CGNAT. You can also compare this IP to what a site like "WhatIsMyIP" shows. If they do not match, your ISP is performing translation at the carrier level.
Is CGNAT bypass safe for work files?
It depends on the tool. A local-first tool that keeps your code and files on your machine while using an encrypted relay for the UI or terminal stream is significantly safer than uploading your code to a cloud IDE or opening raw ports on your firewall.
Can I run AI agents through a relay?
Yes. Since the AI agent runs as a local process, it does not care about the NAT. The relay only facilitates the remote view and control of that process. You can manage your coding agents from any location as long as the local machine has an outbound internet connection.
Conclusion
CGNAT is an annoying reality for many modern developers, but it does not have to be a productivity killer. By moving away from traditional port-based access and toward secure, application-level relays, you can maintain a powerful, local-first workflow. If you want a workspace that handles the complexities of remote connectivity while keeping your code on your machine, you can download Deska to start building on an infinite canvas today.