Configuring Interfaces of a Switch

We can configure the interfaces of a switch according to our requirements. In order to do that first we have to pick the interface which we want to configure.we have to use the command switch(config)# interface type <number> to pick the interface we want to configure.

Let's say I want to configure Fast Ethernet 0/3 interface, then I should use the command

switch(config)#interface Fast Ethernet 0/3

Similarly, if we want to configure multiple interfaces with the same settings then we can use the "interface range" command.

Switch(config)#interface range type number ,[type number],[type number],[type number],

Let's say I want to configure Fast Ethernet 0/1, FastEthernet 0/3, Fast Ethernet 0/6, with the same settings then I can use the interface range command as shown below.

switch(config)#interface range fast ethernet 0/1,fast ethernet 0/3,fast ethernet 0/6,

If the interfaces are in sequence then we can use the command as shown below

switch(config)#interface range type [first number- last number]

Let's say the interfaces which we are configuring are in sequence like Fast Ethernet 0/1 to Fast Ethernet 0/10, then we can use the command as below

switch(config)#interface range fastethernet 0/1-10

Adding Description


Once the configuration is done on all the interfaces of a switch, it becomes difficult for us to go back to a particular interface and check its configuration using the "show running-config" command, unless we know the interface number for which we are looking for.

 So in order to overcome this, we can also add a description to the configuration of the interface.So that we can identify that interface easily from the output of the show running-config command.

For adding the description we can use the below command in the interface configuration mode.

switch(config-if)#description <description>

Let's say FastEthernet 0/10 port of the switch is connected to the IP phone of the user SAM in the accounts department then we can add the description as below

switch(config-if)#description IP phone of SAM in accounts department



Switchport Errors

Whenever an error occurs on the switchport, the switch detects that error automatically and the switchport goes into errdisable state and is disabled. This is the default behavior of the switch.

we can change this behavior of the switch and choose which error can cause the switchport to go into errdisable state and which error can be ignored.

we can use the below command in global configuration mode

Switch(config)#no errdisable detect cause[all|cause]

All: All types of errors will be detected.

arp-inspection: Dynamic ARP inspection related errors will be detected.

bpduguard: Detects when a spanning tree bridge protocol data unit(BPDU) is received on a port configured for STP portFast.

Channel-misconfig: Etherchannel related errors.

dhcp-rate-limit: DHCP snooping related errors.

dtp-flap: Fluctuations in the type of trunk encapsulation.

gbic-invalid: This error occurs if the GBIC or SFP module is invalid.

ilpower: Error related to inline power.

l2ptguard: Layer 2 protocol tunneling issues.

link-flap: If the port link state is changing between up state and down state.

loopback: This error is related if the interface has been looped back.

pagp-flap: This error occurs if the etherchannel bundle's ports no longer have consistent configurations.

psecure-violation: Situations that initiate port security configured on the port.

rootguard: Identifies when an STP BPDU is received from the root bridge on an unexpected port.

security-violation: This issue is identified when errors related to port security occur.

storm-control: If the storm control threshold has been exceeded on a port then this problem will be identified.

udld: This error is identified in case of a unidirectional link(data passing in only one direction).

unicast-flood: Identifies situations that initiate unicast flood blocking on a port.

vmps: Identifies errors occurring while  configuring a port to a dynamic VLAN through VLAN membership policy server(VMPS).

Recover switchport from errdisable state:


Whenever s switchport goes into errdisable state we need to examine the error which resulted in the errdisbale state of the switchport. By doing so we can prevent error from occurring again in the future.

Once the cause of the errdisable state is identified we can reenable the switchport either manually or automatically.

 For reenabling manually we have to issue shutdown command on the interface configuration mode followed by no shutdown command.

For automatic recovery from errdisable state we have to use the below command.


switch(config)errdisable recovery cause [all|cause-name]

In the above command we have to mention the error cause for which we want to reenable the switchport automatically.

Whenever the switchport goes into errdisable state, the port will remain in that state for a period of 300 sec.This is the default duration for which the port will be in errdisable state. We can change this default period using the below command.


Switch(config)#errdisable recover interval <seconds> (30 to 86,400 seconds)