VLANs, Trunks and STP Explained
VLANs, trunks and Spanning Tree
- An access port carries one VLAN, untagged. switchport mode access + switchport access vlan 10. - A trunk carries many VLANs with 802.1Q tags; the native VLAN (default 1) is untagged. Both ends must agree. - Inter-VLAN routing: a router subinterface per VLAN (encapsulation dot1Q 10) — "router-on-a-stick" — or an SVI on a layer-3 switch.
Spanning Tree stops loops. The switch with the lowest bridge ID (priority + MAC) is root. Every other switch picks one root port (lowest cost to root); each segment has one designated port; the rest are blocked. Set the root on purpose: spanning-tree vlan 1 priority 4096 (multiples of 4096) or spanning-tree vlan 1 root primary.
EtherChannel bundles links so STP sees one logical port: LACP active/passive, PAgP desirable/auto, or static on.