switchport access vlan
switchport access vlan
To set the VLAN when an interface is in access mode, use the switchport access vlan command. To
reset the access mode VLAN to the appropriate default VLAN for the device, use the no form of this
command.
Syntax Description
vlan-id
dynamic
name
vlan_name
Command Default
The default settings are as follows:
•
•
Command Modes
Interface configuration mode
Command History
Release
12.1(12c)EW
12.1(13)EW
IOS XE 3.8.0E and
IOS 15.2(4)E
Usage Guidelines
You must enter the
Layer 2 interface before you can enter the switchport access vlan command. This action is required only
if you have not already entered the
Entering the no
messages on the device to which the port is connected.
The no form of the switchport access vlan command resets the access mode VLAN to the appropriate
default VLAN for the device.
Before you configure the switchport access vlan name command, note the following:
•
•
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release XE 3.9.xE and 15.2(5)Ex
2-1096
switchport access [vlan {vlan-id | dynamic | name vlan_name}]
no switchport access vlan
(Optional) Number of the VLAN on the interface in access mode. Valid values are from
1 to 4094.
(Optional) Enables VMPS control of the VLAN.
(Optional) Name of the VLAN on the interface, in access mode. You can enter up to 128
characters.
The access VLAN and trunk interface native VLAN are default VLANs that correspond to the
platform or the interface hardware.
All VLAN lists include all VLANs.
Modification
This command was introduced on the Catalyst 4500 series switch.
Support for VPMS was added.
Option to specify an access VLAN name. The name keyword was added.
switchport
switchport
command shuts the port down and then reenables it, which could generate
The VLAN ID and VLAN name association should be configured and present in the VLAN database
(See example below).
Different switches can have a different ID for the same name. The VLAN name is internally
converted to the VLAN ID.
command without any keywords to configure the LAN interface as a
switchport
command for the interface.
Chapter 2