
Network Bgp Diagnostics
Run read-only BGP triage when production peering is down, flapping, or missing prefixes before any change window.
Overview
Network BGP Diagnostics is an agent skill for the Operate phase that guides read-only BGP triage for neighbor state, route exchange, prefix policy, and AS path evidence before any policy or reset change.
Install
npx skills add https://github.com/affaan-m/everything-claude-code --skill network-bgp-diagnosticsWhat is this skill?
- 6-step read-only triage: neighbor/AFI, summary state, reachability, policy refs, advertised vs installed routes
- Covers Idle through Established-with-missing-prefixes and automation that parses BGP summary output
- Command cheat sheet: show bgp summary/neighbors, TCP :179, prefix-list, route-map, router bgp section
- Default workflow is evidence collection; policy changes and resets deferred to reviewed change windows
- AS path, max-prefix, and route-map filtering checks before assuming transport failure
- 6-step read-only triage flow
Adoption & trust: 1.2k installs on skills.sh; 210k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
A BGP neighbor is stuck, flapping, or Established without expected prefixes and you cannot tell whether transport, policy, or max-prefix limits are at fault.
Who is it for?
SREs or indie operators debugging peering on routers when incidents demand proof before config changes.
Skip if: Greenfield network design without BGP, or teams that need automated remediation instead of read-only diagnosis.
When should I use this skill?
BGP session is down, flapping, Established with missing routes, unexpected prefixes, or when reviewing BGP summary automation.
What do I get? / Deliverables
You get a structured evidence bundle—summary state, peer reachability, policy references, and route comparisons—ready for a reviewed change or escalation without risky resets during triage.
- Ordered triage checklist with captured show output references
- Before-change evidence set for policy or reset decisions
Recommended Skills
Journey fit
BGP sessions and prefix policy live in production network operations—first shelf when routing or peering breaks in prod. Infra subphase covers network routing, VRFs, and carrier/peering evidence—not app-level error triage alone.
How it compares
Use for procedural BGP evidence collection instead of ad-hoc copy-paste of show commands without an ordered triage flow.
Common Questions / FAQ
Who is network-bgp-diagnostics for?
Solo builders and small teams running production BGP on routers who need a consistent read-only triage script during outages or prefix surprises.
When should I use network-bgp-diagnostics?
In Operate when neighbors are non-Established, sessions flap, routes are missing despite Established state, or you are validating BGP parsing automation—always before policy or reset changes.
Is network-bgp-diagnostics safe to install?
Review the Security Audits panel on this Prism page before installing; the skill itself defaults to read-only CLI patterns but agents may still execute commands in your environment.
SKILL.md
READMESKILL.md - Network Bgp Diagnostics
# Network BGP Diagnostics Use this skill when a BGP session is down, flapping, established with missing routes, or advertising unexpected prefixes. The default workflow is read-only evidence collection; policy and reset actions belong in a reviewed change window. ## When to Use - BGP neighbors are stuck in Idle, Connect, Active, OpenSent, or OpenConfirm. - A session is Established but expected prefixes are missing. - A route-map, prefix-list, max-prefix limit, or AS path policy may be filtering routes. - You need before/after evidence for a BGP change. - You are reviewing automation that parses BGP summary output. ## Read-Only Triage Flow 1. Identify the exact neighbor, address family, VRF, and local/remote ASNs. 2. Capture summary state and last reset reason. 3. Prove reachability to the peer source address. 4. Check route policy references before assuming transport failure. 5. Compare advertised, received, and installed routes where the platform supports those commands. ```text 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 platform-specific address-family commands when the device uses VRFs, IPv6, VPNv4, or EVPN. Do not assume global IPv4 unicast. ## State Interpretation | State | First checks | | --- | --- | | Established with prefix count | Route exchange is up; inspect policy and table selection | | Established with zero prefixes | Check inbound policy, max-prefix, advertised routes, and AFI/SAFI | | Active | TCP session is not completing; check routing, source, ACLs, and peer reachability | | Connect | TCP connection is in progress; check path and remote listener | | OpenSent/OpenConfirm | TCP works; check ASN, authentication, timers, capabilities, and logs | | Idle | Neighbor may be disabled, missing config, blocked by policy, or backoff timer | ## Transport Checks ```text 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 ``` If the peer is sourced from a loopback, confirm both directions route to the loopback addresses and that the neighbor config uses the expected update source. Avoid disabling ACLs or firewall policy as a diagnostic shortcut. Read hit counters, logs, and path state first. ## Route Policy Checks ```text show bgp neighbors <peer> advertised-routes show bgp neighbors <peer> routes show ip prefix-list <name> show route-map <name> show bgp <prefix> ``` Some platforms require additional configuration before `received-routes` is available. Do not add that configuration during incident triage unless the operator approves the change. ## AS Path And Prefix Review ```text show bgp regexp _65001_ show bgp regexp ^65001$ show bgp <prefix> show bgp neighbors <peer> advertised-routes | include Network|Path|<prefix> ``` Use AS-path regex carefully. `_65001_` matches AS 65001 as a token. Plain `65001` can match longer ASNs or unrelated text. ## Parser Pattern ```python 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(): sta