PHP Subnet Calculator. Enter an IP/Mask as follows:
192.168.1.1/255.255.255.0 please.
The apache2 web server confronts dayly to the massive automatic attacks
from some geographical zones of which the IP intervals
are known and fixed by the 5
RIRRegional Internet Registry: AFRINIC, APNIC, ARIN, LACNIC, RIPE NCC.s in the World,
which consumes uselessly your bandwidth,
and worse block the human visitors from loading your page, we can do it
simply with the following directive in the configuration file like /etc/apache2/apache2.conf:
<Location />
Deny from 192.168.1.0/255.255.255.0.
</Location>
We have specified here the forbidden subnet addresses by the couple IP/IP-Mask.
The IP mask can be given in two ways.
The first is like 192.168.1.1/255.255.255.0 for a subnet of class C,
prohibiting the following machines: 192.168.1.1 - 192.168.1.255.
The second way is to use the sum of high-bits of the IP mask,
192.168.1.1/24. Effectivelt the IP mask 255.255.255.0 in binary form is as follows:
11111111.11111111.11111111.00000000, which includes exactly 24 non-zero high-bits (the most left bytes).
The above directive is so equivalent to this one:
<Location />
Deny from 192.168.1.0/24
</Location>
.