Communitygithub.com

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

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

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

このスキルは、ネットワークインターフェースの物理リンク、スイッチポート、ケーブル、トランシーバー、デュプレックス設定、または輻輳に関連する問題を診断するために設計されています。スイッチやルーター上でCRC、ラント、ジャイアント、ドロップ、リセット、フラップを確認し、両端のリンクを比較してハードウェア交換の必要性を判断します。また、Linuxホスト上でも `ip -s link show` や `ethtool` コマンドを使用して同様の診断が可能です。このスキルは、設定変更前後のインターフェースカウンターの証拠を提供し、トラフィックの傾向分析を通じて輻輳やケーブル障害を切り分けるのに役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/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

安全なパーサー例

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

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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

関連スキル