qdm12 / gluetun

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.

Home Page:https://hub.docker.com/r/qmcgaw/gluetun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Using qBittorrent with GlueTun v3.38.0 results in very low upload speeds and low ratio ( mostly 0 )

schweppes-0x opened this issue Β· comments

Is this urgent?

None

Host OS

DSM 7.2.1

CPU arch

x86_64

VPN service provider

NordVPN

What are you using to run the container

Portainer

What is the version of Gluetun

Running version v3.38.0 built on 2023-03-25 (commit b3ceece)

What's the problem πŸ€”

I have tried setting up qBittorrent to use gluetun + wireguard + nordvpn. Seems like gluetun succesfully connects to the VPN and is working well. However whenever I download something with qBittorrent, the uploading speed seems way too slow. It reaches 50Kb/s and goes down to 0 again. The ration stays mostly around 0 (max i have seen it get was 0.17). The download speeds also have declined form 1Gb/s to around 40Mb/s (not MB). There has to be an issue with how the port is forwarded on gluetun. I hope you can help me figure it out. The port i use in qbit for incoming connections is 6881

Share your logs (at least 10 lines)

|       β”œβ”€β”€ Unbound settings:
|       |   β”œβ”€β”€ Authoritative servers:
|       |   |   └── cloudflare
|       |   β”œβ”€β”€ Caching: yes
|       |   β”œβ”€β”€ IPv6: no
|       |   β”œβ”€β”€ Verbosity level: 1
|       |   β”œβ”€β”€ Verbosity details level: 0
|       |   β”œβ”€β”€ Validation log level: 0
|       |   β”œβ”€β”€ System user: root
|       |   └── Allowed networks:
|       |       β”œβ”€β”€ 0.0.0.0/0
|       |       └── ::/0
|       └── DNS filtering settings:
|           β”œβ”€β”€ Block malicious: yes
|           β”œβ”€β”€ Block ads: no
|           β”œβ”€β”€ Block surveillance: no
|           └── Blocked IP networks:
|               β”œβ”€β”€ 127.0.0.1/8
|               β”œβ”€β”€ 10.0.0.0/8
|               β”œβ”€β”€ 172.16.0.0/12
|               β”œβ”€β”€ 192.168.0.0/16
|               β”œβ”€β”€ 169.254.0.0/16
|               β”œβ”€β”€ ::1/128
|               β”œβ”€β”€ fc00::/7
|               β”œβ”€β”€ fe80::/10
|               β”œβ”€β”€ ::ffff:127.0.0.1/104
|               β”œβ”€β”€ ::ffff:10.0.0.0/104
|               β”œβ”€β”€ ::ffff:169.254.0.0/112
|               β”œβ”€β”€ ::ffff:172.16.0.0/108
|               └── ::ffff:192.168.0.0/112
β”œβ”€β”€ Firewall settings:
|   β”œβ”€β”€ Enabled: yes
|   β”œβ”€β”€ VPN input ports:
|   |   β”œβ”€β”€ 1194
|   |   └── 443
|   └── Outbound subnets:
|       β”œβ”€β”€ 172.20.0.0/16
|       └── 192.168.0.0/24
β”œβ”€β”€ Log settings:
|   └── Log level: info
β”œβ”€β”€ Health settings:
|   β”œβ”€β”€ Server listening address: 127.0.0.1:9999
|   β”œβ”€β”€ Target address: cloudflare.com:443
|   β”œβ”€β”€ Duration to wait after success: 5s
|   β”œβ”€β”€ Read header timeout: 100ms
|   β”œβ”€β”€ Read timeout: 500ms
|   └── VPN wait durations:
|       β”œβ”€β”€ Initial duration: 6s
|       └── Additional duration: 5s
β”œβ”€β”€ Shadowsocks server settings:
|   └── Enabled: no
β”œβ”€β”€ HTTP proxy settings:
|   └── Enabled: no
β”œβ”€β”€ Control server settings:
|   β”œβ”€β”€ Listening address: :8000
|   └── Logging: yes
β”œβ”€β”€ OS Alpine settings:
|   β”œβ”€β”€ Process UID: 1026
|   β”œβ”€β”€ Process GID: 65536
|   └── Timezone: Europe/Amsterdam
β”œβ”€β”€ Public IP settings:
|   β”œβ”€β”€ Fetching: every 12h0m0s
|   β”œβ”€β”€ IP file path: /tmp/gluetun/ip
|   └── Public IP data API: ipinfo
β”œβ”€β”€ Server data updater settings:
|   β”œβ”€β”€ Update period: 24h0m0s
|   β”œβ”€β”€ DNS address: 1.1.1.1:53
|   β”œβ”€β”€ Minimum ratio: 0.8
|   └── Providers to update: nordvpn
└── Version settings:
    └── Enabled: yes
2024-06-12T17:50:03+02:00 INFO [routing] default route found: interface eth0, gateway 172.20.0.1, assigned IP 172.20.0.2 and family v4
2024-06-12T17:50:03+02:00 INFO [routing] adding route for 0.0.0.0/0
2024-06-12T17:50:03+02:00 INFO [firewall] setting allowed subnets...
2024-06-12T17:50:03+02:00 INFO [routing] default route found: interface eth0, gateway 172.20.0.1, assigned IP 172.20.0.2 and family v4
2024-06-12T17:50:03+02:00 INFO [routing] adding route for 172.20.0.0/16
2024-06-12T17:50:03+02:00 INFO [routing] adding route for 192.168.0.0/24
2024-06-12T17:50:03+02:00 INFO [dns] using plaintext DNS at address 1.1.1.1
2024-06-12T17:50:03+02:00 INFO [http server] http server listening on [::]:8000
2024-06-12T17:50:03+02:00 INFO [healthcheck] listening on 127.0.0.1:9999
2024-06-12T17:50:03+02:00 INFO [firewall] allowing VPN connection...
2024-06-12T17:50:03+02:00 INFO [wireguard] Using available kernelspace implementation
2024-06-12T17:50:03+02:00 INFO [wireguard] Connecting to [REDACTED_IP]:51820
2024-06-12T17:50:03+02:00 INFO [wireguard] Wireguard setup is complete. Note Wireguard is a silent protocol and it may or may not work, without giving any error message. Typically i/o timeout errors indicate the Wireguard connection is not working.
2024-06-12T17:50:03+02:00 INFO [healthcheck] healthy!
2024-06-12T17:50:03+02:00 INFO [firewall] setting allowed input port 1194 through interface tun0...
2024-06-12T17:50:03+02:00 INFO [firewall] setting allowed input port 443 through interface tun0...
2024-06-12T17:50:03+02:00 INFO [dns] downloading DNS over TLS cryptographic files
2024-06-12T17:50:04+02:00 INFO [dns] downloading hostnames and IP block lists
2024-06-12T17:50:14+02:00 INFO [dns] init module 0: validator
2024-06-12T17:50:14+02:00 INFO [dns] init module 1: iterator
2024-06-12T17:50:14+02:00 INFO [dns] start of service (unbound 1.20.0).
2024-06-12T17:50:14+02:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2024-06-12T17:50:14+02:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2024-06-12T17:50:14+02:00 INFO [dns] ready
2024-06-12T17:50:15+02:00 INFO [healthcheck] healthy!
2024-06-12T17:50:15+02:00 INFO [ip getter] Public IP address is [REDACTED_IP] (Netherlands, North Holland, Amsterdam)
2024-06-12T17:50:15+02:00 INFO [vpn] You are running on the bleeding edge of latest!
2024-06-12T18:57:16+02:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2024-06-12T19:59:23+02:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN

Share your configuration

version: '3.9'
services:
 
  gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    network_mode: synobridge
    hostname: gluetun
    cap_add:
      - NET_ADMIN
    devices:
     - /dev/net/tun:/dev/net/tun
    ports:
      - 8888:8888/tcp # HTTP proxy
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
      - 8080:8080 # qbittorrent
      - 6881:6881 # qbittorrent
      - 6881:6881/udp # qbittorrent
    volumes:
      - ${configPath}/gluetun:/gluetun
    environment:
      - PUID=${UID} 
      - PGID=${GID} 
      - TZ=${TZ}
      - VPN_SERVICE_PROVIDER=nordvpn
      - VPN_TYPE=wireguard 
      - WIREGUARD_PRIVATE_KEY=${wireguardPrivateKey}
      - SERVER_COUNTRIES=${VPN_COUNTRIES}
      - FIREWALL_OUTBOUND_SUBNETS=172.20.0.0/16,192.168.0.0/24
      - FIREWALL_VPN_INPUT_PORTS=1194,443
      - UPDATER_PERIOD=24h
    labels:
      - com.centurylinklabs.watchtower.enable=false
    security_opt:
      - no-new-privileges:true
    restart: always
 
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent
    container_name: qbittorrent
    network_mode: service:gluetun
    environment:
      - PUID=${UID}
      - PGID=${GID}
      - TZ=${TZ}
      - VERSION=latest
      - WEBUI_PORT=8080
    volumes:
      - ${configPath}/qbit:/config
      - ${mediaPath}:/media
    depends_on:
      - gluetun
    restart: always

@qdm12 is more or less the only maintainer of this project and works on it in his free time.
Please:

I have tried setting up qBittorrent to use gluetun + wireguard + nordvpn.

There has to be an issue with how the port is forwarded on gluetun. I hope you can help me figure it out. The port i use in qbit for incoming connections is 6881

Looks like NordVPN does not support port forwarding:
https://nordvpn.com/blog/port-forwarding/

While NordVPN does not support port forwarding, it’s worth learning what it is and why it’s sometimes used.

I also do not see anything in your log about a port being forwarded

I would add 6881 to FIREWALL_VPN_INPUT_PORTS, not sure it would make a difference.

As @raph521 said (thanks πŸŽ–οΈ) you cannot use port forwarding, so disable it in qbittorrent, and no point setting FIREWALL_VPN_INPUT_PORTS (except opening a security hole for no reason).

The download speeds also have declined form 1Gb/s to around 40Mb/s (not MB).

What are you comparing it with? What's downloading at 1Gb/s?