16- and 36-Port Ethernet Switch Module for Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series
switchport
240
Cisco IOS Release 12.2(2)XT, 12.2(8)T, and 12.2(15)ZJ
switchport
To set an interface that is in Layer 3 mode into Layer 2 mode for Layer 2 configuration, use the
switchport command in interface configuration mode. To set an interface in Layer 3 mode, use the no
form of this command.
switchport
no switchport
Use the no switchport command (without parameters) to set the interface to the routed-interface status
and to erase all Layer 2 configurations. You must use this command before assigning an IP address to a
routed port.
Note
If an interface is to be configured as a Layer 3 interface, you must first enter the switchport command
with no keywords to configure the interface as a Layer 2 port. Then you can enter additional switchport
commands with keywords.
Syntax Description
This command has no arguments or keywords.
Defaults
By default, all interfaces are in Layer 2 mode.
Command Modes
Interface configuration
Command History
Usage Guidelines
Entering the no switchport command shuts the port down and then reenables it, which might generate
messages on the device to which the port is connected.
Examples
The following example shows how to cause an interface to cease operating as a Layer 2 port and become
a Cisco-routed port:
Switch(config-if)#
no switchport
The following example shows how to cause the port interface to cease operating as a Cisco-routed port
and convert to a Layer 2-switched interface:
Switch(config-if)#
switchport
Release
Modification
12.1(4)EA1
This command was introduced.
12.2(15)ZJ
This command was implemented on the Cisco 2600 series,
Cisco 3600 series, and Cisco 3700 series routers.