netbird icon indicating copy to clipboard operation
netbird copied to clipboard

Android 14 App doesn't connect to the peers

Open nilshee opened this issue 7 months ago • 13 comments

Describe the problem The playstore version of the netbird app won't connect to the peers. The connection and login to the management server works without a problem.

To Reproduce Steps to reproduce the behavior:

  1. Download APP on an android 14 device (tested with Galaxy S23 Ultra and Pixel 7)
  2. Try to use the app

Expected behavior Connect to the peers.

NetBird status -d output: Android app

Screenshots image image image

nilshee avatar Nov 30 '23 23:11 nilshee

Hello @nils1323, we are fixing an issue with IPv6 DNS addresses, can you confirm if your devices are using IPv6?

mlsmaycon avatar Dec 01 '23 13:12 mlsmaycon

The network, the devices are in, is ipv4 only. There is a local (fe prefix) ipv6 address in the network configuration settings of the phones. I'm not sure if that somehow interferes.

nilshee avatar Dec 01 '23 21:12 nilshee

Hello @nils1323, we are fixing an issue with IPv6 DNS addresses, can you confirm if your devices are using IPv6?

image

Hello @mlsmaycon , I have the same problem too,According to the https://github.com/netbirdio/netbird/issues/798#issuecomment-1502430133 , I tested my TURN configuration, I think that it is affected by ipv6.

jiangslee avatar Dec 16 '23 03:12 jiangslee

self host server: netbird-mgmt version 0.24.4 client: ios 0.0.1(40)/ mac 0.24.4 (on ios hostspot)

jiangslee avatar Dec 16 '23 03:12 jiangslee

I have the same problem on my Android phone (Android 13), what i did notice is that it only happens when I add a route, without any routes all peers can see all peers, when I add a route, the Linux nodes can see one another but the Android app sees no other peers. I then remove the route and reconnect the android app i can see all the peers again.

If i run the exact same peers on netbird.io I have no such problem, with and without routes all peers can see all peers

Self Hosted: docker image 0.25.1 Linux client 0.25.1 Android 0.24.4

DENightOne avatar Dec 22 '23 14:12 DENightOne

Same issue here, We're using ipv6 only for external communication. Android devices also have ipv6 addresses. App shows its connected but peers are down.

thefiredragon avatar Jan 11 '24 13:01 thefiredragon

I have a update perhaps related to other issues here

adding to turnserver.conf:

# Allocate Address Family according
# If enabled then TURN server allocates address family according  the TURN
# Client <=> Server communication address family.
# (By default Coturn works according RFC 6156.)
# !!Warning: Enabling this option breaks RFC6156 section-4.2 (violates use default IPv4)!!
#
keep-address-family

make it possible to use netbird over ipv6. It not resolve the issue for android devices with their app. I had tested this with 2 linux devices. DNS only Point to IPv6 external address.

thefiredragon avatar Jan 11 '24 18:01 thefiredragon

Having same issue but with DNS (routes seem fine). Removing DNS servers causes peers to connect again.

j007bond007 avatar Jan 12 '24 20:01 j007bond007

Same problem here, IPv4 only home network, I could see the peers connected on the android app. But I couldn't see them after I switch to mobile network which has IPv6 enabled.

I tried to disabled IPv6 by editing the APN setting but it doesn't allow me to do that like the online tutorials. If you can edit your mobile network APN settings, you can try that and see if it works after disabling IPv6. Right now I just have to wait for the new version to fix this problem.

let-lc avatar Jan 17 '24 00:01 let-lc

@let-lc @thefiredragon @DENightOne @nilshee

Hey guys, see https://github.com/netbirdio/netbird/issues/1453#issuecomment-1887207508

add external-ip=<eip> to turnserver.conf and use docker compose up -d --force-recreate coturn

It works for me, I think you can also try it?

jiangslee avatar Jan 17 '24 05:01 jiangslee

@let-lc @thefiredragon @DENightOne @nilshee

Hey guys, see #1453 (comment)

add external-ip=<eip> to turnserver.conf and use docker compose up -d --force-recreate coturn

It works for me, I think you can also try it?

Sadly this doesn't work for me. I tried on my iOS device and faced the same problems.


I also found another problem when I was doing some tests, not related to IPv6, but DNS.

Both my iOS and Android devices, I added a LAN pi-hole DNS server to the WiFi setting. This doesn't cause any problem on my iOS device, but on Android, 0 of n peers connected problem happens again.

If I connect my Android to another SSID of the same router with auto DHCP (no static IP, no custom DNS), I could see the peers connected now. I'm not a network expert, so I don't know why this is happening. Just sharing my finding.

let-lc avatar Jan 18 '24 01:01 let-lc

Got a similar issue,

I have a small homelab with a k8s cluster and an Adguard Home instance running. I self hosted Netbird and some monitoring tools on a VPS. I'm using adguard as a DNS server on netbird as well as on my router so that all my home equipment (like wife phone) can use services without vpn.

No problem so far with linux or windows clients on netbird, but on my android phone i can see 0 of n Peers connected. Disabling custom DNS in netbird solves the issue, but no custom dns anymore, which is annoying

The DNS Server is on a VM (192.168.1.104) in my local network but it doesnt have netbird installed so I used routing to expose 192.168.1.0/24 through another machine with netbird installed, I don't know if it could be the issue.

I plan on installing netbird on the adguard machine and using it as a dns server with it's netbird ip, don't know if it's possible though.

EDIT : It looks like installing netbird on the adguard machine and using it's netbird ip to set the dns server is working, I can see my peers connected on my phone again. I'll edit the comment if the situation changes

DidZ0 avatar Jan 21 '24 23:01 DidZ0

I've a similar setup to @DidZ0 (self hosted Netbird, with adguard DNS server via custom route) and indeed the peers are not connecting.

I'm just speculating, but can it be a chicken/egg problem where the app is trying to resolve the NetBird domain with the provided DNS server? The issue seems solved if I provide another "bootstrap" nameserver that match only my NetBird domain (netbird.example.com) and resolves with a public DNS server.

MatteoPaier avatar Jan 25 '24 13:01 MatteoPaier

I've found that my version of this issue "Android client not connecting with peers" is related to only specific kind of routes: as long as you route private ranges (10.0.0.0/8,192.168.0.0/16 or 172.16.0.0/12) your Android client will connect just fine.

As soon as you add a public host route (151.23.52.1/32 for example) the client won't connect anymore, remove that "faulty" route and it will eventually be able to connect, ping peers and use private routes with no issues.

Is it possible that this is an Android-specific routing permissions related thing?

penzoiders avatar Feb 27 '24 14:02 penzoiders

Can confirm @penzoiders findings. After removing all public networks it works for the private ones just fine

nilshee avatar Mar 04 '24 19:03 nilshee

I have the same problem. Also noticed that app registers new "hostnames" after reconnect.

jumski avatar Mar 12 '24 07:03 jumski

Phone: Google Pixel 6a, Android 14 Netbird Android app: v.0.0.20, Netbird Agent: 0.25.6, Netbird Selfhosted

Having the same issue. Never worked for me. Reinstalled app and have the same issue. Shows its connected in the Admin portal. It also shows there is an update to 0.26.3 but unsure how to update the agent for the android app since 0.0.20 is the latest.

Luxosity avatar Mar 26 '24 15:03 Luxosity

I can confirm the issue described by DidZ0 and MatteoPaier with a DNS Server in a local network. It works on all other platform except Android. I really hope for a fix on this, it's the only thing that blocks me from fully switching to netbird.

Is there anything we can provide to help fixing this?

Pumba98 avatar Mar 26 '24 16:03 Pumba98

I can confirm the issue described by DidZ0 and MatteoPaier with a DNS Server in a local network. It works on all other platform except Android. I really hope for a fix on this, it's the only thing that blocks me from fully switching to netbird.

Is there anything we can provide to help fixing this?

Seems like I was able to fix my issue by adding a 2nd public nameserver only for "stun.netbird.io" & "turn.netbird.io".

image

In the logs I saw the client failed to resolve those dns entries when establishing a connection to the peer running in my DNS network.

Pumba98 avatar Mar 29 '24 17:03 Pumba98