Home > General > Switchport Host Command

Switchport Host Command

March 31st, 2011

Today a co-worker brought to my attention new Cisco IOS command that make some related interface-related tasks a bit easier to implement.

The command is “switchport host” and it is an interface level command. This means that it can be used on a single interface or on a range of interfaces, such as in the example below.

interface range gi1/0/1 – 24

switchport host

This command is designed to be used to configure access ports that connect to network endpoints (desktops, laptops, ect) and not ports that connect to other network devices. The reason for this is evident when examining the actions this particular command takes on an interface.

First the switchport is set to access mode. Next portfast is enabled, which can have a negative impact on the network if it is not understood correctly (more on this in a bit). Finally, the command disables channel grouping.

Portfast is a powerful configuration item, but it is worth taking a second look at how it functions. To summarize, portfast puts a port directly into the Spanning-Tree state of “forwarding” when the port comes up. This means that the listening and learning states are bypassed, thus there is potential for a loop to be created if someone plugs a piece of network equipment into a port that is configured for portfast.

The “switchport host” command takes a command block such as:

interface range gigabitEthernet 1/0/1 – 24

switchport mode access

spanning-tree portfast

no channel-group

And condenses it into two lines:

interface range gigabitEthernet 1/0/1 – 24

switchport host

Categories: General Tags:
Comments are closed.