Torrent downloader with VPN only Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
przemko
Posts: 88
Joined: Sun Mar 15, 2020 5:40 pm

Torrent downloader with VPN only

Post by przemko »

Hello, I want to install transmission or rtorrent on my Dietpi and connect it to my openvpn that I have on external cloud VPS. I'm not good at that to make it manually so I find docker images like `rtorrent-rutorrent-openvpn`, `transmission-openvpn` or `wireguard-transmission`. I have openvpn and wireguard installed on my VPS. I use openvpn for my smartphone and laptops. I don't know nothing about wireguard but try to learn so i first try wireguard. I install it on my VPS and on Dietpi. Then I do:
`docker pull sebdanielsson/wireguard-transmission`.
Next there's some commands that I don't know how to change to work with my Dietpi:
```
docker run --name wireguard-transmission \
--privileged \
-e "USERNAME=transmission" \
-e "PASSWORD=transmission" \
-e "INTERFACE=wg0" \
-e "KILLSWITCH=wg0" \
-p 51820:51820/udp \
-p 9091:9091 \
-v /path/to/wg-conf-dir:/etc/wireguard \
-v /path/to/transmission-conf-dir:/etc/transmission-daemon \
-v /path/to/transmission-complete-dir:/transmission/complete \
-v /path/to/transmission-incomplete-dir:/transmission/incomplete \
-v /path/to/transmission-watch-dir:/transmission/watch \
sebdanielsson/wireguard-transmission
```
I don't know what to do in wireguard config.
Maybe more easy will be to use openvpn-transmission image?
If someone had time to help me, I would be very grateful.
Regards,
Przemek
User avatar
trendy
Posts: 156
Joined: Tue Feb 25, 2020 2:54 pm

Re: Torrent downloader with VPN only

Post by trendy »

Normally if you start the wireguard interface on your system and allow the whole internet as allowed IPs, then all traffic will go through the tunnel. The wireguard should be supported by dietpi scripts, so you need to set up the keys to both peers, exchange the public keys, and create the configuration file.
User avatar
Joulinar
Posts: 2597
Joined: Sat Nov 16, 2019 12:49 am

Re: Torrent downloader with VPN only

Post by Joulinar »

Looks like WIreguard delivered by the docker image is a server according the configuration. But you would need to have a client to be able to connect to your VPS Wireguard server.

More easier to install wireguard and transmission directly. The docker image make thinks more complicate. I don't see any benefit on using docker in this case.

First start and complete your wireguard installation on your VPS. Once you have created the client configurations files on VPS side, you can install wireguard client on DietPi and transfer the client file. A small how-to is available on our online docs https://dietpi.com/docs/software/vpn/#w ... modern-vpn

Once wireguard is working you can start with transmission
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
przemko
Posts: 88
Joined: Sun Mar 15, 2020 5:40 pm

Re: Torrent downloader with VPN only

Post by przemko »

Looks like WIreguard delivered by the docker image is a server according the configuration. But you would need to have a client to be able to connect to your VPS Wireguard server.

More easier to install wireguard and transmission directly. The docker image make thinks more complicate. I don't see any benefit on using docker in this case.

First start and complete your wireguard installation on your VPS. Once you have created the client configurations files on VPS side, you can install wireguard client on DietPi and transfer the client file. A small how-to is available on our online docs https://dietpi.com/docs/software/vpn/#w ... modern-vpn

Once wireguard is working you can start with transmission
Hi, I have installed wireguard server on my VPS and I install wireguard and transmission from dietpi-software on my Dietpi local server. But I don't know how to make only transmission from dietpi works with wireguard. I have also nextcloud and emby on dietpi and I don't want then to use wireguard.
I find that tutorial:
https://cowboyprogrammer.org/2019/09/wi ... nsmission/
Will it work as I want?
Regards,
Przemko
User avatar
Joulinar
Posts: 2597
Joined: Sat Nov 16, 2019 12:49 am

Re: Torrent downloader with VPN only

Post by Joulinar »

yeah that could be a way. Basically you would go to bind transmission to the VPN IP.

But @trendy is much more an expert on iptables than I. Probably he has some thought on the config and how it will influence your Nextcloud installation.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
przemko
Posts: 88
Joined: Sun Mar 15, 2020 5:40 pm

Re: Torrent downloader with VPN only

Post by przemko »

Can You tell me few things?
In that tutorial TRANSMISSION CONFIG section there're X.X.X.X and xxxx.xxxx... addreses.
1. What IP I have to put there? My VPS serwer IP [wireguard server]?
2. What peer-port?
In `/etc/systemd/system/transmission-daemon.service` there's `wg-quick@wgtorrents.service` => what is that service? Do I have to make that file with some config or it was created automatically when I installed wireguard on Dietpi?
In WIREGUARD CONFIG section.
1. Is is wireguard client on Dietpi config or on my VPS server?
2. What I need to put here:

Code: Select all

PostUp = systemd-resolve -i %i --set-dns=193.138.218.74 --set-domain=~.; ip rule add from X.X.X.X table 42; ip route add default dev %i table 42; ip -6 rule add from xxxx:xxxx:xxxx:xxxx::xxxx table 42
PostDown = ip rule del from X.X.X.X table 42; ip -6 rule del from xxxx:xxxx:xxxx:xxxx::xxxx table 42
and here:

Code: Select all

Endpoint=se4-wireguard.mullvad.net:51820
AllowedIPs=0.0.0.0/0,::/0
?
Regards Przemko.
User avatar
trendy
Posts: 156
Joined: Tue Feb 25, 2020 2:54 pm

Re: Torrent downloader with VPN only

Post by trendy »

przemko wrote: Sat Nov 21, 2020 12:12 pm 1. What IP I have to put there? My VPS serwer IP [wireguard server]?
The IP of the dietpi.
przemko wrote: Sat Nov 21, 2020 12:12 pm 2. What peer-port?
This is your choice.
przemko wrote: Sat Nov 21, 2020 12:12 pm 1. Is is wireguard client on Dietpi config or on my VPS server?
Dietpi
przemko wrote: Sat Nov 21, 2020 12:12 pm 2. What I need to put here:
Replace the xxx with your tunnel IP.
przemko wrote: Sat Nov 21, 2020 12:12 pm In `/etc/systemd/system/transmission-daemon.service` there's `wg-quick@wgtorrents.service` => what is that service? Do I have to make that file with some config or it was created automatically when I installed wireguard on Dietpi?
I am not so sure about that, maybe you should ask the author.
Joulinar wrote: Fri Nov 20, 2020 11:10 pm But @trendy is much more an expert on iptables than I. Probably he has some thought on the config and how it will influence your Nextcloud installation.
That would be difficult. Outgoing torrent ports are not always fixed. Then one would have to match userid or process id in iptables, but I have never tried it myself.
User avatar
Joulinar
Posts: 2597
Joined: Sat Nov 16, 2019 12:49 am

Re: Torrent downloader with VPN only

Post by Joulinar »

I would try to setup Wireguard connection first before going to integrate transmission
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
przemko
Posts: 88
Joined: Sun Mar 15, 2020 5:40 pm

Re: Torrent downloader with VPN only

Post by przemko »

@trendy , @Joulinar thanks very much. I will try those options and experiment first on my laptop and then on Dietpi if I figure something out.
Regards,
Przemko
User avatar
Joulinar
Posts: 2597
Joined: Sat Nov 16, 2019 12:49 am

Re: Torrent downloader with VPN only

Post by Joulinar »

Usually it's quite simple to configure Wireguard. Keep in mind that you need to configure server side as well as client side.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply