switchport access vlan
The switchport access vlan Interface Configuration mode command configures the VLAN ID
when the interface is in access mode. To reconfigure to default, use the no form of this command.
Syntax
switchport access vlan vlan-id
no switchport access vlan
•
vlan-id — VID of the VLAN to which the port is configured.
Default Configuration
All ports belong to VLAN 1.
Command Mode
Interface configuration (Ethernet, port-channel) mode
User Guidelines
•
The command automatically removes the port from the previous VLAN, and adds it to the
new VLAN.
Example
The following example configures a VLAN ID of 23 to the untagged layer 2 VLAN interface
number g16.
console(config)# interface ethernet g16
console(config-if)# switchport access vlan
switchport customer vlan
Use the switchport customer vlan interface configuration command to set the port's VLAN when
the interface is in customer mode. Use the no form of this command to revert to default.
Syntax
switchport customer vlan vlan-id
no switchport customer vlan
•
vlan-id — VLAN ID of the customer
Default Configuration
No VLAN is configured.
Command Modes
Interface configuration (Ethernet, port-channel)
23
VLAN Commands
317