حلول المختبر / VLANs and switching
Trunk not working between switches
Packet Tracer · GNS3 · Cisco IOS · آخر مراجعة
switchport mode trunk on both ends (two "dynamic auto" ports never become a trunk), add switchport trunk encapsulation dot1q first on switches like the 3560, make the native VLAN the same on both sides, and check that every VLAN exists on both switches and is in the allowed list.في هذه الصفحة
What you see
PC1 on Switch1 and PC2 on Switch2 are both in VLAN 10, but they can't ping. On the switches, show interfaces trunk shows nothing, or shows the trunk without VLAN 10.
Check it
show interfaces trunkon both switches. The link must be listed with mode "on" (or "desirable") and status "trunking".- Look at the last two blocks: "Vlans allowed and active in management domain" and "Vlans in spanning tree forwarding state". Your VLAN must be in both.
show interfaces g0/1 switchportshows the administrative and the operational mode. "Administrative: dynamic auto, Operational: static access" means the port did not become a trunk.show vlan briefon both switches. A VLAN that only exists on one switch is not carried.
Fix: make it a trunk on both sides
Two ports in dynamic auto wait for each other forever and stay access ports. Just set both ends to trunk:
interface g0/1
switchport mode trunk
On switches that also speak ISL (Catalyst 3560 in Packet Tracer, many IOU images in GNS3), you get "An interface whose trunk encapsulation is Auto can not be configured to trunk mode". Set the encapsulation first:
interface g0/1
switchport trunk encapsulation dot1q
switchport mode trunk
Fix: native VLAN mismatch
If one side uses native VLAN 99 and the other uses 1, CDP prints %CDP-4-NATIVE_VLAN_MISMATCH and untagged traffic lands in the wrong VLAN. Use the same native VLAN on both ends:
interface g0/1
switchport trunk native vlan 99
Fix: the VLAN is not allowed or does not exist
Create the VLAN on every switch that carries it:
vlan 10
name STAFF
If you limited the allowed list, add the VLAN with the word add. Without add, the command replaces the list and you may cut off every other VLAN:
interface g0/1
switchport trunk allowed vlan add 10
Still not working?
- If VTP is in use, a switch in client mode can lose VLANs when a server with a higher revision number joins. Check
show vtp status. - A blocked port in spanning tree shows as trunking but forwards nothing for that VLAN. Check
show spanning-tree vlan 10.