switchport

Puts the interface in Layer 2 mode and sets the switching characteristics of the Layer 2 interface.

Syntax

switchport
no switchport

Command Default

All Layer 2 interfaces are mapped to default VLAN 1 and the interface is set to access mode.

Modes

Interface subtype configuration mode

Usage Guidelines

For changing the interface configuration mode to trunk or changing the default VLAN mapping, use additional switchport commands.

To redefine the switch from Layer 2 mode into Layer 3 mode, enter no switchport.

Examples

To put a specific Ethernet interface in Layer 2 mode:

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

To remove a specific port-channel interface from Layer 2 mode:

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