# Cisco Config Gen

> Generate Python scripts that build Cisco device configurations. Use when the user wants to create, template, or generate IOS/IOS-XE/NX-OS/ASA configs programmatically.

- Skill: `bradmccloskey/cisco-config-gen` (Agent Skill)
- Install (CLI): `npx skillmds@latest add bradmccloskey/cisco-config-gen`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bradmccloskey/cisco-config-gen/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: bradmccloskey (https://skillmd.com/u/bradmccloskey)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bradmccloskey/cisco-config-gen

---


## Cisco Configuration Generator Scripts

Write Python scripts that generate Cisco device configurations. Follow these standards:

### Structure
- Use Jinja2 templates for config generation
- Support YAML or JSON input for device variables
- Separate data (variables) from logic (templates)
- Output valid IOS/IOS-XE/NX-OS/ASA CLI configs

### Supported Platforms
- IOS / IOS-XE (routers, switches)
- NX-OS (Nexus)
- ASA (firewalls)
- IOS-XR where applicable

### Config Features to Support
- **Routing**: BGP, OSPF, EIGRP, static routes, route-maps, prefix-lists
- **Switching**: VLANs, trunks, access ports, STP, EtherChannel, VTP
- **Security**: ACLs (standard/extended/named), NAT (static/dynamic/PAT), VPN (site-to-site/remote-access), AAA, CoPP
- **Interfaces**: L2/L3 config, subinterfaces, loopbacks, SVIs, port-channels
- **Services**: DHCP, NTP, SNMP, syslog, DNS, TACACS+/RADIUS
- **SDN/Automation**: RESTCONF/NETCONF payloads, DNA Center templates

### Libraries to Use
- `jinja2` for templating
- `yaml` or `json` for variable input
- `ipaddress` for IP/subnet calculations
- `netaddr` if advanced IP math is needed

### Output Requirements
- Generate clean, paste-ready CLI config blocks
- Include `!` comment separators between sections
- Add descriptive comments using `! ---` format
- Validate IP addresses and subnet masks before output
- Support dry-run mode (print to stdout) and file output

### Example Variable File Format (YAML)
```yaml
hostname: R1
interfaces:
  - name: GigabitEthernet0/1
    ip: 10.0.1.1
    mask: 255.255.255.0
    description: Uplink to Core
routing:
  ospf:
    process_id: 1
    router_id: 1.1.1.1
    networks:
      - network: 10.0.1.0
        wildcard: 0.0.0.255
        area: 0
```

