-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow multiple IP addresses #39
Comments
I just found that this isn't currently possible, unfortunately this + #72 is a show stopper for me, I might try and have a look through the code to see if I can contribute but I'm not much of a dev 😅 A example of where multiple IPs might be required is if you have one IP that's a load balancer (say traefik) for local network routing, and one or more IPs that can access it directly. |
I agree the ability to specify multiple IPs per rule would be nice, but to be clear it wouldn't add functionality that isn't currently possible now. Creating multiple whalewall rules with the same options but different IPs would create the same nftable rules as creating one whalewall rule with multiple IPs. Unless I'm missing something, could you create multiple rules in the meantime @sammcj? I welcome contributions, if you do decide to take a stab at it and need help feel free to open a discussion and I'll help as best I can. |
Oh can you @capnspacehook? I tried a bunch of different things that seemed to be invalid:
etc... Also the wording around multiple items is a little confusion (for me at least).
Does "range" here mean:
|
Oh you're trying to set multiple IP addresses with mapped port rules... Yeah that isn't possible now unfortunately. Now what you were saying before makes more sense. In this case the ability to specify multiple IP addresses per rule would actually add new functionality. I think now you should be able to specify multiple mapped port rules anyway, but being able to specify multiple IPs per rule would be a good start. As for IP ranges, the format is as you first stated: 192.168.0.2-192.168.0.254. I'll add examples of the to the README. |
@sammcj just added support for multiple IP addresses per rule, can you try with the latest version of whalewall and confirm it works for your use case? Note that you'll now need to use |
Awesome, thanks so much for looking into this @capnspacehook ! I just tried it and it complains that no ip (without s) rule was found:
config:
Looking at the updated docs, I saw that external doesn't have the ips option like output has, so I removed the external ips but the same error occurred:
Is there a way to get the error logs to print the lint that it has an issue with? |
'mapped_ports.external' does have an 'ips' field, that's a mistake on my part. Updated the README. I think the issue is that your first 'output' rule is not a list entry, but a key instead. As for improving the error message, I don't think that's possible unfortunately, I'm pretty sure that error is directly from the yaml parser I'm using. I can look to see if I can improve the error message but can't make any promises. |
Ah ok, I might submit a PR to add to the documentation so that idiots like me find it easier to follow 😄 I think what keeps throwing me is the combination of terminology (external vs outbound vs output vs inbound) and the difference / mix of the use of lists and keys. For example:
So while this seems to run without errors:
Looking at the documentation, I think it should be more like:
Which also seems to work without errors. |
Yeah feel free to make a PR to improve the docs, I'm sure they could be improved. I'm not exactly sure what you're trying to convey with your two different versions of the config, the main difference I see is the second config uses 'log_prefix'? |
Could be useful set multiple ip addresses (now whalewall only allow ranges or a single IP addr) delimited by commas in a single whalewall rule to simplify it.
Actual:
Enhanced:
The text was updated successfully, but these errors were encountered: