VLANInterface Config

switchport mode access

Configures a switch interface as an access port, placing it in a single VLAN and removing any trunking functionality.

Syntax·Interface Config
switchport mode access

When to Use This Command

  • Connecting an end device like a PC or printer to a switch port that should only belong to one VLAN.
  • Configuring a port for a VoIP phone that requires a dedicated access VLAN for data traffic.
  • Setting up a port for a wireless access point that needs to be in a specific user VLAN.
  • Hardening a switch port by explicitly setting it to access mode to prevent accidental trunking.

Command Examples

Basic Access Port Configuration

interface GigabitEthernet0/1 switchport mode access switchport access vlan 10

The 'switchport mode access' command sets the interface to operate as an access port. The 'switchport access vlan 10' command assigns VLAN 10 to the port. No output is generated if the commands are accepted.

Verifying Access Port Configuration

show interfaces GigabitEthernet0/1 switchport
Name: Gi0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 10 (VLAN0010)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Key fields: 'Administrative Mode: static access' confirms the port is configured as access. 'Operational Mode: static access' shows it is actively running as access. 'Access Mode VLAN: 10' indicates the VLAN assigned. 'Negotiation of Trunking: Off' means DTP is disabled. Ensure 'Operational Mode' matches 'Administrative Mode' for correct operation.

Understanding the Output

When using 'show interfaces switchport', the output provides critical details about the port's VLAN and trunking status. 'Administrative Mode' shows the configured mode (static access, trunk, or dynamic). 'Operational Mode' shows the actual mode negotiated. For an access port, both should be 'static access'. 'Access Mode VLAN' displays the VLAN assigned to the port. 'Trunking Native Mode VLAN' is irrelevant for access ports but defaults to VLAN 1. 'Negotiation of Trunking' should be 'Off' for access ports to prevent DTP from forming a trunk. If 'Operational Mode' shows 'trunk' unexpectedly, the port may be trunking due to DTP misconfiguration. Always verify that 'Access Mode VLAN' matches the intended VLAN and that no voice VLAN is accidentally configured if not needed.

CCNA Exam Tips

1.

Remember that 'switchport mode access' disables DTP, preventing the port from becoming a trunk automatically.

2.

On CCNA, you may be asked to configure an access port and then verify with 'show interfaces switchport' — know the key fields.

3.

A common exam scenario: a port is in 'dynamic desirable' mode and forms a trunk with another switch; you must set it to 'access' to stop trunking.

4.

If you forget 'switchport access vlan', the port remains in VLAN 1 by default.

Common Mistakes

Forgetting to issue 'switchport mode access' before assigning a VLAN; the port may remain in dynamic mode and form a trunk.

Applying 'switchport mode access' on a trunk port without first removing trunk configuration, causing the port to become an access port but potentially losing connectivity.

Using 'switchport mode access' on a port connected to another switch without also configuring the other end, leading to a mismatch and possible spanning-tree issues.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions