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.
https://hub.docker.com/r/qmcgaw/gluetun
MIT License
6.71k stars 331 forks source link

Bug: torrenting slow with almost no peer #2219

Open flemur opened 2 months ago

flemur commented 2 months ago

Is this urgent?

None

Host OS

Ubuntu server 22.04

CPU arch

x86_64

VPN service provider

NordVPN

What are you using to run the container

docker-compose

What is the version of Gluetun

Running version latest built on 2024-04-02T14:51:42.917Z (commit 9821007)

What's the problem 🤔

I recently moved from a VMware host with Ubuntu guest with Docker inside of that, running Gluetun/qBittorrent. Worked great. Never had a bit of issue. Moved that onto a physical Ubuntu host, running Docker with Gluetun/qBittorrent and it hasn't worked right since, even after rebuilding/redoing the config a few times.

Torrents will not connect. At most, I'm seeing 1-2 peers connecting, even on trackers such as the Ubuntu ISOs. If I try the same VPN and qBit on another machine, it works great. It's just Gluetun on this one docker host. Even on the other docker host, it worked fine. I'm getting low-to-no connections, occasional firewall errors, and a top speed of 50kb/s. If I go back to the old vmware/docker/gluetun situation, it gets hundreds of connections and a top speed of about 5mb/s. If I try from the docker host using the native NordVPN client and qBit, it has normal connections/speed, so it doesn't appear to be a problem with the host.

Share your logs (at least 10 lines)

2024-04-11T19:07:00Z INFO [routing] default route found: interface eth0, gateway 172.17.0.1, assigned IP 172.17.0.2 and family v4
2024-04-11T19:07:00Z INFO [routing] adding route for 0.0.0.0/0
2024-04-11T19:07:00Z INFO [firewall] setting allowed subnets...
2024-04-11T19:07:00Z INFO [routing] default route found: interface eth0, gateway 172.17.0.1, assigned IP 172.17.0.2 and family v4
2024-04-11T19:07:00Z INFO [dns] using plaintext DNS at address 1.1.1.1
2024-04-11T19:07:00Z INFO [http server] http server listening on [::]:8000
2024-04-11T19:07:00Z INFO [healthcheck] listening on 127.0.0.1:9999
2024-04-11T19:07:00Z INFO [firewall] allowing VPN connection...
2024-04-11T19:07:00Z INFO [wireguard] Using userspace implementation since Kernel support does not exist
2024-04-11T19:07:00Z INFO [wireguard] Connecting to 185.153.179.144:51820
2024-04-11T19:07:00Z 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-04-11T19:07:00Z INFO [dns] downloading DNS over TLS cryptographic files
2024-04-11T19:07:01Z INFO [dns] downloading hostnames and IP block lists
2024-04-11T19:07:01Z INFO [dns] init module 0: validator
2024-04-11T19:07:01Z INFO [dns] init module 1: iterator
2024-04-11T19:07:01Z INFO [dns] start of service (unbound 1.19.3).
2024-04-11T19:07:01Z INFO [healthcheck] healthy!
2024-04-11T19:07:01Z INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2024-04-11T19:07:01Z INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2024-04-11T19:07:02Z INFO [dns] ready
2024-04-11T19:07:02Z INFO [ip getter] Public IP address is 176.100.43.135 (Canada, British Columbia, Vancouver)
2024-04-11T19:07:03Z INFO [vpn] You are running 3 commits behind the most recent latest

Share your configuration

gluetun:
  image: qmcgaw/gluetun:latest
  container_name: gluetun
  network_mode: bridge
  restart: always
  devices:
  - /dev/net/tun:/dev/net/tun
  security_opt:
  - no-new-privileges=true
  ports:
  - 192.168.1.6:8081:8081 #qbit
  - 6881:6881 #qbit
  - 6881:6881/udp #qbit
  environment:
  - PUID=1000
  - PGID=1000
  - VPN_SERVICE_PROVIDER=nordvpn
  - VPN_TYPE=wireguard
  - WIREGUARD_PRIVATE_KEY=<sekret>
  - SERVER_HOSTNAMES=<tested with various servers in diff countries, all with P2P>
  cap_add:
  - NET_ADMIN
qbittorrent:
  image: linuxserver/qbittorrent:libtorrentv1 #tested this with both "latest" and "libtorrentv1"
  container_name: qbittorrent
  depends_on:
  gluetun:
  condition: service_healthy
  network_mode: service:gluetun
  environment:
  - PUID=1001
  - PGID=1001
  - WEBUI_PORT=8081
  volumes:
  - /docker/qbittorrent/config:/config
  - /docker/qbittorrent/downloads:/downloads
  restart: on-failure:3
github-actions[bot] commented 2 months ago

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

qdm12 commented 2 months ago

Try removing port forwarding with qbittorrent? I believe port 6881 is for torrent port forwarding right? If so, do not use it because it would tell peers to connect to you via your actual public ip (non vpn) on port 6881, which they possibly can't, and you don't have vpn server side port forwarding with NordVPN, so you cannot use port forwarding for torrenting.

ppriorfl commented 2 months ago

I don't believe NordVPN offers port forwarding. So that's likely your problem.

"Unfortunately, at the current moment, we do not offer port forwarding, as multiple customers are using the same servers. You can read more about that in this blog post."

https://support.nordvpn.com/hc/en-us/articles/19483392309649-Does-NordVPN-offer-port-forwarding#:~:text=Unfortunately%2C%20at%20the%20current%20moment,that%20in%20this%20blog%20post