Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Cannot connect to AirVPN - ipv6 error #1648

Closed
uncapped1599 opened this issue Jun 1, 2023 · 6 comments
Closed

Bug: Cannot connect to AirVPN - ipv6 error #1648

uncapped1599 opened this issue Jun 1, 2023 · 6 comments

Comments

@uncapped1599
Copy link

Is this urgent?

Yes

Host OS

Ubuntu 22.04.2 LTS

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 2023-06-01T16:49:06.663Z (commit 943943e)

What's the problem 🤔

I have just decided to migrate my gluetun containers to AirVPN but I simply cannot get the config to work for UK servers. It keeps throwing an ipv6 error, please see logs.

I have tried removing the ipv6 address from the WIREGUARD_ADDRESSES env variable, connecting to an AirVPN server with ipv4 rather than ipv6 as per servers.json - in this case with SERVER_NAMES=Asterion & enabling ipv6 through sysctls. Nothing seems to work. Any ideas what it could be?

Share your logs

2023-06-01T20:28:34.495256666Z ========================================
2023-06-01T20:28:34.495282504Z ========================================
2023-06-01T20:28:34.495285472Z =============== gluetun ================
2023-06-01T20:28:34.495287782Z ========================================
2023-06-01T20:28:34.495290027Z =========== Made with ❤️ by ============
2023-06-01T20:28:34.495292726Z ======= https://github.com/qdm12 =======
2023-06-01T20:28:34.495295008Z ========================================
2023-06-01T20:28:34.495297275Z ========================================
2023-06-01T20:28:34.495299643Z 
2023-06-01T20:28:34.495301973Z Running version latest built on 2023-06-01T16:49:06.663Z (commit 943943e)
2023-06-01T20:28:34.495304317Z 
2023-06-01T20:28:34.495306553Z 🔧 Need help? https://github.com/qdm12/gluetun/discussions/new
2023-06-01T20:28:34.495308932Z 🐛 Bug? https://github.com/qdm12/gluetun/issues/new
2023-06-01T20:28:34.495311229Z ✨ New feature? https://github.com/qdm12/gluetun/issues/new
2023-06-01T20:28:34.495313520Z ☕ Discussion? https://github.com/qdm12/gluetun/discussions/new
2023-06-01T20:28:34.495315867Z 💻 Email? [email protected]
2023-06-01T20:28:34.495318230Z 💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2023-06-01T20:28:34.495739655Z 2023-06-02T00:28:34+04:00 INFO [routing] default route found: interface eth0, gateway 172.19.0.1, assigned IP 172.19.0.3 and family v4
2023-06-01T20:28:34.495760023Z 2023-06-02T00:28:34+04:00 INFO [routing] local ethernet link found: eth0
2023-06-01T20:28:34.495832630Z 2023-06-02T00:28:34+04:00 INFO [routing] local ipnet found: 172.19.0.0/16
2023-06-01T20:28:34.501441753Z 2023-06-02T00:28:34+04:00 INFO [firewall] enabling...
2023-06-01T20:28:34.513223779Z 2023-06-02T00:28:34+04:00 INFO [firewall] enabled successfully
2023-06-01T20:28:34.726315113Z 2023-06-02T00:28:34+04:00 INFO [storage] merging by most recent 13056 hardcoded servers and 13056 servers read from /gluetun/servers.json
2023-06-01T20:28:34.777804489Z 2023-06-02T00:28:34+04:00 ERROR VPN settings: Wireguard settings: interface address is IPv6 but IPv6 is not supported: address fd7d:76ee:e68f:a993:6f83:61c4:262:1f7d/128
2023-06-01T20:28:34.777821913Z 2023-06-02T00:28:34+04:00 INFO Shutdown successful

Share your configuration

version: "2.1"
services:
    gluetun:
        image: qmcgaw/gluetun
        container_name: gluetun
        restart: unless-stopped
        cap_add:
          - NET_ADMIN
          - SYS_MODULE
        volumes:
            - ${CONFIG}/gluetun:/gluetun
            - /lib/modules:/lib/modules
        environment:
            - PUID=${PUID}
            - PGID=${PGID}
            - TZ=${TZ}
            # For Wireguard
            - WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE}
            - WIREGUARD_ADDRESSES=10.xx.xxx.xxx/32
            #Also tried original as provided by AirVPN config
          # - WIREGUARD_ADDRESSES=10.xx.xxx.xxx/32, fd7d:xxx:xxxx:xxxx:xxxx:xxxx:xxx:xxxx/128
            - WIREGUARD_PRESHARED_KEY=${WIREGUARD_PRESHARED}
            - VPN_TYPE=wireguard
            - VPN_SERVICE_PROVIDER=airvpn
            - FIREWALL_VPN_INPUT_PORTS=${FIREWALL_INPUT_PORTS}
            - SERVER_NAMES=Asterion
           # Also tried with cities:
        #   - SERVER_CITIES=London
        ports:
            .....
@qdm12
Copy link
Owner

qdm12 commented Jun 2, 2023

fd7d:76ee:e68f:a993:6f83:61c4:262:1f7d/128 staying around is probably just a configuration error on your end, try to stop and completely remove gluetun, since it might be using the older docker-compose.yml environment variables.

Now you don't NEED to have ipv6 enabled, but if you want to, you can check it's enabled with a container by running:

docker run -it --rm alpine:3.18 ip -6 route

That is more or less how Gluetun checks for IPv6 support.

@uncapped1599
Copy link
Author

Thanks so much for the quick response. You were right and my apologies for the obvious mistake.

Completely removing the container config directory after bringing down the containers has fixed the issue.

While I have your attention, this is the most invaluable container for my entire setup. Thanks so much for all the amazing work on this!

@qriff
Copy link

qriff commented Jun 2, 2023

However when intending to use container network stack sharing, this test seems to also falsely detect lack of IPv6 support when intending to use IPv6 only with Wireguard.

Like in original example appending a IPv6 address to container (tun0) without IPv6 (ethX) fails.

https://docs.docker.com/engine/reference/run/#network-settings
https://stackoverflow.com/questions/55399695/attaching-a-docker-container-to-another-containers-network-with-net-container

@qdm12
Copy link
Owner

qdm12 commented Jun 4, 2023

@uncapped1599 Awesome and thanks 💯

@qriff can you mention in more details this in #1563 and answer:

  1. Do you think there would be a more reliable way to detect IPv6? One could try creating an unattached ipv6 link and see if it works I guess?
  2. If not, we can go ahead and add an optional env variable to enable/disable IPv6 (defaulting to auto).

Closing this since it's resolved and this is going a bit out of topic

@axzxc1236
Copy link

For others wondering how to enable IPv6 with gluetun:

Caultion: IPv6 is experimental in docker and I can't gurantee privacy and security, I am not a docker expert, very far from being one.

  1. Add settings to /etc/docker/daemon.json (If the file doesn't exist, create it)
{
  "ipv6": true,
  "fixed-cidr-v6": "fd00::/80",
  "experimental": true,
  "ip6tables": true
}

(basically https://docs.docker.com/config/daemon/ipv6/#use-ipv6-for-the-default-bridge-network but replaced IP range with unique local address)

  1. sudo systemctl restart docker

  2. Edit docker-compose.yml file, add "sysctls" section and modify WIREGUARD_ADDRESSES to have both IPv4 and IPv6 address, so it becomes:

services:
  gluetun:
    image: qmcgaw/gluetun
    cap_add:
      ........
    environment:
      ........
    ports:
      .......
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0

(reference: dperson/openvpn-client#75 (comment))

  1. Run the docker compose file (preferably without running torrent client for testing purpose) and try to run a command that gets you your public IPv6 address, e.g. curl api6.ipify.org.

  2. Put your public IPv6 address on to https://ipleak.net, if you success it will say your IP is AirVPN exit node. (on AirVPN website if you click "Your IP:" section it redirects you to this website and that why I mention it here)

Screenshot_20230626_194654

@qdm12
Copy link
Owner

qdm12 commented Jul 6, 2023

@axzxc1236 this is awesome, thanks for sharing? Would you mind perhaps opening a pull request on https://github.com/qdm12/gluetun-wiki and create a setup/advanced/ipv6.md page with that content? Thanks 👍 Even just the text is fine, and reference this issue, I can take care of picking it up and add the image too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants