Communitygithub.com

diagnóstico-bgp-red

Patrones de diagnóstico de BGP solo lectura para estado de vecino, intercambio de rutas, política de prefijos, inspección de AS path y recopilación segura de evidencia. Úselo cuando un vecino BGP esté caído, falten rutas, o se necesite inspeccionar política de prefijos y AS path.

¿Qué es diagnóstico-bgp-red?

Esta habilidad proporciona un flujo de trabajo de triaje de solo lectura para diagnosticar problemas de sesiones BGP en redes. Está diseñada para ser utilizada cuando una sesión BGP está caída, fluctuando (flapping), establecida pero con rutas faltantes, o anunciando prefijos inesperados. La habilidad guía al usuario a través de pasos de identificación de vecino, captura de estado, verificación de alcanzabilidad, inspección de políticas de rutas y revisión de AS path, todo antes de considerar cualquier acción de cambio. Soporta la interpretación de estados de sesión (Idle, Active, Established, etc.) y proporciona comandos de diagnóstico específicos para plataformas, así como un patrón de analizador (parser) en Python para extraer datos de resúmenes BGP. Es útil para ingenieros de red y desarrolladores de automatización que necesitan recopilar evidencia de manera segura y sistemática sin alterar la configuración de red durante un incidente.

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

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Diagnóstico de BGP de Red

Use esta habilidad cuando una sesión BGP esté caída, fluctuando, establecida con rutas faltantes, o anunciando prefijos inesperados. El flujo de trabajo predeterminado es la recopilación de evidencia de solo lectura; las acciones de política y restablecimiento pertenecen a una ventana de cambios revisada.

Cuándo Usar

  • Los vecinos BGP están atascados en Idle, Connect, Active, OpenSent u OpenConfirm.
  • Una sesión está Establecida pero faltan los prefijos esperados.
  • Una route-map, prefix-list, límite de max-prefix, o política de AS path puede estar filtrando rutas.
  • Necesita evidencia antes/después para un cambio de BGP.
  • Está revisando automatización que analiza la salida del resumen BGP.

Flujo de Triaje de Solo Lectura

  1. Identifique el vecino exacto, familia de direcciones, VRF y ASN local/remoto.
  2. Capture el estado del resumen y la última razón de reinicio.
  3. Verifique la alcanzabilidad a la dirección de origen del par.
  4. Revise las referencias de política de ruta antes de asumir una falla de transporte.
  5. Compare las rutas anunciadas, recibidas e instaladas donde la plataforma lo permita.
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

Use comandos específicos de familia de direcciones de la plataforma cuando el dispositivo use VRFs, IPv6, VPNv4 o EVPN. No asuma unicast IPv4 global.

Interpretación de Estados

EstadoPrimeras comprobaciones
Establecido con conteo de prefijosEl intercambio de rutas está activo; inspeccione política y selección de tabla
Establecido con cero prefijosRevise política de entrada, max-prefix, rutas anunciadas y AFI/SAFI
ActivoLa sesión TCP no se completa; verifique enrutamiento, origen, ACLs y alcanzabilidad del par
ConectarLa conexión TCP está en progreso; revise ruta y receptor remoto
OpenSent/OpenConfirmTCP funciona; verifique ASN, autenticación, temporizadores, capacidades y registros
IdleEl vecino puede estar deshabilitado, falta configuración, bloqueado por política, o temporizador de retroceso

Comprobaciones de Transporte

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

Si el par tiene como origen un loopback, confirme que ambas direcciones enrutan a las direcciones de loopback y que la configuración del vecino use la fuente de actualización esperada.

Evite deshabilitar ACLs o políticas de firewall como atajo de diagnóstico. Lea primero los contadores de aciertos, registros y estado de la ruta.

Comprobaciones de Política de Ruta

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

Algunas plataformas requieren configuración adicional antes de que received-routes esté disponible. No agregue esa configuración durante el triaje de incidentes a menos que el operador apruebe el cambio.

Revisión de AS Path y Prefijo

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

Use regex de AS-path con cuidado. _65001_ coincide con AS 65001 como token. 65001 simple puede coincidir con ASNs más largos o texto no relacionado.

Patrón de Analizador (Parser)

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

Prefiera la salida estructurada del analizador cuando esté disponible, pero almacene la salida sin procesar con el registro del incidente porque los formatos de resumen BGP varían según la plataforma y la familia de direcciones.

Solo Ventana de Cambio

Estas acciones pueden afectar el enrutamiento y no deben sugerirse como diagnósticos automáticos:

  • Limpiar una sesión BGP.
  • Cambiar autenticación de vecino, temporizadores, fuente de actualización, route-maps o prefix-lists.
  • Habilitar almacenamiento adicional de rutas recibidas.
  • Relajar políticas de firewall, ACL o plano de control.

Si se aprueba un reinicio, prefiera la opción de reinicio suave (soft) o actualización de ruta (route-refresh) menos disruptiva compatible con la plataforma y documente exactamente por qué es segura.

Anti-Patrones

  • Asumir que Active siempre significa que el lado remoto está caído.
  • Ignorar diferencias de VRF, familia de direcciones o fuente de actualización.
  • Usar regex de AS-path amplio sin límites de token.
  • Reiniciar un par antes de leer la última razón de reinicio y registros.
  • Tratar la falta de salida received-routes como prueba de que no llegaron rutas.

Véase También

  • Habilidad: cisco-ios-patterns
  • Habilidad: network-config-validation
  • Habilidad: 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.

Skills relacionados