Communitygithub.com

network-bgp-diagnostics

BGPトラブルシューティングのための診断専用パターン。ネイバー状態、経路交換、プレフィックスポリシー、ASパス検査、安全な証拠収集を提供します。BGPネイバーがダウンしている、経路が欠落している、プレフィックスポリシーやASパスの検査が必要な場合に使用します。

network-bgp-diagnostics とは?

このスキルは、BGPセッションの診断に特化した読み取り専用のワークフローを提供します。主な用途は、BGPネイバーがIdleやActiveなどの状態でスタックしている、Established状態だが期待する経路が受信できない、またはルートマップやプレフィックスリストによるフィルタリングを調査する場合です。このスキルは、Cisco IOSや一般的なネットワークOSを対象としており、show bgp summaryやshow bgp neighborsといったコマンドを使用して、状態解釈、トランスポート到達性確認、ルートポリシーチェック、ASパスレビューを体系的に実施します。さらに、BGPサマリ出力をパースするPythonコード例も含まれており、自動化の文脈でも活用できます。このスキルはあくまで診断に留まり、セッションリセットやポリシー変更などの影響のある操作は変更承認フローに委ねます。

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

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

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

ドキュメント

ネットワーク BGP 診断

このスキルは、BGPセッションがダウンしている、フラッピングしている、Established だが経路が欠落している、または予期しないプレフィックスを広告している場合に使用します。デフォルトのワークフローは読み取り専用の証拠収集です。ポリシーやリセットアクションは、レビューされた変更承認フローに委ねます。

使用するタイミング

  • BGPネイバーがIdle、Connect、Active、OpenSent、またはOpenConfirmでスタックしている場合。
  • セッションがEstablishedだが、期待するプレフィックスが欠落している場合。
  • route-map、prefix-list、max-prefix制限、またはASパスポリシーが経路をフィルタリングしている可能性がある場合。
  • BGP変更の前後証拠が必要な場合。
  • BGPサマリ出力を解析する自動化をレビューしている場合。

読み取り専用トリアージフロー

  1. 正確なネイバー、アドレスファミリ、VRF、ローカル/リモートASNを特定する。
  2. サマリ状態と最終リセット理由を取得する。
  3. ピア送信元アドレスへの到達可能性を確認する。
  4. トランスポート障害を想定する前に、ルートポリシー参照を確認する。
  5. プラットフォームがサポートするコマンドを使用して、広告済み経路、受信経路、およびインストール済み経路を比較する。
show bgp summary
show bgp neighbors <peer>
show ip route <peer>
show tcp brief | include <peer>|:179
show logging | include BGP|<peer>
show running-config | section router bgp
show ip prefix-list
show route-map

デバイスがVRF、IPv6、VPNv4、またはEVPNを使用している場合、プラットフォーム固有のアドレスファミリコマンドを使用してください。グローバルIPv4ユニキャストを想定しないでください。

状態解釈

状態最初の確認事項
Established かつプレフィックス数あり経路交換は正常に行われている。ポリシーとテーブル選択を検査する
Established かつプレフィックス数ゼロインバウンドポリシー、max-prefix、広告済み経路、AFI/SAFIを確認する
ActiveTCPセッションが完了していない。ルーティング、送信元、ACL、ピア到達可能性を確認する
ConnectTCP接続が進行中。パスとリモートリスナーを確認する
OpenSent/OpenConfirmTCPは動作している。ASN、認証、タイマー、ケイパビリティ、ログを確認する
Idleネイバーが無効化されている、設定が欠落している、ポリシーでブロックされている、またはバックオフタイマーが原因の可能性

トランスポートチェック

ping <peer> source <local-source>
traceroute <peer> source <local-source>
show ip route <peer>
show bgp neighbors <peer> | include BGP state|Last reset|Local host|Foreign host

ピアがループバックを送信元としている場合、双方向でループバックアドレスへの経路があること、およびネイバー設定が期待される更新送信元を使用していることを確認してください。

診断の近道としてACLやファイアウォールポリシーを無効にすることは避けてください。最初にヒットカウンター、ログ、パス状態を確認してください。

ルートポリシーチェック

show bgp neighbors <peer> advertised-routes
show bgp neighbors <peer> routes
show ip prefix-list <name>
show route-map <name>
show bgp <prefix>

一部のプラットフォームでは、received-routesを使用可能にするために追加の設定が必要です。インシデントトリアージ中にその設定を追加しないでください。オペレーターが変更を承認した場合を除きます。

ASパスおよびプレフィックスレビュー

show bgp regexp _65001_
show bgp regexp ^65001$
show bgp <prefix>
show bgp neighbors <peer> advertised-routes | include Network|Path|<prefix>

ASパス正規表現は慎重に使用してください。_65001_ はAS 65001をトークンとしてマッチします。単純な 65001 はより長いASNや無関係なテキストにマッチする可能性があります。

パーサーパターン

import re
from typing import Any

BGP_SUMMARY_RE = re.compile(
    r"^(?P<neighbor>\d{1,3}(?:\.\d{1,3}){3})\s+"
    r"(?P<version>\d+)\s+"
    r"(?P<remote_as>\d+)\s+"
    r"(?P<msg_rcvd>\d+)\s+"
    r"(?P<msg_sent>\d+)\s+"
    r"(?P<table_version>\d+)\s+"
    r"(?P<input_queue>\d+)\s+"
    r"(?P<output_queue>\d+)\s+"
    r"(?P<uptime>\S+)\s+"
    r"(?P<state_or_prefixes>\S+)$",
    re.M,
)

def parse_bgp_summary(raw: str) -> list[dict[str, Any]]:
    rows = []
    for match in BGP_SUMMARY_RE.finditer(raw):
        state_or_prefixes = match.group("state_or_prefixes")
        if state_or_prefixes.isdigit():
            state = "Established"
            prefixes_received = int(state_or_prefixes)
        else:
            state = state_or_prefixes
            prefixes_received = None
        rows.append({
            "neighbor": match.group("neighbor"),
            "remote_as": int(match.group("remote_as")),
            "state": state,
            "prefixes_received": prefixes_received,
            "uptime": match.group("uptime"),
        })
    return rows

可能な場合は構造化されたパーサー出力を使用することを推奨しますが、生の出力もインシデントレコードと共に保存してください。BGPサマリの形式はプラットフォームやアドレスファミリによって異なります。

変更承認フローのみ

これらのアクションはルーティングに影響を与える可能性があるため、自動診断として提案すべきではありません。

  • BGPセッションのクリア。
  • ネイバー認証、タイマー、更新送信元、route-map、prefix-listの変更。
  • 追加の受信経路ストレージの有効化。
  • ファイアウォール、ACL、またはコントロールプレーンポリシーの緩和。

リセットが承認された場合は、プラットフォームがサポートする最も影響の少ないソフトリセットまたはルートリフレッシュオプションを優先し、なぜそれが安全であるかを正確に文書化してください。

アンチパターン

  • Active が常にリモート側がダウンしていることを意味すると想定する。
  • VRF、アドレスファミリ、または更新送信元の違いを無視する。
  • トークン境界なしで広範なASパス正規表現を使用する。
  • 最終リセット理由とログを読む前にピアをハードリセットする。
  • received-routes 出力がないことを、経路が到達していない証拠として扱う。

関連情報

  • スキル: cisco-ios-patterns
  • スキル: network-config-validation
  • スキル: network-interface-health

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.

関連スキル