Skip to content

Bug: cannot remove allowed input port from firewallΒ #2334

@mjsjml

Description

@mjsjml

Is this urgent?

No

Host OS

Ubuntu 22.04

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 latest built on 2024-06-17T22:37:52.988Z (commit 93ed87d)

What's the problem πŸ€”

When gluetun fails a healthcheck and gets a new vpn connection, it can't resume port forwarding. The desired ports will be closed on the new connection. Things used to work fine with an older version of gluetun (don't know which one).

ERROR [vpn] cannot remove allowed input port from firewall: removing allowed port 63799 on interface tun0: command failed: "ip6tables --delete INPUT -i tun0 -p tcp --dport 63799 -j ACCEPT": ip6tables: Bad rule (does a matching rule exist in that chain?).: exit status 1

Share your logs (at least 10 lines)

2024-06-24T00:21:55.555343458Z 2024-06-23T17:21:55-07:00 INFO [routing] default route found: interface eth0, gateway 172.18.0.1, assigned IP 172.18.0.10 and family v4
2024-06-24T00:21:55.555374628Z 2024-06-23T17:21:55-07:00 INFO [routing] adding route for 0.0.0.0/0
2024-06-24T00:21:55.555422948Z 2024-06-23T17:21:55-07:00 INFO [firewall] setting allowed subnets...
2024-06-24T00:21:55.558813825Z 2024-06-23T17:21:55-07:00 INFO [routing] default route found: interface eth0, gateway 172.18.0.1, assigned IP 172.18.0.10 and family v4
2024-06-24T00:21:55.558863994Z 2024-06-23T17:21:55-07:00 INFO [routing] adding route for 192.168.2.0/24
2024-06-24T00:21:55.558878991Z 2024-06-23T17:21:55-07:00 INFO [routing] adding route for 192.168.3.0/24
2024-06-24T00:21:55.559692529Z 2024-06-23T17:21:55-07:00 INFO [dns] using plaintext DNS at address 1.1.1.1
2024-06-24T00:21:55.560152708Z 2024-06-23T17:21:55-07:00 INFO [http server] http server listening on [::]:8010
2024-06-24T00:21:55.560488916Z 2024-06-23T17:21:55-07:00 INFO [healthcheck] listening on 127.0.0.1:9999
2024-06-24T00:21:55.562187406Z 2024-06-23T17:21:55-07:00 INFO [firewall] allowing VPN connection...
2024-06-24T00:21:55.580117711Z 2024-06-23T17:21:55-07:00 INFO [wireguard] Using userspace implementation since Kernel support does not exist
2024-06-24T00:21:55.741081357Z 2024-06-23T17:21:55-07:00 INFO [wireguard] Connecting to 146.70.76.34:1637
2024-06-24T00:21:55.741603225Z 2024-06-23T17:21:55-07: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-24T00:21:55.741613525Z 2024-06-23T17:21:55-07:00 INFO [firewall] setting allowed input port 63799 through interface tun0...
2024-06-24T00:21:55.752390228Z 2024-06-23T17:21:55-07:00 INFO [firewall] setting allowed input port 15554 through interface tun0...
2024-06-24T00:21:55.755147894Z 2024-06-23T17:21:55-07:00 INFO [dns] downloading DNS over TLS cryptographic files
2024-06-24T00:22:05.757002689Z 2024-06-23T17:22:05-07:00 WARN [dns] cannot update files: Get "https://www.internic.net/domain/named.root": dial tcp: lookup www.internic.net on 1.1.1.1:53: read udp 10.128.195.141:45807->1.1.1.1:53: i/o timeout
2024-06-24T00:22:05.757016849Z 2024-06-23T17:22:05-07:00 INFO [dns] attempting restart in 10s
2024-06-24T00:22:10.743253391Z 2024-06-23T17:22:10-07:00 INFO [healthcheck] program has been unhealthy for 6s: restarting VPN
2024-06-24T00:22:10.743308381Z 2024-06-23T17:22:10-07:00 INFO [healthcheck] πŸ‘‰ See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md
2024-06-24T00:22:10.743323672Z 2024-06-23T17:22:10-07:00 INFO [healthcheck] DO NOT OPEN AN ISSUE UNLESS YOU READ AND TRIED EACH POSSIBLE SOLUTION
2024-06-24T00:22:10.743337244Z 2024-06-23T17:22:10-07:00 INFO [vpn] stopping
2024-06-24T00:22:10.743349214Z 2024-06-23T17:22:10-07:00 INFO [firewall] removing allowed port 63799...
2024-06-24T00:22:10.759074279Z 2024-06-23T17:22:10-07:00 ERROR [vpn] cannot remove allowed input port from firewall: removing allowed port 63799 on interface tun0: command failed: "ip6tables --delete INPUT -i tun0 -p tcp --dport 63799 -j ACCEPT": ip6tables: Bad rule (does a matching rule exist in that chain?).: exit status 1
2024-06-24T00:22:10.759122005Z 2024-06-23T17:22:10-07:00 INFO [firewall] removing allowed port 15554...
2024-06-24T00:22:10.765512870Z 2024-06-23T17:22:10-07:00 ERROR [vpn] cannot remove allowed input port from firewall: removing allowed port 15554 on interface tun0: command failed: "ip6tables --delete INPUT -i tun0 -p tcp --dport 15554 -j ACCEPT": ip6tables: Bad rule (does a matching rule exist in that chain?).: exit status 1

Share your configuration

gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 8888:8888/tcp
      - 8388:8388/tcp
      - 8388:8388/udp
      - 7474:7474
      - "9001:9000"
      - 6885:6881/udp
      - 58080:8080
      - 9005:9005
      - 8005:8005
      - 9091:9091
    volumes:
      - /home/ms/docker/gluetun:/gluetun
    environment:
      - HTTP_CONTROL_SERVER_ADDRESS=:8010 
      - FIREWALL_VPN_INPUT_PORTS=63799,15554
      - VPN_SERVICE_PROVIDER=airvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PUBLIC_KEY=
      - WIREGUARD_PRIVATE_KEY=
      - WIREGUARD_ADDRESSES=
      - WIREGUARD_PRESHARED_KEY=
      - SERVER_NAMES=
      - FIREWALL_OUTBOUND_SUBNETS=192.168.2.0/24,192.168.3.0/24
    restart: unless-stopped

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions