Network Config Validation
Layered pre-flight warnings for IOS-style config before change windows or automation runs. Detalhes em references/.
When to Activate
- Reviewing Cisco IOS or IOS-XE style snippets before deployment
- Auditing generated config from scripts or templates
- Looking for dangerous commands, duplicate IP addresses, or subnet overlaps
- Checking whether ACLs, route-maps, prefix-lists, or line policies are referenced but not defined
- Building lightweight pre-flight scripts for network automation
Core Principles
- Destructive first — reload, erase, format, routing removal block the gate
- Credentials second — SNMP defaults, SSHv1, enable password, VTY Telnet fail closed
- Addresses third — duplicate IPs and overlapping subnets against full config
- Stale refs fourth — every ACL/route-map/prefix-list referenced must exist
- Regex warns, engineer decides — never treat pre-flight as a device parser
Example
bad = find_dangerous_commands(candidate_lines)
dups = find_duplicate_ips(full_config)
vty = check_vty_blocks(full_config)
gate = not bad and not dups and not [i for i in vty if "Telnet" in i]
References
references/dangerous-commands.md— destructive-pattern regex with line findingsreferences/ips-management.md— duplicate IPs, subnet overlaps, VTY block checksreferences/security-hygiene.md— SNMP/SSH/enable checks plus missing-hygiene scanreferences/preflight-antipatterns.md— validation order, change/automation preflight, anti-patterns
Checklist
- Dangerous-command scan run on the exact snippet to be pasted
- Duplicate IP + overlap scan run against the full candidate config
- All referenced ACLs/route-maps/prefix-lists confirmed to exist
- Rollback commands and out-of-band access confirmed before deploy