Why can't the same local area network successfully P2P? #1633

Open
opened 2025-11-20 06:03:49 -05:00 by saavagebueno · 11 comments
Owner

Originally created by @moqiu365 on GitHub (Feb 17, 2025).

Describe the problem

Image

The server uses Tencent Cloud,The above picture shows the structure of my local area network,
Among them, Android phones, WIN10, and Ubuntu all have installed netbird, and WIN10 connects to Android WiFi hotspots
However, communication between WIN10 and Ubuntu cannot be successfully P2P,I can successfully P2P using other virtual LAN tools (such as VNT, Tailscale), but Netbird cannot

Android phones<--->Ubuntu uses P2P communication
WIN10<--->Ubuntu uses a transit server
WIN10<--->Android phones use P2P communication

When WIN10 is directly connected to the LAN, WIN10 and Ubuntu can successfully P2P, and the firewalls of all devices except Android phones have been turned off

Here are the detailed information of netbird status - d

Image
Image
Image

The following is the configuration of turnserver. conf

Image

Here are the netbird-coturn-1 logs for Docker

Image

To Reproduce

Steps to reproduce the behavior:
not have

Expected behavior

P2P communication should be successful

Are you using NetBird Cloud?

Self deployed netbird

NetBird version

The latest netbird

NetBird status -dA output:

If applicable, add the `netbird status -dA' command output.

Do you face any (non-mobile) client issues?

netbird.debug.3366302722.zip

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Originally created by @moqiu365 on GitHub (Feb 17, 2025). **Describe the problem** ![Image](https://github.com/user-attachments/assets/d1a63361-1237-47e7-b3cd-333787222e98) The server uses Tencent Cloud,The above picture shows the structure of my local area network, Among them, Android phones, WIN10, and Ubuntu all have installed netbird, and WIN10 connects to Android WiFi hotspots However, communication between WIN10 and Ubuntu cannot be successfully P2P,I can successfully P2P using other virtual LAN tools (such as VNT, Tailscale), but Netbird cannot Android phones<--->Ubuntu uses P2P communication WIN10<--->Ubuntu uses a transit server WIN10<--->Android phones use P2P communication When WIN10 is directly connected to the LAN, WIN10 and Ubuntu can successfully P2P, and the firewalls of all devices except Android phones have been turned off Here are the detailed information of netbird status - d ![Image](https://github.com/user-attachments/assets/5fddc0a9-7782-444d-8b31-593e50a9b5ee) ![Image](https://github.com/user-attachments/assets/ba6ffd02-bdf0-460d-9914-35c04660e113) ![Image](https://github.com/user-attachments/assets/d8665855-f144-49c7-8398-410583d49a67) The following is the configuration of turnserver. conf ![Image](https://github.com/user-attachments/assets/eec6a328-9b00-49c4-b2a7-8870eeb188c2) Here are the netbird-coturn-1 logs for Docker ![Image](https://github.com/user-attachments/assets/6d6cd0d7-5a1c-40ea-99b4-887a83a22adf) **To Reproduce** Steps to reproduce the behavior: not have **Expected behavior** P2P communication should be successful **Are you using NetBird Cloud?** Self deployed netbird **NetBird version** `The latest netbird` **NetBird status -dA output:** If applicable, add the `netbird status -dA' command output. **Do you face any (non-mobile) client issues?** [netbird.debug.3366302722.zip](https://github.com/user-attachments/files/18828072/netbird.debug.3366302722.zip) **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here.
saavagebueno added the triage-needed label 2025-11-20 06:03:49 -05:00
Author
Owner

@Aurel004 commented on GitHub (Feb 18, 2025):

Hi,

Might be related to #3325

https://github.com/netbirdio/netbird/issues/3325#issuecomment-2660676927

I would try to edit win10's config.json and put the IP of win10 gave by Android phone

@Aurel004 commented on GitHub (Feb 18, 2025): Hi, Might be related to #3325 https://github.com/netbirdio/netbird/issues/3325#issuecomment-2660676927 I would try to edit win10's config.json and put the IP of win10 gave by Android phone
Author
Owner

@moqiu365 commented on GitHub (Feb 18, 2025):

你好

可能与 #3325 有关

#3325 (评论)

我会尝试编辑 win10 的 config.json 并放入 Android 手机给出的 win10 的 IP

Is it filling in the client's public IP address? Or is it the public IP address of the server?
In some places, the client's public IP is not fixed and changes periodically, so it cannot be manually changed at any time. Isn't this troublesome? Is there a more concise method?

@moqiu365 commented on GitHub (Feb 18, 2025): > 你好 > > 可能与 [#3325](https://github.com/netbirdio/netbird/issues/3325) 有关 > > [#3325 (评论)](https://github.com/netbirdio/netbird/issues/3325#issuecomment-2660676927) > > 我会尝试编辑 win10 的 config.json 并放入 Android 手机给出的 win10 的 IP Is it filling in the client's public IP address? Or is it the public IP address of the server? In some places, the client's public IP is not fixed and changes periodically, so it cannot be manually changed at any time. Isn't this troublesome? Is there a more concise method?
Author
Owner

@lixmal commented on GitHub (Feb 18, 2025):

Can you try using a different interface port on the Windows machine and see if that makes a difference? (Settings -> Advanced Settings)

@lixmal commented on GitHub (Feb 18, 2025): Can you try using a different interface port on the Windows machine and see if that makes a difference? (Settings -> Advanced Settings)
Author
Owner

@moqiu365 commented on GitHub (Feb 18, 2025):

您能否尝试在 Windows 计算机上使用不同的接口端口,看看这是否有所作为?(设置 - >高级设置)

The netbird I installed always doesn't respond when I click on advanced settings. I've changed several versions and it's the same. I don't know what environment is missing

@moqiu365 commented on GitHub (Feb 18, 2025): > 您能否尝试在 Windows 计算机上使用不同的接口端口,看看这是否有所作为?(设置 - >高级设置) The netbird I installed always doesn't respond when I click on advanced settings. I've changed several versions and it's the same. I don't know what environment is missing
Author
Owner

@lixmal commented on GitHub (Feb 18, 2025):

You can do it in PowerShell:

netbird down
netbird up --wireguard-port xxx
@lixmal commented on GitHub (Feb 18, 2025): You can do it in PowerShell: ``` netbird down netbird up --wireguard-port xxx ```
Author
Owner

@moqiu365 commented on GitHub (Feb 18, 2025):

您可以在 PowerShell 中执行此作:

netbird down
netbird up --wireguard-port xxx

I tried 7 to 10 times, but it still shows a transit connection

@moqiu365 commented on GitHub (Feb 18, 2025): > 您可以在 PowerShell 中执行此作: > > ``` > netbird down > netbird up --wireguard-port xxx > ``` I tried 7 to 10 times, but it still shows a transit connection
Author
Owner

@Gauss23 commented on GitHub (Feb 26, 2025):

I don’t get your network infrastructure yet.

The Windows machine uses an Android device for the internet access?

The Android device is using a cellular network for the Internet access? Cgnat IP?

Where is this router/gateway?

The Ubuntu machine has a public IP or an internal IP behind the router?

The router/gateway forwards port 51820 to the ubuntu server?

@Gauss23 commented on GitHub (Feb 26, 2025): I don’t get your network infrastructure yet. The Windows machine uses an Android device for the internet access? The Android device is using a cellular network for the Internet access? Cgnat IP? Where is this router/gateway? The Ubuntu machine has a public IP or an internal IP behind the router? The router/gateway forwards port 51820 to the ubuntu server?
Author
Owner

@moqiu365 commented on GitHub (Feb 26, 2025):

I don’t get your network infrastructure yet.

The Windows machine uses an Android device for the internet access?

The Android device is using a cellular network for the Internet access? Cgnat IP?

Where is this router/gateway?

The Ubuntu machine has a public IP or an internal IP behind the router?

The router/gateway forwards port 51820 to the ubuntu server?

Router ->Android phone (WiFi connected to router) ->Win 10 (WiFi connected to Android phone)

Route ->Ubuntu (Ethernet connection)

The router does not have a public IP address, it is a private IP address after NAT.

Under this network architecture, Win10 and Ubuntu serve as relay connections. If Win10 is routed through Ethernet cables, then Win10 and Ubuntu become P2P connections

@moqiu365 commented on GitHub (Feb 26, 2025): > I don’t get your network infrastructure yet. > > The Windows machine uses an Android device for the internet access? > > The Android device is using a cellular network for the Internet access? Cgnat IP? > > Where is this router/gateway? > > The Ubuntu machine has a public IP or an internal IP behind the router? > > The router/gateway forwards port 51820 to the ubuntu server? Router ->Android phone (WiFi connected to router) ->Win 10 (WiFi connected to Android phone) Route ->Ubuntu (Ethernet connection) The router does not have a public IP address, it is a private IP address after NAT. Under this network architecture, Win10 and Ubuntu serve as relay connections. If Win10 is routed through Ethernet cables, then Win10 and Ubuntu become P2P connections
Author
Owner

@Hookers commented on GitHub (Mar 9, 2025):

+1,I have the same problem,when Linux A-> Android's WIFI -> Android's cellular network , Linux B -> Home WIFI,
the Linux A -> Linux B relay always appears,even if they all have IPv6
but tailscale works very well with P2P

@Hookers commented on GitHub (Mar 9, 2025): +1,I have the same problem,when Linux A-> Android's WIFI -> Android's cellular network , Linux B -> Home WIFI, the Linux A -> Linux B relay always appears,even if they all have IPv6 but tailscale works very well with P2P
Author
Owner

@Gauss23 commented on GitHub (Mar 9, 2025):

Linux A gets an IPv6 address from the Android Wifi? I would doubt that.
In this scenario both machines are behind a NAT, I guess. NAT traversal is always tricky. Here is a nice article about it:
https://tailscale.com/blog/how-nat-traversal-works

Tailscale seems to use their own protocol for this. They are not relying on TURN and STUN, they use DERP. Maybe that's in some scenarios a bit superior, where both machines are behind NAT, without UPNP or similar protocols available.

@Gauss23 commented on GitHub (Mar 9, 2025): Linux A gets an IPv6 address from the Android Wifi? I would doubt that. In this scenario both machines are behind a NAT, I guess. NAT traversal is always tricky. Here is a nice article about it: https://tailscale.com/blog/how-nat-traversal-works Tailscale seems to use their own protocol for this. They are not relying on TURN and STUN, they use DERP. Maybe that's in some scenarios a bit superior, where both machines are behind NAT, without UPNP or similar protocols available.
Author
Owner

@Hookers commented on GitHub (Mar 10, 2025):

Linux A gets an IPv6 address from the Android Wifi? I would doubt that. In this scenario both machines are behind a NAT, I guess. NAT traversal is always tricky. Here is a nice article about it: https://tailscale.com/blog/how-nat-traversal-works

Tailscale seems to use their own protocol for this. They are not relying on TURN and STUN, they use DERP. Maybe that's in some scenarios a bit superior, where both machines are behind NAT, without UPNP or similar protocols available.

this is Linux A wlp2s0 interface which connected Android Wifi only

Image

In theory, when they all have IPv6, there is no NAT,but why does relay always appear?

I pinged Linux A's IPv6 from Linux B, but the ping was unsuccessful. However, TailScale was able to complete the P2P through Linux A's IPv6:41641 and ping through 10.0.x.x

As far as I know, DERP also has stunport, and when I set stunport in DERP, P2P under IPv6 becomes particularly easy,and the delay of ping is very low, otherwise, relay also frequently appear

Additional note: The firewalls for Linux A and Linux B are both turned off,all traffic is passable

@Hookers commented on GitHub (Mar 10, 2025): > Linux A gets an IPv6 address from the Android Wifi? I would doubt that. In this scenario both machines are behind a NAT, I guess. NAT traversal is always tricky. Here is a nice article about it: https://tailscale.com/blog/how-nat-traversal-works > > Tailscale seems to use their own protocol for this. They are not relying on TURN and STUN, they use DERP. Maybe that's in some scenarios a bit superior, where both machines are behind NAT, without UPNP or similar protocols available. this is Linux A wlp2s0 interface which connected Android Wifi only ![Image](https://github.com/user-attachments/assets/a6a307bc-39ed-41ab-a6e4-8f32c8388516) In theory, when they all have IPv6, there is no NAT,but why does relay always appear? I pinged Linux A's IPv6 from Linux B, but the ping was unsuccessful. However, TailScale was able to complete the P2P through Linux A's IPv6:41641 and ping through 10.0.x.x As far as I know, DERP also has stunport, and when I set stunport in DERP, P2P under IPv6 becomes particularly easy,and the delay of ping is very low, otherwise, relay also frequently appear Additional note: The firewalls for Linux A and Linux B are both turned off,all traffic is passable
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1633