Policy BUG - LAN access to Netbird peers stops working when more than one peer is present #2406

Open
opened 2025-11-20 07:09:19 -05:00 by saavagebueno · 4 comments
Owner

Originally created by @KoderKaizen on GitHub (Oct 23, 2025).

Describe the problem

In a self-hosted Netbird environment, there is an issue with policy behavior in a custom setup where a computer in the local LAN (without the Netbird client installed) accesses devices (e.g., IoT) within the Netbird network through a routing peer. The setup with one routing peer and one peer works correctly - all policies are applied as expected. The issue appears when there is more than one peer in the Netbird network (for example: 1x routing-peer + 1x peer + 1x peer or more). In this situation, policies stop working for LAN access to Netbird devices, and the connection fails. The problem can be temporarily resolved by enabling the "All to All" policy, which restores communication. This appears to be a bug in policy handling or routing behavior when more than two peers are present in the network. Please confirm whether this is expected behavior or a bug that needs to be fixed.

To Reproduce

Steps to reproduce the behavior:

  1. Set up a self-hosted Netbird environment.
  2. Add one routing peer.
  3. Add one additional peer - LAN access to Netbird devices works correctly.
  4. Add a second peer (total 3 peers: 1 routing-peer + 2 peers).
  5. Try to reach Netbird devices from LAN, connection fails.
  6. Enable "All to All" policy - connectivity is restored.

Expected behavior

Policies should allow LAN access through the routing peer regardless of how many peers are present in the network.

Are you using NetBird Cloud?

No - self-hosted Netbird control plane

NetBird version

0.59.8

Is any other VPN software installed?

No

Debug output

To help us resolve the problem, please attach the following anonymized status output

netbird status -dA

Create and upload a debug bundle, and share the returned file key:

netbird debug for 1m -AS -U

Uploaded files are automatically deleted after 30 days.

Alternatively, create the file only and attach it here manually:

netbird debug for 1m -AS

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @KoderKaizen on GitHub (Oct 23, 2025). **Describe the problem** In a self-hosted Netbird environment, there is an issue with policy behavior in a custom setup where a computer in the local LAN (without the Netbird client installed) accesses devices (e.g., IoT) within the Netbird network through a routing peer. The setup with one routing peer and one peer works correctly - all policies are applied as expected. The issue appears when there is more than one peer in the Netbird network (for example: 1x routing-peer + 1x peer + 1x peer or more). In this situation, policies stop working for LAN access to Netbird devices, and the connection fails. The problem can be temporarily resolved by enabling the "All to All" policy, which restores communication. This appears to be a bug in policy handling or routing behavior when more than two peers are present in the network. Please confirm whether this is expected behavior or a bug that needs to be fixed. **To Reproduce** Steps to reproduce the behavior: 1. Set up a self-hosted Netbird environment. 2. Add one routing peer. 3. Add one additional peer - LAN access to Netbird devices works correctly. 4. Add a second peer (total 3 peers: 1 routing-peer + 2 peers). 5. Try to reach Netbird devices from LAN, connection fails. 6. Enable "All to All" policy - connectivity is restored. **Expected behavior** Policies should allow LAN access through the routing peer regardless of how many peers are present in the network. **Are you using NetBird Cloud?** No - self-hosted Netbird control plane **NetBird version** 0.59.8 **Is any other VPN software installed?** No **Debug output** To help us resolve the problem, please attach the following anonymized status output netbird status -dA Create and upload a debug bundle, and share the returned file key: netbird debug for 1m -AS -U *Uploaded files are automatically deleted after 30 days.* Alternatively, create the file only and attach it here manually: netbird debug for 1m -AS **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. **Have you tried these troubleshooting steps?** - [ ] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [ ] Checked for newer NetBird versions - [ ] Searched for similar issues on GitHub (including closed ones) - [ ] Restarted the NetBird client - [ ] Disabled other VPN software - [ ] Checked firewall settings
saavagebueno added the triage-needed label 2025-11-20 07:09:19 -05:00
Author
Owner

@mlsmaycon commented on GitHub (Oct 23, 2025):

@KoderKaizen Policies should allow LAN access through the routing peer regardless of how many peers are present in the network. this should work. But this is a bit confusing: Try to reach Netbird devices from LAN, connection fails.

Can you clarify if you are trying to have both peers accessing your routed network or if the LAN nodes trying to access your netbird peers? if is the latter, can you confirm what setup have you done in your LAN router?

@mlsmaycon commented on GitHub (Oct 23, 2025): @KoderKaizen `Policies should allow LAN access through the routing peer regardless of how many peers are present in the network.` this should work. But this is a bit confusing: `Try to reach Netbird devices from LAN, connection fails.` Can you clarify if you are trying to have both peers accessing your routed network or if the LAN nodes trying to access your netbird peers? if is the latter, can you confirm what setup have you done in your LAN router?
Author
Owner

@KoderKaizen commented on GitHub (Oct 24, 2025):

Thanks for your quick response!
To clarify - in my setup, PCs in the local LAN (without Netbird installed) are trying to access the Netbird peers (for example IoT devices) through a routing peer.

So the traffic flow looks like this:
LAN PC -> routing peer (Netbird) -> target peer (Netbird IoT device)

In the LAN router, I have a static route pointing to the Netbird network via the routing peer’s LAN IP, so that local PCs can reach the Netbird subnet.

Everything works perfectly when there is one routing peer and one peer.
However, the moment a third peer is added to the Netbird network, the LAN PCs immediately lose connectivity to the Netbird peers - policies stop being applied and access fails.
Communication only works again if I enable the "All to All" policy, which is not desirable in this setup.

@KoderKaizen commented on GitHub (Oct 24, 2025): Thanks for your quick response! To clarify - in my setup, PCs in the local LAN (without Netbird installed) are trying to access the Netbird peers (for example IoT devices) through a routing peer. So the traffic flow looks like this: LAN PC -> routing peer (Netbird) -> target peer (Netbird IoT device) In the LAN router, I have a static route pointing to the Netbird network via the routing peer’s LAN IP, so that local PCs can reach the Netbird subnet. Everything works perfectly when there is one routing peer and one peer. However, the moment a third peer is added to the Netbird network, the LAN PCs immediately lose connectivity to the Netbird peers - policies stop being applied and access fails. Communication only works again if I enable the "All to All" policy, which is not desirable in this setup.
Author
Owner

@nazarewk commented on GitHub (Oct 24, 2025):

So the traffic flow looks like this:
LAN PC -> routing peer (Netbird) -> target peer (Netbird IoT device)

This sounds like a Site-to-VPN scenario which is not (yet) supported entirely within NetBird and requires additional manual setup to get working. The traffic might be denied on the Access Policy level when passing through your local routing peer or on the receiving (target Peer) end.

I think you should add Masquerading/SNAT rules on what you call a "Routing Peer" (really, any Peer could pass this traffic back, not just the Routing Peer) to translate from LAN PC's IP address to the Peer's NetBird IP address when entering the network.

I would advise a tcpdump analysis on all involved devices to figure out where exactly the traffic gets lost, that might help us give you better advice.

I am pretty sure the target Peer would see the packets as originating from the LAN PC's IP address instead of Routing Peer's internal NetBird IP address. It would explain why All <> All policy resolves the issue, but anything more restrictive does not allow traffic through (Policies are not aware of non-NetBird IPs and drop the traffic).

@nazarewk commented on GitHub (Oct 24, 2025): > So the traffic flow looks like this: > LAN PC -> routing peer (Netbird) -> target peer (Netbird IoT device) This sounds like a Site-to-VPN scenario which is not (yet) supported entirely within NetBird and requires additional manual setup to get working. The traffic might be denied on the Access Policy level when passing through your local routing peer or on the receiving (target Peer) end. I think you should add Masquerading/SNAT rules on what you call a "Routing Peer" (really, any Peer could pass this traffic back, not just the Routing Peer) to translate from LAN PC's IP address to the Peer's NetBird IP address when entering the network. I would advise a `tcpdump` analysis on all involved devices to figure out where exactly the traffic gets lost, that might help us give you better advice. I am pretty sure the target Peer would see the packets as originating from the LAN PC's IP address instead of Routing Peer's internal NetBird IP address. It would explain why `All <> All` policy resolves the issue, but anything more restrictive does not allow traffic through (Policies are not aware of non-NetBird IPs and drop the traffic).
Author
Owner

@KoderKaizen commented on GitHub (Oct 24, 2025):

I understand your point about SNAT/Masquerading.
However, what’s confusing in this case is that the setup works perfectly when there is only one peer in the network, even though no masquerading/SNAT rule is configured on the routing peer.

LAN PC -> routing peer (Netbird, no masquerade) -> peer_1 (IoT device)
Works fine, policies are applied correctly.

The issue appears immediately after adding a second peer (e.g. adding another IoT device, peer_2). From that moment, LAN PCs can no longer reach any Netbird peers - the traffic stops, and policies seem to no longer apply.

My policies:
Image

Image

Given that it works correctly without SNAT when only one peer exists, but fails as soon as another peer joins, this behavior looks more like a bug in policy evaluation or routing logic rather than a NAT configuration issue.

In my infrastructure, there are no additional peers beyond those described above, just the routing peer and the IoT peers.

It’s great to hear that Site-to-VPN support is on your roadmap. I’m really looking forward to full native support for this scenario in future Netbird releases. It would be very useful for setups like mine.

@KoderKaizen commented on GitHub (Oct 24, 2025): I understand your point about SNAT/Masquerading. However, what’s confusing in this case is that the setup works perfectly when there is only one peer in the network, even though no masquerading/SNAT rule is configured on the routing peer. LAN PC -> routing peer (Netbird, no masquerade) -> peer_1 (IoT device) Works fine, policies are applied correctly. The issue appears immediately after adding a second peer (e.g. adding another IoT device, peer_2). From that moment, LAN PCs can no longer reach any Netbird peers - the traffic stops, and policies seem to no longer apply. My policies: ![Image](https://github.com/user-attachments/assets/a1f5481e-babd-409e-86c4-660c140eb094) ![Image](https://github.com/user-attachments/assets/7fea15a7-7397-4977-85fa-8afdcb7cb655) Given that it works correctly without SNAT when only one peer exists, but fails as soon as another peer joins, this behavior looks more like a bug in policy evaluation or routing logic rather than a NAT configuration issue. In my infrastructure, there are no additional peers beyond those described above, just the routing peer and the IoT peers. It’s great to hear that Site-to-VPN support is on your roadmap. I’m really looking forward to full native support for this scenario in future Netbird releases. It would be very useful for setups like mine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2406