wgtunnel icon indicating copy to clipboard operation
wgtunnel copied to clipboard

[BUG] - The ipv6 domain name cannot connect to the server. I hope it can support the ipv6 domain name. Thank you.

Open snakwu opened this issue 11 months ago • 14 comments

The ipv6 domain name cannot connect to the server. I hope it can support the ipv6 domain name. Thank you.

snakwu avatar Mar 20 '24 15:03 snakwu

Because app only supports the domain name of ipv4, if I use the ipv address, such as “[240e:3b2:xxx:xxx::55]: 51820”, to connect, and if I use the domain name of ipv6 to connect, for example, “xxx.snakwu.com:51820” cannot be connected, I think it should be caused by interpreting the address of ipv6 when using the domain name and not automatically translating and adding the “[]” symbol. Thank you

snakwu avatar Mar 20 '24 16:03 snakwu

I'll look into this!

zaneschepke avatar Mar 21 '24 23:03 zaneschepke

I'll look into this!

I think it should be the address translation of the domain name. Thank you.

snakwu avatar Mar 22 '24 00:03 snakwu

Any luck with this issue? It's really annoying - changed my ISP to provide IPv6 and set up Wireguard for IPv6 but my phone can't connect to it. Relevant logs from the app:

         1718186088.926  3703  3728 I h       : Using Wg backend
         1718186088.957  3703  3728 I WireGuard/GoBackend: Bringing tunnel <tunnel> UP
         1718186088.961  3703  3764 D CompatibilityChangeReporter: Compat change id reported: 247079863; UID 10331; state: ENABLED
         1718186089.200  3703  3703 E AndroidRuntime: FATAL EXCEPTION: main
         1718186089.200  3703  3703 E AndroidRuntime: Process: com.zaneschepke.wireguardautotunnel, PID: 3703
         1718186089.200  3703  3703 E AndroidRuntime: java.lang.IllegalArgumentException: Bad address
         1718186089.200  3703  3703 E AndroidRuntime: 	at android.net.VpnService.checkNonPrefixBytes(VpnService.java:479)
--------- beginning of crash
         1718186089.200  3703  3703 E AndroidRuntime: FATAL EXCEPTION: main
         1718186089.200  3703  3703 E AndroidRuntime: Process: com.zaneschepke.wireguardautotunnel, PID: 3703
         1718186089.200  3703  3703 E AndroidRuntime: java.lang.IllegalArgumentException: Bad address
         1718186089.200  3703  3703 E AndroidRuntime: 	at android.net.VpnService.checkNonPrefixBytes(VpnService.java:479)
         1718186089.200  3703  3703 E AndroidRuntime: 	at android.net.VpnService.-$$Nest$smcheckNonPrefixBytes(Unknown Source:0)
         1718186089.200  3703  3703 E AndroidRuntime: 	at android.net.VpnService$Builder.addRoute(VpnService.java:636)
         1718186089.200  3703  3703 E AndroidRuntime: 	at com.wireguard.android.backend.GoBackend.e(Unknown Source:567)
         1718186089.200  3703  3703 E AndroidRuntime: 	at com.wireguard.android.backend.GoBackend.c(Unknown Source:37)
         1718186089.200  3703  3703 E AndroidRuntime: 	at a4.h.a(Unknown Source:336)
         1718186089.200  3703  3703 E AndroidRuntime: 	at a4.e.s(Unknown Source:85)
         1718186089.200  3703  3703 E AndroidRuntime: 	at I4.a.q(Unknown Source:8)
         1718186089.200  3703  3703 E AndroidRuntime: 	at b5.F.run(Unknown Source:114)
         1718186089.200  3703  3703 E AndroidRuntime: 	at b5.l0.run(Unknown Source:146)
         1718186089.200  3703  3703 E AndroidRuntime: 	at i5.j.run(Unknown Source:2)
         1718186089.200  3703  3703 E AndroidRuntime: 	at i5.a.run(Unknown Source:91)
         1718186089.200  3703  3703 E AndroidRuntime: 	Suppressed: g5.g: [m0{Cancelling}@e9d751d, Dispatchers.Main.immediate]

goodness-from-me avatar Jun 12 '24 09:06 goodness-from-me

@zaneschepke Is there any progress? Thank you

snakwu avatar Sep 15 '24 06:09 snakwu

It works perfectly on my pixel 6. I'm using a domain for the endpoint address, and it has both a and aaaa records. My mobile isp provides ipv6 on the network, and my phone is connecting to the wg server over ipv6.

kép

devastgh avatar Sep 17 '24 12:09 devastgh

It works perfectly on my pixel 6. I'm using a domain for the endpoint address, and it has both a and aaa records. My mobile isp provides ipv6 on the network, and my phone is connecting to the wg server over ipv6.

kép Hi, I'd like to ask if you're building the server with the same setup. I'm using this project https://github.com/freifunkMUC/wg-access-server

snakwu avatar Sep 17 '24 14:09 snakwu

Hi, I'd like to ask if you're building the server with the same setup. I'm using this project https://github.com/freifunkMUC/wg-access-server

I'm using openwrt and linux as the server side, but it really shouldn't matter. Make sure that your domain, in your example the "xxx.snakwu.com:51820" has an AAAA record with the ipv6 ip address of your server. The crash probably happens when you input an ipv6 ip address into the endpoint field, but i haven't tried that since i'm using a domain address in there.

devastgh avatar Sep 17 '24 16:09 devastgh

Hi, I'd like to ask if you're building the server with the same setup. I'm using this project https://github.com/freifunkMUC/wg-access-server

I'm using openwrt and linux as the server side, but it really shouldn't matter. Make sure that your domain, in your example the "xxx.snakwu.com:51820" has an AAAA record with the ipv6 ip address of your server. The crash probably happens when you input an ipv6 ip address into the endpoint field, but i haven't tried that since i'm using a domain address in there.

When I use a domain including AAAA, for example: xxx.xxxx.com: 5182 is unable to connect, if using an IPv6 address, for example: "[240e: 3b2: xxx: xxx:: 55]: 51820 In this way, it is possible to connect, of course, my domain name contains the AAAA record,I am sure that my IPv6 network is accessible normally.

snakwu avatar Sep 18 '24 01:09 snakwu

@devastgh If you use a domain name, you can't connect Screenshot_20240918_093357_WG Tunnel

If you directly use the ip address is a normal connection Screenshot_20240918_093427_WG Tunnel

snakwu avatar Sep 18 '24 01:09 snakwu

@devastgh If you use a domain name, you can't connect !

I managed to reproduce this. If the endpoint address does have an AAAA record, but does not have an A record, then the tunnel will fail. If it has both A and AAAA records (dual stack ipv4 + ipv6), then ipv6 will be usable.

In the logs:

2024-09-18T06:40:35.000000527Z 20144 3271 WARNING WireGuard/GoBackend: message= DNS host "[xxxxxx.duckdns.org](http://xxxxxx.duckdns.org/)" failed to resolve; trying again

devastgh avatar Sep 18 '24 06:09 devastgh

@devastgh If you use a domain name, you can't connect !

I managed to reproduce this. If the endpoint address does have an AAAA record, but does not have an A record, then the tunnel will fail. If it has both A and AAAA records (dual stack ipv4 + ipv6), then ipv6 will be usable.

In the logs:

2024-09-18T06:40:35.000000527Z 20144 3271 WARNING WireGuard/GoBackend: message= DNS host "[xxxxxx.duckdns.org](http://xxxxxx.duckdns.org/)" failed to resolve; trying again

I feel you are using the IPv4 address connection, my domain name has A and AAAA at the same time, record, can only connect from A record

snakwu avatar Sep 18 '24 07:09 snakwu

@devastgh If you use a domain name, you can't connect !

I managed to reproduce this. If the endpoint address does have an AAAA record, but does not have an A record, then the tunnel will fail. If it has both A and AAAA records (dual stack ipv4 + ipv6), then ipv6 will be usable. In the logs: 2024-09-18T06:40:35.000000527Z 20144 3271 WARNING WireGuard/GoBackend: message= DNS host "[xxxxxx.duckdns.org](http://xxxxxx.duckdns.org/)" failed to resolve; trying again

I feel you are using the IPv4 address connection, my domain name has A and AAAA at the same time, record, can only connect from A record

I found out my tests were flawed, as my phone did not have ipv6 connection at the time of the testing, hence why it failed to resolve it. So i cannot reproduce this. Are you sure, that the DNS servers set on your phone do give back ipv6 records ? Maybe try it with setting dns manually to 1.1.1.1

devastgh avatar Sep 18 '24 07:09 devastgh

@devastgh If you use a domain name, you can't connect !

I managed to reproduce this. If the endpoint address does have an AAAA record, but does not have an A record, then the tunnel will fail. If it has both A and AAAA records (dual stack ipv4 + ipv6), then ipv6 will be usable. In the logs: 2024-09-18T06:40:35.000000527Z 20144 3271 WARNING WireGuard/GoBackend: message= DNS host "[xxxxxx.duckdns.org](http://xxxxxx.duckdns.org/)" failed to resolve; trying again

I feel you are using the IPv4 address connection, my domain name has A and AAAA at the same time, record, can only connect from A record

I found out my tests were flawed, as my phone did not have ipv6 connection at the time of the testing, hence why it failed to resolve it. So i cannot reproduce this. Are you sure, that the DNS servers set on your phone do give back ipv6 records ? Maybe try it with setting dns manually to 1.1.1.1

Screenshot_20240918_165720_Edge Determine that the ipv6 of the network is

snakwu avatar Sep 18 '24 08:09 snakwu