Communitygithub.com

ネットワークインターフェースヘルス

ルーター、スイッチ、Linuxホスト上のインターフェースエラー、ドロップ、CRC、デュプレックスミスマッチ、フラッピング、速度ネゴシエーションの問題、カウンタートレンドを診断します。インターフェースにエラー、ドロップ、CRC、フラッピング、またはデュプレックス/速度の不一致が見られる場合に使用します。

ネットワークインターフェースヘルス とは?

このスキルは、ネットワークインターフェースの健全性を診断するための包括的なガイドです。物理リンク、スイッチポート、ケーブル、トランシーバー、デュプレックス設定、または輻輳したインターフェースによって引き起こされる可能性のあるネットワーク症状に対処するために設計されています。CRC、入力/出力エラー、ドロップ、フラッピング、速度/デュプレックスの不一致など、さまざまなカウンターを解釈する方法を提供し、問題を特定するためのステップバイステップの診断フローを提供します。このスキルは、Ciscoのようなネットワーク機器とLinuxホストの両方をサポートしており、CLIコマンドとPythonパーサーの例を含んでいます。各インターフェースのヘッダーから次のヘッダーまでブロックをスライスする安全なパーシング手法を強調し、ネットワークの問題を効率的にトラブルシューティングし、根本原因を特定するのに役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/network-interface-health

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ネットワークインターフェースヘルス は何をしますか?

このスキルは、ネットワークの症状が物理リンク、スイッチポート、ケーブル、トランシーバー、デュプレックス設定、または輻輳したインターフェースに起因する可能性がある場合に使用します。

使用するタイミング

  • ホストまたはVLANでパケット損失、レイテンシスパイク、または断続的な到達不能が発生している。
  • スイッチまたはルーターのインターフェースにCRC、ラント、ジャイアント、ドロップ、リセット、またはフラップが表示されている。
  • ハードウェアを交換する前に、リンクの両端を比較する必要がある。
  • 変更ウィンドウで、前後のインターフェースカウンターの証拠が必要。
  • 監視でifInErrors、ifOutErrors、またはifOutDiscardsの上昇が報告されている。

仕組み

インターフェースカウンターは証拠ですが、絶対値よりもトレンドの方が重要です。ベースラインを取得し、測定間隔を待ち、再度取得して、増分を比較します。

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

Linuxホストの場合:

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

カウンターリファレンス

カウンター意味一般的な原因
CRC受信フレームのチェックサム失敗不良ケーブル、汚れたファイバー、不良光学素子、デュプレックスミスマッチ
input errors受信側エラーの総数結論を下す前にサブカウンターを確認
runts最小イーサネットサイズ未満のフレームデュプレックスミスマッチ、コリジョンドメイン、不良NIC
giants想定されるMTUより大きいフレームMTUミスマッチまたはジャンボフレーム境界
input dropsデバイスが着信パケットを受信できなかったバースト、オーバーサブスクリプション、CPUパス、キュー圧力
output drops出力キューがパケットを廃棄した輻輳、QoSポリシー、アンダーサイズアップリンク
resetsインターフェースハードウェアリセットフラッピング、キープアライブ、ドライバー、光学素子、電力
collisionsイーサネットコリジョンカウンター半二重またはネゴシエーションミスマッチ

診断フロー

CRCまたは入力エラー

  1. カウンターが増加していることを確認する(単なる履歴ではない)。
  2. リンクの両端を確認する。受信側のエラーは通常、その側に到着する信号を示しており、必ずしもエラーを報告しているポートを示しているわけではない。
  3. パッチケーブルを交換するか、ファイバーと光学素子を清掃/交換する。
  4. 両側の速度/デュプレックス設定が一致していることを確認する。
  5. 同じタイムスタンプ付近のフラップイベントについてログを確認する。

ドロップ

  1. 入力ドロップと出力ドロップを分離する。
  2. インターフェースレートを容量と比較する。
  3. QoSポリシー、キューカウンター、およびリンクがオーバーサブスクライブされたアップリンクであるかどうかを確認する。
  4. キューチューニングは二次的に扱う。最初にリンクが輻輳しているかどうかを証明する。

デュプレックスと速度

最新のイーサネットリンクでは、両側がサポートしている場合は自動ネゴシエーションを推奨します。片側を固定する必要がある場合は、両側を明示的に設定し、その理由を文書化します。片側を固定速度/デュプレックス、もう片側を自動で混在させないでください。

show interfaces <interface> | include duplex|speed

安全なパーサーの例

各インターフェースブロックを、あるヘッダーから次のヘッダーまでスライスします。任意の文字ウィンドウを使用しないでください。大きなインターフェースブロックは、カウンターが見逃されたり、間違ったポートに割り当てられたりする原因となる可能性があります。

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

例

1つのスイッチポートでのCRC

  1. ローカルポートのカウンターを取得する。
  2. 接続されているリモートポートのカウンターを取得する。
  3. ルーティングやファイアウォールルールを変更する前に、ケーブルまたは光学素子を交換する。
  4. ベースラインを記録した後にのみカウンターをクリアする。
  5. 一定間隔後に再確認する。

インターネットが遅いがLANは正常

  1. WANインターフェースのドロップ/エラーを確認する。
  2. LANアップリンクの使用率と出力ドロップを確認する。
  3. WANリンクに問題がないがスループットが依然として低い場合、ゲートウェイのCPUを確認する。
  4. アップストリームサービスを非難する前に、有線と無線のテストを比較する。

アンチパターン

  • ベースラインを保存する前にカウンターをクリアする。
  • リンクの片側だけを見る。
  • 時間ウィンドウなしで、すべての履歴CRCがアクティブな問題であると想定する。
  • 片側で自動ネゴシエーションと、もう片側で固定速度/デュプレックスを混在させる。
  • 輻輳を確認する前に、出力ドロップをケーブルの問題として扱う。

関連情報

  • エージェント: network-troubleshooter
  • スキル: network-config-validation
  • スキル: homelab-network-setup

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

関連スキル