Page 1 of 1

A range of IP adresses possible ?

Posted: Sat Oct 02, 2021 10:13 pm
by Webmaster78
Hello,

In the following unreal.conf settings, for example for 194.187.248.0/22 :
ban ip {
mask 194.187.248.0;
mask 194.187.248.2;
mask 194.187.248.3;
... etc
mask 194.187.248.22;
reason "Access forbidden.";
};
Is it possible instead of indicating each IP address in my example from .0 to .22, to indicate a range of addresses ? If yes how to do ?

Thank you.

Re: A range of IP adresses possible ?

Posted: Mon Oct 04, 2021 9:47 pm
by CrazyCat
Well, 194.187.248.0/22 means 194.187.248.0 to 194.187.251.255, that's not exactly the same than 194.187.248.0-22 which is not a real notation, even if some softwares (as nmap) understand it.

But to answer your question, no, you can't use a range, you can only use wildcards.
You can try:

Code: Select all

mask 194.187.248.?;
mask 194.187.248.1?;
mask 194.187.248.20;
mask 194.187.248.21;
mask 194.187.248.22;
And each mask must be in its own ban block, I don't think you can have several mask in the same ban block.