[GH-ISSUE #5709] rules work the other way around #10940

Closed
opened 2026-08-05 01:27:45 -04:00 by saavagebueno · 2 comments
Owner

Originally created by @rolikeusch on GitHub (Mar 26, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5709

Describe the problem
the new rules work the other way around. for example, if I block a country, I can still access it, but if I allow a country, it gets blocked. the same with ip addresses.

To Reproduce

Steps to reproduce the behavior:

  1. Go to services
  2. Click on Rules
  3. Add a new Rule e.g Allow only -- Country -- Switzerland
Image

Expected behavior

Now when I access with an ip from Switzerland, I get blocked.

My IP:

curl https://ipinfo.io               
{
  "ip": "109.xxx.xxx.xx",
  "hostname": "109-xxx-xxx-xx.init7.net",
  "city": "xxxxx",
  "region": "Zurich",
  "country": "CH",
  "loc": "xxxxxxxxxxx",
  "org": "AS13030 Init7 (Switzerland) Ltd.",
  "postal": "xxxx",
  "timezone": "Europe/Zurich",
  "readme": "https://ipinfo.io/missingauth"
}
Image

if I set the rule to blocked:

Image

I can access the website:
Image

Are you using NetBird Cloud?

No,

NetBird version

Management. v0.67.1
Dashboard. v2.36.0

Originally created by @rolikeusch on GitHub (Mar 26, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5709 **Describe the problem** the new rules work the other way around. for example, if I block a country, I can still access it, but if I allow a country, it gets blocked. the same with ip addresses. **To Reproduce** Steps to reproduce the behavior: 1. Go to services 2. Click on Rules 3. Add a new Rule e.g Allow only -- Country -- Switzerland <img width="669" height="455" alt="Image" src="https://github.com/user-attachments/assets/ecce6ad8-953b-4f15-9993-d06a1570f881" /> **Expected behavior** Now when I access with an ip from Switzerland, I get blocked. My IP: ``` curl https://ipinfo.io { "ip": "109.xxx.xxx.xx", "hostname": "109-xxx-xxx-xx.init7.net", "city": "xxxxx", "region": "Zurich", "country": "CH", "loc": "xxxxxxxxxxx", "org": "AS13030 Init7 (Switzerland) Ltd.", "postal": "xxxx", "timezone": "Europe/Zurich", "readme": "https://ipinfo.io/missingauth" } ``` <img width="837" height="288" alt="Image" src="https://github.com/user-attachments/assets/88d5df0e-55eb-4092-9ee4-49c78be19335" /> if I set the rule to blocked: <img width="677" height="452" alt="Image" src="https://github.com/user-attachments/assets/e4ee1795-a83e-4f5e-b6bc-b14d9e793b85" /> I can access the website: <img width="1258" height="486" alt="Image" src="https://github.com/user-attachments/assets/dfbc886f-3858-4a2d-8ec1-40f59d02e1ba" /> **Are you using NetBird Cloud?** No, **NetBird version** Management. v0.67.1 Dashboard. v2.36.0
saavagebueno added the triage-needed label 2026-08-05 01:27:45 -04:00
Author
Owner

@lixmal commented on GitHub (Mar 27, 2026):

Can you provide some logs? The behavior you describe is consistent with the proxy not seeing your real IP. When it evaluates rules against the wrong address:

  • "Allow only" sets a default-deny policy: your IP must match to be allowed. If the proxy sees a different IP, it won't match, so everything gets blocked.
  • "Block" keeps a default-allow policy: only matching IPs are rejected. If the proxy sees a different IP, nothing matches the blocklist, so everything passes through.

This applies to both country and IP rules. Check whether your infrastructure (load balancer, ingress controller) is forwarding the real client IP to the proxy.

<!-- gh-comment-id:4140086051 --> @lixmal commented on GitHub (Mar 27, 2026): Can you provide some logs? The behavior you describe is consistent with the proxy not seeing your real IP. When it evaluates rules against the wrong address: - "Allow only" sets a default-deny policy: your IP must match to be allowed. If the proxy sees a different IP, it won't match, so everything gets blocked. - "Block" keeps a default-allow policy: only matching IPs are rejected. If the proxy sees a different IP, nothing matches the blocklist, so everything passes through. This applies to both country and IP rules. Check whether your infrastructure (load balancer, ingress controller) is forwarding the real client IP to the proxy.
Author
Owner

@rolikeusch commented on GitHub (Apr 22, 2026):

sorry I found the issue. I saved the logs as a file, so Netbird couldn't access them anymore. It's working now.

<!-- gh-comment-id:4299446638 --> @rolikeusch commented on GitHub (Apr 22, 2026): sorry I found the issue. I saved the logs as a file, so Netbird couldn't access them anymore. It's working now.
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#10940