GUIDE: Setting up Transmission with OpenVPN and PIA

saeed

Cadet
Joined
May 2, 2015
Messages
7
I would like some help pretty please. Transmission keeps reporting "closed" for the port returned from PIA..

There were no problems with getting a jail, transmission, openvpn all set up and working. Openvpn connection works and I do get a new IP address. Running the port forward script also works as evidenced by getting a port number displayed and a "success" response after that port is changed in transmission. When I open transmission remote GUI and check I get a "closed" under the port field. I also get "Error: portTested: http error 0: No Response" when trying "transmission-remote --port-test" command.

Any thoughts?
 

underpickled

Contributor
Joined
Oct 1, 2013
Messages
167
So this is super helpful and useful, so first of all, thank you to everyone who contributed to this topic and thread.

However, I have to ask... is no one else concerned about storing VPN login credentials in plaintext?
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
I would like some help pretty please. Transmission keeps reporting "closed" for the port returned from PIA..

There were no problems with getting a jail, transmission, openvpn all set up and working. Openvpn connection works and I do get a new IP address. Running the port forward script also works as evidenced by getting a port number displayed and a "success" response after that port is changed in transmission. When I open transmission remote GUI and check I get a "closed" under the port field. I also get "Error: portTested: http error 0: No Response" when trying "transmission-remote --port-test" command.
Hard to say. I would first try restarting the jail in the FreeNAS webGUI. If that doesn't work, I would try changing to a different PIA server, making sure to choose one that can forward ports.

... is no one else concerned about storing VPN login credentials in plaintext?
I don't know. In the big scheme of things, if someone has hacked into your server and can rummage around in your files, you may have bigger problems than someone using your PIA account.
 

saeed

Cadet
Joined
May 2, 2015
Messages
7
Hard to say. I would first try restarting the jail in the FreeNAS webGUI. If that doesn't work, I would try changing to a different PIA server, making sure to choose one that can forward ports.

Thank you for the quick response. I tried both restarting the jail and trying a different PIA server that can forward ports. No luck still.

Any other thoughts?
 

saeed

Cadet
Joined
May 2, 2015
Messages
7
Never mind. It is working now. I have no idea how the problem solved itself. Maybe a late response to restarting the jail haha

Thanks Glorious1
 

Nodja

Dabbler
Joined
Dec 13, 2015
Messages
10
The 2.90 update to transmission borked my jail and I had to start over and I have the same issues with port forwarding. The script is giving me a different port each time it's run so it seems the port forwarding is not sticking on the PIA end. Since it started working for you now I guess it takes a bit until the port forward is effective.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
The 2.90 update to transmission borked my jail and I had to start over and I have the same issues with port forwarding. The script is giving me a different port each time it's run so it seems the port forwarding is not sticking on the PIA end. Since it started working for you now I guess it takes a bit until the port forward is effective.
The 2.9 update messed me up too. For some strange reason, it apparently changed my /etc/rc.conf so that
transmission_enable="NO"
I changed it to YES and it started working, after restarting the jail and running the port_forward script. I think it did take a while until the port forwarding worked though.

Also be aware that 2.84 and 2.9 use different transmission directories. 2.9 uses /var/db/transmission
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
Can someone advise me how to automatically run the port_forward.sh script when the jail starts? Lately I find I need to restart the jail every few days to keep things working, and it would be nice not to have to SSH in as well to run the script.
 

PainCorp

Cadet
Joined
Oct 25, 2015
Messages
9
So it's been years since I've working in a command line bsd/linux system so maybe I'm missing something VERY obvious, but I've been reading for hours and can't see what I'm missing. I'm sure it's obvious, but maybe the time spent reading has made me miss what I need erroneously.

Trying to get the port forwarding script working, when I do "head -n 100 /dev/urandom | md5sum | tr -d " -"" I get:

root@transmission_1:/ # head -n 100 /dev/urandom | md5sum | tr -d " -"
md5sum: Command not found.

I had a hell of a time getting permissions set up, and I still don't think they're quite right, but files are downloading, just ports aren't forwarding right. I'm using the Netherlands server currently, but I'm stuck here right now.

I do have the piacreds file with two of the three lines I need, this is the one that's alluding me right now.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
root@transmission_1:/ # head -n 100 /dev/urandom | md5sum | tr -d " -"
md5sum: Command not found.
Change md5sum to md5 -r
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
Off topic..

I am looking a guide on how to setup Transmission with Torguard VPN service.

Thanks.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
I am looking a guide on how to setup Transmission with Torguard VPN service.
Here they offer openvpn config files, as we're using for PIA. You should be able to follow roughly the same steps, though you'll likely have to modify slightly.
https://torguard.net/downloads.php
I would start with the "Standard TCP Configs".
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
Thanks for this.. But I have another question.

At the moment, openVPN service(TorGuard VPN) currently running in my router and work just fine.

Do I still need to configure my VPN service with Transmission (installed in Freenas) despite of VPN service is already setup and running on the router?

Thanks.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
At the moment, openVPN service(TorGuard VPN) currently running in my router and work just fine.

Do I still need to configure my VPN service with Transmission (installed in Freenas) despite of VPN service is already setup and running on the router?
I'm not familiar with running OpenVPN on the router. I would imagine that means all your traffic on the whole network goes through the VPN. If that's what is happening, and you're OK with that, you probably don't need to do anything. Otherwise, you would install the OpenVPN/TorGuard VPN in the jail with Transmission.

In any case, you should make sure your Transmission traffic is going through the VPN.
 

Brad1961

Dabbler
Joined
Mar 10, 2016
Messages
17
Just to let all know that I had to do fresh install of transmission to update to 2.92 and hence I had to go through the steps to reinstall openvpn.
all is working perfectly still getting fast download speeds and checked my IP with https://ipleak.net/ and I'm defiantly protected

I must say though, on both occasions following the instructions I had to deviate a little to get it to work
 

Sillyus Sodus

Dabbler
Joined
Feb 9, 2016
Messages
14
Is there any way to share the OpenVPN tunnel with plugins in other jails like SickRage or CouchPotato?

Also, I can recommend this command after intsalling nano to stop it putting in line breaks automatically:
echo 'set nowrap' >> /usr/local/etc/nanorc
 
Joined
Feb 25, 2016
Messages
7
Just wanted to say this guide worked for me on an upgraded (9.3 - 9.10) box after creating a new 9.10 jail. IPLeak verification works, just had to use a port-forwarding VPN via PIA's service. I can get the full 24Mbps downstream and 2Mbps upstream with this setup. Works with encryption required in transmission. Thanks!

Only reason I set this up was because I received the dreaded infringement call from my ISP yesterday after switching to them a few days ago.
 

travanx

Explorer
Joined
Jul 1, 2014
Messages
62
Having some problems getting this to work. It errors on piacreds. I was able to manually run the wget line with user/pass/client id and localip to get the port and change the port myself. Anyone have a working script? Thanks.

  1. #! /usr/local/bin/bash
  2. #
  3. # Script based on Eric Rudd's script at https://forums.freenas.org/index.ph...with-openvpn-and-pia.24566/page-2#post-174778
  4. #
  5. # Make sure you have a file named piacreds in the same directory as the script
  6. # 1st line of the file is pia username, 2nd password and third client id
  7. #
  8. # to generate a new client id run
  9. # head -n 100 /dev/urandom | md5sum | tr -d " -"
  10. # in any terminal
  11. #

  12. SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

  13. PROGRAM=`basename $0`
  14. USER=`head -n 1 $SCRIPTDIR/piacreds`
  15. PASSWORD=`head -n 2 $SCRIPTDIR/piacreds | tail -1`
  16. CLIENT_ID=`head -n 3 $SCRIPTDIR/piacreds | tail -1`

  17. local_ip=`ifconfig tun0 | grep "inet " | cut -d\ -f2|tee /tmp/vpn_ip`
  18. json=`wget --no-check-certificate -q --post-data="user=$USER&pass=$PASSWORD&client_id=$CLIENT_ID&local_ip=$local_ip" -O - "https://www.privateinternetaccess.com/vpninfo/port_forward_assignment" | head -1`
  19. PORTNUM=`echo $json | grep -oE "[0-9]+"`
  20. echo $PORTNUM
  21. transmission-remote -p $PORTNUM

  22. exit 0
 
Last edited:

verinas

Dabbler
Joined
Mar 29, 2016
Messages
34
Hi there,

Not having much luck with this so far. I've installed from the script twice and both times after running it appears to all be working but I have no connectivity once OpenVPN starts up. I can't see any issues in /var/log/messages. Can't wget or curl anything and can't ping anything either. It appears as if no host names can be resolved (all trackers fail too). If I turn off openvpn connectivity is fine.

I'm using the PPTP/L2TP/SOCKS Username and Password and confirmed all is working fine from a standard VPN client.

It appears the user in this post had the exact same problem. First time my second IP when the script finished was blank. And second time around it was the same IP on both lines.

Any ideas?
 
Top