Netbird Peer/Client in Linux Docker Container > 0.31.0 -> unable to reach other Docker Containers with published Ports #1693

Closed
opened 2025-11-20 06:04:54 -05:00 by saavagebueno · 10 comments
Owner

Originally created by @yoobeedoobee on GitHub (Mar 10, 2025).

Originally assigned to: @nazarewk on GitHub.

Describe the problem

Netbird Peers in Linux Docker Container > 0.31.0 don't make other Docker Containers with published Ports accessible to logged in Desktop Peers

To Reproduce

Steps to reproduce the behavior:

  1. create a netbird client/peer with docker compose and add image 'netbirdio/netbird:latest'
  2. create another docker container on the same host with published port ie. 8888:80
  3. login with desktop peer@latest to self-hosted netbird@latest and try to reach container on the linux docker peer with published port

Expected behavior

Behaviour expected like with netbirdio/netbird:0.31.0, containers with published ports can be reached here. Starting from 0.32.0 this is not possible anymore.

Are you using NetBird Cloud?

self-host NetBird

NetBird version

latest, ie. 0.38.0

Is any other VPN software installed?

no

Debug output

To help us resolve the problem, please attach the following debug output

netbird status -dA -> unavailable for docker container peer

As well as the file created by

netbird debug for 1m -AS -> unavailable for docker container peer

Have you tried these troubleshooting steps?

  • [x ] Checked for newer NetBird versions
  • [x ] Searched for similar issues on GitHub (including closed ones)
  • [x ] Restarted the NetBird client
  • [x ] Disabled other VPN software
  • [x ] Checked firewall settings
Originally created by @yoobeedoobee on GitHub (Mar 10, 2025). Originally assigned to: @nazarewk on GitHub. **Describe the problem** Netbird Peers in Linux Docker Container > 0.31.0 don't make other Docker Containers with published Ports accessible to logged in Desktop Peers **To Reproduce** Steps to reproduce the behavior: 1. create a netbird client/peer with docker compose and add image 'netbirdio/netbird:latest' 2. create another docker container on the same host with published port ie. 8888:80 3. login with desktop peer@latest to self-hosted netbird@latest and try to reach container on the linux docker peer with published port **Expected behavior** Behaviour expected like with netbirdio/netbird:0.31.0, containers with published ports can be reached here. Starting from 0.32.0 this is not possible anymore. **Are you using NetBird Cloud?** self-host NetBird **NetBird version** `latest`, ie. 0.38.0 **Is any other VPN software installed?** no **Debug output** To help us resolve the problem, please attach the following debug output netbird status -dA -> unavailable for docker container peer As well as the file created by netbird debug for 1m -AS -> unavailable for docker container peer **Have you tried these troubleshooting steps?** - [x ] Checked for newer NetBird versions - [x ] Searched for similar issues on GitHub (including closed ones) - [x ] Restarted the NetBird client - [x ] Disabled other VPN software - [x ] Checked firewall settings
saavagebueno added the triage-needed label 2025-11-20 06:04:54 -05:00
Author
Owner

@yoobeedoobee commented on GitHub (Mar 13, 2025):

Noone else having this issue? I have three peers with linux os (1 Ubuntu, 2 RaspberryOS) and all of them only allow access to other docker containers with version 0.31.0. Starting from 0.32.0 I cannot reach other containers with published ports, only if they run with network_mode: host ...
Any Advice?

@yoobeedoobee commented on GitHub (Mar 13, 2025): Noone else having this issue? I have three peers with linux os (1 Ubuntu, 2 RaspberryOS) and all of them only allow access to other docker containers with version 0.31.0. Starting from 0.32.0 I cannot reach other containers with published ports, only if they run with network_mode: host ... Any Advice?
Author
Owner

@nazarewk commented on GitHub (Mar 13, 2025):

Could you provide me with the docker-compose file with pinned versions of netbird demonstrating the issue?
What kind of operating system and Docker setup are you running? Desktop Peers suggests you're not running on Linux?

@nazarewk commented on GitHub (Mar 13, 2025): Could you provide me with the docker-compose file with pinned versions of `netbird` demonstrating the issue? What kind of operating system and Docker setup are you running? _Desktop Peers_ suggests you're not running on Linux?
Author
Owner

@yoobeedoobee commented on GitHub (Mar 13, 2025):

services:
netbird:
image: 'netbirdio/netbird:0.31.0'
container_name: netbird
restart: unless-stopped
environment:
- 'NB_MANAGEMENT_URL=https://xxx:443'
- 'NB_SETUP_KEY=xxx'
volumes:
- ./data:/etc/netbird
network_mode: host
cap_add:
- NET_ADMIN
- NET_RAW
- BPF
- SYS_ADMIN
- SYS_RESOURCE

This is my compose file on the linux peers, my desktops are windows client and android client, both unable to open Containers on the linux peers if the image is >0.31.0

@yoobeedoobee commented on GitHub (Mar 13, 2025): services: netbird: image: 'netbirdio/netbird:0.31.0' container_name: netbird restart: unless-stopped environment: - 'NB_MANAGEMENT_URL=https://xxx:443' - 'NB_SETUP_KEY=xxx' volumes: - ./data:/etc/netbird network_mode: host cap_add: - NET_ADMIN - NET_RAW - BPF - SYS_ADMIN - SYS_RESOURCE This is my compose file on the linux peers, my desktops are windows client and android client, both unable to open Containers on the linux peers if the image is >0.31.0
Author
Owner

@nazarewk commented on GitHub (Mar 13, 2025):

If you want to communicate between docker compose's containers you should make them part of the same docker network. See https://docs.docker.com/compose/how-tos/networking/

setting network_mode: host makes those listen directly in the host's address space, skipping container networking completely.

Can you verify your linux host has a listener active on the port 8888 with sudo ss -nlptu 'sport = 8888' and what IP address is it listening on? 0.0.0.0 will mean listening on all IPv4 addresses simultaneously, [::1] will mean the same on IPv6.

@nazarewk commented on GitHub (Mar 13, 2025): If you want to communicate between docker compose's containers you should make them part of the same docker network. See https://docs.docker.com/compose/how-tos/networking/ setting `network_mode: host` makes those listen directly in the host's address space, skipping container networking completely. Can you verify your linux host has a listener active on the port `8888` with `sudo ss -nlptu 'sport = 8888'` and what IP address is it listening on? `0.0.0.0` will mean listening on all IPv4 addresses simultaneously, `[::1]` will mean the same on IPv6.
Author
Owner

@yoobeedoobee commented on GitHub (Mar 13, 2025):

This is the active listener:
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp LISTEN 0 4096 0.0.0.0:8888 0.0.0.0:*
tcp LISTEN 0 4096 [::]:8888 [::]:*

As netbird suggests network_mode: host for the docker setup, I did just that. Otherwise there is no hint which ports should be opened for the linux peer. But with network_mode: host I cannot add netbird to a bridge network communicating with the other containers. Well, but it worked fine until 0.31.0 so I am stuck with this image at the moment...

@yoobeedoobee commented on GitHub (Mar 13, 2025): This is the active listener: Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port tcp LISTEN 0 4096 0.0.0.0:8888 0.0.0.0:* tcp LISTEN 0 4096 [::]:8888 [::]:* As netbird suggests network_mode: host for the docker setup, I did just that. Otherwise there is no hint which ports should be opened for the linux peer. But with network_mode: host I cannot add netbird to a bridge network communicating with the other containers. Well, but it worked fine until 0.31.0 so I am stuck with this image at the moment...
Author
Owner

@nazarewk commented on GitHub (Mar 13, 2025):

When you have the port 8888 published from a container, the Netbird peer with host networking should be able to access it on 127.0.0.1:8888 or any other IP address assigned to your host, no matter the Netbird version. Is this not the case?

@nazarewk commented on GitHub (Mar 13, 2025): When you have the port `8888` published from a container, the Netbird peer with `host` networking should be able to access it on `127.0.0.1:8888` or any other IP address assigned to your host, no matter the Netbird version. Is this not the case?
Author
Owner

@yoobeedoobee commented on GitHub (Mar 13, 2025):

Well, here is the solution I just found out:

  • removed network_mode: host
  • removed any privileged directive
  • added the netbird client to the external bridge network connecting the containers
  • and it works even with 0.38.0!!!

I always thought that host network access is mandatory as mentioned in the docs, @see https://docs.netbird.io/how-to/installation ... but there are 2 docker run commands (and no compose), so I built my compose files using the host networking.
This still does not answer what changed from 0.31.0 on ... but I can live with that 😄

Thanx for the hint and your help, may this be helping others too ...

@yoobeedoobee commented on GitHub (Mar 13, 2025): Well, here is the solution I just found out: - removed network_mode: host - removed any privileged directive - added the netbird client to the external bridge network connecting the containers - and it works even with 0.38.0!!! I always thought that host network access is mandatory as mentioned in the docs, @see https://docs.netbird.io/how-to/installation ... but there are 2 docker run commands (and no compose), so I built my compose files using the host networking. This still does not answer what changed from 0.31.0 on ... but I can live with that 😄 Thanx for the hint and your help, may this be helping others too ...
Author
Owner

@nazarewk commented on GitHub (Mar 13, 2025):

Unprivileged Netbird container on relatively modern kernel (5.8+) should work fully with the following additional capabilities:

  • CAP_NET_ADMIN (setting up wireguard)
  • CAP_NET_RAW (setting up raw ipv4 sockets)
  • CAP_BPF (setting up BPF programs)
  • CAP_NET_BIND_SERVICE (DNS server)
@nazarewk commented on GitHub (Mar 13, 2025): Unprivileged Netbird container on relatively modern kernel (5.8+) should work fully with the following additional capabilities: - CAP_NET_ADMIN (setting up wireguard) - CAP_NET_RAW (setting up raw ipv4 sockets) - CAP_BPF (setting up BPF programs) - CAP_NET_BIND_SERVICE (DNS server)
Author
Owner

@serversathome commented on GitHub (Apr 6, 2025):

so im having a similar issue and im running netbird on bare metal. on the host running the netbird client on bare metal, i cannot access any docker container running on the same host from a remote client like my phone. anyone know why??

@serversathome commented on GitHub (Apr 6, 2025): so im having a similar issue and im running netbird on bare metal. on the host running the netbird client on bare metal, i cannot access any docker container running on the same host from a remote client like my phone. anyone know why??
Author
Owner
@nimdasx commented on GitHub (Apr 26, 2025): i think this issue related to - https://github.com/netbirdio/netbird/issues/2701 - https://github.com/netbirdio/netbird/issues/3017 - https://github.com/netbirdio/netbird/issues/3579
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1693