VLANs, Trunking & InterVLAN Routing
CCNA 200-301 · Network Access
A VLAN (Virtual Local Area Network) is a logical grouping of switch ports that behaves like a separate physical network. Two devices in different VLANs cannot communicate directly even if they are plugged into the same switch — they need a router, exactly as if they were on different switches in different buildings. VLANs are how a single switch serves several departments, each isolated from the others, and they are one of the most heavily tested topics on the CCNA. The concepts are few, but the exam tests them through configuration and troubleshooting scenarios, so you need to know both the ideas and the commands.
What a VLAN is and why it matters
By default, every port on a Cisco switch belongs to VLAN 1, the default VLAN, and all ports in VLAN 1 share one broadcast domain. When you create additional VLANs — say VLAN 10 for Sales and VLAN 20 for Engineering — each VLAN becomes its own broadcast domain. A broadcast sent by a device in VLAN 10 is forwarded only to other ports in VLAN 10. This gives three benefits the exam cares about: segmentation (departments are isolated from each other), security (traffic between VLANs must pass through a router or Layer 3 switch, where access lists can control it), and reduced broadcast traffic (broadcasts stay inside their own VLAN instead of reaching every device on the switch). VLAN numbers run from 1 to 4094. The normal range is 1 to 1005 and is the range the CCNA covers; VLANs 1002 to 1005 are reserved for legacy Token Ring and FDDI and cannot be deleted; the extended range (1006 to 4094) is used less commonly.
Creating a VLAN is simple: vlan 10 in global configuration mode, optionally with name Sales. Assigning a port to it takes two commands in interface mode: switchport mode access and switchport access vlan 10. Verify with show vlan brief, which shows every VLAN and its member ports, and show interfaces switchport for a single port's details.
Access ports and voice VLANs
An access port belongs to exactly one VLAN and carries traffic for that VLAN untagged — the connected device has no idea VLANs exist. That is the correct port type for endpoints: PCs, printers, and servers. A common exam scenario is the voice VLAN: an IP phone connects to the switch port, and the user's PC connects through the phone. The switch port is configured as an access port for the data VLAN plus a voice VLAN (switchport voice vlan 150), so the phone's traffic is tagged for the voice VLAN while the PC's traffic stays untagged on the data VLAN. The two devices share one cable and one port but live in different VLANs, which lets the network prioritise voice traffic and keep it separate from data.
Trunk ports and 802.1Q
When VLANs span multiple switches, the link between the switches must carry traffic for several VLANs at once. That link is a trunk port, and it identifies each frame's VLAN by tagging it. The tagging standard is IEEE 802.1Q: the switch inserts a 4-byte tag into the Ethernet frame, including a 12-bit VLAN ID (which is why VLAN numbers go up to 4094). The receiving switch reads the tag, removes it, and forwards the frame to the right VLAN. Endpoints never see tags — tagging happens only between switches (and between a switch and a router doing interVLAN routing).
One VLAN on a trunk is special: the native VLAN. Traffic for the native VLAN crosses the trunk untagged, for compatibility with devices that do not understand tagging. By default the native VLAN is VLAN 1, and it must match on both ends of the trunk — a native VLAN mismatch is a classic exam troubleshooting scenario, producing errors and unpredictable forwarding of untagged traffic. Best practice is to change the native VLAN to an unused VLAN number (such as 99) on both sides, which also closes a VLAN-hopping security hole. Configure a trunk with switchport mode trunk and set the native VLAN with switchport trunk native vlan 99. You can limit which VLANs cross a trunk with switchport trunk allowed vlan 10,20; by default, all VLANs are allowed.
Trunk negotiation is handled by DTP (Dynamic Trunking Protocol). A port in dynamic desirable mode actively tries to form a trunk; a port in dynamic auto mode forms a trunk only if the other side asks. Two ports both in dynamic auto will not form a trunk — a favourite exam trap. For exam purposes, the reliable approach is to set trunk mode explicitly on both sides and disable negotiation with switchport nonegotiate where appropriate. Verify trunk status with show interfaces trunk, which shows the mode, encapsulation, native VLAN, and allowed VLANs for every trunk.
InterVLAN connectivity
Devices in different VLANs need a Layer 3 device to talk to each other. The traditional method is router on a stick: a single router interface connects to a switch trunk port, and the router uses subinterfaces — one per VLAN — each with its own IP address and 802.1Q encapsulation. For VLAN 10, the configuration is interface GigabitEthernet0/0.10, encapsulation dot1Q 10, ip address 192.168.10.1 255.255.255.0. The physical interface itself has no IP address; the subinterfaces do the routing. Router on a stick is simple and cheap, but all interVLAN traffic shares one physical link, which becomes a bottleneck in larger networks.
The modern method is a Layer 3 switch with switched virtual interfaces (SVIs): interface vlan 10 with an IP address, plus ip routing enabled globally. Each SVI is the default gateway for its VLAN, and routing between VLANs happens in hardware at wire speed. The exam tests both methods, and the troubleshooting questions are usually the same in either case: if a host cannot reach another VLAN, check that its default gateway is the correct SVI or subinterface address, that the gateway is up, and that the trunk between the switch and the router carries the VLAN.
Exam traps to watch for
- Forgetting that devices in different VLANs need a router to communicate. A switch alone never forwards traffic between VLANs.
- Assuming two ports in dynamic auto mode will form a trunk. They will not — at least one side must be desirable or set to trunk mode.
- Thinking the native VLAN is tagged. Native VLAN traffic crosses a trunk untagged, and a native VLAN mismatch breaks it.
- Trying to assign a trunk port to a single VLAN with switchport access vlan. Access and trunk are different port modes with different commands.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.Two PCs are connected to the same switch but are in different VLANs. Why can they not communicate directly?
Explanation: Each VLAN is its own broadcast domain and its own IP subnet, so traffic between VLANs must be routed — a switch forwards frames within a VLAN only and never forwards traffic between VLANs. Option A is wrong because a switch's management IP address is irrelevant to frame forwarding between ports. Option C is wrong because the subnet masks follow from the VLAN design; even with matching masks, different VLANs cannot communicate without routing. Option D is wrong because trunk ports carry multiple VLANs between switches and are not used for endpoint PCs.
Exam objective: 200-301 2.1: Configure and verify VLANs (normal range) spanning multiple switches
Q2.What does the 802.1Q protocol do on a trunk link?
Explanation: 802.1Q inserts a 4-byte tag into the Ethernet frame, including a 12-bit VLAN ID, so the receiving switch knows which VLAN the frame belongs to. Option A is wrong because 802.1Q provides no encryption — the tag is plain identification. Option C describes EtherChannel, not 802.1Q. Option D describes Spanning Tree Protocol, not 802.1Q.
Exam objective: 200-301 2.2: Configure and verify interswitch connectivity — 802.1Q
Q3.A trunk link has VLAN 1 as the native VLAN on one switch and VLAN 99 as the native VLAN on the other. What is the result?
Explanation: The native VLAN must match on both ends of a trunk, because native VLAN traffic crosses untagged: with a mismatch, untagged frames sent by one switch are received into the other switch's different native VLAN, leaking traffic between VLANs and generating CDP mismatch errors. Option A is wrong because native VLAN traffic is specifically untagged. Option C is wrong because there is no automatic renegotiation of the native VLAN — it is a manual setting. Option D is wrong because Spanning Tree does not block trunks over a native VLAN mismatch.
Exam objective: 200-301 2.2: Configure and verify interswitch connectivity — native VLAN
Q4.Which command assigns switch port GigabitEthernet0/5 to VLAN 20 as an access port?
Explanation: switchport access vlan 20 (in interface configuration mode, after switchport mode access) assigns the port to VLAN 20 as an access port. Option A is wrong because switchport trunk allowed vlan controls which VLANs cross a trunk port. Option B is wrong because it sets the port to trunk mode, the opposite of an access port. Option D is wrong because it sets the native VLAN on a trunk port.
Exam objective: 200-301 2.1: Configure and verify VLANs (normal range) spanning multiple switches — access ports
Q5.Two switches are connected, and both ports are in dynamic auto mode. What happens?
Explanation: Dynamic auto mode is passive: the port forms a trunk only if the other side asks. When both sides are dynamic auto, neither initiates, so the link stays an access port and no trunk forms. Option A is wrong because trunk formation requires at least one side in dynamic desirable mode (or statically configured as a trunk). Option C is wrong because EtherChannel is a separate feature for bundling links and is not negotiated by DTP. Option D is wrong because no error occurs — the ports simply remain access ports.
Exam objective: 200-301 2.2: Configure and verify interswitch connectivity — trunk ports
Q6.In a router-on-a-stick design, a router subinterface is configured for VLAN 30 with the command encapsulation dot1Q 30. What is the purpose of this command?
Explanation: encapsulation dot1Q 30 tells the subinterface to tag outgoing frames with VLAN 30 and to accept incoming frames tagged for VLAN 30 — it is what binds the subinterface to that VLAN. Option B is wrong because VLANs are created on switches, not on routers; the router only processes tagged traffic. Option C is wrong because Spanning Tree is a switch feature and does not run on router subinterfaces. Option D is wrong because the native VLAN is a switch trunk setting; a subinterface with encapsulation dot1Q 30 (without the native keyword) handles tagged traffic for VLAN 30.
Exam objective: 200-301 2.1: Configure and verify VLANs (normal range) spanning multiple switches — interVLAN connectivity
Q7.A user PC connects through an IP phone to a single switch port. Which configuration lets the phone traffic and PC traffic travel in different VLANs?
Explanation: The voice VLAN feature is designed for exactly this: the port is an access port for the data VLAN (untagged PC traffic) and carries the phone's traffic tagged for the voice VLAN, so both devices share one cable and port but live in separate VLANs. Option A is wrong because endpoints should not connect to trunk ports, and a trunk would not separate the phone and PC traffic in the intended way. Option C is wrong because the phone and PC share a single cable to one port — there is no second port. Option D is wrong because dynamic desirable is a trunk-negotiation mode, not a voice configuration.
Exam objective: 200-301 2.1: Configure and verify VLANs (normal range) spanning multiple switches — access ports (data and voice)
Q8.Which VLAN range is the normal range that the CCNA exam covers for VLAN configuration?
Explanation: The normal VLAN range is 1 to 1005; the CCNA blueprint covers configuring and verifying VLANs in this range. Option B is the extended range (1006 to 4094). Option C is the full range of usable VLAN numbers, not the normal range. Option D is the small set of reserved VLANs (1002 to 1005) for legacy Token Ring and FDDI, which cannot be deleted.
Exam objective: 200-301 2.1: Configure and verify VLANs (normal range) spanning multiple switches
Q9.An engineer configures a Layer 3 switch for interVLAN routing. Which two steps are required for hosts in VLAN 10 to reach hosts in VLAN 20?
Explanation: InterVLAN routing on a Layer 3 switch needs a switched virtual interface (SVI) per VLAN — interface vlan 10 with an IP address that serves as the gateway for that VLAN — and ip routing enabled globally so the switch actually routes between them. Option B is wrong because an access port belongs to one VLAN only. Option C is wrong because no external router is needed when the Layer 3 switch routes, and DTP is unrelated to routing. Option D is wrong because each VLAN needs its own subnet, and disabling Spanning Tree would risk loops, not enable routing.
Exam objective: 200-301 2.1: Configure and verify VLANs (normal range) spanning multiple switches — interVLAN connectivity