# Balena tunnel does not forward port

**URL:** <https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346>\
**Category:** openBalena\
**Tags:** balena-cli\
**Created:** [November 14, 2019, 9:25pm UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346 "2019-11-14T21:25:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerb0n](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gerb0n](https://forums.balena.io/u/gerb0n)\
**Post date:** [November 14, 2019, 9:25pm UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346/1 "2019-11-14T21:25:05Z")

</div>

My device is running a development-image of BalenaOS.  
I can see my webapp running when I navigate to `http://<deviceuid>.local/` inside the browser.  
Also when I SSH to the HostOS and check my running containers with `balena ps` I see it has one container exposing like such `0.0.0.0:80->3000/tcp`.

However when I run the `balena tunnel <full deviceuid> -p 80:8080` command it does not forward the port and I cannot reach the webapp via browser on 8080.

It just prompts that it’s ‘waiting for connection’.

```
Fetching application by name 6b35227b44c7d080a69158082d1587db (string)
[Debug] Application not found
[Debug] Fetching device by UUID 6b35227b44c7d080a69158082d1587db (string)
[Info] Opening a tunnel to 6b35227b44c7d080a69158082d1587db...
[Info] - tunnelling localhost:8080 to 6b35227b44c7d080a69158082d1587db:80
[Info] Waiting for connections...

```

And after a minute or so the following

```
127.0.0.1:60471 => 127.0.0.1:8080 ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error] :0 => undefined:undefined ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error] :0 => undefined:undefined ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error] 127.0.0.1:60479 => 127.0.0.1:8080 ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128
[Error] :0 => undefined:undefined ===> 10.240.0.4:80 :: connect ETIMEDOUT 34.90.19.201:3128

```

I tried it with other ports like 22222 to gain SSH access via the tunnel but no result.

---

<div class="post-metadata">

**Author:** ![karaxuna](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@karaxuna](https://forums.balena.io/u/karaxuna)\
**Post date:** [November 15, 2019, 9:39am UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346/4 "2019-11-15T09:39:23Z")

</div>

Hi, I’ll try this on my local device. Which version of balenaos does the device use?

---

<div class="post-metadata">

**Author:** ![gerb0n](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gerb0n](https://forums.balena.io/u/gerb0n)\
**Post date:** [November 15, 2019, 9:52am UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346/5 "2019-11-15T09:52:37Z")

</div>

I am using balenaOS 2.44.0+rev3.  
My cli is v11.17.3-windows-x64.

---

<div class="post-metadata">

**Author:** ![karaxuna](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@karaxuna](https://forums.balena.io/u/karaxuna)\
**Post date:** [November 15, 2019, 10:51am UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346/6 "2019-11-15T10:51:34Z")

</div>

I tested locally with [https://github.com/balena-io-projects/simple-server-node](https://github.com/balena-io-projects/simple-server-node) repo. Changed the port in server.js to listen to 3000 and added docker-compose.yml that looks like this:

```auto
version: '2.1'
services:
  server:
    build:
      context: .
    ports:
      - '80:3000'

```

Then I run `balena tunnel <full deviceuid> -p 80:8080` and was able to access the website on [http://localhost:8080/](http://localhost:8080/).  
Can you ensure that you are logged in balena-cli with same credentials which you are logged in dashboard?  
Also, can you run same steps as I did and see if it works?

---

<div class="post-metadata">

**Author:** ![gerb0n](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gerb0n](https://forums.balena.io/u/gerb0n)\
**Post date:** [November 15, 2019, 11:24am UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346/8 "2019-11-15T11:24:52Z")

</div>

I am using open-balena and don’t have access to any dashboard as far as I know. I logged with `balena login` and used my ‘super-user’ credentials. Is `balena tunnel` not working for open-balena maybe?

---

<div class="post-metadata">

**Author:** ![karaxuna](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@karaxuna](https://forums.balena.io/u/karaxuna)\
**Post date:** [November 15, 2019, 12:22pm UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346/16 "2019-11-15T12:22:42Z")

</div>

Sorry, did not notice you were talking about openBalena. `balena tunnel` should work with openBalena. CLI is unable to connect to the port 3128 on your openBalena instance IP. Can you check your network/firewall config?

---

<div class="post-metadata">

**Author:** ![gerb0n](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gerb0n](https://forums.balena.io/u/gerb0n)\
**Post date:** [November 15, 2019, 12:49pm UTC](https://forums.balena.io/t/balena-tunnel-does-not-forward-port/44346/18 "2019-11-15T12:49:11Z")

</div>

Awesome, that indeed resolved the issue and in hindsight it was quite obvious.  
Maybe forwarding port 3128 is something worth mentioning on the [getting-started](https://www.balena.io/open/docs/getting-started/) page.

Thanks karaxuna!
