Pages

Switch Port Configuration

You can configure individual or range of ports/interfaces on a switch with various information and settings as explained below.

Selecting Ports to Configure

We need to select one or more switch ports to configure. "Ports" are also referred as "Interfaces". To select a single switch port, Enter global config mode and type the following command.

Switch(config)# interface type module/number

The port is identified by :
Ethernet type  which could be fastethernet/gigabitethernet/tengigabitethernet/vlan.
physical module or blade where it is located.
port number within the module.

Eg: To select a fastethernet 0/3 interface
Switch(config)# interface fastethernet 0/3

If you want to configure many individual interfaces with identical settings, selecting each one is a tedious job. Cisco has a better option of doing this by selecting multiple interfaces with range command. Once selected all the configuration changes entered are applied to each of the interfaces in the selected range.

Switch(config)# interface range type module/number , type module/number , .....

Eg1: To select interfaces fastethernet 0/3 , 0/6 , 0/10
Switch(config)# interface range fastethernet 0/3 , fastethernet 0/6 , fastethernet 0/10

Eg2: To select range of interfaces fastethernet 0/3 , 0/4 , 0/5 , 0/6 , 0/7
Switch(config)# interface range fastethernet 0/3 - 7

Note: Beginning & end port numbers separated by dash/coma with space in between.
 

Identify ports

While adding a port description is optional, it offers great benefit. For example if you come back after a year to configure the switch it can be confusing to identify which port goes to accounts and which one to HR. Adding a description helps any one working on the switch/router any time. It saves time and also prevents outages.
Enter interface configuration mode and type the following command.

Switch(config-if)# description description-string

Eg: Configuring a port description going to HR department
Switch(config-if)# description HR Lan 2nd Floor


Port Speed & Duplex

These commands are not regularly used but are very essential to know when we have issues with communicating between two devices.
We can hard code a switch port to a specific speeds of 10, 100, 1000 and Auto which is the default and duplex settings can be either half, full or Auto.
Enter interface configuration mode and type the following command.

Switch(config-if)# speed {10 | 100 | 1000 | auto}
Switch(config-if)# duplex {auto | full | half}

Eg: Configuring Fast Ethernet 0/5 to force 10Mbps Half duplex
Switch(config)# interface fastethernet 0/5
Switch(config-if)# duplex half
Switch(config-if)# speed 10

Note: If the speed and duplex is set to Auto then a 10Mbps Ethernet link defaults to 10Mbps Half duplex, while a 100Mbps Fast Ethernet link defaults to 100Mbps Full duplex.


Enabling and Disabling Switch Port

To enable or disable an interface use the "no shutdown" or "shutdown" command from the interface config mode.

no shutdown command is used to bring the interface up from the administratively shutdown state. When used the interface with come up but it will not come up/up until a cable is connected with proper end to end connectivity.

Switch(config)#
Switch(config)#int fa 0/0
Switch(config-if)#no shutdown
Switch(config-if)#
*Mar  1 00:01:41.703: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:01:42.703: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Switch(config-if)#
Switch(config-if)#shutdown
Switch(config-if)#
*Mar  1 00:02:50.255: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Mar  1 00:02:51.255: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
Switch(config-if)#


Use the "show interface" command to see the complete information about the interface.

R1#sh interface fa 0/0
FastEthernet0/0 is up, line protocol is up
  Hardware is AmdFE, address is cc00.10e4.0000 (bia cc00.10e4.0000)

  Description: HR Lan 2nd Floor
  MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s, 100BaseTX/FX
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog
     0 input packets with dribble condition detected
     3 packets output, 724 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
R1#