Example 1.
Assume that there is a PC A with IP: 192.168.1.10 and subnet mask: 255.255.255.0. PC A wants to connect PC B with IP: 192.123.2.3. Multiply IP of PC A by the 4 digits of subnet mask A (convert 255 as 1). Then multiply the 4 digits of PC B’s IP by the 4 digits of PC A’s subnet mask (convert 255 as 1). If the sum is the same, they are in the same LAN. If not, they aren’t.
IP (PC A): 192.168.1.10 <--192.168.1.10
Subnet mask (PC A): 255.255.255.0 <--1.1.1.0
Result: 192.168.1.0
IP (PC B): 192.123.2.3 <--192.123.2.3
Subnet mask (PC A): 255.255.255.0 <--1.1.1.0
Result: 192.123.2.0
As 192.168.1.0 192.124.2.0, PC A and PC B are not in the same LAN.
Example 2.
PC A with IP: 192.168.1.10 and subnet mask: 255.255.255.0; PC B with IP 192.168.1.39.
IP (PC A): 192.168.1.10 <-- 192.168.1.10
SM (PC A): 255.255.255.0 <-- 1.1.1.0
Result: 192.168.1.0
IP (PC B): 192.168.1.39 <-- 192.168.1.39
SM (PC A): 255.255.255.0 <-- 1.1.1.0
Result: 192.168.1.0
As 192.168.1.0=192.168.1.0, PC A and PC B are in the same LAN. |