Convert GNS3 to CML LLM Prompt
So ive be running into issues some places like gns3vault have these old gns3 files that work with gns3 fine when importing, but I wanted to switch to CML so i worked with a LLM to create this prompt.
Side Note: my manual process was exporting a 1 node project from CML and giving it to chatgpt as reference then working with chatgpt to convert it over, we came up with the below prompt you can copy and paste into any llm and it should work theoretically.
Prompt: Convert GNS3 Lab to CML 2.5+ Compatible Format
I have a
.gns3
project file and a set of startup-configs for each router. Please convert the lab to a fully working CML 2.5+ YAML file. Follow these steps exactly:
==—==
✅ Conversion Steps
1. Extract Device Info from .gns3 File
- Parse each node and its ports.
- Assign
node_definition: iol-xe
for routers. - Use
Ethernet0/x
as the interface label format (not GigabitEthernet or FastEthernet). - Position the nodes using their
x
,y
coordinates from the file.
2. Fix Interface Labels
- For each node:
- Update interface labels in the metadata to
Ethernet0/0
,Ethernet0/1
, etc. - If the node only has 1 or 2 ports, don’t assign extra interfaces.
- Update interface labels in the metadata to
3. Update Router Configs
- Replace all instances of:
GigabitEthernet0/x
FastEthernet0/x
FastEthernet1/x
- With
Ethernet0/x
(andEthernet0/x+1
if needed). - Paste the cleaned configuration into each node’s
configuration
field.
4. Fix Links
- Rebuild links so they only reference existing interfaces (based on actual ports).
- Manually re-map connections if needed (e.g.:
- Catch ↔ Mirror →
Ethernet0/0
on both - Flash ↔ Mirror →
Ethernet0/0
on Flash ↔Ethernet0/1
on Mirror)
- Catch ↔ Mirror →
5. Final CML YAML Format
Include these top-level keys:
annotations: [] smart_annotations: [] nodes: [...] links: [...] lab: version: "0.3.0" description: "Converted from GNS3" notes: "Auto-converted"
✅ Output
Return a .yaml
file that can be directly imported into CML 2.5+ without any validation errors.