No Switchport Command: How Much Do You Know?

When working with switches, you may meet some interface configuration mode commands such as swtichport mode access, no switchport, etc. Well, do you know what the no switchport command is? Could it be supported by Layer 2 switch or Layer 3 switch? How to use no switchport command? In this article, we will share some insights and help solve the above questions.

What Is a No Switchport Command?

To understand the no switchport command, we’d better get to know Layer 2 switch and Layer 3 switch first. The Layer 2 switch is a network switch that forwards traffic based on layer 2 information of the OSI model. It functions by keeping a table of media access control (MAC) addresses. Moreover, it can assign VLANs to specific switch ports, which in turn are in different Layer 3 subnets. So the communication with other LANs, or VLANs, needs the function of Layer 3. And the Layer 3 switch combines some features of Layer 2 switch and some of the router. That is to say, it can switch packets by checking both IP addresses and MAC addresses.

The no switchport command is provided by the interface on a Layer 3 capable switch. This command can convert a Layer 2 port into a Layer 3 port and makes the port operate like a router interface rather than a switch port. So this port is also called routed port. What’s more, the routed port isn’t joined to any VLANs and do not support VLAN subinterfaces. However, you can apply an IP address directly to the port and more IP configuration options are available after running the no switchport command.

How to Use No Switchport Command?

As mentioned above, the no switchport command is mainly used to configure routed ports. This helps Layer 3 switch reach the default router during the configuration of VLAN. In terms of the configuration of the routed port, you can get into interface configuration mode of a switch and issue the command no switchport. This prohibits Layer 2 capabilities and enables Layer 3. Then you can assign an IP address to the routed port.

no switchport command

Figure 1: An example of a routed port configuration

No Switchport Command on Layer 3 Switch

The no switchport command plays an important role in configuring VLAN on the Layer 3 switch. With the no switchport command, you can get access to the Web Interface. Then, you can simply configure VLAN via the Web Interface. The following is the configuration guide.

  • 1.Connect your computer to the switch.
  • 2.Run the SecureCRT software on the computer, and enter the command #configure terminal to enter the global configure mode.
  • 3.Choose the “http” file, and enable the “http” service.
  • 4.Enter the command #show interface eth-0-1 to check the state of eth-0-1 port on the switch.
  • 5.Enter the command #interface eth-0-1 to enter the eth-0-1 port.
  • 6.Enter the command #no switchport to put the eth-0-1 port in L3 mode to make it the routed port.
  • 7.Assign an IP address to the eth-0-1 port and enter the command #no shutdown to activate the eth-0-1 port.
  • 8.Set the IP address of the computer to make sure it’s in the same network with the eth-0-1 port.
  • 9.Ping the IP address on the computer to check whether there is any mistake in the steps above. (If there were no mistake in the Ping result, you could log in with the username and password of your account to enter the Web Interface.)
  • 10.Add or delete the VLAN in the Service Management.


This post has explained what the no switchport command is, the steps to configure no switchport command, and how to use it on Layer 3 switch. So have you got all the answers to the questions at the beginning? Well, FS provides various high-quality network switches. Welcome to contact us if you have any needs about it.

Related Article: Layer 2 vs Layer 3 Switch: Which One Do You Need?

This entry was posted in Enterprise Network and tagged , , . Bookmark the permalink.