Unable to access qBittorrent WebUI over OpenVPN

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
I have setup a qBittorrent plugin through the native plugin manager on TrueNAS-12.0-U8

OpenVPN has been installed manually through the shell in the qBittorrent jail and is functioning using Cyberghost.

qBittorrent works as expected while on local network. I can connect to the WebUI on both PC and Mobile browsers and the client is able to download torrents correctly.

I am trying to allow myself to connect to qBittorrent WebUI from outside my local network. I have set up the VPN service (OpenVPN) on my Netgear Orbi RBR20 router and this functions perfectly. I can access my router login page, and the internal addresses of Plex and Grafana on my network.

The only page I cannot seem to access is the qBittorrent WebUI and I feel like pulling my hair out. I have tried multiple ports including 32400 which my plex page is running on, so I don't think it can be a blocked port issue. I tried uninstalling the plugin and re-setting everything up to no avail.

I don't have any idea where to go from here, any input would be greatly appreciated.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
It's quite possibly a firewall issue. A normal VPN setup causes VPN clients to be in a different subnet from the main network. If something in either TrueNAS or the plugin is setup to block connections from this different subnet, then that could be your problem.

I would confirm that you can ping both the TrueNAS IP and the plugin IP from the VPN client. This will help you isolate if it's a TrueNAS setting, a plugin setting, or possibly a qBittorrent setting.
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
It's quite possibly a firewall issue. A normal VPN setup causes VPN clients to be in a different subnet from the main network. If something in either TrueNAS or the plugin is setup to block connections from this different subnet, then that could be your problem.

I would confirm that you can ping both the TrueNAS IP and the plugin IP from the VPN client. This will help you isolate if it's a TrueNAS setting, a plugin setting, or possibly a qBittorrent setting.
I tried disabling the firewall within the jail using

Code:
/etc/rc.d/ipfw stop


I then attempted to connect via the external VPN and nothing.

The Orbi VPN connects on a different VLAN for some reason. I have changed the default VLAN of my network to 192.168.111.1, however the VPN connections come in as 192.168.112.### and it doesn't appear there's any way to change this in the Orbi settings which is a somewhat common issue online.

I don't believe it could be a truenas firewall issue as I can connect to my plex config no worries and disabling the firewall within the jail doesn't appear to have any effect.

Can you tell me how to ping the IPs, I'm not super experienced with bash or openvpn
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
I tried reinstalling without the OpenVPN configuration inside the jail and that worked.


So it actually it turns out its a problem with the OpenVPN configuration running inside the jail, it can allow internal connections, but when I attempt to perform a connection from any external source, either through port forwarded external IP address, or through the OpenVPN connection on my router through a quasi-local connection.

How do I allow external connections through so I can access the webUI.
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
I managed to solve this by setting up a redirect to the qBittorrent webUI in an nginx server in another jail and assigning a subdomain to the WebUI.
 

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
I have setup a qBittorrent plugin through the native plugin manager on TrueNAS-12.0-U8

OpenVPN has been installed manually through the shell in the qBittorrent jail and is functioning using Cyberghost.
I am about to go the same way. Can you link to more info to install vpn in the plugin?
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
I am about to go the same way. Can you link to more info to install vpn in the plugin?
Hi Conza,

Here is the guide I followed for OpenVPN configurations in qBittorrent

!!!REGARDLESS OF THE SETUP YOU CHOOSE REBOOT YOUR ENTIRE TRUENAS BOX AFTER ENABLING TUN OR IT WILL NOT WORK!!!


However I found a much better solution. I was only able to achieve speeds of around 8MBps download via OpenVPN as it's a somewhat old protocol and there are better alternatives these days.

Wireguard is a better solution, I was able to achieve speeds around 24MBps (I have gigabit internet) download using this protocol. Support for custom setups with Wireguard is not common and I ended up dropping Cyberghost VPN for Mullvad VPN which does support Wireguard and other useful features. Wireguard is also an easier setup in my opinion.

The guide I followed for this is:

However some adjustments need to be made for qBittorrent (I much prefer qBittorrent to Transmission)

Some adjustments that need to be made from this guide are:
1. Wireguard refused to install for me, instead install:
pkg install wireguard-go wireguard-tools
This is simply the non-kernal version of wireguard that runs as a service

2. I didn't bother with any of the firewall ipfw stuff since you can specify all this in the qBittorrent UI

3. Once you get to the configuring Transmission section look here instead

3a. Set Connection>Listening Port to the port you set in Mullvad, by default the wireguard port is 51820

3b. Advanced>qBittorrent Section>Interface
Set interface to wg0, this ensures all traffic travels only through wireguard and not any unsecured interfaces

Good luck! Let me know if you face any issues, I only just finally got all this working today, it's been a frustrating few weeks, but now I have that sweet sweet bandwidth I'm paying for.
 
Last edited:

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
Legend, thanks.
I have/am paying for Proton VPN elsewhere. I gather I can use that in some capacity?
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
Legend, thanks.
I have/am paying for Proton VPN elsewhere. I gather I can use that in some capacity?
Looks like they support custom wireguard Configs


Follow the guide and just get the config info from Proton
 

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
Question with this: where do I pop this? I go to "Shell" ? How to make sure only installing wireguard for the Torrents jail? Not everything?

1. Wireguard refused to install for me, instead install:
pkg install wireguard-go wireguard-tools
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
Question with this: where do I pop this? I go to "Shell" ? How to make sure only installing wireguard for the Torrents jail? Not everything?

1. Wireguard refused to install for me, instead install:
To access the shell for a specific jail you can either open the main shell on the sidebar and type
iocage console [jail name]
Or open the jail's tab, expand the jail you'd like to edit and press the shell button.

You should never do anything in the master shell without very explicitly knowing what you're doing.
 

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
Got that. Thanks again.
OOF, rightio - after a false start (not installing the non-kernel version), think I have it all sorted with Proton.

How to triple check? And restarting etc. shouldn't need to do anything again? Wireguard starts up etc.?

In terms of

Get the status of wireguard vpn client​

# wg

I do that, and get interface wg0 e.g. 39123 as a listening port, I should be putting THAT in the 3a. Set Connection>Listening Port section of Bitorrent?
 
Last edited:

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
Got that. Thanks again.
OOF, rightio - after a false start (not installing the non-kernel version), think I have it all sorted with Proton.

How to triple check? And restarting etc. shouldn't need to do anything again? Wireguard starts up etc.?
Install wget
pkg install wget
Check your IP
wget -qO - wtfismyip.com/text
Compare to your external IP as per your router

If the IP's are different you know that the traffic is going through the VPN
 

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
Epic. Different.

(1) I am testing on the shell; not yet tried any torrents or anything... but if connection and that all works / different, so should be fine on qbittorrent plugin?

(2) Had a question above edited as well.

(3) Dumb q - downloading torrent from url; or magnet link - best way? I have access to a private tracker, and want this to count there for uploading.

(4) Also save files to location, I should change? How to access on Truenas? I have permissions enabled on network, so I can transfer files easily but yeah, not setup with jail.

/var/db/qbittorrent/conf/qBittorrent/downloads

1653038688615.png
 
Last edited:

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
1. As long as you've set this up in the same jail as qBittorrent everything should work

2. Dont know what you're asking here

3. I'm not sure your usecase, but I use mine for Plex, the best solution for finding torrents is not to look them up yourself but to instead use Radarr (for Movies), Sonarr (for TV Shows) and Prowlarr (to manage your torrent sources). These do everything automatically and once set up you can connect with something like Overseerr to just search a movie, automatically find a torrent, auto download, auto move to the correct folder for Plex and autorefresh Plex library. It's like magic.

4. For save location, I would recommend you make a new dataset for your downloaded media or if you already have a dataset that's fine. Then go into
Jails -> qBittorrent -> Stop
Jails -> qBittorrent -> Mount Points
point /mnt/[Your System]/[Your Dataset] to /media in your jail (or an alternative location you want to use)
Then restart the jail (you cannot change mount points while the jail is live)

Mount points are how you connect your jail to the outside world, for example for me:

Screenshot_20220520-191809_Brave.jpg


There are plenty of videos and tutorials about mount points out there. I also then have this Media dataset shared as a Samba share so I can access copy movies in from my PC or easily rename files/modify things.

In qBittorrent I then point the downloads to /media/Movies or /media/Downloading

If you have trouble with Radarr/Sonarr or anything, id be happy to jump on discord and help you out, just reply to this and I can sort something out.
 

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
2. In terms of

Get the status of wireguard vpn client

# wg

I do that, and get interface wg0 e.g. 39123 as a listening port, I should be putting THAT in the 3a. Set Connection>Listening Port section of Bitorrent?


3. I also use mine for Plex. Yeaaaah geez, I have basically got my library sorted so not such a need but dang ok. Guide on setting those up anywhere? All in same jail would make sense?


4. "In qBittorrent I then point the downloads to /media/Movies or /media/Downloading"

Is that in Radaar/root/media? (Destination) Or /mnt/Nas/Media (Source)
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
2. In terms of

Get the status of wireguard vpn client

# wg

I do that, and get interface wg0 e.g. 39123 as a listening port, I should be putting THAT in the 3a. Set Connection>Listening Port section of Bitorrent?


3. I also use mine for Plex. Yeaaaah geez, I have basically got my library sorted so not such a need but dang ok. Guide on setting those up anywhere? All in same jail would make sense?


4. "In qBittorrent I then point the downloads to /media/Movies or /media/Downloading"

Is that in Radaar/root/media? (Destination) Or /mnt/Nas/Media (Source)
Listening port is the port you set up with Proton, if that is 39123 then yes, set the listening port to 39123.

3. Radarr and Sonarr are absolutely worth setting up. There are community plugins, in the plugins tab, for both which is how I've set them up, you could set them up in a vanilla jail but it's probably easier with the plugins.

4. This will be different for your setup, I don't know what your ZFS datasets look like. The destination should be /media/[call this folder whatever you want] and the source is one of your datasets. This is quite hard to explain unless you know what I'm talking about. Once again, am happy to discord or something to show you
 

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
Thanks. Been sorted for awhile.
But I looked to upgrade the jail/plugin, and it failed (and looks like I have had to reinstall everything again?). The wireguard / VPN was no longer there, vim, wireguard tools etc.

Will I have to reinstall every time in the shell, I reset the server?
 

MormonBoy

Dabbler
Joined
Mar 17, 2022
Messages
18
Thanks. Been sorted for awhile.
But I looked to upgrade the jail/plugin, and it failed (and looks like I have had to reinstall everything again?). The wireguard / VPN was no longer there, vim, wireguard tools etc.

Will I have to reinstall every time in the shell, I reset the serUI
Updating a plugin removes other packages that you've installed, the config files are still there though, you should just be able to reinstall the packages and restart the jail and everything should work. If you don't want to deal with this issue then install everything in a jail manually and just pkg update/upgrade.
 

Conza

Dabbler
Joined
Mar 4, 2022
Messages
24
Ugh. Don't know why I often get this issue.

One new download stalled. But also 0 Seeds etc. Except it says 100% seeding for all the seeds. No peers essentially either.

Truenas server has been up for 9 days running; no problems. But seems like a day or so, stopped seeding? Had not reset, or tried to upgrade or anything. No power outage.

I can ping, no packet loss, didn't change any interface or settings.

Any ideas? I've tried stopping plugin/jail and resetting system several times. No dice.
 
Top