08-28-2017 10:38 AM - edited 03-08-2019 11:51 AM
i have connected 3 pc to a switch without creating a vlan.
two pc having ip address 198.162.20.2 and 198.162.20.3 are pinging with each other but 3rd pc having ip address 125.25.30.2 is not pinging with anyone, why?
08-28-2017 11:45 AM
Your switch by default has all ports assigned to same VLAN, then when your PC sends an ICMP echo request (ping) it will send firts an ARP request complete IP and MAC addresses pair information.
When PC a pings to PC B, the L2 broadcast is received by PB and then it replies adn PC A will know what's the IP address and MAC and it will send the echo request with complete MAC and IP information.
for PC C, PC A will match the IP address against its own and because it does not belong to same segment, PC A will send the request to its default gateway, which is not present in your example, so traffic is discarded from beggining because it's not a a local communication.
Even when they are directly connected, the logical addressing makes impossible to reach that host.
08-28-2017 11:56 AM
Hi
Based on your post, you assigned an IP address to 3 PCs and no gateway configured. and I bet you used /24 as subnet mask.
When PC1 (198.162.20.2) send a ping to PC3 (125.25.30.2), the PC will do some tests:
1. Does IP 125.25.30.2/24 is in the same network as me compary the first 3 bytes : Compare [125.25.30] to [198.162.20] (comparing only the 3 first bytes because the last one is for hosts for a /24). As the network is different, it has to send it to its gateway but it don't have any then the icmp is dropped by the switch because it don't know what do.
This is a small explanaition that I hope it helps.
PS: Please don't forget to rate and select as validated answer if this answered your question
08-28-2017 12:13 PM
i have given the default gateway to all the pc still they are not pinging.
08-28-2017 12:15 PM - edited 08-28-2017 12:16 PM
and it won't work until you correct teh ip addressing and all they belong to same network, or you configure secondary ip addresses in the default gateway to male communication possible from all 3 PC to the default gateway.
08-28-2017 12:23 PM - edited 08-28-2017 12:24 PM
You have the solution of secondary IP that will work.
For a test (not recommended in production), just for learning how arp and this stuff works.
If you setup on your machines the gateway with its own IP address it will works (should be physical not virtual machines)
PS: Please don't forget to rate and select as validated answer if this answered your question
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide