netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
10.64k stars 474 forks source link

Android app: Network routes are not working #858

Open kdre opened 1 year ago

kdre commented 1 year ago

Describe the problem I cannot access defined network routes.

To Reproduce Define network routs in the web interface (In my case: 192.168.0.0/24). Test that network traffic is correctly routed on other clients (e.g. access internal webserver with http://192.168.0.1 in a browser). Test that network traffic is correctly routed on android -> Devices cannot be accessed.

Expected behavior Network traffic should be correctly routed to internal clients according to the defined network routes.

Tested netbird version: 0.0.7 Mobile: Samsung Galaxy S23 Ultra (Android 13)

pappz commented 1 year ago

@kdre Could you share with me the exact version name of the Android application?

mlsmaycon commented 1 year ago

@kdre can you confirm if the issue happens after reconnecting the client? Android limits route configuration to when the interface is created, so if you updated any route for the Android client after connected, you will have to reconnect.

kdre commented 1 year ago

@kdre Could you share with me the exact version name of the Android application?

@pappz The exact version is 0.0.7.

@kdre can you confirm if the issue happens after reconnecting the client? Android limits route configuration to when the interface is created, so if you updated any route for the Android client after connected, you will have to reconnect.

@mlsmaycon Yes, I confirm that the issue happens even after reconnecting (the network routes were defined long before I installed the android app). I just tested it again right now. No success. When I open a web browser on my mobile while netbird is connected and try to access either "http://192.168.0.1" or "http://fritz.box" then nothing happens. The request times out after some time.

If it matters: I use a Samsung Galaxy S23 Ultra (Android 13)

mlsmaycon commented 1 year ago

Thanks @kdre, can you confirm that the network route is being distributed to a group that the android device is part of and that the device and the routing peer are connected?

kdre commented 1 year ago

@mlsmaycon Yes, I can confirm that my mobile device is in the group that receives the network routes. In fact, I only have an "all" group ('1'). And the netbird website shows that all clients are in group '1' and also that the network routes are for group '1'.

I can further confirm that the routing peer is up and running and connected (there are two defined for redundancy, but only one is currently online).

I am currently sitting in my office and I just opened a web browser on my notebook which is connected to the netbird network and accessed http://192.168.0.1 which is my router at home. It just works. Even dns is correctly resolved (I can access http://fritz.box).

When I connect to the netbird network on my mobile and try to do the same in a browser then it times out. Tested on chrome, Samsung browser and DuckDuckGo.

edit: I just updated the android netbird client to version 0.0.8. The problem still exists.

gerthomas commented 1 year ago

Routes to private networks works for me using Android app.

Tested netbird version: 0.0.8 Mobile: Samsung Galaxy S22 Ultra (Android 13)

buster39 commented 1 year ago

Yes, on Android 13 it works on two devices here. On Android 9 (Fire HD 10-Tablet) not.

Akruidenberg commented 1 year ago

Same here. Android app will not connect to the server where network routes are applied. Linux and Windows are working. Android and Docker are not. Android version is LineageOS 20, running on Oneplus 6.

thehoff commented 1 year ago

android 13. pixel 7. connects but cant use advertised routes.

soakes commented 5 months ago

Hi, I am also experencing the same issue on android 14 running on a Pixel 6 Pro.

I can confirm that the network routes are being distributed to a group which both mobile client and the servers have access to. The "what I call" private link pairs work (thats your CGNAT range), but actual routed blocks do not.

The Linux based networks, all can communicate correctly, its only the android client that cant reach anything within the networks apart from the CGNAT ranges.

Any thoughts?

Update

Doing some digging, it seems the same issue is happening on the OSX client as well. This is using the netbird client inside brew.

Using a netbird status -d shows:

{... snip}
 hh***.netbird.cloud:
  NetBird IP: 100.92.**.**
  Public key: pEkLEL************************
  Status: Connected
  -- detail --
  Connection type: P2P
  Direct: true
  ICE candidate (Local/Remote): srflx/host
  ICE candidate endpoints (Local/Remote): **.**.**.**:51820/**.**.**.**:51820
  Last connection update: 2024-04-01 10:07:16
  Last WireGuard handshake: 2024-04-01 10:07:16
  Transfer status (received/sent) 692 B/880 B
  Quantum resistance: false
  Routes: -
  Latency: 9.513138ms

The bit I would like to point out is the routes line, you can see its blank.

If you check like the same peer on one of the linux gateways, you will see its present.

  {... snip}
   hh***.netbird.cloud:
  NetBird IP: 100.92.*******
  Public key: pEkLEL*********************
  Status: Connected
  -- detail --
  Connection type: P2P
  Direct: true
  ICE candidate (Local/Remote): host/host
  ICE candidate endpoints (Local/Remote): **.**.**.**:51820/**.**.**.**:51820
  Last connection update: 2024-04-01 05:47:30
  Last WireGuard handshake: 2024-04-01 09:11:36
  Transfer status (received/sent) 23.6 MiB/242.6 MiB
  Quantum resistance: false
  Routes: 10.26.xx.xx/24
  Latency: 6.066276ms

I suspect the same issue is happning with the android client but I have no easy way to confirm this.

Assuming what I suspect is going on, how can we get the routes to populate to android/osx clients?