cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6251
Views
10
Helpful
5
Replies

IP address in same subnet or not

I want to know how a PC determines whether another PC is on same subnet or not
as i have been taught a PC applies its own Subnet mask to the IP address and determines its network portion.
But please Consider the Below Question for answering

PC1 : 10.1.1.1  /24 Mask
PC2 : 10.1.1.2  /16 Mask

Now if PC1 applies its network mask to PC2s IP address will it think that they are on the same network

Can Anyone Please Explain me with this Example.

2 Accepted Solutions

Accepted Solutions

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @ojasdillikar4794214 ,

the two devices in your example are in overlapping IP subnets.

 

PC1 : 10.1.1.1 /24 Mask
PC2 : 10.1.1.2 /16 Mask

 

10.1.1.0/24  is a subnet of 10.1.0.0/16

 

Both will think that the other host is in the same subnet as it is and to resolve the MAC address of the other host they will use ARP.

 

The two devices may be able to talk even if the subnet mask is different as ARP request are sent to FFFF.FFFF.FFFF broadcast destination.

 

Now let's suppose that these two devices are connected to a switch and a router R1 connects to a third port in same VLAN.

R1 has IP 10.1.1.254/24

R1 has another interface in another VLAN with IP 10.1.2.254/24.

 

PC1 if configured with def gW 10.1.1.254 will be able to send packets to an host in 10.1.2.0/24

PC2 will try to ARP to resolve each host in 10.1.2.X thinking they are in the same subnet,

Now depending on R1 configuration R1 can help PC2 by answering an ARP request for 10.1.2.X with the MAC address of its interface with IP address 10.1.1.254.

This feauture is called Proxy ARP and from a security point of view is recommended to disable it.

 

Hope to help

Giuseppe

 

View solution in original post

 

By default it will fail because each device thinks the other is local, see Giuseppe's example below and by all means come back if you still have questions. 

 

Jon

 

 

View solution in original post

5 Replies 5

Jon Marshall
Hall of Fame
Hall of Fame

 

Your understanding is correct. 

 

Both PCs will think each is in the same subnet even though they are using a different subnet mask and if they were in the same vlan they would be able to communicate. 

 

Jon

Thank you for the answer , I was starting to doubt my understand buy What
If they are not on the Same VLAN , they are completely separated by a
router , will they still be able to communicate ? Or will it fail

 

By default it will fail because each device thinks the other is local, see Giuseppe's example below and by all means come back if you still have questions. 

 

Jon

 

 

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @ojasdillikar4794214 ,

the two devices in your example are in overlapping IP subnets.

 

PC1 : 10.1.1.1 /24 Mask
PC2 : 10.1.1.2 /16 Mask

 

10.1.1.0/24  is a subnet of 10.1.0.0/16

 

Both will think that the other host is in the same subnet as it is and to resolve the MAC address of the other host they will use ARP.

 

The two devices may be able to talk even if the subnet mask is different as ARP request are sent to FFFF.FFFF.FFFF broadcast destination.

 

Now let's suppose that these two devices are connected to a switch and a router R1 connects to a third port in same VLAN.

R1 has IP 10.1.1.254/24

R1 has another interface in another VLAN with IP 10.1.2.254/24.

 

PC1 if configured with def gW 10.1.1.254 will be able to send packets to an host in 10.1.2.0/24

PC2 will try to ARP to resolve each host in 10.1.2.X thinking they are in the same subnet,

Now depending on R1 configuration R1 can help PC2 by answering an ARP request for 10.1.2.X with the MAC address of its interface with IP address 10.1.1.254.

This feauture is called Proxy ARP and from a security point of view is recommended to disable it.

 

Hope to help

Giuseppe

 

Thanks a lot , You explained it Really well . Happy that you made me understand it well ☺

Review Cisco Networking for a $25 gift card