angristan / wireguard-install

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

IPv6 Capabilities to IPv4 Only Provider? #323

Closed Paffo closed 2 years ago

Paffo commented 2 years ago

Hi, i was wondering if this could be used to add IPv6 Support (via VPS) to a IPv4-only home network.

My VPS has both a Public IPv4 and public IPv6 in the /64 Range. My home network only has IPv4, no IPv6 support. I need to connect to a IPv6-only service, i was wondering if wireguard could be used for this.

I unfortunately have zero knowledge in networking so i'm not sure im explaining myself properly, i want to know if it's possible to create a IPv6 interface on my local machine, channel it's traffic to the VPS via the only available mean (IPv4) and navigate the web via the VPS's IPv6 address.

Thanks

tokon2000 commented 2 years ago

I think this should be possible. I have tested the following:

The website is showing the IPv4 and IPv6 of the wg server. Without the connection to the wg server it is showing only IPv4.

But I don't know if this is a "real" IPv6 connection. Don't know an IPv6 only service.

EDIT Tested again, I can reach ipv6.google.com

Paffo commented 2 years ago

Could you explain how you did it? Because i tried and it doesn't work from the Windows client. I setup wireguard with this script, then created a config and imported it in the windows client. It connects successfully but the client has no internet (either v4 or v6) until i disconnect. forwarding is enabled and ports are allowed in the firewall, so no idea why it does that. Logs show nothing other than successful connection.

pothi commented 2 years ago

It is possible. Unfortunately, I don't have a Windows client. I have a linux client and a Mac client, though. Nevertheless, the pattern must be the same irrespective of the OS.

Please post your own config in order to troubleshoot. You must have a working configuration in order to take advantage of IPv6 via a VPS.

Once you have a working configuration (where "AllowedIPs=vps_ipv4/32", then you can modify it to "AllowedIPs=vps_ipv4/32,::/0" in order to take advantage of IPv6 via the VPS.

tokon2000 commented 2 years ago

I have not tested this with Windows until now. But maybe I can try it later this day.

Paffo commented 2 years ago

It is possible. Unfortunately, I don't have a Windows client. I have a linux client and a Mac client, though. Nevertheless, the pattern must be the same irrespective of the OS.

Please post your own config in order to troubleshoot. You must have a working configuration in order to take advantage of IPv6 via a VPS.

Once you have a working configuration (where "AllowedIPs=vps_ipv4/32", then you can modify it to "AllowedIPs=vps_ipv4/32,::/0" in order to take advantage of IPv6 via the VPS.

[Interface]
PrivateKey = KEY
Address = 10.66.66.2/32, fd42:42:42::2/128
DNS = 94.140.14.14, 94.140.15.15

[Peer]
PublicKey = KEY
PresharedKey = KEY
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = VPS_IP:58570
tokon2000 commented 2 years ago

I have tested a Windows machine now and it works. So no Windows client problem.

Paffo commented 2 years ago

I have tested a Windows machine now and it works. So no Windows client problem.

im trying all combination but unfortunately nothing. It successfully tunnels the IPv4, but IPv6 is always no connection.

My Client Config:

[Interface]
PrivateKey = KEY
Address = 10.66.66.2/32,fd42:42:42::2/128
DNS = 94.140.14.14,94.140.15.15

[Peer]
PublicKey = KEY
PresharedKey = KEY
Endpoint = VPS_Public_IPv6:58570
AllowedIPs = 0.0.0.0/0,::/0

My VPS /etc/wireguard/wg0.conf

[Interface]
Address = 10.66.66.1/24,fd42:42:42::1/64
ListenPort = 58570 (opened and allowed in firewall)
PrivateKey = KEY

### Client MainPC
[Peer]
PublicKey = KEY
PresharedKey = KEY
AllowedIPs = 10.66.66.2/32,fd42:42:42::2/128
Paffo commented 2 years ago

In the end my PC was the problem. Tested the same exact setup on a different PC and it's working perfectly.

Thanks to everyone for the help.