Skip to main content

Day 9: Switch Interfaces

Switch Interfaces

Overview

What are Switch Interfaces?

  • Physical ports on a switch where devices (PCs, servers, routers, other switches) connect

  • Each interface can be independently configured with different settings

  • Configuration and status monitoring is done through the Cisco CLI

Key Difference from Routers:

Unlike routers (which default to administratively down), switch interfaces are active by default and don't require no shutdown to enable them.

 


 

Viewing Switch Interface Status

show ip interface brief

SW1# show ip interface brief


This command displays a summary of all interfaces on the switch.

Output Columns:

Column

What It Shows

Details

Interface

Port name

Fa0/1, Fa0/2, Gi0/1, etc.

IP Address

IP address assigned to interface

Most switch interfaces don't have IPs assigned

Method

How IP was assigned

manual, DHCP, etc. (rarely used on access ports)

Status (L1)

Physical layer status

up = connected, down = not connected

Protocol (L2)

Data link layer status

up = operational, down = problem detected

Status Meanings on Switches:

Status

Protocol

Meaning

up

up

Interface is connected and operational

down

down

Interface has no cable or no device connected

administratively down

down

Interface has been disabled with shutdown

Key Difference: Unlike routers, switch interfaces do NOT default to "administratively down" — they are active by default.

show interfaces status

SW1# show interfaces status


This provides a more detailed view of all interfaces.

Output Columns:

Column

Purpose

Port

Interface name (Fa0/1, Fa0/2, etc.)

Name

Description assigned to the interface (for organization)

Status

connected, notconnect, disabled, err-disabled

VLAN

VLAN assignment (default is VLAN 1)

Duplex

half, full, or auto

Speed

10, 100, 1000 (Mbps) or auto

Type

10/100BaseTX, 10/100/1000BaseTX, etc.

 


 

Interface Configuration Basics

Entering Interface Configuration Mode

SW1# configure terminal

SW1(config)# interface fastethernet 0/1

SW1(config-if)#


Or use shorthand:

SW1(config)# interface fa0/1

SW1(config-if)#


Adding a Description

SW1(config-if)# description ## Connection to PC1 ##


Descriptions are useful for documenting what each port is connected to.

Disabling an Interface

SW1(config-if)# shutdown


  • Puts interface in "administratively down" status

  • Useful for security (disabling unused ports)

  • Can be re-enabled with no shutdown

Enabling a Disabled Interface

SW1(config-if)# no shutdown


 


 

Configuring Multiple Interfaces at Once

Interface Range Command

Manually configuring each unused interface would be tedious. Use the interface range command:

SW1(config)# interface range fastethernet 0/5 - 12

SW1(config-if-range)#


This selects interfaces Fa0/5 through Fa0/12 (inclusive).

Apply configuration to all selected interfaces:

SW1(config-if-range)# description ## Not in use ##

SW1(config-if-range)# shutdown


Both commands are applied to all 8 interfaces (0/5, 0/6, 0/7, ... 0/12) at once.

Verify the changes:

SW1# show interfaces status


You should see all the selected interfaces now show "disabled" status.

Other Range Syntax

// Separate specific interfaces

SW1(config)# interface range fa0/1, fa0/5, fa0/10

SW1(config-if-range)# shutdown


// Combine multiple ranges

SW1(config)# interface range fa0/1 - 5, fa0/10 - 15

SW1(config-if-range)# shutdown


 


 

Duplex and Collisions

Half Duplex vs. Full Duplex

Half Duplex:

  • Device cannot send AND receive at the same time

  • Must wait to receive before sending

  • Must wait to send before receiving

  • Like a walkie-talkie — only one person can talk at a time

Full Duplex:

  • Device can send AND receive simultaneously

  • No waiting required

  • Like a telephone — both parties can talk at the same time

  • More efficient, uses available bandwidth fully

Modern Switch Reality

Most modern switches and devices support Full Duplex.

Half duplex is virtually unused today, except in legacy or specialized scenarios.

Historical Context: Hubs vs. Switches

Hubs (Layer 1 Devices):

  • Simple repeaters that flood frames to all ports

  • All connected devices share the same collision domain

  • When multiple devices send simultaneously, collisions occur (frames corrupt each other)

  • All devices use Half Duplex (because collisions are common)

  • Use CSMA/CD to detect and handle collisions

Switches (Layer 2 Devices):

  • Intelligent devices that forward frames based on MAC addresses

  • Each port has its own collision domain

  • Collisions rarely occur (only within the same port pair, very unlikely)

  • All devices can use Full Duplex (no collision risk)

  • CSMA/CD is almost never triggered

CSMA/CD (Carrier Sense Multiple Access with Collision Detection)

How it works (for historical context):

  1. Device listens to the network (carrier sense)

  2. Waits until no other devices are transmitting

  3. Begins transmitting data

  4. If collision detected (two devices send at once), jam signal is sent

  5. All devices stop transmitting

  6. Each device waits a random amount of time

  7. Retry transmission

  8. Process repeats until successful

Why it's obsolete: Full Duplex switches make collisions impossible within normal operation.

 


 

Speed and Duplex Autonegotiation

Default Settings

Modern switch interfaces support automatic negotiation of speed and duplex:

Interface Type | Default Speed | Default Duplex |

10/100 | Auto | Auto |

10/100/1000 | Auto | Auto |


How autonegotiation works:

  1. Both devices advertise their capabilities (speeds and duplex modes they support)

  2. Devices negotiate the best mutually supported speed and duplex

  3. Both ends use the negotiated settings

Example:

Device A: Supports 10/100/1000 Full Duplex

Device B: Supports 10/100 Full Duplex

Result: Both use 100 Mbps Full Duplex (best common speed)


What Happens When Autonegotiation Fails?

If a device doesn't support autonegotiation (or it's disabled), the switch must guess:

Speed Fallback:

  • Switch tries to detect the speed the other device is using

  • If detection fails, defaults to the slowest supported speed

  • Example: On a 10/100/1000 interface, defaults to 10 Mbps

Duplex Fallback:

Speed

Default Duplex

10 Mbps

Half Duplex

100 Mbps

Half Duplex

1000 Mbps

Full Duplex

Why this matters:

  • Mismatched duplex causes performance problems and errors

  • Speed mismatch causes data loss or slow throughput

  • Always ensure both sides match or both use autonegotiation

Manually Configuring Speed and Duplex

If autonegotiation isn't working properly, manually set the interface:

SW1(config-if)# speed 100

SW1(config-if)# duplex full


Both sides must match manually (best practice: set both to auto if possible).

 


 

Interface Errors and Counters

Viewing Interface Statistics

SW1# show interfaces fastethernet 0/1


This displays detailed statistics including error counters at the bottom.

Error Types and Meanings

Frame Reception Statistics:

Counter

Meaning

Normal?

Runts

Frames smaller than minimum 64 bytes

Should be 0

Giants

Frames larger than maximum 1518 bytes

Should be 0

CRC Errors

Frames that failed CRC check (FCS trailer)

Should be 0

Frame Errors

Frames with incorrect format due to errors

Should be 0

Aggregated Counters:

Counter

Meaning

Input Errors

Total of various receive errors (runts, CRC, frame, etc.)

Output Errors

Count of frames switch tried to send but failed

What These Errors Indicate

Error Type

Common Causes

Runts

Cable issues, duplex mismatch, electromagnetic interference (EMI)

Giants

Device doesn't properly enforce frame size limits, MTU mismatch

CRC Errors

Bad cable, duplex mismatch, EMI, faulty NIC

Frame Errors

Cable problems, duplex mismatch, hardware failure

Output Errors

Switch interface hardware problem, buffer overflow

Troubleshooting with Error Counters

High runt/CRC errors?

  1. Check cable quality and connections

  2. Verify duplex settings on both ends

  3. Check for electrical interference

  4. Replace faulty cable or NIC

Increasing errors after configuration change?

  1. Verify speed/duplex settings match on both ends

  2. Check if autonegotiation is conflicting

  3. Look at interface utilization (might be saturated)

 


 

Complete Interface Configuration Example

Scenario: Setting up a PC Connection

Requirements:

  • Connect PC to Fa0/1

  • Label the port

  • Ensure it's enabled

  • Verify speed/duplex is auto (default)

Configuration:

SW1# configure terminal

SW1(config)# interface fastethernet 0/1

SW1(config-if)# description ## PC1 - Finance Department ##

SW1(config-if)# speed auto

SW1(config-if)# duplex auto

SW1(config-if)# no shutdown

SW1(config-if)# exit


// Verify configuration

SW1# show interfaces status


Expected output:

Port      Name                          Status    Vlan   Duplex  Speed Type

Fa0/1     ## PC1 - Finance Dept ##      connected  1      auto   auto  10/100BaseTX


 


 

Disabling Unused Ports for Security

The Problem

Unused ports are a security risk — unauthorized devices can connect and access the network.

The Solution: Disable Them

SW1# configure terminal

SW1(config)# interface range fastethernet 0/5 - 28

SW1(config-if-range)# description ## Unused - Security ##

SW1(config-if-range)# shutdown

SW1(config-if-range)# exit


// Verify

SW1# show interfaces status


Result:

All ports Fa0/5 through Fa0/28 now show "disabled" status and will not accept any connections.

 


 

Quick Reference: Common Interface Commands

Configuration Mode

Command

Purpose

interface fa0/1

Enter interface configuration mode

interface range fa0/1 - 5

Configure multiple interfaces at once

description <text>

Add description to interface

no shutdown

Enable interface

shutdown

Disable interface

speed 10 | 100 | 1000 | auto

Set interface speed

duplex half | full | auto

Set duplex mode

Privileged EXEC Mode

Command

Purpose

show ip interface brief

Summary of all interfaces

show interfaces status

Detailed interface status

show interfaces fa0/1

Detailed stats for one interface

show interfaces description

Show interface descriptions

 


 

Summary Table: Interface Status States

Status

Protocol

Meaning

Solution

up

up

Operational

None needed

down

down

No cable or device

Check cable, reconnect device

down

down

Disabled

Use no shutdown to enable

up

down

Physical good, L2 problem

Check configurations, VLAN issues

 


 

Key Takeaways for CCNA

✅ Switch interfaces are active by default — no shutdown needed to enable them (unlike routers)

✅ show ip interface brief shows summary status; show interfaces status shows detailed info

✅ Interface range command allows configuring multiple ports at once for efficiency

✅ Full Duplex is standard on modern switches; Half Duplex is legacy (used with hubs)

✅ CSMA/CD was used to detect collisions on hubs; obsolete with full-duplex switches

✅ Autonegotiation lets devices automatically negotiate speed and duplex (default and preferred)

✅ Mismatched speed/duplex causes performance problems and errors

✅ Error counters (runts, giants, CRC) indicate cable, duplex, or hardware issues

✅ Disable unused ports with shutdown command for security

✅ Descriptions on interfaces help with organization and troubleshooting

✅ Always verify interface status after making changes using show commands

✅ Typical default is Speed auto, Duplex auto — change only if autonegotiation fails