You need to know subnet mask and IPv4 adress of each PC.
Open a command/terminal prompt.
ipconfig for Windows
ifconfig for Linux.
Look at the subnet mask. Does it match?
NO: You know right away computers are not on the same network.
YES: Proceed below to determine whether or not computers are on the same subnet.
Compare IP addresses to determine if devices are on the same subnet.
We will be using most common subnet mask of 255.255.255.0 as example. It tells us the size of the network block:
- In each of the four sections, if the value is 255, we will substitute that with a 0.
- If there is any other number in the section, we then subtract that number from 256.
- In the example above, we would get 0.0.0.256 (256 - 0 = 256). This is a block of 256 numbers.
If the subnet were 255.255.252.0, we substitute and get 0.0.4.256. This is a block of 1024 addresses (4 x 256 = 1024).
When comparing two IP address/subnet combinations, the addresses must match for any section where the subnet value is 255. For a subnet of 255.255.255.0, we expect to see the first three sections of the IP address match (reading left to right) if they are in the same subnet.
The key is to match up the subnet and the IP address. Let’s look at four examples: