Create a Full Network Topology
create_full_network_topologyBuild or rebuild a Packet Tracer network in one call from JSON: add devices, links, host IP settings, and IOS configs while preserving existing devices.
Instructions
Build a whole network in one call into the open Packet Tracer file (existing devices are kept). Same format export_network_topology returns, so exports can be rebuilt. Steps run in order: devices (+modules), links, host IP settings, then IOS configs; errors are collected, not fatal.
Format: { "description": "OSPF lab", "devices": [ {"name": "R1", "device_type": "router", "model": "2911", "x": 100, "y": 100, "modules": [{"slot": "0/0", "module": "HWIC-2T"}], "config": "hostname R1\ninterface Gi0/0\n ip address 192.168.1.1 255.255.255.0\n no shutdown"}, {"name": "SW1", "device_type": "switch", "model": "2960-24TT", "x": 300, "y": 100}, {"name": "PC1", "device_type": "pc", "model": "PC-PT", "x": 500, "y": 100} ], "links": [{"device_a": "R1", "port_a": "GigabitEthernet0/0", "device_b": "SW1", "port_b": "GigabitEthernet0/1"}, {"device_a": "PC1", "port_a": "FastEthernet0", "device_b": "SW1", "port_b": "FastEthernet0/1"}], "hosts": [{"name": "PC1", "port": "FastEthernet0", "ip_address": "192.168.1.10", "subnet_mask": "255.255.255.0", "default_gateway": "192.168.1.1"}] } Use full port names. cable defaults to "auto". Discover models with get_device_models and modules with get_device_model_details.
Examples:
"Build a 3-router OSPF lab with a LAN behind each router"
"Recreate the topology I exported earlier"
"Set up a router-on-a-stick lab with two VLANs"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topology | Yes | Topology object (or its JSON string): description, devices, links, hosts -- see the docstring |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | No | ||
| errors | No | ||
| devices | No |