It is necessary to block all addresses: 109.207.13.X ie from 22.214.171.124 to 126.96.36.199
I read that the number of addresses is indicated:
Please tell me how to? And that means / 16/24?
Answer 1, Authority 100%
/ 16 ,
/ 24 – is the designation of classes of networks
To rewrite the materiel will not, therefore, read here .
experiment and clearly understand the correct understanding can here .
As for said “109.207.13.X ie from 188.8.131.52 to 184.108.40.206”, it is a class C network, ie,
220.127.116.11/24 with the subnet mask
/ 24 means representing the mask in decimal form, namely with its binary notation
11111111.11111111.11111111.00000000 , i.e., mask
24 bits of the possible
32 -x, and the number of possible hosts in this subnetwork, as in the case of thy , just
256 , ie from
255 , inclusive).
Ah .. Once went to a booze – Cut the last cucumber ..
So, what is
/ 24 : IP address (IPv4) address is composed of 4 bytes (32-bit, i.e., bit 4×8 divided point) where the format write in binary form looks like
11000000.10101000.00000000.00000001 . A decimal form similar record looks like a record of 4 numbers from
255 , inclusive, where
255 – the maximum number that can be expressed as in 8 bits, i.e.,
255 in binary format would look like this:
11111111 . Those. some IP, for example
192.168.0.1 , will appear in binary form as:
11000000.10101000.00000000.00000001 . If you take a network
192.168.0.0/24 and choose an IP address from the range of
192.168.0.0 - 192.168.0.255 , then the specific IP address of any of the 256 possible hosts (theoretically from the
255 and including) the subnet mask would look like this:
255.255.255.0 in decimal form), which means that
3h8 = 24 bits (left to right) in the address – are bits indicating the subnet address and the last 8 bits are reserved for the host IP addresses in the subnet, i.e., from the
255 (which is equivalent to
256 ti, and
256 – the number of all possible combinations of the
Now, further and deeper: for example, it does not require all
256 hosts on the same subnet, and want to divide the space into another
2 subnet (for
128 hosts in each). Then it is possible to divide this network as follows: a subnet mask is
/ 25 – the number of bits from left to right) and the network get a
128 hosts in each:
0-127 in one (network
192.168.0.0 with the Broadcast Address
192.168 .0.127 ) and
192.168.0.128 with the Broadcast Address
192.168.0.255 ) in the other.
I will add more to understand (without going into the details of the operations with binary data), expressing simple words for quickly calculation in mind: once the IPv4 address consists of always from
4x8 = 32 Bit, and if the subnet mask in Some concrete case occupies, say,
24 bit (those from left to right), then
32-24 = 8 Bit goes under the range for IP addresses of hosts (read computers , network printers, other devices with your IPv4). And in order to calculate in this case, what is the number of possible hosts for each subnet with this mask, then it is necessary to
2 to build
8 – the number of zeros in the mask), i.e. The result will be
256 . If you take the
network 192.168.0.0/26 , the number of zeros will be equal to
6 -th (
32-26 ), then the number of hosts will be
2 ^ 6 = 64 , mask –
255.255.255.192 , and the number of subnets will be in this range will be equal to
4 -m (
4x64 in each).
Attentive notice, even without going into details that the amount of possible hosts in the subnet and the last number in the amount in the amount give
256 , and the number of subnets is
256 divided by
64 (number of hosts in each subnet, where
64 – only for this example! – Why, you need to understand yourself At least by analogy with
/ 16 , shown below) and make logical conclusions.
Well, based on the above, it is not difficult to decompose the following:
/ 16 (the so-called
class b ) – this is when it is possible
2 ^ 16 ) hosts in one subnet, i.e. The mask looks like this:
111111111.1111111.00000000.00000000 , i.e. The network address takes
8x2 = 16 bit (left), and under the IP addresses of hosts allocated also
8x2 = 16 (all possible combinations from
111111111111111 , i.e. just
65536 ) Bit value from the address (right). Those. The range of IP addresses of hosts in decimal form looks like this: from
192.168.255.255 , where the subsnet mask
/ 16 , i.e.
Well, so on ..
As for “please tell me how it is right?” – If we are talking about
.htaccess , you can safely use
Deny and specify
Order Allow, Deny ALLOW FROM ALL Deny From 18.104.22.168/224
If it comes to blocking in some
Juniper – then it is then in their documentation and on the rutcode 🙂