0

If Pc1 has IP 192.168.10.2 / 24 ---> Network ID : 192.168.10.0 and Pc2 has IP 192.168.11.3 / 23 ---> Network ID : 192.168.10.0 directly connected (no switches no routers). Why cant i ping?

But if chnage PC1 subnet mask to: /23 it works . Why?

Mahmoud
  • 3
  • 2

2 Answers2

0

For two hosts to directly communicate across a shared L2 segment, they need to be in the same subnet - from each one's perspective.

While 192.168.10.2 belongs to 192.168.10.0/23 from 192.168.11.3's perspective, the other direction doesn't work (192.168.11.3 is not part of 192.168.10.0/24 - but it is part of 192.168.10.0/23).

Zac67
  • 81,287
  • 3
  • 67
  • 131
0

Can 2 Directly connected PCs having the same network ID but different subnet mask talk?

Actually, you have two different networks:

  • 192.168.10.2/24 is in 192.168.10.0 to 192.168.10.255
  • 192.168.11.3/23 is in 192.168.10.0 to 192.168.11.255, but not in the first network

This first PC recognizes that the second PC is in a different network, so it will send packets destined to the second address to its configured gateway for delivery to a different network.

The second PC believes that the first PC is in the same network, so it sends packets destined to the first PC directly to the PC.

A host will mask the destination address with its configured mask to determine whether or not the destination is on the same network. When the first PC masks the destination address of the second PC, it determines that it is on a different network. When the destination is on a different network, then the host will encapsulate the packet in a frame destined to its configured gateway because the gateway is a host on the network that knows how to reach the other network.

Ron Maupin
  • 98,218
  • 26
  • 115
  • 191
  • Thx for info mate, dont think its a duplicate question, think the "A host will mask the destination address with its configured mask" is new. – Mahmoud Aug 28 '19 at 15:50
  • That is actually in my answer to the duplicate question. Please read the two-part answer I provided. – Ron Maupin Aug 28 '19 at 15:51