switchport mode

Sets the mode of the Layer 2 interface.

Syntax

switchport mode { access | trunk }

Parameters

access
Sets the Layer 2 interface as access. Access mode assigns the port to a VLAN
trunk
Sets the Layer 2 interface as trunk. Trunk mode makes the port linkable to other switches and routers

Modes

Interface subtype configuration mode

Usage Guidelines

You must configure the same native VLAN on both ends of an 802.1 or classified VLAN trunk link. Failure to do so can cause bridging loops and VLAN leaks.

Examples

To set the mode of a specific Ethernet interface to access:

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

To set the mode of a specific port-channel interface to trunk:

device# configure terminal
switch(config)# interface port-channel 44 
switch(config-Port-channel-44)# switchport mode trunk