Open Jas0n99 opened 5 years ago
Yes, it does have an internal default. But there are 2 reduce
parameters. From the iprange -h
:
--ipset-reduce PERCENT
--reduce-factor PERCENT
> IPSET REDUCE mode
Merge all files and print the merged set,
but try to reduce the number of prefixes (subnets)
found, while allowing some increase in entries.
The PERCENT is how much percent to allow increase
on the number of entries in order to reduce
the prefixes (subnets)
(the internal default PERCENT is 20).
Use -v to see exactly what it does.
The resulting set is sorted.
--ipset-reduce-entries ENTRIES
--reduce-entries ENTRIES
> IPSET REDUCE mode
Allow increasing the entries above PERCENT,
if they are below ENTRIES
(the internal default ENTRIES is 16384).
So, to enable reduce
mode you have to give either --ipset-reduce PERCENT
or --ipset-reduce-entries ENTRIES
. For the one not given in the parameters, the default will be used. But if you use one of these parameters, you have to overwrite its default value.
Ah okay, that makes sense, just not clearly documented anywhere... hehe...
The man page of iprage says the option --ipset-reduce has "the internal default PERCENT is 20". Yet, when you don't use a number after the option strange things happen.
For instance:
Will sit there and wait saying:
If you move the -v after the reduce:
It appears to work, but it does NOT output any of the verbose content that it should.
Only way to get it to work as expected is to include the percentage amount, i.e.:
If you run without the -v or percent, it just sits there (presumably waiting for stdin).
So I'm not sure if it's just the documentation not being real specific (what would be point be of saying what an internal default is if you must explicitly always specify it?) or an actual bug.