I don't see this mentioned anywhere but I assume this is normal though I want to confirm. Is this expected behavior for the web UI to show the peer listening port to be in Closed state?
I'm also having this problem.
I set it to use port forwarding, and I configured port forwarding in my router. It still says closed, and I'm afraid that means I'm in "passive" mode with peers (not good!).
I checked netstat -tuplen but I don't see the Transmission Listen Port listed there.
I also tried running the docker with --expose=[MYPORT] but that didn't help.
Any advice?
@eroji I think I got it.
I found a related issue in the repository with an answer from @haugene: https://github.com/haugene/docker-transmission-openvpn/issues/97#issuecomment-233200397
To get the port open you need to setup port forwarding with your VPN provider.
Well, it's not sure that you can open the port. You can't do it in the container or your local network. The port needs to be forwarded to you by the router managing your public ip. That's the address you're visible under when connecting to the vpn and that's where requests will be sent.
This means that your vpn provider needs to support port forwarding and it's up to them to have documentation for this. This will be different for every provider. PIA has this support and I've scripted port opening using them because that's the provider I use.
The impression I got was that PIA is supported out of the box, and it is also the provider I am using. I Googled the topic and it seems like it is limited to a small set of gateways?
EDIT: Deleted and re-built the image now it's working it seems.
The script seems to update the port periodically, but it doesn't always end up showing "Open" for the port it selects? Is this expected for the way the script works?
@eroji It used to update hourly, but now it's only done at startup. The documentation might be outdated on that point. After getting a port it triggers a port check. It only works on a few gateways, that's true, and you should see a "curl error" in the logs if you select a server that doesn't support it. It is possible that the port gets opened but the check fails and says Closed, you should then be able to check port again from the UI. Looking at the logs will tell you more about what's going on. Also, if you recreate the container a bunch of times PIA will say "there's already an active port forwarding ..." something. Wait a while and try again.
@tylerburleigh Configuring port forwarding in your router doesn't matter. VPN, remember. You're no longer getting traffic to your router directly (which is the whole point). Your public IP is now the VPN server, and all traffic is going there and is then tunnelled back to the container. Port forwarding needs to be configured with your VPN provider if they support it.
I had trouble with PIA + Port Forwarding as well. Often times when starting the container it would not forward the port. After some testing, and some reading, I found out the new PIA port forwarding API is only available for 2 minutes after you connect to the tunnel -- after 2 minutes, you get the "curl error".
Furthermore I think the port forward request is sent too early, possibly before the tunnel is up and ready (or maybe the PIA port forward API needs a second or two to do something behind the scenes...). I tossed a sleep 15 before updatePort.sh is executed in start.sh and so far the port has been forwarded correctly every time over a period of a week or two. This used to be almost an every day problem before.
@haugene
@spede That's interesting information. I will give your modification a try.
Thanks @spede, I added that change to the dev branch now. Would be great if that makes the script stable. This has been a recurring problem.
The fix that was added to the port update script for PIA has been merged to master and is included in the lastest tag of this image. Closing this.
Most helpful comment
I had trouble with PIA + Port Forwarding as well. Often times when starting the container it would not forward the port. After some testing, and some reading, I found out the new PIA port forwarding API is only available for 2 minutes after you connect to the tunnel -- after 2 minutes, you get the "curl error".
Furthermore I think the port forward request is sent too early, possibly before the tunnel is up and ready (or maybe the PIA port forward API needs a second or two to do something behind the scenes...). I tossed a
sleep 15beforeupdatePort.shis executed instart.shand so far the port has been forwarded correctly every time over a period of a week or two. This used to be almost an every day problem before.@haugene