GUIDE: Setting up Transmission with OpenVPN and PIA

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
Hey Mannekino,

I think I'm having the same problems you are and it's leading to slow downloads and uploads as a result. I'm convinced that I want to switch to a scheme like yours with wireguard and probably a different provider. Would you be willing to put together a short guide on how you set up wireguard +Mullvad in your transmission Jail?

Thanks.

I've written the guide: https://www.truenas.com/community/t...ion-jail-to-use-wireguard-with-mullvad.90232/
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
Anyone have a link to an up to date guide (for TrueNAS 12, transmission v3) for setting up Transmission, OpenVPN, PIA. I have been knocking my head against this for weeks now and I'm getting no where.
 

dak180

Patron
Joined
Nov 22, 2017
Messages
308

dak180

Patron
Joined
Nov 22, 2017
Messages
308
Is there any guide/overview of how to use them, or are we supposed to read the scripts to understand the intent?
I have not really had a chance to make a separate writeup on how to use them but I have done my best to make the scripts really easy to read and understand.
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
I have not really had a chance to make a separate writeup on how to use them but I have done my best to make the scripts really easy to read and understand.
They appear to be very specific to your particular setup (jails/file system layout). i.e. If I'm not mistaken, there are references to other jails in the transmission fstab setup.
 

dak180

Patron
Joined
Nov 22, 2017
Messages
308
If I'm not mistaken, there are references to other jails in the transmission fstab setup.
No dependencies on other jails; in order it sets up a mount for where I keep scripts, a user dir, torrent file location, incomplete downloads, completed downloads, Transmission config dir, and an OpenVPN config dir.

They appear to be very specific to your particular setup (jails/file system layout).
Of course, though editing to fit your layout should not be too difficult.
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
No dependencies on other jails; in order it sets up a mount for where I keep scripts, a user dir, torrent file location, incomplete downloads, completed downloads, Transmission config dir, and an OpenVPN config dir.

Of course, though editing to fit your layout should not be too difficult.

The paths beginning '/mnt/jail/...' were what made me think they might be older style jails from pre iocage days ;-)

I forked the repo yesterday and changed the paths to suit my layout, but I'm still unable to get it to work. The iocage create fails with vnet problems, which I'm unable to fix due to a lack of understanding (and documention on TrueNAS'/iocage's sites).
 

dak180

Patron
Joined
Nov 22, 2017
Messages
308
The iocage create fails with vnet problems, which I'm unable to fix due to a lack of understanding (and documention on TrueNAS'/iocage's sites).
This likely because I have my jail setup on a separate vlan you will need to adjust the creation properties in particular, you will need to change interfaces, resolver, vnet0_mac, and vnet_default_interface to suit your setup. If you are unsure of the values to use you can always create a test jail in the gui and then use iocage get -a [jail_name] to get a list of all the properties.
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
This likely because I have my jail setup on a separate vlan you will need to adjust the creation properties in particular, you will need to change interfaces, resolver, vnet0_mac, and vnet_default_interface to suit your setup. If you are unsure of the values to use you can always create a test jail in the gui and then use iocage get -a [jail_name] to get a list of all the properties.
Thanks. The iocage get -a [jail_name] helped a lot. Still working through it, but at least I'm getting somewhere now ;-)
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
After much messing around I managed to get Transmission, OpenVPN, and ipfw all working together in a single jail. Unfortunately, this only lasted until the jail was restarted (because of system reboot).
Now OpenVPN fails to start. /var/log/messages shows:

Code:
May 26 13:55:33 transmission openvpn[33542]: Cannot open TUN/TAP dev /dev/tun0: No such file or directory (errno=2)
May 26 13:55:33 transmission openvpn[33542]: Exiting due to fatal error


Any ideas on why this might fail after the reboot, and how to fix it?
 

Niel Archer

Dabbler
Joined
Jun 7, 2014
Messages
28
After much messing around I managed to get Transmission, OpenVPN, and ipfw all working together in a single jail. Unfortunately, this only lasted until the jail was restarted (because of system reboot).
Now OpenVPN fails to start. /var/log/messages shows:

Code:
May 26 13:55:33 transmission openvpn[33542]: Cannot open TUN/TAP dev /dev/tun0: No such file or directory (errno=2)
May 26 13:55:33 transmission openvpn[33542]: Exiting due to fatal error


Any ideas on why this might fail after the reboot, and how to fix it?

Looks like the jail cannot create tun0 for some reason, and the openvpn configuration file explicitly stated 'tun0' instead of just 'tun'. Changing that seems to have fixed the problem, at least for now.
 

kangwenhao

Cadet
Joined
Dec 11, 2016
Messages
5
I followed the first part of this guide to get OpenVPN working, so I turned it on, and got a different ip when I checked in the terminal, but then my Web GUI stopped working. When I turned the VPN off, the WebGUI started working again. Anyone know why the VPN would be blocking a local network connection? Have I missed some simple configuration toggle? I haven't set up any firewall stuff yet, wanted to make sure the VPN was working properly first, so it shouldn't be a misconfigured firewall, but I can't figure out what else could be wrong.
 

dak180

Patron
Joined
Nov 22, 2017
Messages
308
Anyone know why the VPN would be blocking a local network connection? Have I missed some simple configuration toggle? I haven't set up any firewall stuff yet, wanted to make sure the VPN was working properly first, so it shouldn't be a misconfigured firewall, but I can't figure out what else could be wrong.
Assuming that your local network is somewhere in the 192.168 range you will want to add the following to your openvpn config file: route 192.168.0.0 255.255.0.0 net_gateway
 

kangwenhao

Cadet
Joined
Dec 11, 2016
Messages
5
Assuming that your local network is somewhere in the 192.168 range you will want to add the following to your openvpn config file: route 192.168.0.0 255.255.0.0 net_gateway
Perfect! That fixed it! Thank you so much!
 
Top