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
8.04k stars 372 forks source link

Help: How can I confirm inter-connectivity between all the containers in Docker Compose #479

Closed nodecentral closed 3 years ago

nodecentral commented 3 years ago

@qdm12 / Quinten

I’m so sorry for all the posts, I’ve been trying for days to get a working set up, but no luck so far.

Is this urgent?: No Host OS (approximate answer is fine too): QNAP Debian CPU arch or device name: amd64 What VPN provider are you using: PUREVPN What is the version of the program 3.18.0 What's the problem

No matter what I try I always seem to have issues getting everything to connect to each other, I have tried a single Docker Compose using gluetun as a service, and I’ve also tried separate docker compose files each using network_mode = container:gluetun - but neither has worked fully, some in part but never all as a whole.

For example i can get things like jackett, sonarr and everything connect, retrieve info from the internet etc, and I can also pass things to qbittorrent but - then qbittorrent just can’t seem to connect to anything. (Nothing is reported as going in or out, and trackers are marked as Not working etc.)

All of this made me wonder if the connectivity is there, so I thought I would have a look at the Docker network which is created by the single Docker compose. Having called the application gluetunvpn123 i was expecting to see all the containers associate listed when I do an inspect , but it does not seem to show any? - any ideas ?

[/] # docker network ls
NETWORK ID     NAME                    DRIVER    SCOPE
72fa1bb3c34d   bridge                  bridge    local
f0a21b92cfab   gluetunvpn123_default   bridge    local
4f9577e56ea5   host                    host      local
a73049c1796b   none                    null      local
12e7591600b5   qnet-dhcp-eth0-6d6da6   qnet      local
44ee9b71d589   qnet-dhcp-eth1-6d6da6   qnet      local
6e3360a4323d   transvpn_default        bridge    local
[/] # docker network inspect gluetunvpn123_default
[
    {
        "Name": "gluetunvpn123_default",
        "Id": "f0a21b92cfab4021ecf1d2463363451a21492dbeec9bcd2b4f9c54e10c69c9ca",
        "Created": "2021-05-31T21:30:55.466617799+01:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.29.4.0/22",
                    "Gateway": "172.29.4.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "1cbf24e7306cf6fc3e4143d1e77eff13ec99ce3f29acd4ca815a13a1728fc94e": {
                "Name": "gluetun",
                "EndpointID": "24e6ae39b957c604e5810b873d6ebc2eaa1525e6a0fc2fd959f0d9803a35253d",
                "MacAddress": "02:42:ac:1d:04:02",
                "IPv4Address": "172.29.4.2/22",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "default",
            "com.docker.compose.project": "gluetunvpn123",
            "com.docker.compose.version": "1.27.4"
        }
    }
]

The docker yml is as follows.

services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    ports:
      - 8000:8000 # Remote Control VPN
      - 8888:8888 # Tinyproxy
      - 9117:9117 # Jackett
      - 6881:6881 # qbittorrent connictivy port
      - 6881:6881/udp # qbittorrent connectivty port
      - 8082:8082 # qbittorrent Admin interface defined via env
      - 89:80/tcp # whoami health api
      - 8989:8989 # sonarr
      - 7878:7878 # radarr
    environment:
      # More variables are available, see the readme table
      - VPNSP=purevpn
      - REGION=North Holland,Flanders
      - COUNTRY=Netherlands,Belgium
      - CITY=Amsterdam,Zaventem
      - SERVER_HOSTNAME=nl2-ovpn-udp.pointtoserver.com,nl2-ovpn-tcp.pointtoserver.com,vlap-th2-ovpn-udp.pointtoserver.com,vleu-be2-ovpn-udp.pointtoserver.com,vleu-be2-ovpn-tcp.pointtoserver.com
      - OPENVPN_USER=purevpn
      - OPENVPN_PASSWORD=Password
      - OPENVPN_CIPHER=aes-256-gcm
      - OPENVPN_VERBOSITY=3
      # Timezone for accurate logs times
      - TZ=Europe/London
      - UMASK_SET=022
    restart: always

  jackett:
    image: ghcr.io/linuxserver/jackett
    container_name: jackett
    environment:
      - PGID=1005
      - PUID=1000
      - TZ=Europe/London
    volumes:
      - /share/Container/jackett/config:/config
    network_mode: 'service:gluetun'
    restart: unless-stopped

  sonarr:
    image: ghcr.io/linuxserver/sonarr
    container_name: sonarr
    environment:
      - PUID=1005
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - /share/Container/sonarr/config:/config
      - /share/Container/vpn/media/downloads:/downloads/
      - /share/Container/vpn/media:/media
      - /share/Container/vpn/media/tv:/tv
    network_mode: "service:gluetun"
    restart: unless-stopped

  radarr:
    image: ghcr.io/linuxserver/radarr
    container_name: radarr
    environment:
      - PUID=1005
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - /share/Container/radarr/config:/config
      - /share/Container/vpn/media:/downloads
      - /share/Container/vpn/media:/media
      - /share/Container/vpn/media/movies:/movies
    network_mode: "service:gluetun"
    restart: unless-stopped

  whoami:
    image: containous/whoami # A container that exposes an API to show its IP address
    container_name: whoami
    environment:
      - PUID=1005
      - PGID=1000
      - TZ=Europe/London
    network_mode: "service:gluetun"
    restart: always

  qbittorrent:
   image: ghcr.io/linuxserver/qbittorrent
   container_name: qbittorrent
   environment:
     - PUID=1005
     - PGID=1000
     - TZ=Europe/London
     - WEBUI_PORT=8082
   volumes:
      - /share/Container/qbittorrent/config:/config
      - /share/Container/vpn/media/downloads:/downloads
    network_mode: "service:gluetun"
    restart: unless-stopped
qdm12 commented 3 years ago

i was expecting to see all the containers associate listed when I do an inspect , but it does not seem to show any?

Expected. All containers using gluetun as their network run within gluetun network-wise, so there is only one host (gluetun). The other are just processes in the gluetun container really (which you won't see either with ps from within gluetun though, because of Docker's isolation).

then qbittorrent just can’t seem to connect to anything

See your issue #472; if this doesn't fix it, if my memory is right, there were also issues due to an update of qbittorrent, so you may want to try another image tag or another torrent client such as deluge.

In the future please open discussions at https://github.com/qdm12/gluetun/discussions for help (I need to update the issue templates as well, so my bad as well!)