Communitygithub.com

思科IOS-IOS-XE审查模式

用于Show命令、配置层级、通配符掩码、ACL部署、接口规范以及安全变更窗口验证的思科IOS和IOS-XE审查模式。在阅读、编写或审查思科IOS/IOS-XE配置或规划变更窗口时使用。

思科IOS-IOS-XE审查模式 是什么?

**Cisco IOS Patterns** 是一个专业技能,旨在帮助工程师和AI代理系统审查思科IOS和IOS-XE设备配置,确保变更安全有效。它总结了关键的CLI操作模式,包括全局配置、接口配置、路由进程和线路配置等模式,并提供了只读Show命令的精选列表,用于在不加剧问题的情况下收集证据。该技能重点强调通配符掩码与子网掩码的区别,避免因误用导致ACL匹配范围扩大;同时指导ACL的正确部署方向、接口规范化(如描述、Switchport模式、Native VLAN)以及变更窗口的前后验证流程。它支持在Cursor、Claude Code等开发工具中作为上下文知识使用,适用于网络工程师、SRE和AI代理,帮助规划维护窗口、执行只读故障排查,并规避反模式(如未做差异对比就应用配置、在验证前保存配置等)。通过遵循这些模式,用户可以显著降低人为错误风险,确保网络变更的可靠性和可回溯性。

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

思科 IOS 模式

在审查思科 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。在路由接口上,在假设链路状态意味着转发正常之前,确认掩码、对端地址和路由进程。

变更窗口验证

使用与实际变更相匹配的前后检查。

show running-config | section interface GigabitEthernet0/1
show interfaces GigabitEthernet0/1
show logging | include GigabitEthernet0/1|changed state|line protocol
show ip route <前缀>
show ip access-lists <名称>

对于路由变更,还需要在变更前后捕获邻居状态和路由表。对于 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.

相关技能