Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

BGP Routing Protocol

БесплатноБез исполняемых скриптовНе проверен

This skill should be used when the user asks to "configure BGP", "manipulate BGP path selection", "implement BGP confederations", "configure route…

zebbernот zebbern★ 34 звезды на GitHub21 установка в других каталогах

Об этом скилле

BGP Routing Protocol

Purpose

Master Border Gateway Protocol (BGP) configuration and path manipulation for enterprise and ISP networks. This skill covers BGP peering, attribute manipulation, confederations, route reflectors, communities, and advanced path control techniques essential for network engineers and penetration testers analyzing routing infrastructure.

Prerequisites

Required Environment

  • Cisco IOS routers or equivalent
  • Multi-AS topology for practice
  • Console/SSH access to devices

Required Knowledge

  • IP addressing and subnetting
  • Basic routing concepts
  • Cisco IOS CLI familiarity

Outputs and Deliverables

  1. BGP Peering - Established neighbor relationships
  2. Path Manipulation - Controlled route selection
  3. Scalable Design - Confederations and route reflectors
  4. Policy Implementation - Community-based filtering

Core Workflow

Phase 1: Basic BGP Configuration

Establish BGP peering relationships:

! Basic eBGP configuration
router bgp 65001
 bgp router-id 1.1.1.1
 neighbor 10.0.0.2 remote-as 65002
 network 192.168.1.0 mask 255.255.255.0

! eBGP with loopback (requires ebgp-multihop)
router bgp 65001
 neighbor 2.2.2.2 remote-as 65002
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 ebgp-multihop 3

! Static route for loopback reachability
ip route 2.2.2.2 255.255.255.255 Serial0/0

iBGP Configuration:

! iBGP peering (same AS)
router bgp 65001
 neighbor 3.3.3.3 remote-as 65001
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 3.3.3.3 next-hop-self

Phase 2: BGP Path Selection Process

Understand the BGP best path selection algorithm:

Priority Attribute Preference
1 Weight Highest
2 Local Preference Highest
3 Locally Originated Prefer local
4 AS-Path Length Shortest
5 Origin IGP < EGP < Incomplete
6 MED Lowest
7 eBGP over iBGP Prefer eBGP
8 IGP Metric Lowest
9 Router ID Lowest

Verification Commands:

show ip bgp
show ip bgp summary
show ip bgp neighbors
show ip bgp 192.168.1.0/24

Phase 3: Weight Attribute

Influence local path selection (Cisco-proprietary):

! Set weight for specific neighbor
router bgp 65001
 neighbor 10.0.0.2 weight 1000

! Set weight using route-map (preferred)
ip prefix-list NETWORK-A seq 5 permit 192.168.1.0/24

route-map SET-WEIGHT permit 10
 match ip address prefix-list NETWORK-A
 set weight 500
route-map SET-WEIGHT permit 20

router bgp 65001
 neighbor 10.0.0.2 route-map SET-WEIGHT in

Key Points:

  • Default weight is 0 (32768 for locally originated)
  • Higher weight preferred
  • Only locally significant
  • Not advertised to neighbors

Phase 4: Local Preference

Influence AS-wide path selection:

! Set local preference for incoming routes
ip prefix-list PREFER-PATH seq 5 permit 10.0.0.0/8

route-map SET-LOCPREF permit 10
 match ip address prefix-list PREFER-PATH
 set local-preference 200
route-map SET-LOCPREF permit 20

router bgp 65001
 neighbor 10.0.0.2 route-map SET-LOCPREF in

Key Points:

  • Default local preference is 100
  • Higher value preferred
  • Exchanged between iBGP peers
  • Used for outbound traffic engineering

Verification:

show ip bgp
! Look for LocPrf column

Phase 5: AS-Path Prepending

Influence inbound traffic by lengthening AS-path:

! Prepend own AS number to outgoing updates
route-map PREPEND permit 10
 set as-path prepend 65001 65001 65001

router bgp 65001
 neighbor 10.0.0.2 route-map PREPEND out

Key Points:

  • Only prepend your own AS number
  • Makes path less preferred to remote ASes
  • Used for inbound traffic engineering
  • Too much prepending can be ignored

Phase 6: MED (Multi-Exit Discriminator)

Influence inbound traffic between same AS connections:

! Set MED for outgoing routes
route-map SET-MED permit 10
 set metric 100

router bgp 65001
 neighbor 10.0.0.2 route-map SET-MED out

! Compare MED from different ASes (not default)
router bgp 65001
 bgp always-compare-med
 bgp bestpath as-path ignore

Key Points:

  • Default MED is 0
  • Lower MED preferred
  • Only compared for paths from same AS by default
  • Suggests preferred entry point to remote AS

Phase 7: Origin Attribute

Manipulate path preference via origin code:

! Set origin in route-map
route-map SET-ORIGIN permit 10
 set origin incomplete

route-map SET-ORIGIN-EGP permit 10
 set origin egp 1

router bgp 65001
 neighbor 10.0.0.2 route-map SET-ORIGIN out

Origin Codes:

  • i - IGP (from network command) - Most preferred
  • e - EGP (legacy) - Middle preference
  • ? - Incomplete (redistributed) - Least preferred

Phase 8: BGP Confederations

Scale iBGP with sub-AS design:

! Sub-AS 65501 configuration
router bgp 65501
 bgp confederation identifier 65000
 bgp confederation peers 65502
 neighbor 10.0.0.2 remote-as 65502
 neighbor 10.0.0
Полный SKILL.md на GitHub

Установить BGP Routing Protocol в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл BGP Routing Protocol?

This skill should be used when the user asks to "configure BGP", "manipulate BGP path selection", "implement BGP confederations", "configure route reflectors", "use BGP communities", or "troubleshoot BGP routing". It provides comprehensive BGP configuration and path manipulation techniques.

Как установить скилл BGP Routing Protocol?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл BGP Routing Protocol запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить BGP Routing Protocol с