25 Switching and VLANs questions with answers for ccna roles — 7 easy, 13 medium, 5 hard.
About Switching and VLANs
Switching is where most real tickets live. This topic covers VLANs, access and trunk ports, 802.1Q tagging, the native VLAN, DTP and VTP risks, voice VLANs, inter-VLAN routing with router-on-a-stick and Layer 3 switches, and MAC address table behaviour. It also covers troubleshooting trunks that will not form and users who cannot reach other VLANs.
Sheet progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
A VLAN is a logical Layer 2 broadcast domain created on a switch, independent of physical location. VLANs separate users, voice, guests and servers, reduce broadcast traffic, and improve security because traffic between VLANs must pass through a router or Layer 3 switch where it can be filtered. For example, finance and guest Wi-Fi users can share switches but stay isolated.
02
What is the difference between an access port and a trunk port?
An access port belongs to one VLAN and carries untagged frames, typically to PCs, printers or servers. A trunk port carries traffic for many VLANs between switches, routers or hypervisors, adding an 802.1Q tag to identify each frame's VLAN, except the native VLAN which is sent untagged. Access ports can also carry a separate voice VLAN for IP phones.
802.1Q inserts a 4-byte tag after the source MAC in the Ethernet frame. The tag holds a 12-bit VLAN ID (1 to 4094 usable), 3 priority bits used by CoS for QoS, and a DEI bit. The tag is added when a frame leaves a trunk and removed at an access port. Older ISL encapsulation is obsolete; modern switches support only 802.1Q.
04
What is inter-VLAN routing and what are the ways to do it?
Hosts in different VLANs need a Layer 3 device to communicate. Options are: a router with one physical interface per VLAN (legacy), router-on-a-stick using one trunk with subinterfaces, or a Layer 3 switch with switched virtual interfaces (SVIs). SVIs are the most common in campuses because routing happens in hardware at line rate, with no single trunk bottleneck.
05
How do you create a VLAN and assign an access port?
Create the VLAN, name it, and set the port mode and VLAN.
vlan 20
name SALES
interface GigabitEthernet1/0/5
switchport mode access
switchport access vlan 20
switchport voice vlan 150
spanning-tree portfast
show vlan brief
06
How do you verify VLANs, trunks and MAC learning on a switch?
These show commands cover most VLAN troubleshooting.
show vlan brief
show interfaces trunk
show interfaces Gi1/0/5 switchport
show mac address-table vlan 20
show mac address-table address 0050.56ab.cdef
show interfaces status
They show VLAN membership, allowed and active VLANs on trunks, native VLAN and where each MAC was learned.
07
Tell me about a time you worked with a difficult end user during a ticket.
Situation: a senior manager was angry that his laptop lost network access before a client call. Task: fix it fast and calm him down. Action: I listened, gave a clear time estimate, found the port had been moved to a wrong VLAN in a recent change, corrected it and confirmed the call worked. Result: he was back online in ten minutes, and I added a port description check to our change process.
08
What is the native VLAN and what problems can a mismatch cause?
The native VLAN is the VLAN whose frames cross a trunk untagged, VLAN 1 by default. Both ends must use the same native VLAN; if they differ, frames leak between VLANs and CDP logs a native VLAN mismatch. For security, set the native VLAN to an unused ID, do not put users in it, and optionally tag it with vlan dot1q tag native to prevent VLAN hopping.
Dynamic Trunking Protocol negotiates whether a link becomes a trunk. Modes are dynamic auto, dynamic desirable, trunk and access. Auto plus auto stays access, while desirable with auto or desirable forms a trunk. Attackers can use DTP to form a trunk and reach all VLANs, so best practice is to hard-code access or trunk and use switchport nonegotiate on trunks.
VLAN Trunking Protocol shares VLAN definitions from a server switch to clients in the same VTP domain. Modes are server, client, transparent and off. The risk is that a switch with a higher configuration revision number can overwrite and wipe VLANs across the domain. Many networks use transparent mode or VTP version 3 with a primary server to avoid this.
A voice VLAN lets an IP phone and a PC share one switch port while keeping their traffic separate. The port is an access port in the data VLAN, and the switch tells the phone through CDP or LLDP-MED to tag voice frames with the voice VLAN. This allows QoS priority for voice and separate addressing. Configure it with switchport voice vlan.
12
What is a Layer 3 switch and how is it different from a router?
A Layer 3 switch forwards packets between VLANs in hardware using SVIs or routed ports, giving very high throughput with many Ethernet ports. A router usually has fewer ports but richer WAN features such as NAT, VPN, deep QoS, varied WAN interfaces and large routing tables. In campuses, Layer 3 switches handle inter-VLAN routing while routers or firewalls handle the edge.
13
A PC in VLAN 20 cannot reach a PC in VLAN 30. What do you check?
First I check each PC has the correct IP, mask and gateway for its VLAN. Then I confirm the switch ports are in the right VLANs with show vlan brief, and that the trunk to the Layer 3 device allows both VLANs using show interfaces trunk. On the Layer 3 device I check the SVIs or subinterfaces are up and have the right IPs, and that no ACL blocks the traffic.
14
After adding a new VLAN, users on one access switch cannot use it but others can. Why?
The most likely cause is the trunk to that switch does not allow the new VLAN, because someone configured an explicit allowed list. Check show interfaces trunk and add it with switchport trunk allowed vlan add 50, not without add, which would replace the list. Also confirm the VLAN exists on that switch with show vlan brief, especially if VTP is transparent.
15
A trunk between two switches is not forming. What would you check?
I check show interfaces trunk and show interfaces switchport on both sides. Common causes are mismatched modes (both dynamic auto), one side hard-coded as access, encapsulation not set on older switches, or the port being err-disabled. Native VLAN mismatch and allowed list differences do not stop the trunk but break traffic. Best fix is switchport mode trunk on both ends with nonegotiate.
Use one trunk link and a subinterface per VLAN with 802.1Q encapsulation.
interface GigabitEthernet0/0
no shutdown
interface GigabitEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
interface GigabitEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
The switch port facing the router must be a trunk.
18
How do you configure inter-VLAN routing on a Layer 3 switch with SVIs?
Enable routing and create an SVI per VLAN as the gateway.
ip routing
interface vlan 10
ip address 192.168.10.1 255.255.255.0
ip helper-address 10.0.0.50
no shutdown
interface vlan 20
ip address 192.168.20.1 255.255.255.0
no shutdown
show ip route connected
19
How do you handle a change that must be done during a night window?
Situation: we had to migrate 30 access ports to new VLANs overnight. Task: finish with zero business impact. Action: I prepared configs in advance, got peer review, scheduled a rollback, informed the helpdesk and tested each floor with a laptop after changes. Result: the migration finished an hour early, morning tickets were zero, and the plan became our template for later VLAN changes.
20
Logs show MAC address flapping for several hosts between an access port and an uplink. What do you check?
MAC flapping means the switch sees the same source MAC arriving on two ports, which usually points to a Layer 2 loop, a misconfigured server NIC team, or a virtual machine host bridging two uplinks. Check show mac address-table for the MAC, trace both ports, verify STP state and look for unmanaged switches or hypervisor teaming in active-active mode without a matching port channel. Fix the loop or teaming, and keep BPDU Guard on access ports.
21
What is the MAC address table and what happens when it is full?
The MAC address table, stored in CAM, maps MAC addresses to ports and VLANs. When it fills, as in a MAC flooding attack, new addresses cannot be learned and the switch floods unknown unicast frames out of all ports in the VLAN, which lets an attacker sniff traffic. Port security limiting MACs per port prevents this.
22
An SVI shows status down/down even though it is configured. What could be wrong?
An SVI comes up only if the VLAN exists in the VLAN database and at least one access or trunk port in that VLAN is up and forwarding, and the SVI is not shut down. So I check show vlan brief for the VLAN, check that at least one port in it is connected, check trunks allow it, and run no shutdown on the SVI. On Layer 3 switches, ip routing must be enabled for routing.
23
How would you redesign a flat network where 600 users sit in VLAN 1?
I would split users into VLANs by function or floor, each with a /24 or smaller, put voice, wireless, printers, servers and management in their own VLANs, and route between them on a Layer 3 core with SVIs. DHCP scopes and helper addresses would be added per VLAN. I would migrate in phases with a rollback plan and move VLAN 1 out of use for both users and the native VLAN.
24
How do you make an access switch port a routed port on a Layer 3 switch?
A routed port behaves like a router interface and does not belong to any VLAN.
interface GigabitEthernet1/0/1
no switchport
ip address 10.0.0.1 255.255.255.252
no shutdown
Routed uplinks between distribution and core avoid spanning tree on those links and allow fast routing convergence with ECMP.
A private VLAN splits one VLAN into a primary VLAN and secondary VLANs. Isolated ports can talk only to promiscuous ports such as the gateway, while community ports can talk to each other and to promiscuous ports. It is used in hosting, DMZs and hotel networks to isolate customers on the same subnet without creating many subnets. It requires VTP transparent mode or VTP v3.
Frequently asked questions
How important is Switching and VLANs in CCNA interviews?
Switching is where most real tickets live. This topic covers VLANs, access and trunk ports, 802.1Q tagging, the native VLAN, DTP and VTP risks, voice VLANs, inter-VLAN routing with router-on-a-stick and Layer 3 switches, and MAC address table behaviour. It also covers troubleshooting trunks that will not form and users who cannot reach other VLANs.
How should I use the Switching and VLANs sheet?
Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.