Two PCs on the Same Switch Cannot Ping

intermediate
LAB TOPOLOGY

Department VLAN Lab

One access switch · four isolated broadcast domains · port map follows the supplied lab

VLAN 10 · SALES · 192.168.10.0/27VLAN 20 · MARKETING · 192.168.20.0/26VLAN 30 · FINANCE · 192.168.30.0/27VLAN 40 · IT · 192.168.40.0/28VLAN 10NICE0/0VLAN 10NICE0/1VLAN 20NICE0/2VLAN 20NICE0/3VLAN 30NICE1/0VLAN 30NICE1/1VLAN 30NICE1/2VLAN 40NICE1/3VLAN 40NICE2/0VLAN 40NICE2/1PC1SALES192.168.10.10/27PC2SALES192.168.10.11/27PC3MRKT192.168.20.10/26PC4MRKT192.168.20.11/26SW1L2 ACCESS SWITCHPC5FINANCE192.168.30.10/27PC6FINANCE192.168.30.11/27PC7FINANCE192.168.30.12/27PC8IT192.168.40.10/28PC9IT192.168.40.11/28PC10IT192.168.40.12/28
Topology note:VLAN IDs, subnet sizes and switch-port assignments follow the supplied VLAN lab. Host IPs are example usable addresses inside those exact subnets.

Situation

PC1 and PC2 are connected to SW1. Both links are up. PC1 is 192.168.10.10/24; PC2 is 192.168.10.20/24. They should be local neighbours, but ping fails.

SW1# show vlan brief
VLAN Name       Status Ports
10   SALES      active E0/1
20   MRKT       active E0/2

Your task

Before opening the answer, decide: is this an IP-routing problem, an ARP problem, or a VLAN membership problem? Which single command above gives the strongest clue?

Think through the packet

PC1 sees PC2 as local because both addresses are /24, so PC1 sends an ARP broadcast. SW1 does not flood that broadcast from VLAN 10 into VLAN 20. PC1 therefore cannot learn PC2’s MAC address.

Root cause

E0/1 and E0/2 are in different VLANs even though the IP addresses suggest the hosts belong to the same IP subnet. The Layer-2 design and Layer-3 addressing disagree.

Fix

Put both hosts in the intended VLAN, or redesign addressing/routing if they truly belong in different VLANs. Never “fix” this by randomly changing the gateway.

Verification

show vlan brief → clear ARP cache if needed → ping again → inspect show mac address-table dynamic.