MarkusMcNugen / docker-qBittorrentvpn

Docker container which runs a headless qBittorrent client with WebUI and optional OpenVPN
https://hub.docker.com/r/markusmcnugen/qbittorrentvpn/
GNU General Public License v3.0
175 stars 93 forks source link

WebUI Only Works if VPN is Disabled #112

Closed YabaiKai closed 2 years ago

YabaiKai commented 2 years ago

Hi Everyone,

I'm usually one to troubleshoot my own problems, but I've been plugging at this to no avail for many nights now. Only if I start the container with VPN_ENABLED set to "no" can I access the WebUI. I figure this must be a problem with the OpenVPN part of the container, but I just don't even know where to start. Only thing I can figure is that it is a problem with iptables.

For what it's worth, I've tried several other configurations and had similar issues:

Here's my docker-compose:

services:
  qbittorrent:
    container_name: qBittorrentVPN
    volumes:
      - "/volume1/Docker/qBittorrentVPN/downloads:/downloads"
      - "/volume1/Docker/qBittorrentVPN/config:/config"
    environment:
      - VPN_ENABLED=yes
      - VPN_USERNAME=<username>
      - VPN_PASSWORD=<password>
      - "LAN_NETWORK=192.168.1.102/24"
      - "NAME_SERVERS=8.8.8.8,8.8.4.4"
    ports:
      - 8080:8080
      - 8999:8999
      - 8999:8999/udp
    cap_add:
      - NET_ADMIN
    devices:
      - "/dev/net/tun:/dev/net/tun"
    privileged: true
    image: markusmcnugen/qbittorrentvpn:latest

And attached is my log file. I see nothing all that fishy, though I do notice that in the iptables it mentions "192.168.1.0/24" instead of my LAN_NETWORK setting, "192.168.1.102". But further up you can see that it is loading in the LAN_NETWORK env variable correctly.

qBittorrentVPN Log File.txt

Help me GitHub community, you're my only hope!

YabaiKai commented 2 years ago

I did read through all the other issues, open and closed. I see a few others saying the same as me, but it seems they were all using some VPS service. Rest assured, this is a purely local NAS setup.

YabaiKai commented 2 years ago

In case anyone finds this later on, I figured out my problem. In my docker-compose I had used my full IP "192.168.1.102/24", as I thought this meant that only the first three octets were relevant. Turns out, that you need to set the last octet to "0" or it won't work. So, even though my server is located at 192.168.1.102, I needed to set the LAN_NETWORK variable to "192.168.1.0/24".

Good luck all!