Network Policy does not limit Traffic to specified port #2460

Open
opened 2025-11-20 07:10:04 -05:00 by saavagebueno · 5 comments
Owner

Originally created by @philzett on GitHub (Nov 14, 2025).

Describe the problem

We want to limit Traffic from a Group of Peers to a specific port. But as soon as the policy is active, all traffic to the peer is allowed. When disabling the policy no traffic at all is allowed.

To Reproduce

Steps to reproduce the behavior:

  1. Created a Peergroup "Peers1"
  2. Created a Network "Network1" with a Ressource "Host1" (10.12.0.195) and a Routing Peer "RoutingPeer1" (Masquerading enabled). We also use this routing peer for other traffic.
  3. We created a policy "Policy1" which allows Traffic from "Peers1" to "Network1" TCP 8080

Expected behavior

Access Host1 on tcp 8080.

Are you using NetBird Cloud?
No

Please specify whether you use NetBird Cloud or self-host NetBird's control plane.

NetBird version

netbird-mgmt version 0.59.13

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


C:\Users\Peer1>netbird status -dA
Peers detail:

RoutingPeer1.anon-COGhR.domain:
NetBird IP: 100.124.1.91
Public key: csRgyV7kxNbe0ElZMiG2IessE568x+itzFK+YsksLTE=
Status: Connected
-- detail --
Connection type: Relayed
ICE candidate (Local/Remote): -/-
ICE candidate endpoints (Local/Remote): -/-
Relay server address: rels://netbird.anon-iWpe0.domain:443
Last connection update: 54 minutes, 35 seconds ago
Last WireGuard handshake: 19 seconds ago
Transfer status (received/sent) 290.6 KiB/288.8 KiB
Quantum resistance: false
Networks: 10.12.0.195/32
Latency: 0s

Events:
[INFO] SYSTEM (057ad8ba-357e-45a5-8ce2-3cac8b8a67ec)
Message: Network map updated
Time: 19 minutes, 53 seconds ago
[INFO] SYSTEM (663089d2-c3dc-4da3-a99e-3e6b0824893f)
Message: Network map updated
Time: 16 minutes, 4 seconds ago
[INFO] SYSTEM (9cb7c2e6-2d42-4092-9511-00c6e0ab77e1)
Message: Network map updated
Time: 14 minutes, 42 seconds ago
[INFO] SYSTEM (b41c24f7-9c57-442c-8c69-d8df34f8cec6)
Message: Network map updated
Time: 14 minutes, 1 seconds ago
[INFO] SYSTEM (d406f955-5785-4b48-bb5b-0ef5d888087c)
Message: Network map updated
Time: 12 minutes, 35 seconds ago
[INFO] SYSTEM (5e54a881-40bb-4918-8ca0-8b261c9d877b)
Message: Network map updated
Time: 22 seconds ago
OS: windows/amd64
Daemon version: 0.59.13
CLI version: 0.59.13
Profile: default
Management: Connected to https://netbird.anon-iWpe0.domain:443
Signal: Connected to https://netbird.anon-iwpe0.domain:10000/
Relays:
[stun:netbird.anon-iWpe0.domain:3478] is Available
[turn:netbird.anon-iWpe0.domain:3478?transport=udp] is Available
[rels://netbird.anon-iWpe0.domain:443] is Available
Nameservers:
[1.1.1.1:53, 1.0.0.1:53] for [.] is Available
[10.12.x.x:53, 172.x.x.x:53, 172.x.x.x:53] for [de.anon-iWpe0.domain, anon-aPYsh.domain, ivda.anon-kzL3G.domain, anon-KgGkb.domain, anon-QJBl0.domain] is Available
FQDN: Peer1.anon-COGhR.domain
NetBird IP: 100.124.78.124/16
Interface type: Userspace
Quantum resistance: false
Lazy connection: false
Networks: -
Forwarding rules: 0
Peers count: 2/20 Connected


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?

  • [ x] Reviewed client troubleshooting (if applicable)
  • [ 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 @philzett on GitHub (Nov 14, 2025). **Describe the problem** We want to limit Traffic from a Group of Peers to a specific port. But as soon as the policy is active, all traffic to the peer is allowed. When disabling the policy no traffic at all is allowed. **To Reproduce** Steps to reproduce the behavior: 1. Created a Peergroup "Peers1" 2. Created a Network "Network1" with a Ressource "Host1" (10.12.0.195) and a Routing Peer "RoutingPeer1" (Masquerading enabled). We also use this routing peer for other traffic. 4. We created a policy "Policy1" which allows Traffic from "Peers1" to "Network1" TCP 8080 **Expected behavior** Access Host1 on tcp 8080. **Are you using NetBird Cloud?** No Please specify whether you use NetBird Cloud or self-host NetBird's control plane. **NetBird version** netbird-mgmt version 0.59.13 **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 ----------------- C:\Users\Peer1>netbird status -dA Peers detail: RoutingPeer1.anon-COGhR.domain: NetBird IP: 100.124.1.91 Public key: csRgyV7kxNbe0ElZMiG2IessE568x+itzFK+YsksLTE= Status: Connected -- detail -- Connection type: Relayed ICE candidate (Local/Remote): -/- ICE candidate endpoints (Local/Remote): -/- Relay server address: rels://netbird.anon-iWpe0.domain:443 Last connection update: 54 minutes, 35 seconds ago Last WireGuard handshake: 19 seconds ago Transfer status (received/sent) 290.6 KiB/288.8 KiB Quantum resistance: false Networks: 10.12.0.195/32 Latency: 0s Events: [INFO] SYSTEM (057ad8ba-357e-45a5-8ce2-3cac8b8a67ec) Message: Network map updated Time: 19 minutes, 53 seconds ago [INFO] SYSTEM (663089d2-c3dc-4da3-a99e-3e6b0824893f) Message: Network map updated Time: 16 minutes, 4 seconds ago [INFO] SYSTEM (9cb7c2e6-2d42-4092-9511-00c6e0ab77e1) Message: Network map updated Time: 14 minutes, 42 seconds ago [INFO] SYSTEM (b41c24f7-9c57-442c-8c69-d8df34f8cec6) Message: Network map updated Time: 14 minutes, 1 seconds ago [INFO] SYSTEM (d406f955-5785-4b48-bb5b-0ef5d888087c) Message: Network map updated Time: 12 minutes, 35 seconds ago [INFO] SYSTEM (5e54a881-40bb-4918-8ca0-8b261c9d877b) Message: Network map updated Time: 22 seconds ago OS: windows/amd64 Daemon version: 0.59.13 CLI version: 0.59.13 Profile: default Management: Connected to [https://netbird.anon-iWpe0.domain:443](https://netbird.anon-iwpe0.domain/) Signal: Connected to https://netbird.anon-iwpe0.domain:10000/ Relays: [stun:netbird.anon-iWpe0.domain:3478] is Available [turn:netbird.anon-iWpe0.domain:3478?transport=udp] is Available [rels://netbird.anon-iWpe0.domain:443] is Available Nameservers: [1.1.1.1:53, 1.0.0.1:53] for [.] is Available [10.12.x.x:53, 172.x.x.x:53, 172.x.x.x:53] for [de.anon-iWpe0.domain, anon-aPYsh.domain, ivda.anon-kzL3G.domain, anon-KgGkb.domain, anon-QJBl0.domain] is Available FQDN: Peer1.anon-COGhR.domain NetBird IP: 100.124.78.124/16 Interface type: Userspace Quantum resistance: false Lazy connection: false Networks: - Forwarding rules: 0 Peers count: 2/20 Connected -------------------------------------------- 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?** - [ x] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [ 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 07:10:04 -05:00
Author
Owner

@lixmal commented on GitHub (Nov 14, 2025):

Can you provide a debug bundle from the routing peer please?

@lixmal commented on GitHub (Nov 14, 2025): Can you provide a debug bundle from the routing peer please?
Author
Owner

@philzett commented on GitHub (Nov 17, 2025):

Hi, I uploaded with key:
d42cac7b2736a6b4537fce4c366a9292e41752f1352edbcd9653046d745349a9/35a1b8d7-77fd-480b-9e52-8ee59d13e1f8

@philzett commented on GitHub (Nov 17, 2025): Hi, I uploaded with key: d42cac7b2736a6b4537fce4c366a9292e41752f1352edbcd9653046d745349a9/35a1b8d7-77fd-480b-9e52-8ee59d13e1f8
Author
Owner

@philzett commented on GitHub (Nov 17, 2025):

And another one after also updating routing peer to latest:
d42cac7b2736a6b4537fce4c366a9292e41752f1352edbcd9653046d745349a9/74cb1918-f3a3-4cc7-bfea-10386bf42a16

@philzett commented on GitHub (Nov 17, 2025): And another one after also updating routing peer to latest: d42cac7b2736a6b4537fce4c366a9292e41752f1352edbcd9653046d745349a9/74cb1918-f3a3-4cc7-bfea-10386bf42a16
Author
Owner

@lixmal commented on GitHub (Nov 19, 2025):

You have a rule for 10.8.0.0/13 that allows ALL. That subnet includes 10.12.0.195

@lixmal commented on GitHub (Nov 19, 2025): You have a rule for `10.8.0.0/13` that allows `ALL`. That subnet includes `10.12.0.195`
Author
Owner

@philzett commented on GitHub (Nov 20, 2025):

Thank you for investigating, but that rule should be for other clients. Also the Client limited to 10.12.0.195 can not reach any other address in 10.8.0.0/13.

It can only contact 10.12.0.195 as intended, but the limitation to Port TCP 8080 does not work

@philzett commented on GitHub (Nov 20, 2025): Thank you for investigating, but that rule should be for other clients. Also the Client limited to 10.12.0.195 can not reach any other address in 10.8.0.0/13. It can only contact 10.12.0.195 as intended, but the limitation to Port TCP 8080 does not work
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2460