# Port forwarding without router access or behind CGNAT: what works

November 21, 2026, The Expose team

You can't forward a port on a router you can't sign in to. Behind carrier-grade NAT (CGNAT), you can't forward one even with the password. You can still get the same result from the other direction. A program on your computer opens an outgoing connection to a server with a public address, and that server passes incoming traffic back through the connection. Your router already allows outgoing connections, the same as it allows a browser tab, so nothing on it has to change.

Which tool does that depends on what you want to reach:

| What you want to reach | What works | Start with |
| --- | --- | --- |
| A website, API or webhook endpoint | An outbound HTTP tunnel | `expose share http://localhost:3000` |
| SSH, a database or another TCP service | A TCP tunnel | `expose share-port 22`, with Expose Pro |
| Your own NAS, Raspberry Pi or home server, only for you | A mesh VPN | Tailscale on each device |
| A game server or anything else over UDP | A tunnel that carries UDP | playit.gg, Pinggy, LocalXpose or frp |
| Anything, through a server you rent | An SSH reverse tunnel | `ssh -N -R 8080:localhost:3000 you@your-server` |
| Anything, for good | A public IPv4 address, or IPv6 | Your ISP |

Before you pick, spend a minute on why the port won't open. The answer rules some of these rows in or out.

## Why you can't open a port

Four different problems look the same from the inside. You forward a port, or try to, and nothing comes through.

- **You can't sign in to the router.** You're in a dorm, an office or a rented flat, or your ISP locked the router. The router could forward the port, but you can't tell it to.
- **You're behind CGNAT.** Your ISP shares one public IPv4 address among many customers and runs the NAT itself. Incoming connections stop at the ISP, before they reach your router. A forward on your router never sees them, so the router password doesn't help.
- **You're behind double NAT.** A modem or a second router sits in front of yours. Forwarding works once you deal with the box in front.
- **Something blocks the port.** Your ISP or a firewall drops traffic on that port, even though the forward is right.

On a phone hotspot, run the check below while you're connected to the hotspot. Tunnels work there too, because they only need an outgoing connection.

### Check for CGNAT in a minute

The free [CGNAT check](https://expose.dev/cgnat-check) compares your router's WAN IP, which you copy from the router's status page, with the public IP the internet sees. The WAN IP tells you which case you're in:

| Router WAN IP | What it means | What you can do |
| --- | --- | --- |
| `100.64.0.0` to `100.127.255.255` | CGNAT. [RFC 6598](https://www.rfc-editor.org/rfc/rfc6598) set this range aside for carrier-grade NAT in April 2012. | A tunnel, a mesh VPN, IPv6, or a public IPv4 from your ISP |
| `192.0.0.0` to `192.0.0.7` | DS-Lite. Your ISP sends your IPv4 through its own NAT, which works like CGNAT. | The same, and IPv6 is already there |
| `10.x`, `172.16.x` to `172.31.x`, `192.168.x` | Another NAT in front of your router | Bridge mode on the box in front, or a forward on both |
| A public address that matches your public IP | You have a public IPv4 | Port forwarding works, if you can sign in |

If you can't sign in to the router to read its WAN IP, the CGNAT check has a traceroute method. You trace the route to your own public IP and paste the output. If your router answers for that address at the first hop, the address is on your router. If a hop in `100.64.0.0/10` shows up, you're behind CGNAT. Switch off Tailscale or any other mesh VPN before you trace, because [Tailscale gives devices addresses from the same range](https://tailscale.com/kb/1015/100.x-addresses).

## Port forwarding vs tunneling

Port forwarding is a rule on your router. It passes connections that arrive on a public port to a computer on your network. A tunnel works the other way round. Your computer connects out to a server with a public address, and visitors connect to that server.

| | Port forwarding | Hosted tunnel | Mesh VPN | `ssh -R` to a server you rent |
| --- | --- | --- | --- | --- |
| Setup | Router login, a fixed local IP, a forward rule and a firewall rule | Install a client, run one command | Install the app on every device and sign in | Rent a server, configure sshd, keep the connection up |
| Security exposure | The port on your home IP is open to everyone until you delete the rule | Only what you share, only while the command runs. Your home IP stays hidden. | Only devices in your private network can connect | Whatever you open on the server. Your home IP stays hidden. |
| Works behind CGNAT | No | Yes | Yes | Yes |
| Needs a server | No | No, the provider runs it | No, the provider runs the relays | Yes, your own |
| Cost | Free | Free plans with limits. Expose Pro is $79 per user per year. | Tailscale's Personal plan is free for up to 6 users | The server's rent |

## A website or API: use an outbound tunnel

If the thing you want to reach speaks HTTP, an outbound tunnel is the quickest fix. That covers a website, an API, a webhook endpoint and an OAuth callback. With Expose it takes two commands. First install the client:

```bash
# macOS and Linux
curl -fsSL https://expose.dev/install.sh | sh

# Windows, in PowerShell
irm https://expose.dev/install.ps1 | iex
```

Neither installer needs admin rights. The script installs to `~/.local/bin`, and the PowerShell installer to `%LOCALAPPDATA%\Programs\Expose`. That helps on a work or university laptop where you can't use `sudo`. Homebrew users can run `brew install --cask expose`, and [Laravel Herd](https://expose.dev/docs/integrations/laravel-herd) already includes Expose.

Then share the local site:

```bash
expose share http://localhost:3000
```

The first time, Expose opens your browser so you can sign in or create a free account. Then it prints a public HTTPS URL. Each request to that URL comes back through the connection the Expose client opened. Your router, your ISP's CGNAT and the building's firewall only see an outgoing connection.

![Terminal output of expose share showing the shared site, the dashboard URL, the public URL and incoming requests](https://expose.dev/img/docs/expose/img/expose_terminal.webp)

What you get on every plan, the free one included:

- **HTTPS on the public URL.** You don't set up a certificate.
- **No warning page in front of your site.** Visitors and webhook providers reach your app directly.
- **A request dashboard at `http://127.0.0.1:4040`.** It lists every request and can replay one, which helps when a webhook fails. See the [request dashboard docs](https://expose.dev/docs/client/dashboard).
- **No change to your dev server.** Expose connects to it on your machine, so it can keep listening on `127.0.0.1`.

The free plan gives you a random URL on each connection, a time limit per connection and one server in Frankfurt. Expose Pro costs $79 per user per year. It removes the time limit and adds a URL that stays the same with `--subdomain=my-app`, your own domain, and servers in New York, San Francisco, São Paulo, Singapore and Sydney as well as Frankfurt.

A tunnel gets through a company or university network the same way a browser does. That doesn't mean the network's owner allows it, so check the rules first. The [sharing docs](https://expose.dev/docs/client/sharing) list every way to share, including `.test` sites from Herd or Valet.

### Put a login in front of anything you share

Anyone who gets a public URL can open it. Add a gate before you send the link around:

```bash
# A username and password
expose share http://localhost:3000 --basicAuth="user:secret"

# A login page that only accepts these email domains and addresses
expose share http://localhost:3000 --magic-auth=@company.com,client@example.com
```

With [password protection](https://expose.dev/docs/client/basic-authentication), the browser asks for the username and password before it shows the site. It doesn't work on a site that already uses basic authentication. [Magic authentication](https://expose.dev/docs/client/magic-authentication) asks for an email address and lets in only the domains and addresses you list. Expose doesn't send an email to confirm the address, so it keeps out people who stumble on the URL but not someone who knows an accepted address. When that matters, pass both flags.

## A TCP service: expose share-port

For SSH, a database or any other service that doesn't speak HTTP, Expose shares a TCP port:

```bash
expose share-port 22
```

Expose prints a public address, made of the host name of an Expose server and a port that server assigns. Connect to that host and port, for example with `ssh -p PORT you@HOST`. Add `--server=us-1` or another region key to pick the server closest to you.

Sharing a TCP port through the Expose network needs Expose Pro. On the free plan you share HTTP and HTTPS sites.

The two login options above are for HTTP. Magic authentication doesn't work with `share-port`, and HTTP basic authentication can't protect a protocol that isn't HTTP. Anyone who finds the host and port can try to connect, so the service has to check who connects. For SSH, that means key-based login with password login switched off. For a database, it means a user with a strong password.

### A Minecraft server

A Minecraft Java Edition server listens on TCP port 25565 by default ([Minecraft Wiki](https://minecraft.wiki/w/Server.properties)). A TCP tunnel can carry it. With Expose Pro, run `expose share-port 25565`, and players enter the host and port Expose prints as the server address. Bedrock Edition is different. The Minecraft Wiki says the Bedrock Dedicated Server "uses UDP, unlike Java Edition which uses TCP", with port 19132 for IPv4 ([Bedrock Dedicated Server](https://minecraft.wiki/w/Bedrock_Dedicated_Server)). For Bedrock you need a tool from the [UDP section](#udp-game-servers-and-voice) below. Expose is built for web development. For a game server that runs for weeks, a game-focused relay such as playit.gg sets up the ports for you.

## Your own devices: a mesh VPN

If only you need to get in, to reach a NAS, a Raspberry Pi or a home server from your laptop or phone, don't make anything public. A mesh VPN such as Tailscale puts your devices on one private network, wherever each of them is. Nobody outside that network can connect.

Tailscale doesn't need port forwarding. Its docs say that "most of the time, you don't need to open any firewall ports for Tailscale" ([firewall ports](https://tailscale.com/kb/1082/firewall-ports)). Every connection starts through one of Tailscale's relay servers, called DERP servers, and Tailscale then tries to switch to a direct connection. When both devices are behind a hard NAT, the connection stays on the relay and still works ([connection types](https://tailscale.com/kb/1257/connection-types)).

Tailscale's Personal plan is free for non-commercial use, with up to 6 users and unlimited devices ([pricing](https://tailscale.com/pricing)). You install Tailscale on every device that takes part, so a mesh VPN suits you and a few people you know, not the public.

Tailscale can also publish a device on the public internet with Funnel. Funnel is in beta, listens only on ports 443, 8443 and 10000, and uses names in your tailnet's `ts.net` domain ([Funnel docs](https://tailscale.com/kb/1223/funnel)). If you want a public URL for webhooks or a client demo, the [Tailscale Funnel alternative](https://expose.dev/tailscale-funnel-alternative) page compares Funnel with Expose.

## UDP: game servers and voice

Expose doesn't tunnel UDP. It carries HTTP, HTTPS and TCP only, so it can't host a UDP game server or a WireGuard endpoint. These tools do carry UDP, according to their own docs, which we read on November 21, 2026:

| Tool | How you start a UDP tunnel | Free plan |
| --- | --- | --- |
| [playit.gg](https://playit.gg/) | Pick your game and playit sets up the ports. Other games and services get a custom TCP or UDP tunnel. | A free tier. On playit's list of custom tunnel types, TCP is marked Premium and UDP isn't. Premium starts at $3 a month. |
| [Pinggy](https://pinggy.io/docs/udp_tunnels/) | With the Pinggy CLI, which is in beta: `pinggy -p 443 -R0:localhost:8000 udp@free.pinggy.io`. The plain SSH command can't create UDP tunnels. | Includes UDP, with a 60 minute tunnel timeout. The port changes on each connection, and Pro can reserve one. |
| [LocalXpose](https://localxpose.io/docs/tunnels/udp) | `loclx tunnel udp --port 4545` | The free Starter plan lists HTTP and HTTPS tunnels only. [UDP is listed on Pro](https://localxpose.io/pricing), at $8 a month. |
| [frp](https://github.com/fatedier/frp) | Run `frps` on a server with a public IP, run `frpc` at home, and add a proxy with `type = "udp"` | Open source under Apache-2.0. You pay for the server. |

playit.gg is built for game servers. Its homepage says "your router stays untouched and your home IP stays private." Pinggy and LocalXpose are general tunnels that also do UDP. frp is the do-it-yourself option. Our [Pinggy](https://expose.dev/pinggy-alternative) and [LocalXpose](https://expose.dev/localxpose-alternative) comparisons cover where they fit better than Expose.

## Do it yourself: a server you rent and ssh -R

If you'd rather not use a hosted tunnel, rent a small server with a public IP and build the tunnel with OpenSSH. Run this on your computer:

```bash
ssh -N -R 8080:localhost:3000 you@your-server
```

`-R` forwards connections to port 8080 on the server back to port 3000 on your machine, and `-N` keeps SSH from running a remote command ([ssh manual](https://man.openbsd.org/ssh)).

There is one catch. By default, sshd binds a remote forward to the server's loopback address, so only the server itself can reach port 8080. To let the internet in, set `GatewayPorts yes` or `GatewayPorts clientspecified` in the server's `sshd_config`, where the default is `no` ([sshd_config manual](https://man.openbsd.org/sshd_config)). The other way is to leave the forward on loopback and run a reverse proxy such as Caddy or nginx on the server in front of it, which also gives you a place to handle HTTPS.

You take on the server's rent, the TLS certificate, the firewall on the server, and a way to restart the tunnel when the connection drops. If you want the Expose dashboard and `expose share` on your own server, the [Expose server](https://expose.dev/docs/server/introduction) is open source and you can host it yourself.

## Fix it at the source

The options above work around the router. These remove the reason you needed a workaround.

### UPnP: a program opens the port for you

UPnP's Internet Gateway Device protocol lets a program on your network ask the router to add a port forward, with no admin login. That's why some "port forward without router access" guides work. If UPnP is on, a port-mapping app can open the port for you.

The same property is the risk. "The UPnP protocol, by default, does not implement any authentication," [Wikipedia's UPnP article](https://en.wikipedia.org/wiki/Universal_Plug_and_Play) notes, so any program on your network can open ports, malware included. Some devices take UPnP requests from the internet too. In 2013, [CERT/CC note VU#922681](https://www.kb.cert.org/vuls/id/922681) warned that devices built on the libupnp library may accept them, and that the library's flaws let "a remote, unauthenticated attacker" run code on the device. CERT's advice was to disable UPnP if it isn't absolutely necessary. Some devices ship with UPnP off for these reasons. On a network someone else runs, you can't switch it on.

Behind CGNAT, UPnP can't help. It opens a port on your router, and the ISP's NAT still drops the incoming connection before it gets there. If you run the network yourself and UPnP is off, leave it off and forward the one port you need by hand.

### Ask your ISP for a public IPv4 address

Some ISPs give you a public IPv4 address on request, some charge for it, and some only offer it on business plans. Ask to be taken off CGNAT, or for a public IPv4 address. Normal port forwarding then works, as long as you can sign in to the router.

### Use IPv6

CGNAT only applies to IPv4. If your ISP gives you IPv6, each device gets a global address, so there's no NAT to forward through. You allow the port in the router's IPv6 firewall instead, which still needs the router login. Visitors on IPv4-only networks can't reach you over IPv6.

### Fix double NAT

If the CGNAT check found a private WAN IP and the box in front of your router is yours, put that box in bridge mode, or forward the port on both devices.

## What doesn't work

- **Windows port proxy rules and firewall rules.** `netsh interface portproxy` and Windows Firewall settings change how your computer handles a connection once it arrives. The router still drops the connection first.
- **A regular VPN app.** A VPN app only makes outgoing connections. It helps only if the VPN provider offers port forwarding.
- **UPnP behind CGNAT.** The port opens on your router, but the ISP's NAT still blocks the connection.
- **Another port number.** If CGNAT is the problem, no inbound port gets through, whatever its number.

## Questions

### Can you port forward without router access?

Not in the strict sense. Port forwarding is a rule on the router, so someone who can sign in has to add it, or UPnP has to be on so a program can add it. You can get the same result without the router: an outbound tunnel for a website or a TCP service, a mesh VPN for your own devices, or an SSH reverse tunnel to a server you rent.

### How do you bypass CGNAT?

Make the connection start from your side. CGNAT only blocks connections that start on the internet. An outbound tunnel, a mesh VPN and an SSH reverse tunnel all start with an outgoing connection from your computer. To get rid of CGNAT itself, ask your ISP for a public IPv4 address, or use IPv6.

### How do I host a website without port forwarding?

For a demo, a test or webhooks, run `expose share http://localhost:3000` and send the HTTPS URL it prints. The site goes offline when your computer sleeps or the command stops, so a site people rely on belongs on a host. [Hosting from localhost](https://expose.dev/blog/hosting-localhost) compares a tunnel, port forwarding and a deploy.

### Is a tunnel safer than port forwarding?

Usually. A port forward leaves a port on your home IP open to everyone until you remove the rule, and your IP is in the URL. A tunnel exposes only the site or port you share, only while the command runs, and visitors connect to the tunnel server instead of your IP. The URL is still public, so add `--basicAuth` or `--magic-auth` before you share it.

### Does a tunnel work on a mobile hotspot?

Yes. A tunnel only needs an outgoing connection, and a hotspot gives you one. Run `expose share` as you would on any other network, and the public URL works the same way.
