VLANs and access ports
A VLAN is a logical grouping of switch ports that share a broadcast domain. Ports assigned to the same VLAN act as if they are on the same physical switch, even if they span multiple physical switches. Ports in different VLANs cannot exchange frames directly. Only a Layer 3 device, a router or a multilayer switch, can carry traffic between VLANs.
Access ports carry traffic for a single VLAN. When a PC is plugged into an access port, frames arrive and leave untagged. The switch handles the VLAN assignment internally. The connected device has no idea it is on a VLAN. This is the normal configuration for workstations, printers, and IP phones.
VLANs are configured locally on each switch and must be created consistently across all switches in the network. The VLAN Trunking Protocol (VTP) can automate this propagation in Cisco environments, but it can also accidentally wipe VLAN databases if a switch with a higher revision number is added to the network. Many engineers use VTP transparent mode or simply configure VLANs manually.
Trunk links and 802.1Q tagging
A trunk link carries traffic for multiple VLANs between switches. When a switch sends a frame across a trunk, it inserts a 4-byte 802.1Q tag into the Ethernet frame that identifies which VLAN the frame belongs to. The receiving switch reads the tag, removes it, and forwards the frame out the correct access port for that VLAN.
The native VLAN is the one VLAN on a trunk that is not tagged. Frames arriving untagged on a trunk port are assumed to belong to the native VLAN. The default native VLAN is VLAN 1 on Cisco switches, and it must match on both ends of the trunk. A native VLAN mismatch causes CDP warnings and can result in traffic being placed in the wrong VLAN, which is a security risk.
The allowed VLANs list on a trunk controls which VLANs are permitted to traverse that link. By default, all active VLANs are allowed. Restricting this list improves security and reduces unnecessary broadcast traffic crossing trunk links that connect to areas where those VLANs have no presence.
Inter-VLAN routing and how to choose the correct answer
Since VLANs are separate broadcast domains, a Layer 3 device is needed to move traffic between them. Router-on-a-stick uses a single router interface with subinterfaces, one per VLAN, each tagged for its VLAN. Traffic from VLAN 10 that needs to reach VLAN 20 goes up to the router on one subinterface and comes back down on another. It works but the physical trunk link becomes a bottleneck for all inter-VLAN traffic.
A multilayer switch (Layer 3 switch) is the better solution for campus networks. Each VLAN gets a Switched Virtual Interface (SVI), which is a virtual Layer 3 interface on the switch itself. The switch routes between VLANs internally at wire speed without the traffic having to leave the chassis.
Access port vs trunk port: end device (PC, printer, phone) = access port, one VLAN, no tagging. Switch-to-switch or switch-to-router link carrying multiple VLANs = trunk port, 802.1Q tagging.
Native VLAN mismatch: both ends must use the same native VLAN or traffic gets placed in the wrong VLAN. Check with show interfaces trunk.