Monday, December 22, 2008

Handy Switchport host command

Now, speaking of access ports, check this out. Cisco came out with a secret-ninja command that automatically does three things:

1. Configures a switchport to access mode (for hosts)
2. Enables portfast
3. Disables Etherchannel capabilities

Here it is:

Switch(config)# interface range fa0/1 - 24
Switch(config-if-range)# switchport host

switchport mode will be set to access
spanning-tree portfast will be enabled
channel group will be disabled

Best Regards,
Deepak Arora

11 comments:

CCIE Roger Perkin said...

I have just discovered this as well - great command will be using it from now on



Switchport host

Anonymous said...

nice. thanks for the tip.

imran shahid said...

Also disables Trunk..
imran CCNP,CCDP

Anonymous said...

Anonymous

"imran shahid said...Also disables Trunk.."

That is what switchport mode access does, he mentioned it already.

Anonymous said...

"imran shahid said...Also disables Trunk.."

That's what switchport mode access does, he covered it already

Sanju said...

Thnx for such a good tips.

Unknown said...

This magic Commands is not working in my ME model switch @ Cisco ME-3400-24TS-A.

Please specified in which Cisco models it works

A Network Artist said...

It's supported on ME as well. Below are the details:

switchport host

Use the switchport host interface configuration command to optimize a Layer 2 port for a host connection. The no form of this command has no affect on the system.

switchport host
Syntax Description

This command has no arguments or keywords.
Defaults

The default is for the port to not be optimized for a host connection.
Command Modes

Interface configuration
Command History
Release

Modification

12.2(44)EY


This command was introduced.

Usage Guidelines

To optimize the port for a host connection, the switchport host command sets switch port mode to access, enables spanning tree Port Fast, and disables channel grouping. Only an end station can accept this configuration.

Because spanning tree Port Fast is enabled, you should enter the switchport host command only on ports that are connected to a single host. Connecting other switches, hubs, concentrators, or bridges to a fast-start port can cause temporary spanning-tree loops.

Enable the switchport host command to decrease the time that it takes to start up packet forwarding.
Examples

This example shows how to optimize the port configuration for a host connection:

Switch(config-if)# switchport host

switchport mode will be set to access

spanning-tree portfast will be enabled

channel group will be disabled

Switch(config-if)#

You can verify your setting by entering the show interfaces interface-id switchport privileged EXEC command.


https://www.cisco.com/en/US/docs/switches/metro/me3400e/software/release/12.2_58_ez/command/reference/cli3.html#wp6416484

Anonymous said...

If switchport host command is configured on an interface that is connected to a switch, can i also enable bpduguard on the interface, in order to prevent temporary spanning-tree loop?

A Network Artist said...

Well "switchport host" is essentially a macro which runs " spanning-tree portfast & switchport mode access " commands

So there is no problem is using "bpduguard" configuration on interface or globally.

Anuj said...

Thanks for sharing. I use this command number of time during my work but never gave thought that it is performing all there operations at same time.
www.networkengg.com