Network Bgp Diagnostics logo

Network Bgp Diagnostics

Community
arsallls
network-bgp-diagnostics

BGP neighbor state analysis, stuck session troubleshooting, AS path inspection, route filtering, and peering issue diagnosis on Cisco IOS/IOS-XE and multi-vendor devices.

Overview

Publisherarsallls
Repositoryclaude-network-skills
Skill namenetwork-bgp-diagnostics
Stars
77
Forks
14
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by arsallls on GitHub. Read the source before you install it.

Installation

Install the Network Bgp Diagnostics AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/arsallls/claude-network-skills/tree/main/skills/network-bgp-diagnostics
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/arsallls/claude-network-skills.git /tmp/claude-network-skills
mkdir -p .claude/skills
cp -r /tmp/claude-network-skills/skills/network-bgp-diagnostics .claude/skills/network-bgp-diagnostics
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Network Bgp Diagnostics in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Network Bgp Diagnostics on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Network Bgp Diagnostics is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Network BGP Diagnostics

Patterns and commands for diagnosing BGP peering problems, stuck neighbor states, route advertisement issues, and AS path anomalies.

When to Activate

  • Troubleshooting BGP neighbor sessions not reaching Established state
  • Diagnosing why a BGP peer shows Active, Idle, or Connect state
  • Investigating missing or unexpected routes in the BGP table
  • Analyzing AS path attributes, route-maps, or prefix filters
  • Debugging BGP flapping neighbors or high message counts
  • Validating BGP configuration before or after a change window

Reading BGP Summary Output

Cisco IOS-XE: show bgp summary

BGP router identifier 10.0.0.1, local AS number 65001
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.0.0.2        4 65002    1234    5678        42    0    0 01:23:45        10
10.0.0.3        4 65003       0       5         0    0    0 00:02:11  Active
10.0.0.4        4 65004      12      10         0    0    0 never      Idle

State/PfxRcd column interpretation:

ValueMeaning
Integer (e.g. 10)Established — number of prefixes received
ActiveTrying to open TCP connection to peer
IdleNot trying — check for misconfiguration or shutdown
ConnectTCP SYN sent, waiting for peer response
OpenSentTCP connected, BGP OPEN sent, waiting reply
OpenConfirmOPEN received, waiting KEEPALIVE

Key fields to check when a session isn't Established

# Check whether the neighbor is configured and enabled
show bgp neighbors 10.0.0.3

# Look for these in the output:
#   BGP state = Active  (TCP failing)
#   BGP state = Idle, reason: No route to host
#   Hold time: 0  (peer sent OPEN with hold time 0 — may be intentional)
#   Last reset: never / <timestamp> + reason

Diagnosing Stuck States

Active state — TCP not establishing

# 1. Verify IP reachability to the peer
ping 10.0.0.3 source Loopback0

# 2. Check the routing table for a path to the peer
show ip route 10.0.0.3

# 3. Verify the update-source matches what the peer expects
show bgp neighbors 10.0.0.3 | include source|local

# 4. Check ACLs or firewalls blocking TCP 179
show ip access-lists | include 179

# Common fix: misconfigured update-source
router bgp 65001
  neighbor 10.0.0.3 update-source Loopback0

Idle state — session administratively down or misconfigured

# Check if neighbor is manually shut down
show bgp neighbors 10.0.0.4 | include shutdown|Idle

# Check for AS number mismatch
show bgp neighbors 10.0.0.4 | include remote AS|configured

# Re-enable a shut neighbor
router bgp 65001
  no neighbor 10.0.0.4 shutdown

Established but no routes exchanged

# Check inbound route policy
show bgp neighbors 10.0.0.2 | include policy|filter|prefix

# Check what's being advertised
show bgp neighbors 10.0.0.2 advertised-routes

# Check what's being received (before policy)
show bgp neighbors 10.0.0.2 received-routes

# Check what's in the table after policy
show bgp neighbors 10.0.0.2 routes

Route Filtering Troubleshooting

# Check if a prefix-list is blocking routes
show ip prefix-list INBOUND-FILTER

# Trace why a specific prefix is missing
show bgp 192.168.100.0/24

# Check route-map applied to neighbor
show route-map PEER-IN

# Force re-advertisement after policy change (no hard reset)
clear ip bgp 10.0.0.2 soft in
clear ip bgp 10.0.0.2 soft out

AS Path Analysis

# Find routes with specific AS in path
show bgp regexp _65003_

# Find routes originating from a specific AS
show bgp regexp ^65003$

# Find all iBGP routes
show bgp regexp ^$

# Count hops to a destination
show bgp 203.0.113.0/24 | include Path

# Check for AS path prepending
show bgp neighbors 10.0.0.2 advertised-routes | include Path

Python: Parsing BGP Summary Output

python
import re

# Match a standard IOS/IOS-XE BGP summary neighbor line
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<tbl_ver>\d+)\s+"
    r"(?P<in_q>\d+)\s+"
    r"(?P<out_q>\d+)\s+"
    r"(?P<uptime>\S+)\s+"
    r"(?P<state_pfx>\S+)",
    re.MULTILINE,
)

def parse_bgp_summary(raw: str) -> list[dict]:
    neighbors = []
    for m in SUMMARY_RE.finditer(raw):
        state_pfx = m.group("state_pfx")
        try:
            prefixes = int(state_pfx)
            state = "Established"
        except ValueError:
            prefixes = 0
            state = state_pfx
        neighbors.append({
            "neighbor": m.group("neighbor"),
            "remote_as": int(m.group("remote_as")),
            "state": state,
            "prefixes_received": prefixes,
            "uptime": m.group("uptime"),
        })
    return neighbors

# Find non-established sessions
def find_problem_sessions(raw: str) -> list[dict]:
    return [n for n in parse_bgp_summary(raw) if n["state"] != "Established"]

Anti-Patterns

# BAD: Hard reset — tears down and rebuilds the TCP session, causes route flap
clear ip bgp 10.0.0.2

# GOOD: Soft reset — re-applies policy without dropping the session
clear ip bgp 10.0.0.2 soft in
clear ip bgp 10.0.0.2 soft out

# BAD: Relying on numeric AS path regexp without anchors — matches unintended ASes
show bgp regexp 65003   # matches 65003, 165003, 650039, etc.

# GOOD: Use anchors for exact AS matching
show bgp regexp _65003_   # word-boundary match
show bgp regexp ^65003$   # exact origin AS

# BAD: Forgetting that 'received-routes' requires 'soft-reconfiguration inbound'
# If you haven't configured it, the command will fail
neighbor 10.0.0.2 soft-reconfiguration inbound   # add this to see received routes

# BAD: Mismatched MD5 authentication — session shows Active with no TCP errors
# Check both sides have the same password configured
show bgp neighbors 10.0.0.2 | include password|MD5

Best Practices

  • Always use soft resets (clear ip bgp <ip> soft) to avoid dropping the session
  • Set neighbor <ip> description on every peer — makes show bgp summary readable at a glance
  • Use Loopback interfaces as BGP update-source for iBGP — more resilient to physical link failures
  • Configure neighbor <ip> fall-over for fast failure detection on directly connected eBGP peers
  • Set explicit hold timers — the default 90/30s can be too slow for production networks
  • Use neighbor <ip> soft-reconfiguration inbound if you need to inspect received routes before policy

Related Skills

  • cisco-ios-patterns
  • network-config-validation
  • network-interface-health

Frequently asked questions

What does the Network Bgp Diagnostics AI skill do?

BGP neighbor state analysis, stuck session troubleshooting, AS path inspection, route filtering, and peering issue diagnosis on Cisco IOS/IOS-XE and multi-vendor devices.

Why use Network Bgp Diagnostics on TypingMind?

Because you install it once and use it with any model. Network Bgp Diagnostics is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Network Bgp Diagnostics in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/arsallls/claude-network-skills/tree/main/skills/network-bgp-diagnostics. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Network Bgp Diagnostics?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Network Bgp Diagnostics?

As many as you like. As long as a model supports skills, you can use Network Bgp Diagnostics with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Network Bgp Diagnostics AI skill free?

Yes. It is published on GitHub by arsallls under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇