Skip to content

Intermediate · Switching and VLANs · topic 25 of 57 · 30 min

Switch management and interface troubleshooting

Explanation

A layer 2 switch gets a management IP address on an SVI and a default gateway with ip default-gateway, so you can reach it remotely. To troubleshoot a port, read its status (up/up, down/down, administratively down, err-disabled) and its error counters. CRC errors, runts and late collisions usually point to bad cabling or a duplex mismatch, which you fix by setting speed and duplex the same on both ends.

Giving a switch a management address

A layer 2 switch forwards frames without needing any IP address. But you want to log in to it remotely (with SSH), back up its configuration and monitor it. For that the switch itself needs an IP address. On a layer 2 switch you put that address on an SVI, usually in a dedicated management VLAN, and tell the switch where its router is.

output
SW1(config)# vlan 99
SW1(config-vlan)# name MGMT
SW1(config-vlan)# exit
SW1(config)# interface vlan 99
SW1(config-if)# ip address 10.99.0.11 255.255.255.0
SW1(config-if)# no shutdown
SW1(config-if)# exit
SW1(config)# ip default-gateway 10.99.0.1
Cisco IOS: management address on SVI 99, and a default gateway so the switch can reply to admins in other subnets.

Why ip default-gateway and not a default route? A layer 2 switch does not route (ip routing is off), so it uses ip default-gateway, exactly like a PC uses its gateway. A layer 3 switch with ip routing on uses a normal default route instead (ip route 0.0.0.0 0.0.0.0 next-hop).

Tip: Use a separate management VLAN instead of VLAN 1, and do not put user PCs in it. Then a user cannot even reach the login prompt of your switches.

Reading interface status

output
SW1# show interfaces status

Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1     Reception PC       connected    10         a-full  a-100 10/100BaseTX
Fa0/2                        notconnect   10           auto   auto 10/100BaseTX
Fa0/3     CCTV cam 3         err-disabled 30           auto   auto 10/100BaseTX
Fa0/4                        disabled     1            auto   auto 10/100BaseTX
Gi0/1     Uplink to R1       connected    trunk        full   1000 10/100/1000BaseTX
Cisco IOS: one line per port. "a-full" and "a-100" mean the value was auto-negotiated.

The Name column comes from the description command. connected means it works; notconnect means no cable or the other end is off; disabled means an administrator shut it down; err-disabled means the switch shut it down itself because of a problem it detected.

Routers and switches also report two words for each interface, for example in show ip interface brief or the first line of show interfaces: the line status (layer 1, the physical link) and the protocol status (layer 2, the data link).

Status / ProtocolWhat it meansWhat to check
up / upWorkingNothing at layers 1 and 2; look higher (IP, VLAN, routing).
down / downNo physical linkCable unplugged or broken, wrong cable, the other end shut down or powered off.
administratively down / downSomeone typed shutdownType no shutdown if the port should be in use.
up / downPhysical link fine, layer 2 not workingEncapsulation or keepalive mismatch (common on serial links).
down / down (err-disabled)The switch shut the port to protect the networkFind the cause (BPDU guard, port security...), fix it, then shutdown and no shutdown.

Error counters

A port can be up/up and still perform badly. show interfaces shows counters of bad frames since the counters were last cleared.

output
SW1# show interfaces fastEthernet 0/1
FastEthernet0/1 is up, line protocol is up (connected)
  ...
  Half-duplex, 100Mb/s, media type is 10/100BaseTX
  ...
     12 runts, 0 giants, 0 throttles
     87 input errors, 75 CRC, 0 frame, 0 overrun, 0 ignored
  ...
     0 output errors, 152 collisions, 1 interface resets
     0 babbles, 23 late collision, 0 deferred
Cisco IOS (trimmed): half duplex plus runts, CRC errors and late collisions on a 100 Mbps link is a classic duplex mismatch.
  • Runts: frames smaller than 64 bytes, the minimum Ethernet size. Often the broken pieces of collisions.
  • Giants: frames bigger than the maximum size (1518 bytes for a normal untagged frame). Often an MTU setting mismatch.
  • CRC errors: the frame check sequence did not match, so the frame was damaged on the way. Bad cable, electrical noise, or a duplex mismatch.
  • Late collisions: collisions after the first 64 bytes were sent. On a modern switched network these almost always mean a duplex mismatch.
  • Input errors: the total of several input error types, including runts, giants and CRC.

Speed, duplex and the duplex mismatch

Duplex says whether a link can send and receive at the same time (full duplex) or must take turns (half duplex). Both ends must agree. Normally both use autonegotiation and agree on the best speed and full duplex. The trouble starts when one end is hard-coded and the other is on auto: the auto side can still sense the speed, but it cannot learn the duplex, so at 10 or 100 Mbps it falls back to half duplex.

Result: one side sends whenever it likes (full), the other thinks it is a collision and backs off (half). The full-duplex side sees CRC errors and runts; the half-duplex side sees late collisions. The link works, but it is slow and drops packets, which users describe as "the network is slow only at this desk".

output
SW1(config)# interface fastEthernet 0/1
SW1(config-if)# description Reception PC
SW1(config-if)# speed auto
SW1(config-if)# duplex auto
SW1(config-if)# end
SW1# clear counters fastEthernet 0/1
Cisco IOS: set both ends to auto (or both to the same fixed values), then clear the counters and watch whether errors still rise.
Careful: Common mistakes: hard-coding speed 100 and duplex full on the switch while the PC stays on auto (that creates a mismatch); trusting old counters (clear them first, then re-check after some minutes); and bringing back an err-disabled port without fixing the cause, so it goes err-disabled again a second later.
Tip: Use description on every important port: "Uplink to R1 Gi0/0", "Billing printer". It shows in show interfaces status and saves a lot of guessing during an outage.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Switch management and interface troubleshooting · 1/7

Switch management and port troubleshooting

In this lesson you will learn how to manage a switch remotely and how to read the health of its ports.

Prefer a video by a teacher? Find free videos on “cisco switch interface status errors duplex mismatch troubleshooting” on YouTube ↗

In real life: The slow billing counter at a supermarket in Kochi

The billing PC at counter 3 of a supermarket takes twenty seconds to print each bill, while the other counters are fast. The IT person runs show interfaces status and sees counter 3 at "half" duplex and "100". show interfaces shows thousands of late collisions. Somebody had set the PC network card to 100 Mbps full duplex by hand, while the switch port was on auto. Setting the PC back to auto-negotiate fixes it, and clear counters followed by a check an hour later shows zero new errors.

Practice (0/3 done)

Task 1 · Code · Python

Write diagnose(line, protocol) for the two status words of an interface. Return "working" for ("up", "up"), "shut down by admin" for ("administratively down", "down"), "physical problem" for ("down", "down"), "layer 2 problem" for ("up", "down"), "err-disabled" for ("down", "down (err-disabled)"), and "unknown" for anything else.

Task 2 · Code · Python

Write likely_cause(counters) where counters is a dict that may contain "late_collisions", "crc", "runts" and "giants" (missing keys mean 0). Return "duplex mismatch" if there are any late collisions; otherwise "cabling or noise" if there are CRC errors; otherwise "mtu mismatch" if there are giants; otherwise "healthy".

Task 3 · Question

show interfaces fa0/7 says "FastEthernet0/7 is administratively down, line protocol is down". What fixes it?

Quick quiz

Question 1

1.Which command gives a layer 2 switch a gateway for its own management traffic?

Question 2

2.An interface is down/down. What is the most likely cause?

Question 3

3.What are runts?

Question 4

4.A port shows many late collisions. What is the usual cause?

Question 5

5.In show interfaces status, what does a-full mean?

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

Which command gives a layer 2 switch a gateway for its own management traffic?

Answer: ip default-gateway 10.99.0.1

A layer 2 switch does not route, so it uses ip default-gateway, like a PC.

An interface is down/down. What is the most likely cause?

Answer: A physical problem such as an unplugged or broken cable

down/down means no physical link. administratively down would mean shutdown.

What are runts?

Answer: Frames smaller than 64 bytes

Runts are frames below the 64-byte Ethernet minimum, often fragments from collisions.

A port shows many late collisions. What is the usual cause?

Answer: A duplex mismatch

On switched networks, late collisions almost always mean one side is half duplex and the other full.

In show interfaces status, what does a-full mean?

Answer: Full duplex agreed by autonegotiation

The a- prefix means the value was auto-negotiated.

One end of a 100 Mbps link is set to full duplex by hand, the other is on auto and falls back to half. What will you most likely see?Related

Answer: Late collisions on one side, CRC errors on the other, and a slow link

That is a duplex mismatch: the link is up but slow and full of errors.

From Ethernet frames and MAC addresses

An SVI for VLAN 30 stays down/down. Which is a likely cause?Related

Answer: No port in VLAN 30 is up

An SVI needs the VLAN to exist and at least one up, forwarding port in that VLAN.

From Inter-VLAN routing

A 16-port switch has a PC on every port. How many collision domains are there?Related

Answer: 16

Each switch port is its own collision domain.

From Network devices

A PC shows no link light on its network port. Which layer should you check first?Related

Answer: Layer 1

No link light points to the physical layer: cable, port or NIC.

From The OSI model

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. This is the last topic of “Switching and VLANs”. The module exam comes next.
  2. Module 5 exam: Switching and VLANs · 13 questions · 20 min, without help. 5 topics of this module still to finish first.
  3. Then the next module, Spanning Tree and EtherChannel. 57 topics left in the course before the final exam.

← Previous: CDP and LLDP: discovering neighbours