Communitygithub.com

네트워크 BGP 진단

BGP 세션 장애, 경로 누락, 프리픽스 정책 및 AS 경로 검사를 위한 읽기 전용 진단 패턴입니다. BGP 이웃이 다운되었거나, 경로가 누락되었거나, 프리픽스 정책 및 AS 경로 검사가 필요할 때 사용하세요.

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

이 스킬은 BGP 세션이 다운되었거나, 플래핑 중이거나, Established 상태이지만 예상 경로가 누락되었거나, 예상치 못한 프리픽스를 광고하는 경우를 진단하기 위한 **읽기 전용** 문제 해결 워크플로우를 제공합니다. 주요 초점은 증거 수집에 있으며, 정책 변경이나 리셋과 같은 변경 작업은 명시적으로 검토된 변경 창으로 제한됩니다. Cisco IOS, Juniper, Arista 등 다양한 플랫폼에서 사용할 수 있는 `show bgp summary`, `show bgp neighbors`, `ping`, `traceroute`와 같은 CLI 명령어와 상태 해석 표(Idle, Active, Established 등), AS 경로 정규식 검사 패턴을 포함합니다. 또한 `show bgp neighbors <peer> advertised-routes`와 같은 경로 정책 확인 명령어와 `show bgp regexp`를 사용한 AS 경로 검사 방법, 그리고 BGP 요약 출력을 파싱하는 Python 코드 예제를 제공합니다. 이 스킬은 BGP 문제를 신속하게 진단하고 수정 작업 전에 충분한 증거를 확보하는 데 도움을 줍니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/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 (프리픽스 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/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.

관련 스킬