nordvpn + torrent on headless rpi3

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
arturo
Posts: 9
Joined: Thu Mar 21, 2019 8:49 am

nordvpn + torrent on headless rpi3

Post by arturo »

Hi,
I have a Raspberry Pi3 running DietPi as a headless server.
I have tried to get Deluge and rtorrent+rutorrent working but nothing gets downloaded despite being connected a p2p friendly server (A German one). So my idea is to have a light webserver on the Pi3 offering a web interface to the torrent program. I understand that this is only possible when using a Socks5 proxy and that rtorrent doesn't support Socks5, am I right?
What would be a good setup to achieve the aboven (that doesn't imply installing X Windows?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: nordvpn + torrent on headless rpi3

Post by MichaIng »

Strange that there are reported so many issues with torrent downloads via NordVPN since I find so many reports that it is indeed a very recommended VPN provider for P2P/torrent purpose. Perhaps I have to setup a test account any try myself, although the instructions from NordVPN are very clear and there is not much that one can do wrong, especially if with disabled VPN download+upload works.

Yeah rTorrent does not provide internal proxy support so this needs to be enabled externally. However SOCKS5 should not be required, just an enhancement for torrenting. Deluge however supports this, so I suggest you try with this first: https://nordvpn.com/de/tutorials/socks5/deluge/

Even with VPN enabled you can always access the web UI from local network by using the local IP/hostname of the server. Only when accessing externally a dedicated proxy to bypass the VPN. With rTorrent (ruTorrent) there is already a webserver that provides ruTorrent access. Only Deluge has it's own internal web application.
But most properly you don't want the system to communicate to WAN outside of the VPN. At least I would recommend this and open the web UIs only to the local network?
arturo
Posts: 9
Joined: Thu Mar 21, 2019 8:49 am

Re: nordvpn + torrent on headless rpi3

Post by arturo »

Thanks a lot for your fast reply and helpful insights.

I could swear I had rtorrent working fine some months ago on a previous installation (that SD card is truly dead now)

I tried deluge 2 weeks ago but despite setting the socks5 proxy I was having the same problem; downloads stayed at 0Kb downloaded

And yes you are right, I don't want to access the webif from the WAN.
The only other purpose this raspberry pi serves (and it servers well) is to act as a web gateway, so when I change the default gateway in LAN clients from the router to the raspberry pi, then thanks to iptables the traffic is routed through nordvpn (and that works like a charm)
So if I get deluge working, then I can uninstall the web server as deluge doesn't use one?

I will try Deluge with the guide you pointed out and report back
arturo
Posts: 9
Joined: Thu Mar 21, 2019 8:49 am

Re: nordvpn + torrent on headless rpi3

Post by arturo »

Hello,
Tried deluge and it works with sock5 but another set of problems.
When I try to connect from a LAN linux with the Deluge client:

tail -n 12 /mnt/dietpi_userdata/deluge/.config/deluge/deluged.log

Code: Select all

BadLoginError: Password does not match
root@Brexit:/mnt/dietpi_userdata/deluge/.config/deluge# tail -n 12 deluged.log 
  File "/usr/lib/python2.7/dist-packages/deluge/core/rpcserver.py", line 262, in dispatch
    ret = component.get("AuthManager").authorize(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/deluge/core/authmanager.py", line 95, in authorize
    raise BadLoginError("Password does not match")
BadLoginError: Password does not match
Password does not match
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/core/rpcserver.py", line 262, in dispatch
    ret = component.get("AuthManager").authorize(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/deluge/core/authmanager.py", line 95, in authorize
    raise BadLoginError("Password does not match")
BadLoginError: Password does not match
I tried to connect as root/dietpi . Is it supposed to be a different user for the client connection?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: nordvpn + torrent on headless rpi3

Post by MichaIng »

Does it work if you login via web interface and password dietpi?
Did you ever changed your global software password e.g. on first boot?
arturo
Posts: 9
Joined: Thu Mar 21, 2019 8:49 am

Re: nordvpn + torrent on headless rpi3

Post by arturo »

Yes it works
And yes, I changed the global password directly in the .txt file (not during the installation)
but it seems like dietpi is still the default.
I have changed the deluge password in the webif (preferences, interface)
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: nordvpn + torrent on headless rpi3

Post by MichaIng »

You did follow this instructions to enable deluge client login? https://dietpi.com/phpbb/viewtopic.php? ... art=10#p61

If changing the password via deluge web UI does still not allow client login, then perhaps some special characters are not handled well by deluge. Otherwise strange then that web UI login works.

Note that the global password inside dietpi.txt is only used on first run setup. It is then stored encrypted on the root file system. To change it afterwards you need to change via dietpi-config. So yours is still dietpi then.
arturo
Posts: 9
Joined: Thu Mar 21, 2019 8:49 am

Re: nordvpn + torrent on headless rpi3

Post by arturo »

Thanks, I have changed strategy.
Dug out an old Raspberry Pi 1 (model B) and set it up with nordvpn and routing all traffic through the VPN (thanks to iptables).

Code: Select all

#Enable IP Forwarding 
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

#These rules will redirect the kernel to accept packets coming from the 192.168.1.0 subnet, and forward them onto the tun0 #interface.
sudo iptables -I FORWARD -o tun0 -s 192.168.1.0/16 -j ACCEPT
sudo iptables -I INPUT -s 192.168.1.0/16 -j ACCEPT

Did a new installation of rtorrent on the Raspberry Pi 3 but this time with no vpn or iptables and instead set the default gateway to the ip of the Raspberry pi 1

I verify that the Raspbery pi 3 has a vpned public ip with

Code: Select all

dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
And
then launch rtorrent which works but I would say it is a bit slow

How could I speed it up since it has no socks5 proxy support?
arturo
Posts: 9
Joined: Thu Mar 21, 2019 8:49 am

Re: nordvpn + torrent on headless rpi3

Post by arturo »

Yes I did, but it never worked, I tried all sort of passwords, I think it is something different but I have given up on deluge for now
MichaIng wrote: Thu Apr 04, 2019 2:06 pm You did follow this instructions to enable deluge client login? viewtopic.php?f=8&t=5&start=10#p61
Post Reply