Chapter 2: Network Access
In Chapter 1 you learned how devices address each other. Now we go one layer deeper: how switches move frames inside a local network. This chapter covers VLANs, trunking, Spanning Tree, EtherChannel, wireless LANs, and switch port security — the "Network Access" domain of the CCNA 200-301 exam (v2.0 blueprint), and the configuration work you will do on day one as a network engineer.
2.1 VLAN Concepts
A VLAN (Virtual LAN) is a logical grouping of switch ports that behaves like a separate physical switch. Devices in the same VLAN can talk to each other directly; devices in different VLANs cannot — even if they are plugged into the same physical switch — without going through a router (a topic called inter-VLAN routing, covered in Chapter 3).
Why VLANs exist
Without VLANs, every device on a switch shares one broadcast domain — the set of devices receiving each other's broadcasts (ARP, DHCP). Hundreds of devices' broadcasts waste bandwidth and CPU on every host. VLANs split one switch into multiple broadcast domains, add Layer 2 security boundaries, and let you reassign a user with one port config change — no re-cabling.
A VLAN is a separate broadcast domain. Devices in different VLANs need a Layer 3 device (router or Layer 3 switch) to communicate.
VLAN ranges and types
Cisco switches support VLAN IDs 1–4094, split into two ranges:
| Range | VLAN IDs | Notes |
|---|---|---|
| Normal range | 1–1005 | In vlan.dat; all switches |
| Extended range | 1006–4094 | Running-config only; needs VTP transparent on older switches |
A few VLANs are special and you must know them for the exam:
- VLAN 1 is the default VLAN. Every switch port belongs to VLAN 1 until you change it, and it is the default native VLAN on trunks. You cannot delete or rename VLAN 1.
- VLANs 1002–1005 are reserved for legacy Token Ring and FDDI. You cannot delete them either.
- A voice VLAN carries IP phone traffic. The phone tags its own voice frames while the attached PC's data stays untagged on the access (data) VLAN — one cable and one port serve both devices.

2.2 Access Ports vs Trunk Ports
- Access port: belongs to exactly one VLAN. Connects to end devices (PCs, printers, phones). Frames are treated as belonging to that VLAN; no tag is added.
- Trunk port: carries multiple VLANs, used on switch-to-switch and switch-to-router links. Frames are tagged with their VLAN ID so the far end can sort them.
Cisco loves asking which port type goes where: end devices get access ports, switch-to-switch and switch-to-router links get trunks. If a question shows a PC plugged into a trunk port, something is wrong.
Basic configuration:
Switch(config)# vlan 10
Switch(config-vlan)# name SALES
Switch(config-vlan)# exit
Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
The switchport trunk allowed vlan command controls which VLANs may cross the trunk. By default, a trunk allows all VLANs (1–4094) — pruning this list is a common security and efficiency practice.
2.3 802.1Q Tagging and the Native VLAN
The tagging standard on Cisco trunks is IEEE 802.1Q. A frame for VLAN 20 crossing a trunk gets a 4-byte 802.1Q header with a 12-bit VLAN ID field (hence the 4094 maximum — 2^12 minus reserved values). The receiving switch reads the tag, strips it, and forwards the frame inside VLAN 20.
One VLAN per trunk is the native VLAN: its frames cross untagged. The default is VLAN 1, and both ends must agree — a mismatch leaks traffic between the two native VLANs and triggers CDP warnings.
Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk native vlan 99
On an 802.1Q trunk, every VLAN's frames are tagged except the native VLAN's frames, which cross untagged. A native VLAN mismatch is a classic misconfiguration.
A trunk allows VLANs 10, 20, 30 with native VLAN 99 on both ends. A VLAN 20 frame and a VLAN 99 frame arrive. Which gets tagged, and with what ID?
Show solution
The VLAN 20 frame is tagged with ID 20. The VLAN 99 frame crosses untagged — native VLAN traffic is never tagged. If the far end used a different native VLAN, that untagged frame would land in the wrong VLAN: the classic native VLAN mismatch.
2.4 DTP: Dynamic Trunking Protocol
Manually setting every port is the safe approach, but Cisco switches can negotiate trunking with DTP (Dynamic Trunking Protocol):
- access — never trunks. trunk — always trunks. dynamic auto — trunks only if the other side asks. dynamic desirable — actively tries to trunk. nonegotiate — trunks without sending DTP frames.
The negotiation rules that matter for the exam:
| Local mode | Forms a trunk with... |
|---|---|
| trunk | trunk, dynamic desirable, dynamic auto |
| dynamic desirable | trunk, dynamic desirable, dynamic auto |
| dynamic auto | trunk, dynamic desirable (NOT another dynamic auto) |
| nonegotiate | trunk or nonegotiate only |
Switch(config)# interface gigabitEthernet 0/24
Switch(config-if)# switchport mode dynamic desirable
Switch(config-if)# switchport nonegotiate
Two ports both set to dynamic auto will NOT form a trunk — one side must be desirable or trunk. And for security, Cisco recommends disabling DTP on access ports (switchport mode access plus switchport nonegotiate) so a rogue device can't negotiate itself into a trunk.
2.5 Spanning Tree Protocol — RSTP Focus
Why STP exists
Switches flood broadcasts out of every port, so a physical loop — two switches joined by two cables — makes broadcasts circle forever, multiplying into a broadcast storm that kills the network in seconds. Yet we want redundant links, so one cable failure doesn't isolate anyone. Spanning Tree resolves this: cable the redundant links, and STP logically blocks the extras, leaving one active loop-free path. If the active path fails, STP unblocks a backup automatically.
Know RSTP (Rapid STP, IEEE 802.1w): classic STP (802.1D) needs 30–50 seconds to converge (15s listening + 15s learning, plus timers); RSTP converges in seconds with a proposal/agreement handshake. Cisco's default is Rapid PVST+ — per-VLAN RSTP, one instance per VLAN.
Switch(config)# spanning-tree mode rapid-pvst
Root bridge election
Every STP decision is measured from the root bridge, elected as follows:
- Each switch claims root, sending BPDUs with its bridge ID = priority (default 32768) + MAC.
- Lowest bridge ID wins — lowest priority first, lowest MAC breaks ties.
Set priority in multiples of 4096 (0, 4096, … 61440):
Switch(config)# spanning-tree vlan 10 priority 4096
Switch(config)# spanning-tree vlan 10 root primary ! 24576, or lower if needed
Switch(config)# spanning-tree vlan 10 root secondary ! 28672
RSTP port roles and states
After the root is elected, each non-root switch picks one root port (lowest-cost path to the root). Per segment, one designated port forwards traffic. The rest — ports that would close a loop — become blocked alternate ports (backup paths toward the root) or backup ports (backup for a designated port on the same segment).
RSTP has three port states (classic STP had five):
| RSTP state | Forwards? | Learns MACs? |
|---|---|---|
| Discarding | No | No |
| Learning | No | Yes |
| Forwarding | Yes | Yes |
Switch A reaches the root bridge two ways: a direct 1 Gbps link (STP cost 4), and a two-hop path through Switch B made of two 1 Gbps links (4 + 4). Which port becomes Switch A's root port?
Step 1: Cisco default STP costs — 10 Mbps = 100, 100 Mbps = 19, 1 Gbps = 4, 10 Gbps = 2. Step 2: Direct path cost = 4. Alternate path cost = 4 + 4 = 8. Step 3: 4 < 8, so the direct-link port has the lowest root path cost. Final answer: the direct-link port becomes the root port; the port toward Switch B becomes an alternate (discarding) port. Note STP counts cost, not hops: a 100 Mbps direct link (19) would lose to two 10 Gbps hops (2 + 2 = 4).
PortFast and BPDU Guard
An access port to a PC doesn't need STP's waiting states — one host can't create a loop. PortFast sends the port straight to forwarding. But if someone plugs a switch into a PortFast port, a loop forms instantly — so pair PortFast with BPDU Guard, which error-disables the port the moment a BPDU arrives.
Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# spanning-tree portfast
Switch(config-if)# spanning-tree bpduguard enable
Or enable both globally for all PortFast ports at once:
Switch(config)# spanning-tree portfast default
Switch(config)# spanning-tree portfast bpduguard default
PortFast belongs on access ports facing end devices — never on trunks to other switches. Favorite exam scenario: "a user plugged a small switch into a PortFast port and the network looped" — the missing piece is BPDU Guard.
A junior admin enables PortFast on all ports, including inter-switch trunks. Name two problems, and the correct approach.
Show solution
1) PortFast on a trunk skips STP's listening/learning states, so a temporary loop can form during convergence. 2) Without BPDU Guard, a rogue switch or misbehaving NIC sending BPDUs into a PortFast port can trigger a spanning-tree recalculation. Correct: PortFast only on host-facing access ports, always with BPDU Guard (spanning-tree bpduguard enable, or spanning-tree portfast bpduguard default globally).
2.6 EtherChannel
EtherChannel bundles multiple physical links into one logical link: more bandwidth and redundancy. If a member fails, traffic continues on the rest with no STP reconvergence — STP sees the bundle as a single link, which also avoids blocking one of the parallel links.
Two negotiation protocols:
| LACP (IEEE 802.3ad) | PAgP (Cisco proprietary) | |
|---|---|---|
| Modes | active, passive | desirable, auto |
| Forms a channel when | active+active or active+passive | desirable+desirable or desirable+auto |
| Standard | Open (multi-vendor) | Cisco only |
Member ports must match to form and stay healthy: same speed and duplex, same VLAN config (same access VLAN, or same trunk allowed-VLAN and native VLAN lists), same STP settings. A channel can be Layer 2 (switched) or Layer 3 (routed, with no switchport and IP addresses).
You bundle four 1 Gbps links into one LACP EtherChannel. What is the aggregate bandwidth, and the maximum throughput of a single flow (e.g., one file transfer)?
Step 1: Aggregate = 4 × 1 Gbps = 4 Gbps total capacity. Step 2: EtherChannel spreads frames across members by hashing (typically source/destination MAC or IP). All frames of one flow hash to the same member link, keeping them in order. Step 3: One flow therefore never exceeds one member's speed: 1 Gbps. Final answer: 4 Gbps aggregate, but any single flow tops out at 1 Gbps — EtherChannel multiplies total capacity; it doesn't speed up any one conversation.
Configuration:
Switch(config)# interface range gigabitEthernet 0/1 - 2
Switch(config-if-range)# channel-group 1 mode active
Switch(config-if-range)# exit
Switch(config)# interface port-channel 1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
LACP modes are active/passive; PAgP modes are desirable/auto. passive+passive and auto+auto never form a channel. Member links must match in speed, duplex, and VLAN config.

2.7 Wireless LAN Concepts
AP modes: autonomous vs lightweight
| Autonomous AP ("fat") | Lightweight AP ("thin") | |
|---|---|---|
| Intelligence | Standalone, individually configured | Minimal; centrally managed |
| Management | Per-device web/CLI | By a Wireless LAN Controller |
| Best for | A handful of APs | Tens to thousands of APs |
The CCNA focuses on the enterprise model: lightweight APs + WLC.
A Wireless LAN Controller (WLC) is the brain of an enterprise wireless network: AP registration and configuration, client authentication, centralized security policy, QoS, RF management (auto-adjusting channel and transmit power), and seamless roaming between APs.
Lightweight APs talk to the WLC with CAPWAP: a control tunnel (UDP 5246) for management and a data tunnel (UDP 5247) for client traffic. Time-critical RF work stays on the AP; management and policy live on the WLC — this split is split-MAC architecture.
SSIDs and wireless security
Each Wi-Fi network name you see is an SSID (Service Set Identifier). One physical AP can broadcast several SSIDs (CORP, GUEST), each mapped to a different VLAN on the wired side.
Security, oldest to newest:
- WPA2 (802.11i): AES-CCMP encryption. WPA2-Personal uses a pre-shared key (PSK) with a 4-way handshake — strong, but weak passwords fall to offline dictionary attacks.
- WPA3: current standard. WPA3-Personal replaces the PSK handshake with SAE (Simultaneous Authentication of Equals) — resistant to offline dictionary attacks, with forward secrecy (captured traffic stays unreadable even if the password later leaks). WPA3-Enterprise adds an optional 192-bit mode.
Strength order: WEP < WPA < WPA2 < WPA3. WPA3's headline feature is SAE replacing pre-shared keys in Personal mode. Also know: CAPWAP, centralized WLC management, and that lightweight APs are useless without their controller.
2.8 Switch Port Security
Port security limits which devices may use a switch port by restricting allowed source MAC addresses — your defense against someone unplugging a PC and connecting a rogue device to the jack.
Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 2
Switch(config-if)# switchport port-security violation restrict
Switch(config-if)# switchport port-security mac-address sticky
Key options:
- maximum — allowed MAC count (default 1).
- mac-address sticky — learns the connected MAC dynamically and writes it to the running config, so you never type MACs by hand. Save with
copy running-config startup-configto survive reboots. - aging — learned MACs can expire after a set time (absolute or inactivity-based).
When the MAC limit is exceeded or an unknown MAC appears, one of three violation modes triggers:
| Mode | Drops violating frames? | Logs / SNMP trap? | Port state |
|---|---|---|---|
| protect | Yes | No | Stays up |
| restrict | Yes | Yes (syslog + SNMP, increments counter) | Stays up |
| shutdown | Yes (all traffic) | Yes | Err-disabled (default mode) |
Default violation mode is shutdown: the port goes err-disabled. Recover manually with shutdown then no shutdown (after removing the cause).
A visitor unplugs the room PC, connects a laptop, and the port goes err-disabled. The visitor leaves, the PC is reconnected, but the port stays down. What happened, and what are the exact steps to restore service?
Show solution
The laptop's MAC wasn't in the secure table, so shutdown mode err-disabled the port. Reconnecting the PC doesn't help — err-disabled ports stay down until manually recovered. Steps: 1) interface gigabitEthernet 0/x, 2) shutdown, 3) no shutdown. The PC (whose sticky MAC matches) works immediately. To avoid repeats in shared rooms, consider violation restrict with a higher maximum.
End-of-Chapter Test
switchport mode trunk with the data VLAN as native B. switchport mode access with switchport access vlan 10 and switchport voice vlan 20 C. switchport mode trunk with switchport trunk allowed vlan 10,20 D. Two access ports, one for the phone and one for the PC
dynamic auto and the other to dynamic auto. What is the result? A. A trunk forms B. An access link forms; no trunk C. Both ports go err-disabled D. DTP elects one side as trunk
spanning-tree vlan 1 priority 16384. Which becomes the root bridge for VLAN 1? A. The first switch, because its MAC is lower B. The second switch, because its priority is lower C. Neither; an election tie disables both D. The first switch, because default priority always wins
violation protect. A second, unauthorized device is connected. What happens? A. The port goes err-disabled B. Violating frames are dropped silently; the port stays up with no log message C. Violating frames are dropped and an SNMP trap is sent D. The new device's MAC replaces the oldest sticky entry
---