Switching (VLAN/STP)

no switchport

Make this switch port a routed (Layer 3) port: no VLAN, no bridging, no spanning tree. It can then take an ip address, and with 'ip routing' the switch routes through it.

Works on: SwitchMode: iface
Watch out

A switch port refuses 'ip address' until it is routed. 'switchport' turns it back into a switch port and removes the address.

Run this command live

Don't just read it — type no switchport in a real network simulator in your browser and watch it take effect. No install, no account needed to start.

Open the lab

Frequently asked

What does the "no switchport" command do?

Make this switch port a routed (Layer 3) port: no VLAN, no bridging, no spanning tree. It can then take an ip address, and with 'ip routing' the switch routes through it.

What's the common gotcha with "no switchport"?

A switch port refuses 'ip address' until it is routed. 'switchport' turns it back into a switch port and removes the address.

More Switching (VLAN/STP) commands

← Back to the full command reference