
Network Interface Health
FreeDiagnose network interface issues effectively.
Free · Opens the source repo
What Network Interface Health does
The Network Interface Health skill provides a systematic approach to diagnosing network issues related to physical links, switch ports, and Linux hosts. It focuses on identifying common problems such as packet loss, latency spikes, and interface errors, including CRC errors, duplex mismatches, and flapping. By utilizing a series of commands and diagnostic techniques, users can gather critical data to troubleshoot and resolve network performance issues.
This skill is particularly useful for network engineers and system administrators who need to ensure the reliability and performance of their network infrastructure. It guides users through the process of monitoring interface counters, understanding the implications of various error types, and comparing link statuses before making hardware changes. The emphasis on trend analysis over absolute values helps users to establish baselines and identify anomalies effectively.
The skill includes specific commands for both network devices and Linux hosts, allowing for comprehensive diagnostics across different environments. It also provides a counter reference that explains the significance of various metrics, such as CRC errors and input/output drops, along with common causes for these issues. This reference can help users quickly pinpoint the source of network problems and implement solutions accordingly.
For anyone involved in maintaining network health, this skill serves as a valuable resource to streamline the troubleshooting process and improve overall network performance. By following the outlined diagnostic flow and utilizing the provided examples, users can enhance their ability to quickly identify and resolve network interface issues, leading to a more stable and efficient network environment.
When to use it
Use this skill when experiencing packet loss, latency spikes, or interface errors on network devices or Linux hosts.
When not to use it
This skill may not be suitable for diagnosing application-layer issues or problems unrelated to network interfaces.
What you can build with it
Diagnosing a CRC Error on a Switch Port
Retrieve the interface counters from both local and remote ports to identify the source of CRC errors before making any hardware changes.
Identifying Packet Loss in a VLAN
Monitor the VLAN interface for packet loss and latency spikes, using the skill to analyze interface counters and determine the cause.
Comparing Link Status Before Hardware Changes
Use the skill to gather evidence of interface performance before replacing hardware, ensuring both ends of the link are assessed.
How to install Network Interface Health
View source1. Install with the skills CLI
npx skills add affaan-m/ecc/network-interface-health --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by affaan-mネットワークインターフェースヘルス
ネットワークの症状が物理リンク、スイッチポート、ケーブル、トランシーバー、デュプレックス設定、または輻輳したインターフェースによって引き起こされている可能性がある場合にこのスキルを使用する。
使用するタイミング
- ホストまたは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または入力エラー
- カウンターが増加していることを確認する(歴史的なものだけでなく)。
- リンクの両端を確認する。受信側エラーは通常、エラーを報告しているポートではなく、その側に到着する信号を指す。
- パッチケーブルを交換するか、ファイバーとオプティクスを清掃/交換する。
- 両側で速度/デュプレックス設定が一致していることを確認する。
- 同じタイムスタンプ前後のフラップイベントのログを確認する。
ドロップ
- 入力ドロップと出力ドロップを分離する。
- インターフェースレートを容量と比較する。
- QoSポリシー、キューカウンター、リンクがオーバーサブスクリプションのアップリンクかどうかを確認する。
- キューチューニングは二次的な処置として扱う。まずリンクが輻輳しているかどうかを証明する。
デュプレックスと速度
両側がサポートしている場合、最新のイーサネットリンクではオートネゴシエーションを優先する。一方の側を固定する必要がある場合は、両側を明示的に設定し、理由を文書化する。一方をfixed speed/duplexに設定し、もう一方をautoにすることは絶対にしてはならない。
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
- ローカルポートのカウンターを取得する。
- 接続されたリモートポートのカウンターを取得する。
- ルーティングやファイアウォールルールを変更する前にケーブルまたはオプティクスを交換する。
- ベースラインを記録した後にのみカウンターをクリアする。
- 一定間隔後に再確認する。
インターネットは遅いがLANは正常
- WANインターフェースのドロップ/エラーを確認する。
- LANアップリンクの利用率と出力ドロップを確認する。
- WANリンクがクリーンでもスループットが低い場合はゲートウェイCPUを確認する。
- 上流サービスを責める前に有線と無線のテストを比較する。
アンチパターン
- ベースラインを保存する前にカウンターをクリアする。
- リンクの一方の側だけを確認する。
- 時間ウィンドウなしで過去のすべてのCRCをアクティブな問題と仮定する。
- 一方の側でオートネゴシエーションを使用し、もう一方で固定速度/デュプレックスを使用する。
- 輻輳を確認する前に出力ドロップをケーブル問題として扱う。
関連情報
- エージェント:
network-troubleshooter - スキル:
network-config-validation - スキル:
homelab-network-setup
Frequently asked questions about Network Interface Health
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
