Understanding VLANs and Their Purpose
What a VLAN Actually Does
A Virtual Local Area Network (VLAN) is a logical grouping of network devices spanning multiple physical switches. Unlike traditional networks where all devices on a switch belong to the same broadcast domain, VLANs create separate broadcast domains on the same physical infrastructure.
You assign switch ports to different VLAN IDs (numbered 1 to 4094). VLAN 1 is the default, though security best practices recommend avoiding it for regular traffic. VLANs 1002-1005 are reserved for legacy technologies.
Key Benefits of VLANs
VLANs provide several critical advantages:
- Enable network segmentation without extra hardware
- Reduce broadcast traffic by limiting broadcast domains
- Improve security by isolating sensitive traffic
- Simplify management by grouping users logically, not physically
Practical VLAN Example
Imagine a company with three departments sharing the same physical switches. You could place all finance computers in VLAN 10, HR computers in VLAN 20, and guest devices in VLAN 30. Each group remains logically separated while using the same hardware.
Why This Matters for Network+
Multiple exam questions test your ability to identify appropriate VLAN configurations for different network scenarios. You'll also need to understand how VLANs control traffic, manage bandwidth, and enforce security at the data link layer.
VLAN Tagging Methods: Access and Trunk Ports
Understanding Access Ports
An access port belongs to a single VLAN and connects to end devices like computers, printers, or IP phones. When a frame arrives at an access port, the switch adds a VLAN tag internally, processes the frame, and removes the tag before sending it out. The connected device never sees the VLAN tag.
Access ports are straightforward to configure because the connected device doesn't need to understand VLANs at all.
Understanding Trunk Ports
A trunk port carries traffic for multiple VLANs simultaneously. Use trunk ports to connect switches together or to connect switches to routers. When frames traverse a trunk port, they keep their VLAN tags so the receiving switch knows which VLAN each frame belongs to.
Trunk ports enable inter-switch communication while maintaining VLAN separation across multiple devices.
VLAN Tagging Standards
IEEE 802.1Q is the industry standard, inserting a 4-byte tag into the frame header containing the VLAN ID and priority information. Inter-Switch Link (ISL) is Cisco's older proprietary method, rarely seen in modern networks.
For the CompTIA Network+ exam, focus on 802.1Q as the standard method.
Common Configuration Mistakes
VLAN mismatch errors occur when:
- An access port is assigned to the wrong VLAN
- A port configured as access should be trunk (or vice versa)
- Trunk ports fail to negotiate properly
- Native VLAN settings don't match on both ends
Mastering port types is essential for both exam success and real-world troubleshooting.
Inter-VLAN Routing and Communication Between VLANs
The Core Problem VLANs Create
Devices in different VLANs cannot communicate by default because VLANs create separate broadcast domains. This isolation provides security benefits but blocks communication between departments or groups. You need a Layer 3 device (router) to enable communication between VLANs. This process is called inter-VLAN routing.
Traditional Routing Approach
The traditional approach uses a router with multiple physical interfaces, with each interface connected to a different VLAN. However, this becomes expensive and inefficient with many VLANs. A router supporting 20 VLANs would need 20 physical interfaces.
Router-on-a-Stick (ROAS) Configuration
Router-on-a-Stick (ROAS) uses a single physical interface connected to a trunk port on the switch. The router's interface is divided into subinterfaces, each handling a different VLAN.
For example, you might configure:
- Gi0/0.10 for VLAN 10 with IP address 192.168.10.1/24
- Gi0/0.20 for VLAN 20 with IP address 192.168.20.1/24
Devices in VLAN 10 use 192.168.10.1 as their default gateway. Devices in VLAN 20 use 192.168.20.1. The router matches the incoming VLAN tag to the appropriate subinterface and routes accordingly.
Layer 3 Switching Alternative
Modern managed switches support inter-VLAN routing directly through Layer 3 switching. They use virtual interfaces (SVIs) to route between VLANs without an external router. This eliminates the single point of failure that ROAS creates.
Exam Focus
The Network+ exam tests your understanding of these routing methods and your ability to design appropriate routing architectures for different network sizes.
VLAN Configuration and Best Practices
Step-by-Step Configuration Process
Configuring VLANs involves specific steps you should understand for both the exam and practical implementation:
- Create the VLAN on the switch using "vlan 10" command
- Assign a descriptive name to the VLAN
- Enter interface configuration mode for each port
- Specify VLAN membership for that port
Configuring Access Ports
Access ports use these commands:
- "switchport mode access"
- "switchport access vlan 10"
This configuration assigns the port to VLAN 10 as an access port.
Configuring Trunk Ports
Trunk ports require additional steps:
- "switchport mode trunk"
- "switchport trunk allowed vlan 10,20,30"
Specifying allowed VLANs prevents unnecessary traffic from crossing the trunk.
Understanding Native VLAN
The native VLAN is the untagged VLAN on a trunk port, typically VLAN 1 by default. The native VLAN must match on both ends of a trunk connection, or VLAN mismatches will occur. Best practices recommend changing the native VLAN to something other than VLAN 1 for security purposes and explicitly configuring it on both sides of the trunk.
VLAN Pruning Best Practice
VLAN pruning restricts which VLANs are allowed on specific trunk ports to reduce unnecessary traffic. If VLAN 10 only exists on two switches, prune it from trunk ports that don't need it.
Common Misconfigurations to Avoid
- Assigning a port to the wrong VLAN
- Configuring a port as access when it should be trunk
- Mismatched native VLANs on trunk ends
- Forgetting to allow specific VLANs on trunk ports
Understanding these best practices helps you avoid errors on the exam and in real deployments.
Troubleshooting VLANs and Common Issues
Systematic Troubleshooting Approach
VLAN troubleshooting requires a methodical approach. Start with verification:
- Confirm the device is in the correct VLAN by checking the switch port configuration
- Verify IP addressing is correct for that VLAN
- Ensure the default gateway is correctly configured
- Check physical connectivity (is the cable actually plugged in?)
- Verify the switch port is operational
Diagnosing Same-VLAN Communication Issues
When devices in the same VLAN cannot communicate:
- First verify they're actually in the same VLAN
- Check physical connectivity and cable status
- Verify IP addressing for that VLAN subnet
- Confirm the default gateway address
- Ensure the switch port is not disabled
Diagnosing Inter-VLAN Communication Issues
When inter-VLAN communication fails, check these items:
- Router is configured with subinterfaces for both VLANs
- Trunk is correctly configured on the switch
- Default gateway addresses are correct for each VLAN
- Router's trunk port configuration matches the switch
- Native VLAN matches on both sides of the trunk
Essential Troubleshooting Commands
These commands provide critical diagnostic information:
- "show vlan brief" displays VLAN assignments
- "show interfaces switchport" verifies port configurations
- "show interfaces trunk" checks trunk status and VLAN allowances
- "show ip route" confirms routing between VLANs
Exam Scenario Questions
The exam often presents scenarios where you must identify which configuration command or verification step would solve a specific VLAN problem. Hands-on practice with these commands is essential for success.
