Communitygithub.com

네트워크 BGP 진단

BGP 세션 상태, 경로 교환, 프리픽스 정책, AS 경로 검사 및 안전한 증거 수집을 위한 읽기 전용 BGP 문제 해결 패턴입니다. BGP 이웃이 다운되었거나, 경로가 누락되었거나, 프리픽스 정책 및 AS 경로 검사가 필요할 때 사용하세요.

네트워크 BGP 진단란 무엇인가요?

이 스킬은 BGP 진단 시 읽기 전용(Read-Only) 문제 해결에 특화된 패턴을 제공합니다. BGP 세션이 다운되었거나, 플래핑 중이거나, Established 상태이지만 예상 경로가 누락된 경우, 또는 예상치 못한 프리픽스를 광고하는 경우에 사용합니다. 주요 기능으로는 이웃 상태 해석, 전송(Transport) 연결 확인, 경로 정책(Route Policy) 및 AS 경로 검사, 그리고 표준 진단 명령어 세트를 제공합니다. Cisco IOS, NX-OS, JunOS, Arista EOS 등 다양한 네트워크 플랫폼에서 작동하며, VRF, IPv6, VPNv4, EVPN과 같은 주소 계열(Address Family)을 지원합니다. 이 스킬은 SNMP/Walker, NAPALM, Netmiko, Ansible과 같은 보강 데이터 소스와 함께 사용할 수 있으며, 모든 진단 단계는 실제 설정 변경 없이 안전하게 증거를 수집하는 데 초점을 맞춥니다. 또한, 정규식을 사용한 BGP 요약 파서 패턴을 포함하여 자동화 도구와의 통합을 지원하며, 세션 리셋이나 설정 변경은 별도의 변경 창(Change Window)에서만 수행하도록 명확히 경고합니다.

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

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

네트워크 BGP 진단(Network BGP Diagnostics)

이 스킬은 BGP 세션이 다운되었거나, 플래핑 중이거나, Established 상태이지만 경로가 누락되었거나, 예상치 못한 프리픽스를 광고하는 경우에 사용합니다. 기본 워크플로우는 읽기 전용 증거 수집이며, 정책 변경 및 리셋 작업은 승인된 변경 창(Change Window)에서 수행해야 합니다.

사용 시기

  • 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 (프리픽스 0개)인바운드 정책, 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-path 정규식을 주의해서 사용하십시오. _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-path 정규식 사용
  • 마지막 리셋 이유와 로그를 읽기 전에 피어 하드 리셋
  • 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.

관련 스킬