I have a question about network masks.

  • Host A IP :
  • Host B IP :

Why is PC1 able to ping PC2, but when PC2 tries to ping PC1, it times out? Can I get a detailed explanation?

Edit for clarification:

On PC1 we did ping -c2, and we did get a reply successfully from PC2. On PC2 we did ping -c2, and we did not get a reply successfully from PC1. We want to know why this happened?

enter image description here

Update: We used instead, and were able to ping PC1 to PC2, but not PC2 to PC1, which is what we wanted. Can someone explain why this is?

  • You need to give a lot more context around this. If those two hosts are connected to the same switch, on the same VLAN. There is no reason they shouldn't be able to ping each other. – Ron Maupin Apr 3 '16 at 22:11
  • Now if host B's IP had been instead, then packets would go from A to B, but they shouldn't go back, so it shouldn't ping. – Law29 Apr 3 '16 at 22:56
  • I edited my question. – yoman Apr 4 '16 at 0:04
  • There is something else going on. As I wrote in my first comment, based on the information you have given us, and if both PCs are on a single VLAN, there is no reason the two PCs can't ping each other. You should give us more information, e.g. a diagram, switch model(s) and configurations, etc. The PCs, themselves, are off-topic here. – Ron Maupin Apr 4 '16 at 0:23
  • 1
    They are either in different layer-2 networks, or there's a firewall involved: A ping B, B answers; B pings A, A ignores it. – Ricky Beam Apr 4 '16 at 0:37

It's because the two PCs are on different networks. The PC with is on a network which spans hosts to, while the PC with is on a network with hosts from to, but the network doesn't include the first PC with the address Clearly the second host thinks the first host is on a different network.

When an IP host wants to send something to another IP host, it first looks to see if the destination IP address is on the same network as itself. If not, it sends the traffic to its configured gateway.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.