What does 192.168.0.0/24 mean?
There are two parts two an IP address – the network number and the host number. At home I have the IP 192.168.1.15, and here the .15 is the host number (the IP of my machine) and the network number is 192.168.0.
Each IP is made up of four other numbers – in the case of my home IP it’s 192.168.1.15 and at work it’s 10.0.0.8. Each of those decimals is between 0-255 and represents 1 byte (8 bits) of binary:
192.168.1.15 translates as 11000000.10101000.00000001.00001111
The slash after the IP address denotes the subnet mask. A subnet mask defines what is part of the network and what is not. Often when you see an IP address you’ll also see a subnet mask. It’s probably written as 255.255.255.0 and that’s the same as /24, meaning that you are using the first 24 bits of the whole address. A subnet of 255.255.0.0 would be /16 and using the first 16 bits, and a subnet of 255.0.0.0 would be /8 and the first 8 bits. Each of the four blocks in an IP address is worth 8 bits, or 1 byte, and it’s the number of bits that’s important. The / refers to the number of bits in the subnet mask.
So let’s say we have a subnet mask of 255.255.255.0 and an IP of 192.168.1.15
An AND operation is performed on the IP and the subnet values. AND operations use the following rules:
1 AND 1 = 1
0 AND 0 = 0
0 AND 1 = 0
1 AND 0 = 0
So when you AND the two together you are doing this:
11000000.10101000.00000001.00001111 (192.168.1.15 IP address)
11111111.11111111.11111111.00000000 (255.255.255.0 subnet)
11000000.10101000.00000001.00000000 converts back to decimal as 192.168.1.0
So your network will be any address from 192.168.1.0-192.168.1.255.
So instead of writing 255.255.255.0 a nice, shorthand version is 192.168.1.0/24. This notation is called CIDR (Classless Inter-Domain Routing) notation.