switchport access

Sets the Layer 2 interface as access.

Syntax

switchport access { vlan vlan_id}
no switchport access { vlan vlan_id}

Command Default

All Layer 2 interfaces are in access mode and belong to the VLAN ID 1.

Parameters

vlan vlan_id
Sets the port VLAN (PVID) to the specified vlan_id. Range is below 4090 for 802.1Q VLANs.

Modes

Interface subtype configuration mode on edge ports

Usage Guidelines

In access mode, the interface only allows untagged and priority tagged packets.

Enter no switchport access vlan to set the PVID to the default VLAN 1.

Examples

To set the Layer 2 interface PVID to 100 on a specific Ethernet interface:

device# configure terminal
switch(config)# interface ethernet 1/9 
switch(conf-if-eth-1/9)# switchport access vlan 100

To set the PVID to the default VLAN 1 on a specific port-channel interface:

device# configure terminal
switch(config)# interface port-channel 44 
switch(config-Port-channel-44)# no switchport access vlan