Layer 2 Switching Commands 807switchport access vlanUse the switchport access vlan command in Interface Configuration mode toconfigure the VLAN ID when the interface is in access mode. To reconfigurethe interface to use the default VLAN, use the no form of this command.Syntaxswitchport access vlan vlan-idno switchport access vlan• vlan-id — The identifier of the VLAN associated with the access port.Default ConfigurationThis command has no default values.Command ModeInterface Configuration (Ethernet and port channel) modeUser GuidelinesThis command configures the interface access mode VLAN membership. Theno form of the command sets the access mode VLAN membership to VLAN1. It is possible to configure the access mode VLAN identifier when the port isin general or trunk mode. Doing so does not change the VLAN membershipof the interface until the interface is configured into access mode.If the VLAN identified in the command has not been previously created, thesystem creates the VLAN, issues a message, and associates the VLAN with theinterface.ExamplesThe following example configures interface gi1/0/8 to operate in access modewith a VLAN membership of 23. Received untagged packets are processed onVLAN 23. Received packets tagged with VLAN 23 are also accepted. Otherreceived tagged packets are discarded.console(config)#interface gigabitethernet 1/0/8console(config-if-Gi1/0/8)#switchport access vlan 23The following example sets the PVID for interface Gi1/0/12 to VLAN ID 33.Since VLAN 33 does not exist, it is automatically created.