Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 14 App doesn't connect to the peers #1347

Closed
nilshee opened this issue Nov 30, 2023 · 28 comments
Closed

Android 14 App doesn't connect to the peers #1347

nilshee opened this issue Nov 30, 2023 · 28 comments
Labels
Android bug Something isn't working

Comments

@nilshee
Copy link

nilshee commented Nov 30, 2023

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

@mlsmaycon
Copy link
Collaborator

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

@nilshee
Copy link
Author

nilshee commented Dec 1, 2023

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.

@mlsmaycon mlsmaycon added bug Something isn't working Android labels Dec 8, 2023
@jiangslee
Copy link

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 #798 (comment) , I tested my TURN configuration, I think that it is affected by ipv6.

@jiangslee
Copy link

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

@DENightOne
Copy link

DENightOne commented Dec 22, 2023

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

@thefiredragon
Copy link

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
Copy link

thefiredragon commented Jan 11, 2024

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.

@j007bond007
Copy link

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

@let-lc
Copy link

let-lc commented Jan 17, 2024

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.

@jiangslee
Copy link

@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?

@let-lc
Copy link

let-lc commented Jan 18, 2024

@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.

@DidZ0
Copy link

DidZ0 commented Jan 21, 2024

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

@MatteoPaier
Copy link

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.

@penzoiders
Copy link

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?

@nilshee
Copy link
Author

nilshee commented Mar 4, 2024

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

@jumski
Copy link

jumski commented Mar 12, 2024

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

@Luxosity
Copy link

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.

@Pumba98
Copy link

Pumba98 commented Mar 26, 2024

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
Copy link

Pumba98 commented Mar 29, 2024

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.

@adlion
Copy link

adlion commented Jun 10, 2024

+1
Pixel 7
Samsung A52 5G

@mlsmaycon
Copy link
Collaborator

Hello folks, can you please enable trace logs, reconnect and then share the logs with us for analysis?

To enable trace logs, you can go to the Advanced menu and ticky the enable trace log box:
Advanced menu

@nilshee
Copy link
Author

nilshee commented Aug 25, 2024

Seems to be working now

@nilshee nilshee closed this as completed Aug 25, 2024
@deB4SH
Copy link

deB4SH commented Aug 30, 2024

Still running into this issue - android device is not connecting to peers.

Android 13
Netbird Client 0.0.24

@nilshee
Copy link
Author

nilshee commented Aug 30, 2024

Still running into this issue - android device is not connecting to peers.

Android 13
Netbird Client 0.0.24

Which versions are you running for the other components?
Most likely an update around 0.28.8 fixed it for me.

@v1rusnl
Copy link
Contributor

v1rusnl commented Oct 9, 2024

Hello folks, can you please enable trace logs, reconnect and then share the logs with us for analysis?

To enable trace logs, you can go to the Advanced menu and ticky the enable trace log box:

Clean install. Android 13, Galaxy Tab 6 Lite. Netbird selfhosted. All other peers including an Oppo Find X5 Pro with Android 14 connect fine.

netbird-1728498486226.log.txt

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".

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.

But @Pumba98 is right. I had my NextDNS Public DNS Resolvers and my Fritzbox Router IP for internal DNS stuff additionally configured in control panel. As soon as I deleted the Fritzbox DNS for Home LAN, the Galaxy Tab began to connect to the other peers. Weird that I have another Android device which worked also with Fritzbox DNS activated.

@SnowCoder404
Copy link

Hey can i help me please ? xD

When i connect with netbird from my android phone it's not working with mobile internet.
When i give hotspot for my Laptop and i connect my Laptop with netbird then it's work.
The android app works in my home network it's very funny and i can't say what the error might be.

Mobile Internet is only public V6 address and private V4 address.

Homelab Internet is Dual Stack so a Public V4 and V6 address.

VPS Internet is Dual Stack so a Public V4 and V6 address.

I love netbird it's perfect because i can all self hosting.

@turnah
Copy link

turnah commented Dec 23, 2024

Same issue, works over WiFi but not mobile internet on Android app.

@giraypultar
Copy link

When I was first setting up the android client, I had entered a shared key, thinking that the shared key is the same as the setup key. My android was not working because of the shared key. Once, I removed the shared key, it started working.
Maybe this comment might help someone who made the same mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android bug Something isn't working
Projects
None yet
Development

No branches or pull requests