As you have mentioned 192.168.10.0/24
specifies the range between 192.168.10.0
to 192.168.10.255
, /24
specifies number of masked bits out of 32 starting from left. So, in binary /24
would be represented as 1111 1111 1111 1111 1111 1111 0000 0000
and it is called a mask since first 24 bits of all IP's in this range are going to be same.
How /24
is useful is explained here:
Take an IP in the range, say 192.168.10.12
.When you apply a bitwise And
operation on this ip and /24
as follows
192.168.10.12 - 11000000 10101000 00001010 00001100
mask -/24 - 11111111 11111111 11111111 00000000
result of & - 11000000 10101000 00001010 00000000
you will get the result as 192.168.10.0
which is IP address of the network the host 192.168.10.12
belongs to. This is the way mask is helpful.