Skip to content

Bug: AirVPN Wireguard Port Forwarding Not Working #3003

@keyman015

Description

@keyman015

Is this urgent?

No

Host OS

TrueNAS

CPU arch

x86_64

VPN service provider

AirVPN

What are you using to run the container

docker-compose

What is the version of Gluetun

Running version v3.40.3 built on 2025-11-18T21:59:50.593Z (commit 01e9274)

What's the problem 🤔

After finding out that OpenVPN isnt multi-threaded, I wanted to move to Wireguard; but the change wasn't as simple as I thought. On Wireguard it no longer port forwards properly at all and I cant figure out what I'm doing wrong.

Now everything was working perfectly fine on OpenVPN, and when I switch back to it (uncomment it in the compose) then it works flawlessly where qBittorrent recognises the open port (shows green earth). However on Wireguard it doesn't work at all. While the connection does work and content can be access via the tunnel using Wireguard, torrent is essentially haulted due to the port not functioning.

Yes, I have ensured the wireguard kernal module is loaded; ive also setup a post init command to import it every time to ensure the container has it

This is the AirVPN port info screen:

Image

Yes, this is the same port as FIREWALL_VPN_INPUT_PORTS (and TORRENTING_PORT on qBittorrent)

And then when I try to test the port:
Wireguard:

Image

OpenVPN:

Image (This is only changing the compose to use wireguard, without modifying the port at all or any other setting)

Now the container logs show it failing to connect the first time and then does so successfully after, this happens randomly between startups and isn't a problem for me. (i.e. sometimes it wouldnt have any connection issues at all).

Note: sorry for all the obfuscation, if it poses an issue let me know.

Thanks for the help :)

Share your logs (at least 10 lines)

========================================
========================================
=============== gluetun ================
========================================
=========== Made with ❤️ by ============
======= https://github.com/qdm12 =======
========================================
========================================
Running version v3.40.3 built on 2025-11-18T21:59:50.593Z (commit 01e9274)
🔧 Need help? ☕ Discussion? https://github.com/qdm12/gluetun/discussions/new/choose
🐛 Bug? ✨ New feature? https://github.com/qdm12/gluetun/issues/new/choose
💻 Email? [email protected]
💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2025-11-22T12:51:14+08:00 INFO [routing] default route found: interface eth0, gateway 172.16.7.1, assigned IP 172.16.7.2 and family v4
2025-11-22T12:51:14+08:00 INFO [routing] local ethernet link found: eth0
2025-11-22T12:51:14+08:00 INFO [routing] local ipnet found: 172.16.7.0/24
2025-11-22T12:51:14+08:00 INFO [firewall] enabling...
2025-11-22T12:51:15+08:00 INFO [firewall] enabled successfully
2025-11-22T12:51:15+08:00 INFO [storage] merging by most recent 21098 hardcoded servers and 21098 servers read from /gluetun/servers.json
2025-11-22T12:51:15+08:00 INFO Alpine version: 3.20.8
2025-11-22T12:51:15+08:00 INFO OpenVPN 2.5 version: 2.5.10
2025-11-22T12:51:15+08:00 INFO OpenVPN 2.6 version: 2.6.11
2025-11-22T12:51:15+08:00 INFO IPtables version: v1.8.10
2025-11-22T12:51:15+08:00 INFO Settings summary:
├── VPN settings:
|   ├── VPN provider settings:
|   |   ├── Name: airvpn
|   |   └── Server selection settings:
|   |       ├── VPN type: wireguard
|   |       ├── Countries: XXXX
|   |       └── Wireguard selection settings:
|   |           └── Server public key: XXXX
|   └── Wireguard settings:
|       ├── Private key: KE4...n4=
|       ├── Pre-shared key: NDC.../0=
|       ├── Interface addresses:
|       |   └── XXXX
|       ├── Allowed IPs:
|       |   ├── 0.0.0.0/0
|       |   └── ::/0
|       └── Network interface: tun0
|           └── MTU: 1320
├── DNS settings:
|   ├── Keep existing nameserver(s): no
|   ├── DNS server address to use: 127.0.0.1
|   └── DNS over TLS settings:
|       ├── Enabled: yes
|       ├── Update period: every 24h0m0s
|       ├── Upstream resolvers:
|       |   └── google
|       ├── Caching: yes
|       ├── IPv6: no
|       └── DNS filtering settings:
|           ├── Block malicious: no
|           ├── Block ads: no
|           ├── Block surveillance: no
|           ├── Allowed hosts:
|           |   ├── XXXX
|           |   ├── XXXX
|           |   └── XXXX
|           └── 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:
|       └── XXXX (does show correct port)
├── 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: yes
|   ├── Listening address: :8888
|   ├── User: 
|   ├── Password: [not set]
|   ├── Stealth mode: yes
|   ├── Log: no
|   ├── Read header timeout: 1s
|   └── Read timeout: 3s
├── Control server settings:
|   ├── Listening address: :8000
|   ├── Logging: yes
|   └── Authentication file path: /gluetun/auth/config.toml
├── Storage settings:
|   └── Filepath: /gluetun/servers.json
├── OS Alpine settings:
|   ├── Process UID: 568
|   ├── Process GID: 568
|   └── Timezone: XXXX
├── Public IP settings:
|   ├── IP file path: /tmp/gluetun/ip
|   ├── Public IP data base API: ipinfo
|   └── Public IP data backup APIs:
|       ├── ifconfigco
|       ├── ip2location
|       └── cloudflare
└── Version settings:
    └── Enabled: yes
2025-11-22T12:51:15+08:00 INFO [routing] default route found: interface eth0, gateway 172.16.7.1, assigned IP 172.16.7.2 and family v4
2025-11-22T12:51:15+08:00 INFO [routing] adding route for 0.0.0.0/0
2025-11-22T12:51:15+08:00 INFO [firewall] setting allowed subnets...
2025-11-22T12:51:15+08:00 INFO [routing] default route found: interface eth0, gateway 172.16.7.1, assigned IP 172.16.7.2 and family v4
2025-11-22T12:51:15+08:00 INFO TUN device is not available: open /dev/net/tun: no such file or directory; creating it...
2025-11-22T12:51:15+08:00 INFO [dns] using plaintext DNS at address 8.8.8.8
2025-11-22T12:51:15+08:00 INFO [http proxy] listening on :8888
2025-11-22T12:51:15+08:00 INFO [http server] http server listening on [::]:8000
2025-11-22T12:51:15+08:00 INFO [healthcheck] listening on 127.0.0.1:9999
2025-11-22T12:51:15+08:00 INFO [firewall] allowing VPN connection...
2025-11-22T12:51:15+08:00 INFO [wireguard] Using available kernelspace implementation
2025-11-22T12:51:15+08:00 INFO [wireguard] Connecting to XXXX:XXXX
2025-11-22T12:51:15+08: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.
2025-11-22T12:51:15+08:00 INFO [firewall] setting allowed input port XXXX through interface tun0...
2025-11-22T12:51:15+08:00 INFO [dns] downloading hostnames and IP block lists
2025-11-22T12:51:15+08:00 INFO [dns] DNS server listening on [::]:53
2025-11-22T12:51:21+08:00 WARN [dns] dialing tls server for request IN A github.com.: dial tcp 8.8.4.4:853: i/o timeout
2025-11-22T12:51:21+08:00 WARN [dns] dialing tls server for request IN AAAA github.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:25+08:00 WARN [dns] dialing tls server for request IN A dht.transmissionbt.com.: dial tcp 8.8.4.4:853: i/o timeout
2025-11-22T12:51:25+08:00 WARN [dns] dialing tls server for request IN AAAA dht.transmissionbt.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:25+08:00 WARN [dns] dialing tls server for request IN A cloudflare.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:26+08:00 WARN [dns] dialing tls server for request IN AAAA github.com.: dial tcp 8.8.4.4:853: i/o timeout
2025-11-22T12:51:26+08:00 WARN [dns] dialing tls server for request IN A github.com.: dial tcp 8.8.4.4:853: i/o timeout
2025-11-22T12:51:27+08:00 WARN [dns] dialing tls server for request IN AAAA dht.transmissionbt.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:27+08:00 WARN [dns] dialing tls server for request IN A dht.transmissionbt.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:30+08:00 WARN [dns] dialing tls server for request IN A router.bittorrent.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:30+08:00 WARN [dns] dialing tls server for request IN AAAA dht.transmissionbt.com.: dial tcp 8.8.4.4:853: i/o timeout
2025-11-22T12:51:30+08:00 WARN [dns] dialing tls server for request IN AAAA router.bittorrent.com.: dial tcp 8.8.4.4:853: i/o timeout
2025-11-22T12:51:30+08:00 WARN [dns] dialing tls server for request IN A dht.transmissionbt.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:30+08:00 INFO [healthcheck] program has been unhealthy for 6s: restarting VPN (healthcheck error: dialing: dial tcp4: lookup cloudflare.com: i/o timeout)
2025-11-22T12:51:30+08:00 INFO [healthcheck] 👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md
2025-11-22T12:51:30+08:00 INFO [healthcheck] DO NOT OPEN AN ISSUE UNLESS YOU READ AND TRIED EACH POSSIBLE SOLUTION
2025-11-22T12:51:30+08:00 INFO [vpn] stopping
2025-11-22T12:51:30+08:00 INFO [firewall] removing allowed port XXXX...
2025-11-22T12:51:30+08:00 WARN [dns] dialing tls server for request IN A cloudflare.com.: dial tcp 8.8.4.4:853: i/o timeout
2025-11-22T12:51:30+08:00 ERROR [vpn] getting public IP address information: fetching information: Get "https://ipinfo.io/": context canceled
2025-11-22T12:51:30+08:00 ERROR [vpn] cannot get version information: Get "https://api.github.com/repos/qdm12/gluetun/releases": context canceled
2025-11-22T12:51:31+08:00 INFO [vpn] starting
2025-11-22T12:51:31+08:00 INFO [firewall] allowing VPN connection...
2025-11-22T12:51:31+08:00 INFO [wireguard] Using available kernelspace implementation
2025-11-22T12:51:31+08:00 INFO [wireguard] Connecting to XXXX:XXXX
2025-11-22T12:51:31+08: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.
2025-11-22T12:51:31+08:00 INFO [firewall] setting allowed input port XXXX through interface tun0...
2025-11-22T12:51:31+08:00 WARN [dns] dialing tls server for request IN AAAA github.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:31+08:00 WARN [dns] dialing tls server for request IN A github.com.: dial tcp 8.8.8.8:853: i/o timeout
2025-11-22T12:51:32+08:00 INFO [dns] ready
2025-11-22T12:51:32+08:00 INFO [healthcheck] healthy!
2025-11-22T12:51:32+08:00 INFO [ip getter] Public IP address is XXXX (XXXX - source: ipinfo)

Share your configuration

services:
  gluetun:
    image: qmcgaw/gluetun:v3
    cap_add:
      - NET_ADMIN
    networks:
      - vpn-net
    ports:
      - 8080:8080   # qBittorrent WebUI
      - 8888:8888   # Gluetun Proxy
      - 8191:8191   # other connected container
    volumes:
      - /mnt/SSDs/Apps/Gluetun/Config:/gluetun
    environment:
      - PUID=568
      - PGID=568
      - VPN_SERVICE_PROVIDER=airvpn
      - SERVER_COUNTRIES=XXXX
      - FIREWALL=on
      - FIREWALL_VPN_INPUT_PORTS=XXXX
      - HEALTH_TARGET_ADDRESS=cloudflare.com:443
      - DOT_PROVIDERS=google
      - DOT_IPV6=off
      - BLOCK_MALICIOUS=off
      - BLOCK_ADS=off
      - UNBLOCK=XXXX,XXXX,XXXX
      - UPDATER_VPN_SERVICE_PROVIDERS=airvpn
      - FIREWALL_ENABLED_DISABLING_IT_SHOOTS_YOU_IN_YOUR_FOOT=on
      # - OPENVPN_CLIENTCRT_SECRETFILE=/gluetun/client.crt
      # - OPENVPN_CLIENTKEY_SECRETFILE=/gluetun/client.key
      - VPN_TYPE=wireguard
      - WIREGUARD_PUBLIC_KEY=XXXX
      - WIREGUARD_PRIVATE_KEY=XXXX
      - WIREGUARD_PRESHARED_KEY=XXXX
      - WIREGUARD_ADDRESSES=XXXX
      - WIREGUARD_MTU=1320
      - HTTPPROXY=on
      - HTTPPROXY_STEALTH=on
    restart: unless-stopped
    mem_limit: 725m
    cpus: 4

  qbittorrent:
    image: linuxserver/qbittorrent:latest
    network_mode: "service:gluetun"   # shares Gluetun’s VPN stack
    depends_on:
      - gluetun
    environment:
      - PUID=568
      - PGID=568
      - WEBUI_PORT=8080
      - TORRENTING_PORT=XXXX
      - BIND_TO_INTERFACE=tun0
    volumes:
      - /mnt/SSDs/Apps/qBittorrent/Config:/config
      - /mnt/HDDs/Streaming/Downloads:/data/Downloads
    restart: unless-stopped
    mem_limit: 4048m
    cpus: 6

networks:
  vpn-net:
    external: true

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions