Batfish config analysis

From automateyournetwork/netclaw · View interactive version

Batfish config analysis is an AI agent skill from the GitHub repository automateyournetwork/netclaw. Batfish network configuration analysis -- pre-deployment validation, reachability testing, ACL/firewall tracing, differential analysis, compliance checking. Use when validating configs before deployment, testing traffic paths, tracing ACL rules, comparing config versions, or auditing compliance poli

How to use this skill

Skill file

Batfish Configuration Analysis

MCP Server

Available Tools (8)

| Tool | Parameters | What It Does |

|------|-----------|--------------|

| batfish_upload_snapshot | snapshot_name, configs/config_path, network | Upload device configs to Batfish and create a named snapshot |

| batfish_validate_config | snapshot_name, network | Validate configs with per-device pass/fail status, vendor detection, warnings |

| batfish_test_reachability | snapshot_name, src_ip, dst_ip, protocol, dst_port | Test if traffic can flow between two endpoints with full path trace |

| batfish_trace_acl | snapshot_name, device, filter_name, src_ip, dst_ip, protocol, dst_port | Trace a packet through ACL rules to find matching permit/deny rule |

| batfish_diff_configs | reference_snapshot, candidate_snapshot, include_routes, include_reachability | Compare two snapshots for route and reachability differences |

| batfish_check_compliance | snapshot_name, policy_type | Check configs against compliance policies (6 built-in policy types) |

| batfish_list_snapshots | network | List all available snapshots |

| batfish_delete_snapshot | snapshot_name, network | Delete a snapshot |

Workflow: Pre-Change Validation

When a user wants to validate configurations before deployment:

  1. Upload configs: batfish_upload_snapshot with inline configs dict or path to config directory
  2. Validate: batfish_validate_config to check parse status, vendor detection, warnings/errors
  3. Test reachability: batfish_test_reachability for critical traffic paths
  4. Check compliance: batfish_check_compliance against organizational policies
  5. Report: Structured pass/fail results with specific findings
  6. GAIT: All operations automatically logged

Example: Validate Before Deploy

# Upload proposed configs
batfish_upload_snapshot snapshot_name="pre-change-site-a" config_path="/path/to/configs/"

# Validate parse status
batfish_validate_config snapshot_name="pre-change-site-a"

# Test critical path
batfish_test_reachability snapshot_name="pre-change-site-a" src_ip="10.1.1.1" dst_ip="10.2.2.1" protocol="TCP" dst_port=443

# Check compliance
batfish_check_compliance snapshot_name="pre-change-site-a" policy_type="interface_descriptions"

Workflow: Change Impact Analysis

When comparing before/after configurations:

  1. Upload "before" snapshot: batfish_upload_snapshot with current configs
  2. Upload "after" snapshot: batfish_upload_snapshot with proposed configs
  3. Diff: batfish_diff_configs to find route and reachability differences
  4. Investigate: Use batfish_trace_acl on any newly denied traffic
  5. Report: Structured diff showing added/removed/changed routes and flows

Workflow: ACL Troubleshooting

When investigating access control issues:

  1. Upload configs: batfish_upload_snapshot with device configs
  2. Trace packet: batfish_trace_acl with device, ACL name, and packet headers
  3. Review: Identify matching rule, line number, permit/deny action
  4. Test alternatives: Modify config, re-upload, trace again

Integration with Other Skills

| Skill | Integration |

|-------|-------------|

| pyats-config-mgmt | Validate configs with Batfish before pushing via pyATS |

| gait-session-tracking | All Batfish operations automatically logged |

| servicenow-change-workflow | Reference Batfish validation in change request evidence |

| fwrule-analyzer | Complement ACL trace with cross-vendor overlap analysis |

| cml-lab-lifecycle | Validate CML lab configs with Batfish analysis |

Important Rules

Error Handling

Environment Variables

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.