feat: show IOL-style interface names on iol-runner ports

Name ports after the IOL interface they map to (Ethernet0/0, one 4-port
unit per adapter range) via the _get_container_ifname override point, so
the GNS3 UI matches the IOS CLI. Display only — the flat adapter number
remains the socket index.
This commit is contained in:
YueGuobin committed 2026-09-05 21:54:12 +08:00
1 parent cd17306372
commit 4c818c6b37
3 files changed
+24 -1

No files matched your search

@@ -105,6 +105,15 @@ class IOLDockerVM(VendorDockerVM):
volumes.append(needed)
return volumes
def _get_container_ifname(self, adapter_number):
"""
Override: name ports after the IOL interface they map to
(Ethernet0/0, Ethernet0/1, … — a new 4-port unit every four
adapters), so what the GNS3 UI shows matches the IOS CLI. Wiring is
unaffected: the flat adapter number remains the socket index.
"""
return f"Ethernet{adapter_number // 4}/{adapter_number % 4}"
async def start(self):
await self._prepare_iol_runtime()