-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headscale does not start with large networks in ACLs #1372
Comments
Hi, Same issue here. I'm actually using large networks in order to allow access through exit nodes to the internet only, so quite problematic.
|
Hi, I started debugging and found a possible problem with the generation of the ACLPeerCacheMap. The generateACLPeerCacheMap function in acls.go creates a struct for each destination IP. If I understand the code correctly, the code should only look if the peer is included in the destination prefix. |
Yes, this is kind of known, the logic was not correct, and the current working version is not attempted optimised, the main goal was for it to be correct. The goal would be to rewrite it later to provide a version that does not do something silly like listing all IPs. As @pkrivanec the way to do this properly is by doing ip prefixes instead of single IPs, but that required more planning and rewrites, and we needed to get the tests right first, before we can start changing it. |
This unfortunately is a blocker for our organization too. Edit: I noticed #1377 has a potential fix. I'll give that patch a try and report back in that issue. |
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
I have rewritten this whole thing in #1381, this is an unoptimised, but "way smarter and cleaner" solution, I have added @Chluz case as a test case so we don't regress. The initial version was a lot of cladding on a suboptimal temp solution, but this should be closer to something we can live with. I think it should not need optimalisations before it's useful, but I'll look into that as part of ACL refactoring. The previous few PRs was mostly to get tests that we could be confident in so we now can refactor it without too much worry. I appreciate that it lead to one really bad decision, but now we can write a faster solution without breaking things. Would be great if someone tests #1381 while I am working on it, and apologies for the inconvenience. |
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
resolved in next release |
Hi,
headscale v0.22.1 does not work with large networks (10.0.0.0/8) in ACLs.
The v0.21.0 version had no problem with this configuration.
Bug description
Headscale does not start correctly and uses 100% CPU and memory.
To Reproduce
Use acl.hujson:
Context info
The text was updated successfully, but these errors were encountered: