Setting up a separate computer to download files to my PLEX server over the network

Good morning everyone,

So here is my dilemma.  I am using a computer as a PLEX server and also as a torrenting/usenet machine.  However, I cannot use them both at the same time due to PLEX going dark while my VPN is up.  So I was wondering if it would be possible to set up a separate computer (thinking Raspberry Pi 2 since I have one laying around) as a straight torrenting box that saves to my PLEX computer over the network instead of ever saving anything to the Pi itself.  This way I can have the torrent box always up and running with PLEX always looking through and updating whenever the apps like Sonarr download things and available to stream stuff whenever I need to access it.  Any help here would be great, the PLEX server is running Lubuntu and the Pi would probably be running the latest version of Raspbian.

Should be pretty easy to implement. In Sonarr, look at the advanced settings for “download clients”, and configure an entry for “Remote Path Mappings”.

Set up the vpn on your router. Set it so that only bt traffic gets routed over the vpn. Ta da.

I followed this guide to set up a specific user to only use the interface connected with the VPN: Making all network traffic for a Linux user use a specific network interface | Cadman.uk

This allows for normal connections (ie, plex) to be separated from connections you want behind a VPN (ie, torrents).

I have done that for a while. Make your download box put the media in a dump folder then have Sonarr/Couch potato clean it up and move it into the plex library over a network share. As long as your permissions are good you’ll be fine.

The only problem I see with your setup is the PI. In my experience, a Raspberry PI (at least the original version, maybe the PI2 is OK) doesn’t have enough power to run a torrent though VPN – the processing required for the VPN is just too much. I have a 60Mb/s link that I could saturate running transmission-daemon on a PI but if I tried to run it and a VPN together on the PI I would get a max of 100kB/s. Since moving them both to a VM on a real box I am back to full speed.

You need to isolate the traffic going over the VPN connection, and the best ways to do that are by either using a VM (and just set the VM image up to only allow traffic out through the vpn connection) or using a container such as lxc or docker. There are several docker images ready to go for this use case:

uses deluge but is limited to PIA

uses transmission, but has certs and configs for several popular vpn providers

https://hub.docker.com/r/haugene/transmission-openvpn/

Just setup a freenas server with transmission + flexget? Works wonders for me. My FreeNAS also runs Plex. It all runs on an VMware ESXI with my drives raw mapped to the freenas. The other instance is my pfsense router+firewall.

set up samba shares in lubuntu, then map the network drive to the plex computer’s network and host.
source Mounting Network Resources | Plex Support

yes, in fact that is how I roll:
1 Ubuntu server w ssh
2 transmission
3 sabnzbd
4 sickrage
5 couchpotato
6 profit!
all apps point to /mnt/public which is my nas
plex is on its own machine with the same nas mount point

What OS are you running on the machine machine? You can use VMWare Workstation or Hyper-V and run the torrenting/usenet machine there.

How do you identify bt traffic to be routed over the vpn?

This is not ideal. You still have DNS leakage, plus what if the program daemonizes to run as nobody or another uid?

Better to use a virtual machine for your torrent client and send all vm traffic through the VPN, or use a container (lxc or docker) to do the same. You’ll still need to set up routes within the container (so the only traffic that can get out is to the vpn endpoint,) but won’t need to limit the routes to that user.

Isolation is the only way to be sure.

This combined with /u/NoMoreNicksLeft 's suggestion would work pretty decently… you run your torrent client on the pi and let your router do the VPN work by forcing the pi IP to use the VPN. Only annoyance left is moving the files from the Pi into plex.

Lubuntu is what is running on my main machine. Could I set up a separate virtual machine that uses the VPN whole the machine as a whole doesn’t?

The best way seems to be to have your bt client bind to a second ip address, make it 192.168.44.44 or whatever. Your other apps will use your regular 192.168.1.x address.

Then mark all packets coming from 192.168.44.x with the packet marking module, whatever that is called.

Route only those over the tunnel.

This way you can do it from multiple computers too (just use another 192.168.44.x address).

The only caveat is that some things won’t work. Forget getting soulseek’s qt client to bind to the 44.x address, or aMule (though I haven’t used that in nearly two years). Though, some of those problems for me are OSX problems (on linux, nearly anything can be made to bind to any address).

That’s easy. Either use samba or nfs on the Plex server (or nas) to export the Plex media library (or a sonarr/couch potato pickup location) then mount the share on the pi and save the torrents directly to the share. At no point should you have to touch the media yourself.

I’m going to assume this is possible via something like VirtualBox. In my instance I’m running Windows server, using Hyper-V for the VM and have the VPN installed in the VM.

I didn’t want to mess with trying to make the VPN work on my main machine so I just set up a VM. I am running Linux Mint MATE as my main machine / PLEX server. Also running a Virtual Machine with Mint Mate that I use for downloading and that’s connected to the VPN. Main machine and Virtual Machine run 24/7.

The VM is SO easy. The hardest part (and it’s not that hard) is finding the terminal command to mount the folder you are sharing between the main machine / Virtual machine for copying your downloads over.

Even when torrent clients say they bind to a second IP (for example, transmission), they still leak packets out of the primary IP. For example, with DNS lookups. You can’t trust them to really be bound.

yeah but in my experience with raspi, neither are particularly stable for long-term use.