PluginBench
Skill
Pass
Audit score 90

network-interface-health

affaan-m/everything-claude-code

Diagnose physical link, duplex, and interface counter issues on network devices.

What is network-interface-health?

Captures and analyzes interface error counters (CRCs, drops, runts, giants, flaps) on routers, switches, and Linux hosts to identify cable, transceiver, duplex mismatch, or congestion problems. Use when a network path shows packet loss, latency spikes, or intermittent reachability.

  • Parse and compare interface counters across measurement intervals to detect trends rather than absolute values
  • Diagnose CRC errors, input/output drops, runts, giants, collisions, and resets with root-cause guidance
  • Validate speed and duplex settings on both ends of a link to catch negotiation mismatches
  • Separate input drops (burst/oversubscription) from output drops (congestion/QoS) to guide remediation
  • Provide safe regex-based parsing of show interfaces output to avoid counter misalignment on large blocks

How to install network-interface-health

npx skills add https://github.com/affaan-m/everything-claude-code --skill network-interface-health
Prerequisites
  • Access to network device CLI (router, switch) or Linux host with ip and ethtool commands
  • Ability to run show interfaces or equivalent commands twice with a known time interval between captures
  • Basic understanding of Ethernet counters (CRC, drops, duplex) and their common causes
Claude Code
Cursor
Windsurf
Cline

How to use network-interface-health

  1. 1.Capture baseline interface counters using show interfaces <interface> or ip -s link show <interface>
  2. 2.Wait a measurement interval (e.g., 5–10 minutes) while the symptom is active or reproducible
  3. 3.Capture counters again and calculate the delta for each counter since the baseline
  4. 4.Compare both ends of the link (local and remote port) to correlate errors and identify the signal direction
  5. 5.Check logs for flap events, resets, or state changes around the same timestamp as counter increments
  6. 6.Use the counter reference table to map observed errors to root causes (cable, duplex, congestion, etc.)
  7. 7.Clear counters only after recording and saving the baseline; recheck after remediation

Use cases

Good for
  • Troubleshoot intermittent packet loss or latency spikes by capturing before/after interface counters
  • Diagnose CRC errors on a switch port and compare both ends of the link before hardware replacement
  • Identify duplex mismatch or flapping by correlating counter increments with log timestamps
  • Validate that a WAN uplink is clean before escalating to gateway CPU or upstream service issues
  • Prove congestion on an oversubscribed uplink by separating output drops from cable/transceiver problems
Who it's for
  • Network engineers and operators troubleshooting link-layer issues
  • System administrators diagnosing host NIC or switch port problems
  • Change-control teams needing before/after counter evidence for hardware swaps
  • On-call responders investigating intermittent reachability or performance complaints

network-interface-health FAQ

Should I clear interface counters before diagnosing?

No. Clear counters only after saving a baseline. Clearing before diagnosis loses historical evidence and makes it harder to correlate with log timestamps.

If both ends of a link show CRCs, which side is the problem?

CRCs on the receive side usually indicate a signal quality issue arriving on that port (bad cable, dirty fiber, bad optic, or duplex mismatch). Compare both sides; the port with higher CRC increments is more likely receiving the bad signal.

What is the difference between input drops and output drops?

Input drops mean the device could not accept inbound packets (burst, oversubscription, or CPU path pressure). Output drops mean the egress queue discarded packets (congestion, QoS policy, or undersized uplink). Diagnosis differs: input drops suggest burst handling; output drops suggest sustained congestion.

Can I use auto-negotiation on one side and fixed speed/duplex on the other?

No. This is an anti-pattern that causes duplex mismatches and collisions. Either use auto-negotiation on both sides or configure both sides explicitly with the same speed and duplex, and document why fixed settings are needed.

How do I know if a counter is a historical problem or an active one?

Capture counters at two points in time and calculate the delta. If the counter incremented during your measurement interval, it is an active problem. If it did not change, it is historical.

Full instructions (SKILL.md)

Source of truth, from affaan-m/everything-claude-code.


name: network-interface-health description: Diagnose interface errors, drops, CRCs, duplex mismatches, flapping, speed negotiation issues, and counter trends on routers, switches, and Linux hosts. metadata: origin: community

Network Interface Health

Use this skill when a network symptom might be caused by a physical link, switch port, cable, transceiver, duplex setting, or congested interface.

When to Use

  • A host or VLAN has packet loss, latency spikes, or intermittent reachability.
  • A switch or router interface shows CRCs, runts, giants, drops, resets, or flaps.
  • You need to compare both ends of a link before replacing hardware.
  • A change window needs before/after interface counter evidence.
  • Monitoring reports rising ifInErrors, ifOutErrors, or ifOutDiscards.

How It Works

Interface counters are evidence, but the trend matters more than the absolute number. Capture a baseline, wait a measurement interval, capture again, then compare increments.

show interfaces <interface>
show interfaces <interface> status
show logging | include <interface>|changed state|line protocol

On Linux hosts:

ip -s link show <interface>
ethtool <interface>
ethtool -S <interface>

Counter Reference

CounterMeaningCommon cause
CRCReceived frame checksum failedBad cable, dirty fiber, bad optic, duplex mismatch
input errorsAggregate receive-side errorsCheck sub-counters before concluding
runtsFrames below minimum Ethernet sizeDuplex mismatch, collision domain, faulty NIC
giantsFrames larger than expected MTUMTU mismatch or jumbo-frame boundary
input dropsDevice could not accept inbound packetsBurst, oversubscription, CPU path, queue pressure
output dropsEgress queue discarded packetsCongestion, QoS policy, undersized uplink
resetsInterface hardware resetFlapping, keepalive, driver, optic, power
collisionsEthernet collision counterHalf duplex or negotiation mismatch

Diagnosis Flow

CRCs Or Input Errors

  1. Confirm counters are incrementing, not just historical.
  2. Check both ends of the link. Receive-side errors usually point to the signal arriving on that side, not necessarily the port reporting the error.
  3. Replace patch cable or clean/replace fiber and optics.
  4. Confirm speed/duplex settings match on both sides.
  5. Check logs for flap events around the same timestamp.

Drops

  1. Separate input drops from output drops.
  2. Compare interface rate against capacity.
  3. Check QoS policy, queue counters, and whether the link is an oversubscribed uplink.
  4. Treat queue tuning as secondary. First prove whether the link is congested.

Duplex And Speed

Prefer auto-negotiation on modern Ethernet links when both sides support it. If one side must be fixed, configure both sides explicitly and document why. Never mix fixed speed/duplex on one side with auto on the other.

show interfaces <interface> | include duplex|speed

Safe Parser Example

Slice each interface block from one header to the next. Do not use an arbitrary character window; large interface blocks can cause counters to be missed or assigned to the wrong port.

import re
from typing import Any

HEADER_RE = re.compile(
    r"^(?P<name>\S+) is (?P<status>(?:administratively )?down|up), "
    r"line protocol is (?P<protocol>up|down)",
    re.I | re.M,
)
ERROR_RE = re.compile(r"(?P<input>\d+) input errors, (?P<crc>\d+) CRC", re.I)
DROP_RE = re.compile(r"(?P<output>\d+) output errors", re.I)
DUPLEX_RE = re.compile(r"(?P<duplex>Full|Half|Auto)-duplex,\s+(?P<speed>[^,]+)", re.I)

def parse_show_interfaces(raw: str) -> list[dict[str, Any]]:
    headers = list(HEADER_RE.finditer(raw))
    interfaces = []
    for index, header in enumerate(headers):
        end = headers[index + 1].start() if index + 1 < len(headers) else len(raw)
        block = raw[header.start():end]
        errors = ERROR_RE.search(block)
        drops = DROP_RE.search(block)
        duplex = DUPLEX_RE.search(block)
        interfaces.append({
            "name": header.group("name"),
            "status": header.group("status"),
            "protocol": header.group("protocol"),
            "duplex": duplex.group("duplex") if duplex else "unknown",
            "speed": duplex.group("speed").strip() if duplex else "unknown",
            "input_errors": int(errors.group("input")) if errors else 0,
            "crc_errors": int(errors.group("crc")) if errors else 0,
            "output_errors": int(drops.group("output")) if drops else 0,
        })
    return interfaces

Examples

CRCs On One Switch Port

  1. Capture counters on the local port.
  2. Capture counters on the connected remote port.
  3. Replace the cable or optic before changing routing or firewall rules.
  4. Clear counters only after recording the baseline.
  5. Recheck after a fixed interval.

Internet Slow But LAN Is Fine

  1. Check WAN interface drops/errors.
  2. Check LAN uplink utilization and output drops.
  3. Check gateway CPU if the WAN link is clean but throughput is still low.
  4. Compare wired and wireless tests before blaming upstream service.

Anti-Patterns

  • Clearing counters before saving a baseline.
  • Looking at only one side of a link.
  • Assuming all historical CRCs are active problems without a time window.
  • Mixing auto-negotiation on one side with fixed speed/duplex on the other.
  • Treating output drops as a cable problem before checking congestion.

See Also

  • Agent: network-troubleshooter
  • Skill: network-config-validation
  • Skill: homelab-network-setup