cross-posted from: https://lemmy.world/post/3754933

While experimenting with ProtonVPN’s Wireguard configs, I realized that my real IPv6 address was leaking while IPv4 was correctly going through the tunnel. How do I prevent this from happening?

I’ve already tried adding ::/0 to the AllowedIPs option and IPv6 is listed as disabled in the NetworkManager profile.

    • empireOfLove@lemmy.one
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      1
      ·
      edit-2
      1 year ago

      Broke: disabling ipv6 because it’s causing security holes with software not originally built for it

      Woke: disabling ipv6 because hex ip strings are too hard to type

    • 3laws@lemmy.world
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      1 year ago

      The whole Silicon Valley, governments and economic infrastructure hangs by a thread made of bootleg shortcuts.

    • dack@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      In this case, disabling IPv6 is actually the right move. If the VPN provider doesn’t support IPv6, then there’s no way to allow to allow IPv6 Internet traffic without causing a leak/VPN bypass. If you block IPv6 via firewall or routing it to a dead-end, it will add delays as things try IPv6, timeout, and fall back to IPv4. If you just remove the IPv6 address from the Internet interface, you have to also make sure it doesn’t get re-added by SLAAC/DHCPv6 or other interface changes (switching wifi networks, etc). As dumb as it seems, disabling IPv6 or switching to a provider that supports it are probably the best options.

      • p1mrx@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        edit-2
        1 year ago

        In this case, disabling IPv6 is actually the right move. If the VPN provider doesn’t support IPv6, then there’s no way to allow to allow IPv6 Internet traffic without causing a leak/VPN bypass.

        The right move for the VPN provider is to support IPv6. The right move for the user is to take their business to a provider that does.

    • Molecular0079@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Haha, yeah that’s what ProtonVPN support recommended to me and I am not sure if I want to disable IPv6 globally like that. I feel (with my inexperienced brain) that there’s gotta be a way to do it on a per connection basis.

    • fuckwit_mcbumcrumble@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Unironically that’s one thing we do to anonymize traffic at work. We could do NAT via IPV6 but what’s the point when IPV4 already helps mask who is doing what in the office.

  • z3bra@lemmy.sdf.org
    link
    fedilink
    arrow-up
    7
    ·
    1 year ago

    IPv4 and IPv6 are two different network stacks. Your IPv4 stack is hidden behind wireguard, but not the IPv6 one.

    The correct way to fix your issue is to setup a second witeguard tunnel for IPv6, and route IPv6 traffic through it.

    • notabot@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      If you disable IPv6 at the kernel level there’s no extra latency as nothing even tries to connect to an IPv6 address. It’s a shame to have to do it, but does fix the issue.

  • Either fix IPv6 in the Wireguard tunnel or, if the tunnel isn’t under your control, set up your firewall to drop all IPv6 traffic directed towards the wider internet. You could also gimp your normal network interface by disabling IPv6 on it if you always have the VPN on anyway.

    Disabling IPv6 system wide will cause all kinds of fun and interesting random failures in tons of applications. You can drop all the routes you want, but I wouldn’t remove the link local addresses or the ::1 address unless you like debugging failed assertions in your system logs.

    • Laser@feddit.de
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      For me, it was rather the opposite: when dropping IPv6 packets, applications would often hang and behave weirdly. Disabling IPv6 completely would mean they’d stop trying to do anything on IPv6 and function well.

      • Dropping all IPv6 packets would cause problems but if you only drop the packets destined for the internet you should be fine, I believe. You may also need to configure your DNS to prefer A records over AAAA, though, but if your VPN only supports IPv4 I assume your VPN’s DNS server doesn’t accept AAAA queries.

  • dr_robot@kbin.social
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Wireguard easily supports dual stack configuration on a single interface, but the VPN server must also have IPv6 enabled. I use AirVPN and I get both IPv6 and IPv4 with a single wireguard tunnel. In addition to the ::/0 route you also need a static IPv6 address for the wireguard interface. This address must be provided to you by ProtonVPN.

    If that’s not possible, the only solution is to entirely disable IPv6.

  • authed@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    1 year ago

    I just disable ipv6 on my router to simply my firewall and such… Won’t use it until necessary

  • wmassingham@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    You can either route IPv6 through the tunnel, or if the tunnel doesn’t support it, you have to block it somehow if you don’t want it going out to the Internet. You can do that by creating a firewall rule to block it on your host or network, or by disabling IPv6 entirely at the host or network level.

    • Molecular0079@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      You can either route IPv6 through the tunnel

      That’s what I am trying to do with the ::/0 option but it doesn’t seem to work. I am guessing because the tunnel itself doesn’t have IPv6?

      • Max-P@lemmy.max-p.me
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Add a dummy IPv6 on the WireGuard interface, like a completely random fd00::/128 address on it so it thinks it’s IPv6 enabled. It’ll then just go nowhere as the remote end won’t accept it. You can then drop it at the firewall level before it goes into the tunnel to save some bandwidth.

  • Presi300@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Just disable IPv6, if you don’t wanna, try a configuration tool like PiVPN, which can setup wireguard automatically

      • sounddrill@lemmy.antemeridiem.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        We’re not talking about privacy in that context here

        We’re trying to patch a leaking ipv6 which I gave my solution to.

        Don’t use it if you don’t like it lmao

        • zwekihoyy@lemmy.ml
          link
          fedilink
          arrow-up
          0
          arrow-down
          1
          ·
          1 year ago

          I suppose but my point was that rooting your device decreases security immensely via crippling the android security model.