-
Notifications
You must be signed in to change notification settings - Fork 50
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
Max entries for ipsets #16
Comments
ok nice. Thanks! When you say it takes 48MB or ram, what do you measure? iprange memory? kernel ipset memory? |
I am using ipset to output the info on the set. So I assume this is system ram that ipset is using for that set. Ex:
|
Can you post the one it says 48MB? |
Had to regenerate it since I deleted it. Can't figure out what I did to get that really large list but here is one that is pretty big.
That's 14.6MB (13403576 bytes) after being reduced with the default settings in iprange.
|
Well, this is the trade off. As the wiki page says, for each prefix in an ipset, another lookup is made by the kernel. If you give it 20 prefixes, the kernel will do 20 lookups for each packet it checks against this ipset. Depending on the amount of traffic on your systems and the design of your firewall, this may or may not affect performance. In general, the kernel is very fast, and most probably you will notice increased CPU utilization and system load if the amount of traffic is huge. The design of your firewall is important too. You should utilize the connection tracker, so that only the first packet of each connection is checked against the ipset. So, once the connection is accepted, all other packets will just flow unchecked. If you use firehol, set |
Thanks. I am using connection tracker so it should all work out fine. |
Something like this? ipset -L NAME | grep ^[0-9] | iprange -v >/dev/null |
Just gives me the same result. |
I was wondering if you could help me in understanding the wiki page for iprange.
I've been trying to understand how to best reduce my ip sets. From what I can tell an ipset can be millions of entries long and there will be no appreciable loss in speed. The only trade off is in ram usage. The larger the set the greater the ram. Do you know if that is really the case?
I have a raw country.list that is 19193 entries long, with 19 CIDRs, and takes up .48MB or ram by running
ipset list country.list
If I run iprange like this:
iprange -v --ipset-reduce 0 --ipset-reduce-entries 100000 country.list >/dev/null
I get a set that contains:
3 CIDR prefixes
64012 entries
Ram now nearing 1.5MB
I have other sets using as much as 23MB of ram, 26 CIDR prefixes, and over 90000 entries. I could reduce them further but they are going to get tremendously huge.
Do you have any thoughts on if this will slow the network down or if the only adverse effect is ram consumption?
Is there an amount of ram I should be trying to keep my sets under?
Thanks for creating such a great tool.
The text was updated successfully, but these errors were encountered: