Configuring the switchport access VLAN type

Do the following to change the switchport access VLAN type. This configuration works only when the interface is set as switchport.

Before you begin

Ensure that reserved VLANs are not used. Use the no switchport access vlan command to set the default VLAN as the access VLAN.

Procedure

  1. Enter the configure terminal command to access global configuration mode.
    device# configure terminal 
  2. Enter the interface ethernet command to specify an Ethernet interface.
    device(config)# interface ethernet 0/1
    
  3. Enter the switchport command to set the interface as switchport.
    device(conf-if-eth-0/1)# switchport
    
  4. Enter the switchport access vlan command to set the mode of the interface to access and specify a VLAN.
    device(conf-if-eth-0/1)# switchport access vlan 10
    

Example

This example sets the mode of a specific port-channel interface to trunk.

device# configure terminal
device(config)# interface port-channel 35
device(config-port-channel-35)# switchport mode trunk