angristan / wireguard-install

WireGuard VPN installer for Linux servers
https://stanislas.blog/2019/01/how-to-setup-vpn-server-wireguard-nat-ipv6/
MIT License
8.12k stars 1.32k forks source link

Prefer IPv6 over IPv4 by default #290

Open ghost opened 2 years ago

ghost commented 2 years ago

Hello team and @angristan ,

I have a Ubuntu 20.04 VPS on AWS Lightsail and I installed wireguard. IPv6 is supported and I can ping IPv6 address. When I access some websites like google.com or youtube.com, IPv4 is preferred by default and I have to pass capthca screen sometimes for security reasons. Some shared public IPv4 address on cloud are blacklisted or suspicious because they are used too much on the cloud.

To overcome this issue I would like to use IPv6 by default and IPv4 as a fallback.

You can see the test results on https://ipv6-test.com/

Thanks

Wireguard is working

Screenshot_20211115-203741_Opera

Wireguard is not working

Screenshot_20211115-222919_Chrome

ghost commented 2 years ago

@angristan Kindly ask your support. Thanks for your hard-working

rootbeerdan commented 2 years ago

I am able to get around this by changing the IPv6 subnet to something outside of the ULA range during setup. Below is what my address looks like in the client:

Address = 10.66.66.2/32,2602:80a:200f::2/128

And you can see that Happy Eyeballs is now enabled:

Happy Eyeballs enabled

This has to do with the use of utilizing IPv6 ULA addressing (fc00::/7), since most OSs will not prioritize ULA unlike regular IP space. In our instance since we own our own IPv6 space, we dedicated a /64 subnet for tunnel use, so we can avoid any conflicts.

If we wanted to follow RFCs, this behavior can't actually change, as everything outside of ULA space is owned by someone else, or has another purpose. I wonder if we can add a note in the script to change the IPv6 to an address you own if you want to use it with Happy Eyeballs.

ghost commented 2 years ago

Thanks @rootbeerdan :)

ghost commented 2 years ago

@angristan @rootbeerdan step 2(b) explains this configuration https://www.digitalocean.com/community/tutorials/how-to-set-up-wireguard-on-ubuntu-20-04

The problem is I created a new VPS with local unique IPv6 and set it up but problem persisted.

After that, I choosed an local IPv6 range 2602:: and problem has been solved.

ghost commented 2 years ago

@rootbeerdan If you open ICMPv6 port on your server, the score will be 19 points.