Communitygithub.com

cisco-ios-patterns

Cisco IOS 和 IOS-XE 配置審查模式,涵蓋 show 指令、配置層級、萬用遮罩、ACL 放置、介面衛生與安全變更窗口驗證。

cisco-ios-patterns 是什麼?

此技能提供一套模式與最佳實踐,用於審查 Cisco IOS 和 IOS-XE 裝置的配置片段、建立變更窗口檢查清單,以及在不造成事故的情況下收集故障排除證據。它針對 read-only show 指令收集、ACL 萬用遮罩驗證、介面衛生(如明確的 switchport 模式和 native VLAN 設定)以及變更驗證前後比對,提供了具體建議。支援的平台包括 Cisco IOS 和 IOS-XE 路由器與交換器。此技能的核心工作流程強調在套用任何變更前,先透過 read-only 指令擷取當前狀態,然後在維護窗口內套用最小變更,並在儲存前驗證行為。它還明確指出常見的反模式,例如在未進行裝置特定差異比較的情況下套用產生的配置、在變更後檢查通過前儲存配置,以及將子網路遮罩誤用為萬用遮罩。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/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 和許多路由陳述使用萬用遮罩,而非子網路遮罩。

子網路遮罩       萬用遮罩
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 在結尾都有一個隱含的拒絕。當操作目標包含觀察未命中的流量時,請新增一個明確的記錄拒絕,並確認記錄量是安全的。

ACL 放置審查

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

  • 過濾的流量方向是 in 還是 out?
  • 管理流量是否來自已知的跳板主機或管理子網路?
  • 是否已明確允許必要的路由、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 模式與已記錄的 native VLAN。在路由介面上,在假設鏈路狀態意味著轉送正常之前,請先確認遮罩、對等 IP 位址與路由處理程序。

變更窗口驗證

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

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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

相關技能