π CCNA Module 3 β VLANs & Trunking
π΄ HIGH PRIORITY β Know These First
1. What is a VLAN?
A VLAN (Virtual Local Area Network) logically separates devices into different networks even when they are connected to the same physical switch infrastructure.
Key idea:
VLAN = separate logical network / broadcast domain
Devices in the same VLAN can communicate at Layer 2 without a router.
Devices in different VLANs need inter-VLAN routing.
2. Why use VLANs?
The three benefits emphasized in your quiz:
π Security β separates groups of devices
π° Cost reduction β better use of existing infrastructure
π Improved IT staff efficiency β easier management
Other benefits:
Smaller broadcast domains
Better network performance
Easier project/application management
3. VLAN Types
VLAN Type | Purpose |
|---|---|
Default VLAN | VLAN 1; all switch ports are assigned here by default |
Data VLAN | Carries normal user-generated traffic |
Native VLAN | Carries untagged traffic on an 802.1Q trunk |
Management VLAN | Used for management traffic such as SSH, HTTPS, SNMP |
Voice VLAN | Carries IP phone/VoIP traffic |
π΄ VLAN 1
Remember:
Default VLAN
All ports start in VLAN 1
Cannot be renamed or deleted
Default native VLAN
Default management VLAN
Best practice: don't use VLAN 1 as the native VLAN
π΄ Access Ports vs. Trunk Ports
Access Port
An access port normally belongs to one data VLAN.
Example:
switchport mode access
switchport access vlan 20Think:
Access = one VLAN
Trunk Port
A trunk carries multiple VLANs across one physical link.
Example:
switchport mode trunkThink:
Trunk = many VLANs
A trunk can connect:
Switch β Switch
Switch β Router
Switch β Server/device with an 802.1Q NIC
π΄ VLAN Tagging β 802.1Q
Ethernet frames normally don't contain VLAN information.
When traffic travels across a trunk, IEEE 802.1Q adds a 4-byte VLAN tag.
The VLAN tag contains:
TPID
Priority
CFI
VLAN ID
VLAN ID
The VLAN ID field is 12 bits, allowing VLAN IDs up to 4096 values.
This is why the maximum VLAN number is associated with 4094 in the module's extended VLAN range.
π΄ Native VLAN
The native VLAN handles untagged frames on an 802.1Q trunk.
Default:
Native VLAN = VLAN 1
If a trunk receives an untagged frame:
Untagged frame β Native VLAN
Important exam trap
If the native VLAN is VLAN 99:
Native VLAN = 99
PVID = 99Cisco's recommended practice is to use an unused, separate native VLAN rather than VLAN 1.
Another exam trap
Both ends of a trunk should have the same native VLAN.
A mismatch can cause errors and connectivity problems.
π΄ Voice VLAN
IP phones use a separate VLAN for voice traffic.
Example:
switchport access vlan 20
switchport voice vlan 150This means:
VLAN 20 = data
VLAN 150 = voice
An access port can therefore carry one data VLAN + one voice VLAN.
Why separate voice traffic?
Voice requires:
Reliable bandwidth
QoS
Low delay
Priority over congested traffic
The module specifies a desired delay of less than 150 ms.
π΄ VLAN Ranges
Normal-Range VLANs
1β1005
Characteristics:
VLAN 1 and 1002β1005 are automatically created
VLAN 1 and 1002β1005 cannot be removed
Configuration stored in vlan.dat
Stored in flash
Can be synchronized with VTP
Extended-Range VLANs
1006β4094
Characteristics:
Stored by default in the running configuration
Have fewer features
VTP must be transparent
β Memorize
Normal VLAN β vlan.dat β Flash
Extended VLAN β running-config
π΄ VLAN Configuration
Create a VLAN
configure terminal
vlan 20
name student
endAssign a port to a VLAN
interface fa0/6
switchport mode access
switchport access vlan 20
endThe VLAN is configured on the switch port, not on the end device.
The device's IP address/subnet should correspond to the VLAN.
π΄ VLAN Verification Commands
show vlan
Displays configured VLAN information.
Useful options include:
show vlan brief
show vlan id 20
show vlan name student
show vlan summaryshow interfaces [interface-id] switchport
Used to verify:
Access VLAN
Voice VLAN
Switchport mode
show interfaces trunk
Used to verify trunk information, including:
Native VLAN
Allowed VLANs
Trunk status
β Quiz connection:
If asked which command can be used to view the native VLAN:
show interfaces trunk
π΄ Changing VLAN Membership
To move a port:
switchport access vlan 30To return the port to VLAN 1:
no switchport access vlanImportant:
A VLAN can remain active even if no ports are currently assigned to it.
π΄ Deleting VLANs
Delete a specific VLAN:
no vlan 20This removes it from vlan.dat.
Important exam scenario
If a port is still assigned to a VLAN that gets deleted:
The port becomes inactive and devices connected to it cannot communicate.
The port hasn't necessarily been reassigned automatically.
Delete the entire VLAN database
delete flash:vlan.datThen reload the switch.
π΄ Trunk Configuration
Basic trunk configuration:
interface fa0/1
switchport mode trunk
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,30,99
endThis means:
Port = trunk
Native VLAN = 99
Allowed VLANs = 10, 20, 30, 99
π΄ Allowed VLANs
This is a major exam trap.
Suppose the current allowed VLANs are:
10,20Then you enter:
switchport trunk allowed vlan 30The result is:
Only VLAN 30 is allowed.
It replaces the existing list.
To add VLAN 30 instead:
switchport trunk allowed vlan add 30Think:
allowed vlan= replaceallowed vlan add= add
π΄ Resetting a Trunk
Remove the restricted VLAN list:
no switchport trunk allowed vlanResult:
All VLANs are allowed.
Reset native VLAN:
no switchport trunk native vlanResult:
Native VLAN returns to VLAN 1.
Turn a trunk into an access port:
switchport mode accessπ΄ DTP β Dynamic Trunking Protocol
DTP = Dynamic Trunking Protocol
It is a Cisco proprietary protocol used to negotiate trunking.
Major exam fact
Other vendors generally don't support DTP.
If connecting a Cisco switch to a non-Cisco switch:
switchport mode trunk
switchport nonegotiateThis manually establishes the trunk and prevents DTP negotiation.
π΄ DTP Modes
Mode | Behavior |
|---|---|
access | Permanent non-trunk |
trunk | Permanent trunk |
dynamic auto | Passive |
dynamic desirable | Actively attempts to form a trunk |
β Critical combinations
Auto + Auto
β No trunk
Auto + Desirable
β Trunk
Desirable + Desirable
β Trunk
Memory trick
Auto waits. Desirable desires.
Two devices both waiting = nothing happens.
π΄ switchport nonegotiate
Stops DTP frames from being sent.
Used with:
switchport mode trunk
switchport nonegotiateThe neighbor must be manually configured for trunking.
Important
switchport nonegotiate is used with static access or trunk mode, not dynamic negotiation modes.
π§ Module 3 Memory Tricks
VLAN
VLAN = Logical separation
Access vs. Trunk
Access = one
Trunk = many
Normal vs. Extended
Normal = Flash/vlan.dat
Extended = running-config
Native VLAN
Native = untagged
Voice VLAN
Data + Voice = two VLANs
DTP
Auto waits
Desirable tries
Allowed VLAN
allowed vlan= replaceallowed vlan add= add
VLAN 1
Default, Native, Management
β Common Exam Traps
Deleting a VLAN doesn't automatically move its ports to VLAN 1.
Normal VLAN information is stored in
vlan.datin flash.Extended VLANs are stored in running-config.
Untagged trunk traffic goes to the native VLAN.
Two dynamic-auto ports do NOT form a trunk.
Other-vendor switches don't support Cisco DTP.
switchport trunk allowed vlan 30replaces the allowed list.show interfaces trunkcan show the native VLAN.
A voice VLAN can coexist with a data VLAN on the same access port when an IP phone is involved.
VLANs create smaller broadcast domains.
Different VLANs require routing to communicate.
VLAN 1 cannot be deleted or renamed.
Both ends of a trunk should use the same native VLAN.
A trunk is a point-to-point link carrying multiple VLANs.
π Module 3 Quiz Review
These are the quiz facts I'd prioritize because they represent the concepts your instructor is testing:
Deleted VLAN β port becomes inactive
Normal VLAN configuration β Flash
Non-Cisco switch β doesn't support DTP
vlan.datβ VLAN databaseSeparate native VLAN β avoids using data VLAN for untagged traffic
Untagged frame β Native VLAN
Trunks β Switch-to-switch or switch-to-802.1Q device
VLAN benefits β Security, cost reduction, IT efficiency
Extended VLAN β running configuration
Normal VLAN β Flash
Management VLAN β administrator access
show interfaces trunkβ native VLANvlan.datβ FlashVoIP β separate voice VLAN
switchport trunk allowed vlan 30β only VLAN 30Dynamic auto + dynamic auto β no trunk