switchport access vlan [vlan-id]
Binds a static access interface to a specific Layer 2 broadcast domain. Any untagged frames entering this port are immediately mapped to the specified VLAN ID inside the switch's MAC address forwarding architecture.
Quick Reference
Switch(config-if)#switchport mode accessno switchport access vlanSyntax & Parameters
| Parameter | Description & Operational Limits |
|---|---|
| [vlan-id] | The active VLAN number to associate with the port. • Valid range encompasses 1 to 4094. • Cannot use reserved system tokens ( |
CLI Deployment Scenarios
Scenario 1: Standard Assignment
You need to map interface GigabitEthernet 0/4 into the pre-existing Sales broadcast domain on VLAN 30.
Scenario 2: The Magic Auto-Creation Feature
You assign a port to a VLAN that hasn't actually been created in the switch's database yet. Cisco IOS will build it on the fly.
CCNA Exam Gotchas
Reverting Default Behavior vs. Port Orphans
Executing no switchport access vlan on an interface safely resets the port's logical assignment back to factory standard VLAN 1. However, explicitly executing no vlan [id] globally isolates the port from the database, turning it into an inactive orphan interface that cannot send or receive frames. Cisco loves testing this subtle contrast.
The SVI Contrast
Do not confuse an access port configuration with a Layer 3 Switch Virtual Interface (SVI). Entering interface vlan 30 moves you into an IP routing interface context. To place a hardware switch port into a VLAN domain, you must use interface g0/x followed by the switchport access vlan 30 command sequence.