BlueMesh

هذه الصفحات متوفرة بالإنجليزية فقط حاليًا.

حلول المختبر / VLANs and switching

PCs on the same switch can't ping

Packet Tracer · GNS3 · Cisco IOS · آخر مراجعة

الجواب المختصرTwo PCs on the same switch only talk directly when their ports are in the same VLAN and their IPs are in the same subnet with the same mask. Check show vlan brief, then each PC's IP settings. Also check for a shut or err-disabled port, a duplicate IP, and (in GNS3 with real PCs) the PC firewall.
في هذه الصفحة

Check it

  1. show vlan brief on the switch. Are both PC ports in the same VLAN? A port missing from the list is a trunk or not a switch port at all.
  2. On each PC, ipconfig. Same subnet, same mask? 192.168.1.10/24 and 192.168.2.10/24 are different networks even on the same switch.
  3. show interfaces status on the switch. Both ports should be "connected", not "disabled" or "err-disabled".
  4. Look for a duplicate IP. Two devices with the same address make ping work some of the time and fail other times.

Fix: put the ports in the right VLAN

vlan 10
 name STAFF
interface range f0/1 - 10
 switchport mode access
 switchport access vlan 10
 no shutdown

On real IOS, switchport access vlan 10 creates the VLAN if it doesn't exist, but it's clearer to create it yourself. If show vlan brief shows the VLAN as "act/lshut" or "suspended", turn it on with vlan 10 then no shutdown (or state active).

Fix: IP settings

Give both PCs addresses in the same subnet with the same mask. For a lab with one VLAN and no router, the gateway doesn't matter for this ping, but set it anyway so the next step works.

It works on the second try

The first ping in Packet Tracer often loses one or two packets while the PC sends ARP. That is normal behaviour, not a fault. Also, right after you plug in a PC, the switch port stays orange for about 30 seconds (spanning tree). See link stays orange.

In GNS3 with real PCs

Windows blocks incoming ping by default. If the switch config looks right, try with the Windows firewall off for a minute. VPCS and Linux hosts don't have this problem.

Port security

If port security is on and you moved a PC, the port may have shut itself (err-disabled). See interface down.

حلول ذات صلة