zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
850 stars 46 forks source link

[BUG] - No IPv6 connectivity when using IPv4-only public network #346

Open Zaczero opened 1 month ago

Zaczero commented 1 month ago

Describe the bug

My WireGuard network is configured with IPv6 address ranges. When I connect to a Wi-Fi network that provides only IPv4 connectivity, I am unable to reach the VPN's private IPs. My WG network does not have any IPv4 addresses configured. On my Linux desktop, there are no issues with that configuration, and IPv6 over IPv4 works seamlessly.

Without restarting the app, if I switch to an IPv6-enabled network, I can access the internal network. However, when I switch back to the IPv4-only network, I can temporarily still reach some internal websites (likely due to keepalive) and even refresh them, but eventually, a connection error occurs.

Smartphone (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Configure IPv6 WG network
  2. Connect to IPv4-only public network
  3. Attempt to communicate with an WG internal device
  4. See connection error (ERR_CONNECTION_REFUSED on Chromium)

Expected behavior

IPv6 works over IPv4 only public networks.

Additional context

wg_tunnel_logs-1725901952.txt

Zaczero commented 1 week ago

Turns out for the IPv6 DNS to work, I had to add 2000::/128 address to server's addresses list: https://android.stackexchange.com/a/257790

Pretty weird but now everything works as expected. Perhaps we could improve user experience by showing a small alert or adding this address automatically. It seems to be a crucial part of having a working IPv6 VPN.

To clarify: the server doesn't actually need to configure that IP, it's only a client-sided change.