Home computickets What is / 24/16 ip-address?

What is / 24/16 ip-address?

Author

Date

Category

It is necessary to block all addresses: 109.207.13.X ie from 109.207.13.0 to 109.207.13.255

I read that the number of addresses is indicated:
So:
109.207.13.0/16
or so:
109.207.13.0/24

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 109.207.13.0 to 109.207.13.255”, it is a class C network, ie, 109.207.13.0/24 with the subnet mask 255.255.255.0 (where / 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 0 to 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 0 to 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 0 to 255 and including) the subnet mask would look like this: 11111111.11111111.11111111.00000000 (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 0 to 255 (which is equivalent to 256 ti, and 256 – the number of all possible combinations of the 00000000 to 11111111 ).

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 255.255.255.128 (ie 11111111.11111111.11111111.10000000 or / 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 128-255 (Network 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 (where 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 256 and 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 65536 (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 00000000.00000000 to 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.0.0 to 192.168.255.255 , where the subsnet mask / 16 , i.e. 255.255.0.0

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 109.207.13.0/24 .

Order Allow, Deny
ALLOW FROM ALL
Deny From 109.207.13.0/224

If it comes to blocking in some Cisco or Juniper – then it is then in their documentation and on the rutcode 🙂

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions