Skills affaan-m ecc

network-interface-health

Use it when:
A host or VLAN has packet loss or intermittent reachability, or a switch port shows CRCs, drops, resets or flaps.
It does:
Captures a counter baseline, waits, captures again and compares the increments, on both ends of the link.
You get:
A likely cause from a counter table, such as a bad cable or optic, a duplex or MTU mismatch, or a congested uplink.
Also has:
A Python parser for show interfaces output that slices each interface block cleanly.

TL;DR

A diagnostic flow from ECC for problems that may sit in a physical link, switch port, cable, transceiver, duplex setting or congested interface. Counters are evidence, but the trend matters more than the total, so the agent records a baseline, waits a measurement interval and compares the increments: show interfaces and show logging on network gear, ip -s link and ethtool on Linux hosts. A counter table maps CRCs, input errors, runts, giants, input and output drops, resets and collisions to their usual causes. For CRCs it checks both ends, since receive errors point at the signal arriving on that side, then the cable, fiber or optic, then speed and duplex. For drops it separates input from output and proves congestion before tuning queues. It prefers auto-negotiation on both sides and never mixes fixed and auto settings. Worked examples cover CRCs on one switch port and slow internet with a healthy LAN. Anti-patterns include clearing counters before saving a baseline and blaming the cable for output drops.

Summarizes the skill at d2ef268.

npx skills add https://github.com/affaan-m/ecc --skill network-interface-health
Total Downloads
5,300 on skills.sh, Nov 9, 2026
Repo stars
299,776 affaan-m/ecc
First seen
May 19, 2026 on skills.sh
Weekly Downloads
452
+77% over the 8 weeks to Nov 9
Weekly values
Week toInstalls
Sep 21255
Sep 28156
Oct 5140
Oct 12232
Oct 19406
Oct 26405
Nov 2473
Nov 9452
Category

Find root causes, review code and test what you built.

Computer networks: home labs, VLANs, VPNs, DNS, routing and network diagnostics.

Everything for building software: planning, coding, debugging, design, frameworks, cloud, agents and skills.

Type

A multi-step process the agent follows: interview, debug, run a TDD loop, review.

Effect

Adds no side effects of its own. It shapes how the agent thinks, writes or reviews. Guidelines and routers are always effect:none, even when the task they support edits code.

Needs

Instructions only. Works in any agent that supports skills.

Publisher

Everyone else. Unverified vendor claims default to community.

Topics

SKILL.md

From affaan-m/ecc at d2ef268. Checked daily, last changed Nov 6, 2026.

Frontmatter
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. Use when an interface shows errors, drops, CRCs, flapping, or a duplex or speed mismatch.
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

Counter Meaning Common cause
CRC Received frame checksum failed Bad cable, dirty fiber, bad optic, duplex mismatch
input errors Aggregate receive-side errors Check sub-counters before concluding
runts Frames below minimum Ethernet size Duplex mismatch, collision domain, faulty NIC
giants Frames larger than expected MTU MTU mismatch or jumbo-frame boundary
input drops Device could not accept inbound packets Burst, oversubscription, CPU path, queue pressure
output drops Egress queue discarded packets Congestion, QoS policy, undersized uplink
resets Interface hardware reset Flapping, keepalive, driver, optic, power
collisions Ethernet collision counter Half 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