Communitygithub.com

cisco-ios-patterns

用于审查 Cisco IOS 和 IOS-XE 配置的模式集合,涵盖 show 命令、配置层次结构、通配符掩码、ACL 放置、接口卫生以及安全变更窗口验证。在阅读、编写或审查 Cisco IOS/IOS-XE 配置或规划变更窗口时使用。

cisco-ios-patterns 是什么?

此技能提供了一组经过验证的模式,用于审查 Cisco IOS 和 IOS-XE 设备的配置,并规划安全变更。它涵盖了关键领域,如选择只读 show 命令、正确使用通配符掩码与子网掩码、ACL 方向放置以及接口卫生标准。该技能还定义了变更窗口验证工作流,包括变更前后的状态捕获和基于证据的确认。通过遵循这些模式,用户能够避免常见的反模式——例如在验证前保存配置或将子网掩码误用于通配符——从而提高网络操作的可靠性和安全性。该技能适用于所有支持 IOS/IOS-XE 的 Cisco 路由器和交换机,不依赖特定平台,可与通用网络代理或故障排除工作流配合使用。

兼容平台~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 末尾都隐式包含 deny 语句。当运营目标包括观察丢失的数据包时,添加显式记录的 deny 语句,并确认日志记录量安全。

ACL 放置审查

在将 ACL 应用于接口之前,请回答以下问题:

  • 要过滤哪个流量方向,in 还是 out?
  • 管理流量是否来自已知的跳板机或管理子网?
  • 是否为所需的路由、DNS、NTP、监控或应用流量显式设置了 permit 语句?
  • 是否可从安全测试源获取命中计数器?
  • 是否存在回滚命令以及可用的控制台或带外路径?

不要通过移除防火墙或 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/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.

相关技能