cisco-conf-generator/docs/templates/EXAMPLE_CONFIGS.md
2026-01-25 18:01:48 +01:00

5.3 KiB

Example Cisco Configuration Templates

Basic Switch Configuration

{
  "hostname": "SWITCH-01",
  "vlans": [
    {"id": 1, "name": "MANAGEMENT"},
    {"id": 10, "name": "USERS"},
    {"id": 20, "name": "SERVERS"},
    {"id": 30, "name": "VOICE"},
    {"id": 99, "name": "QUARANTINE"}
  ],
  "interfaces": [
    {
      "name": "Vlan1",
      "description": "Management VLAN",
      "type": "layer3",
      "ip_address": "192.168.1.10/24",
      "enabled": true
    },
    {
      "name": "GigabitEthernet0/1",
      "description": "Access Port - User Workstation",
      "type": "access",
      "vlan": 10,
      "enabled": true
    },
    {
      "name": "GigabitEthernet0/2",
      "description": "Access Port - Server",
      "type": "access",
      "vlan": 20,
      "enabled": true
    },
    {
      "name": "GigabitEthernet0/3",
      "description": "Access Port - VoIP Phone",
      "type": "access",
      "vlan": 30,
      "enabled": true
    },
    {
      "name": "GigabitEthernet0/24",
      "description": "Uplink to Core Switch",
      "type": "trunk",
      "trunk_vlans": [1, 10, 20, 30],
      "enabled": true
    }
  ]
}

Router with NAT Configuration

{
  "hostname": "ROUTER-01",
  "interfaces": [
    {
      "name": "GigabitEthernet0/0",
      "description": "Inside LAN Interface",
      "ip_address": "192.168.1.1/24",
      "enabled": true
    },
    {
      "name": "GigabitEthernet0/1",
      "description": "Outside WAN Interface",
      "ip_address": "203.0.113.1/24",
      "enabled": true
    }
  ],
  "routes": [
    {
      "destination": "0.0.0.0/0",
      "gateway": "203.0.113.254",
      "metric": 1
    }
  ],
  "nat": {
    "inside_interface": "GigabitEthernet0/0",
    "outside_interface": "GigabitEthernet0/1",
    "inside_addresses": ["192.168.1.0/24"],
    "outside_address": "203.0.113.1"
  },
  "acls": [
    {
      "name": "OUTSIDE_IN",
      "type": "extended",
      "rules": [
        {
          "action": "permit",
          "protocol": "tcp",
          "source": "any",
          "destination": "203.0.113.1",
          "port": 80
        },
        {
          "action": "permit",
          "protocol": "tcp",
          "source": "any",
          "destination": "203.0.113.1",
          "port": 443
        },
        {
          "action": "deny",
          "protocol": "ip",
          "source": "any",
          "destination": "any"
        }
      ]
    }
  ]
}

CCNA Lab: OSPF Routing

{
  "hostname": "R1",
  "interfaces": [
    {
      "name": "GigabitEthernet0/0",
      "description": "Link to R2",
      "ip_address": "10.0.0.1/24",
      "enabled": true
    },
    {
      "name": "GigabitEthernet0/1",
      "description": "Link to R3",
      "ip_address": "10.0.1.1/24",
      "enabled": true
    },
    {
      "name": "Loopback0",
      "description": "Router ID",
      "ip_address": "192.168.1.1/32",
      "enabled": true
    }
  ],
  "routes": [
    {
      "destination": "10.0.2.0/24",
      "gateway": "10.0.0.2",
      "metric": 10
    }
  ]
}

Advanced: Multi-VLAN with ACLs

{
  "hostname": "SWITCH-02",
  "vlans": [
    {"id": 100, "name": "ADMIN"},
    {"id": 101, "name": "ACCOUNTING"},
    {"id": 102, "name": "ENGINEERING"},
    {"id": 200, "name": "GUEST"}
  ],
  "interfaces": [
    {
      "name": "GigabitEthernet1/0/1",
      "description": "Admin Workstation",
      "type": "access",
      "vlan": 100,
      "enabled": true
    },
    {
      "name": "GigabitEthernet1/0/2",
      "description": "Accounting Workstation",
      "type": "access",
      "vlan": 101,
      "enabled": true
    },
    {
      "name": "GigabitEthernet1/0/3",
      "description": "Engineering Workstation",
      "type": "access",
      "vlan": 102,
      "enabled": true
    },
    {
      "name": "GigabitEthernet1/0/4",
      "description": "Guest WiFi Access Point",
      "type": "access",
      "vlan": 200,
      "enabled": true
    },
    {
      "name": "GigabitEthernet1/0/47",
      "description": "Uplink Trunk",
      "type": "trunk",
      "trunk_vlans": [100, 101, 102, 200],
      "enabled": true
    }
  ],
  "acls": [
    {
      "name": "VLAN_ISOLATION",
      "type": "extended",
      "rules": [
        {
          "action": "permit",
          "protocol": "ip",
          "source": "192.168.101.0/24",
          "destination": "192.168.101.0/24"
        },
        {
          "action": "deny",
          "protocol": "ip",
          "source": "192.168.101.0/24",
          "destination": "192.168.102.0/24"
        },
        {
          "action": "permit",
          "protocol": "ip",
          "source": "any",
          "destination": "any"
        }
      ]
    }
  ]
}

Preconfigured Lab Presets (V1 Feature)

Coming soon:

  • CCNA Topology (3 routers, 2 switches)
  • CCNP Advanced (OSPF, EIGRP, redistribution)
  • Network Segmentation (DMZ + internal VLANs)
  • VoIP Configuration (CallManager-ready)
  • Data Center Access Layer

Importing Existing Configs

Future feature to:

  1. Parse existing running-config
  2. Extract VLAN, interface, route info
  3. Populate config builder GUI
  4. Allow modifications & re-push

Example:

# CLI utils (future)
def parse_show_running_config(output: str) -> dict:
    """
    Parse Cisco 'show running-config' output
    Extract VLANs, interfaces, routes, ACLs
    Return as config_data dict
    """
    pass