Technical Anshu
Tutorials Blog
How Tunnels Work

How Web Tunnels Work and Why CGNAT Cannot Stop Them

Port forwarding fails for lakhs of users because their ISP never gave them a real public IP. Tunnels succeed on the same connection, in the same house, on the same day. The difference is a single idea: who starts the connection.

Technical AnshuNetworking BasicsCGNAT Explained
Watch the full video — turn your PC into a public web server with just 2 commands, step by step

To understand why the two-command trick works on almost any internet connection, you need only one picture: an inbound door versus an outbound pipe. Old-style hosting from home needed an inbound door, and most modern ISPs have quietly removed it. A tunnel needs no door at all — it walks out through the same opening your browser uses, and simply never hangs up.

Two ways a visitor can try to reach your PC
Port forwarding — visitor knocks from outsideBLOCKED ON CGNAT
Tunnel — your PC connects out and stays connectedWORKS ON CGNAT
Inbound knock: visitor -> ISP network -> ??? no address of yours to knock on Outbound pipe: your PC -> tunnel service (connection held open) visitor -> tunnel service -> down the pipe -> your PC

The visitor never connects to your home directly in the tunnel model. They connect to the service, and the service relays.

1

Why Inbound Hosting Breaks — NAT and CGNAT

Every home router does NAT: many devices inside share one public IP address outside. Port forwarding tells the router, when a knock arrives on this port, pass it to that PC. That works only if the knock can reach your router in the first place. With CGNAT, the ISP adds a second layer — hundreds of homes share one real public IP, and the address your router shows as its WAN address is itself a private one. A visitor's knock reaches the ISP's layer and has no way to know which home it wants. Your router's port forwarding rule is correct and useless, because the door it guards is one floor below the locked entrance.

2

The Tunnel Trick — Your PC Calls Out First

A tunnel tool reverses the direction. The tool on your PC opens a connection outward to the tunnel service and keeps it open, like a phone call your PC makes and refuses to end. Outbound connections are the ordinary traffic of the internet — browsers, apps and updates all work this way — so they pass through NAT, CGNAT and home firewalls without any special permission. The tunnel service then gives that held-open connection a public URL with its name on it.

3

What Happens When a Visitor Clicks Your Link

The visitor's browser connects to the tunnel service's server, which has a genuine public address — no CGNAT problem on that side. The service looks at the URL, matches it to your held-open connection, and passes the request down the pipe to your PC. Your local web server answers, and the answer travels back up the same pipe to the visitor. Your PC is never directly reachable from the internet at all; the service is the public face, and your PC is a backstage worker it can call.

4

Why This Shape Is Also a Security Shape

Because nothing knocks inbound, you need no open ports on your router and nothing at home listens for strangers. The attack surface concentrates in two places you can control: the tunnel service itself, and whatever your local server publishes. Hold on to the second half of that sentence. The tunnel hides your home address and your router — it does not hide your website. Whatever the local server serves is served to the entire internet, bugs, weak passwords and forgotten files included.

5

The Honest Costs of the Trick

Nothing here is magic, and the trade-offs are real. Every visitor's traffic takes a detour through the service, which adds a little delay. The service is a middleman: free tiers can throttle you, cap your connections or change their rules. Your address lives on their domain, not yours. And if the tunnel service goes down, your site is down even though your PC and connection are perfectly healthy. For a demo, all of this is a bargain. For a business, it is the list of reasons hosting exists.

🔴 CGNAT cuts both ways. It cannot stop your tunnel — and it cannot protect you either. Once the tunnel is up, your published site is as public as any website on earth, whatever your ISP's addressing looks like.

Watch the Complete Video Guide

Watch the video to see the tunnel come up on a normal home connection — no router login, no ISP call, the public URL working within moments.

Watch Full Video
Frequently Asked Questions

How do I know if my connection is behind CGNAT

Compare the WAN IP address shown in your router's status page with the IP address a website reports as yours when you search for it. If the two differ, there is another NAT layer between your router and the internet, which usually means CGNAT. Another classic sign: port forwarding rules set up perfectly that still never work from outside.

Does a tunnel make my PC invisible and safe

It hides your home IP address and keeps your router's ports closed, which removes one whole class of attack. It does not protect the website itself. Whatever your local server publishes is served to the whole internet, with all of its bugs, default passwords and forgotten files included. Invisible address, very visible website.

Will a tunnel work on mobile data and office networks

Usually yes, because it only needs an outbound connection — the same thing your browser uses all day. Strict office networks that filter unknown outbound tools can still block it. And using a tunnel to publish office systems without permission is a policy violation, not a clever trick, whatever the technology allows.

This guide is based on the Technical Anshu video on turning a PC into a public web server • Stuck on any step, ask in the video comments