Diagnoses router, switch, and Linux host interface errors including CRC, drops, duplex mismatches, jitter, speed negotiation issues, and counter trends. Provides CLI commands and a Python parser.
How this skill is triggered — by the user, by Claude, or both
Slash command
/everything-claude-code:network-interface-healthThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
当网络症状可能由物理链路、交换机端口、电缆、收发器、双工设置或拥塞接口引起时使用此技能。
当网络症状可能由物理链路、交换机端口、电缆、收发器、双工设置或拥塞接口引起时使用此技能。
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 | 低于最小以太网大小的帧 | 双工不匹配、冲突域、故障网卡 |
| giants | 大于预期 MTU 的帧 | MTU 不匹配或巨型帧边界 |
| input drops | 设备无法接受入站数据包 | 突发、超额订阅、CPU 路径、队列压力 |
| output drops | 出站队列丢弃数据包 | 拥塞、QoS 策略、上行链路不足 |
| resets | 接口硬件重置 | 抖动、keepalive、驱动程序、光模块、电源 |
| collisions | 以太网冲突计数器 | 半双工或协商不匹配 |
在双方都支持的现代以太网链路上优先使用自动协商。如果一方必须固定,请在双方明确配置并记录原因。永远不要在一方混合固定速度/双工与另一方的自动。
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
network-troubleshooternetwork-config-validationhomelab-network-setupnpx claudepluginhub aaione/everything-claude-code-zhDiagnoses physical link issues—interface errors, drops, CRCs, duplex mismatches, flapping, and speed negotiation problems on routers, switches, and Linux hosts.
Analyzes sosreport archives for Linux network configs: extracts interfaces, routing tables, connections, firewall rules (firewalld/iptables), DNS settings to diagnose connectivity issues.
Analyzes network traffic using Wireshark: captures live on interfaces or from PCAP files, applies capture/display filters for IPs/ports/protocols, troubleshoots security/performance issues.