Communitygithub.com

cisco-ios-patterns

Cisco IOS 與 IOS-XE 檢閱模式,涵蓋 show 指令、設定階層、萬用遮罩、ACL 放置、介面整潔與安全變更窗口驗證。適用於讀取、撰寫或審查 Cisco IOS / IOS-XE 設定,或規劃變更窗口。

cisco-ios-patterns 是什麼?

此技能專為網路工程師與 AI 代理設計,提供一套結構化模式,用來審查、驗證 Cisco IOS 與 IOS-XE 裝置的設定,並安全地進行變更。其主要價值在於減少人為錯誤,尤其是在處理 ACL 萬用遮罩、介面方向、設定模式等複雜環節時,提供明確的檢查清單與最佳實務。此技能支援 CLI 式的操作平台,並強調以唯讀指令收集資訊、進行變更前後比對,以及避免常見的反模式(例如未經差異比對就套用設定)。透過涵蓋從啟用模式、設定模式到儲存設定的完整工作流程,以及提供豐富的唯讀收集指令範例和萬用遮罩對照表,此技能有助於確保任何網路變更都能在最小風險下完成,並保留完整的稽核軌跡。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/cisco-ios-patterns

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Cisco IOS 模式

在審查 Cisco IOS 或 IOS-XE 片段、建立變更窗口檢查清單,或解釋如何從路由器或交換器收集證據而不使狀況惡化時,使用此技能。

使用時機

  • 在計畫中的變更前,審查 IOS 或 IOS-XE 設定。
  • 選擇用於故障排除的唯讀 show 指令。
  • 檢查 ACL 萬用遮罩和介面方向。
  • 說明全域、介面、路由程序與線路設定模式。
  • 驗證變更已寫入執行中的設定,並已蓄意儲存。

操作規則

將 IOS 範例視為模式,而非可直接貼上到產品的變更。在對真實裝置進行變更前,請確認平台、介面名稱、目前設定、回滾路徑及頻外存取。

偏好採用此工作流程:

  1. 使用唯讀指令擷取目前狀態。
  2. 審查確切的候選設定。
  3. 確認管理存取不會被封鎖。
  4. 在維護窗口套用最小變更。
  5. 重新讀取狀態,與基準比較,然後僅在驗證後才儲存。

模式參考

Router> enable
Router# show running-config
Router# configure terminal
Router(config)# interface GigabitEthernet0/1
Router(config-if)# description UPLINK-TO-CORE
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# end
Router# show running-config interface GigabitEthernet0/1

running-config 是作用中記憶體。startup-config 是重新啟動後保留的設定。不要只因指令被接受就儲存變更;先驗證行為,若變更獲核准,再使用 copy running-config startup-config。

唯讀收集

show version
show inventory
show processes cpu sorted
show memory statistics
show logging
show running-config | section line vty
show running-config | section interface
show running-config | section router bgp
show ip interface brief
show interfaces
show interfaces status
show vlan brief
show mac address-table
show spanning-tree
show ip route
show ip protocols
show ip access-lists
show route-map
show ip prefix-list

當設定可能包含機密、客戶名稱或私有拓撲時,請僅收集所需的部分,而非將完整設定傾印至工單中。

萬用遮罩

IOS ACL 與許多路由陳述使用萬用遮罩,而非子網路遮罩。

Subnet mask       Wildcard mask
255.255.255.255   0.0.0.0
255.255.255.252   0.0.0.3
255.255.255.0     0.0.0.255
255.255.0.0       0.0.255.255

在部署前審查萬用遮罩。不小心將子網路遮罩用作萬用遮罩,可能會比預期匹配到更多的流量。

ip access-list extended WEB-IN
  10 permit tcp 192.0.2.0 0.0.0.255 any eq 443
  999 deny ip any any log

每個 ACL 在結尾都有一個隱含的 deny。當操作目標包含觀察未命中時,請加入明確的 logged deny,並確認記錄量是安全的。

ACL 放置審查

在將 ACL 套用至介面前,回答以下問題:

  • 正在過濾的流量方向是 in 還是 out?
  • 管理流量是否源自已知的跳板主機或管理子網?
  • 是否有明確的 permit 規則用於必要的路由、DNS、NTP、監控或應用流量?
  • 是否能從安全的測試來源取得命中計數器?
  • 是否有回滾指令以及可用的主控台或頻外路徑?

不要透過移除防火牆或 ACL 保護來測試可達性。請先讀取計數器、日誌和路由狀態。

介面整潔

interface GigabitEthernet0/1
 description UPLINK-TO-CORE
 switchport mode trunk
 switchport trunk allowed vlan 10,20,30
 switchport trunk native vlan 999
 no shutdown

使用清晰的描述、明確的 switchport 模式以及有記錄的原生 VLAN。在路由介面上,請在假設連結狀態意味著轉送正常前,先確認遮罩、對端定址和路由程序。

變更窗口驗證

使用與實際變更相符的變更前/後檢查。

show running-config | section interface GigabitEthernet0/1
show interfaces GigabitEthernet0/1
show logging | include GigabitEthernet0/1|changed state|line protocol
show ip route <prefix>
show ip access-lists <name>

對於路由變更,也要在變更前後擷取鄰居狀態與路由表。對於 ACL 變更,應比較從計畫測試來源取得的命中計數器,而非依賴一般的 ping。

反模式

  • 在未經裝置特定差異比對的情況下套用產生的設定。
  • 在變更後檢查通過前儲存設定。
  • 在 IOS 預期萬用遮罩的地方使用子網路遮罩。
  • 將 ACL 套用至錯誤的介面方向。
  • 透過停用 ACL、路由策略或驗證來進行故障排除。
  • 在未清理機密和拓撲的情況下,將完整設定貼入公開工具。

另請參閱

  • 代理:network-config-reviewer
  • 代理:network-troubleshooter
  • 技能: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/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.

相關技能