Every switch port operates in one of two main modes: access or trunk. Picking the wrong one is one of the most common reasons a lab "won't work."

Access ports

An access port is a member of one VLAN. Frames leave it untagged — the end device (a PC, printer, IP phone, or access point) has no idea VLANs even exist. You use access ports for the edge of the network, where hosts plug in.

Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

Trunk ports

A trunk port carries many VLANs over a single link. To keep them separate, the switch tags each frame with its VLAN ID using the 802.1Q standard. Trunks connect switches to other switches, or a switch to a router (for inter-VLAN routing).

Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk

The native VLAN

One VLAN on every trunk is the native VLAN (VLAN 1 by default), and its frames cross the trunk untagged. Both ends of a trunk must agree on the native VLAN or CDP will flag a "native VLAN mismatch." This is a classic exam gotcha.

Quick comparison

Access: one VLAN · untagged · to end devices · switchport mode access.
Trunk: many VLANs · 802.1Q tagged (except native) · between switches/routers · switchport mode trunk.