diff --git a/docs/features/iol-runner-docker.md b/docs/features/iol-runner-docker.md index bdee70e80..465dd981d 100644 --- a/docs/features/iol-runner-docker.md +++ b/docs/features/iol-runner-docker.md @@ -93,7 +93,12 @@ API docs for the auth flow), or in the Web UI under "console_type": "telnet", "environment": "GNS3_IOL_RUNNER=1", "extra_volumes": ["/config"], - "memory": 2560 + "custom_adapters": [ + {"adapter_number": 0, "port_name": "Ethernet0/0"}, + {"adapter_number": 1, "port_name": "Ethernet0/1"}, + {"adapter_number": 2, "port_name": "Ethernet0/2"}, + {"adapter_number": 3, "port_name": "Ethernet0/3"} + ] } ``` @@ -101,17 +106,20 @@ API docs for the auth flow), or in the Web UI under |---|---|---| | `environment` | `GNS3_IOL_RUNNER=1` | The switch that selects `IOLDockerVM` (skip-init, unix-socket NIO, auto volumes). Optional: `GNS3_IOL_MEMORY=` (default 2048). | | `extra_volumes` | `["/config"]` | `/tmp/run` is auto-added. **Never add `/tmp`** — it would persist the socket directory into the projects tree and uBridge would reject the too-long AF_UNIX path. | +| `custom_adapters` | one entry per adapter | Names each port after the IOL interface it maps to: adapter `N` → `Ethernet{N/4}/{N%4}` (same mechanism SR Linux uses for `mgmt0`/`e1-1`). Raise the list up to `Ethernet7/3` (32 ports, the IOL maximum) when raising `adapters`; adapters beyond the list fall back to `eth{N}`. | | `memory` | optional; `0` (default) = no cap | Unset works — Docker applies no limit. When you do set a cap, keep it at IOL memory + ~512 MB, or the cgroup OOM-killer shoots the router. | | `console_type` | `telnet` | The runner muxes the IOS console onto PID 1 stdio; `docker_exec` is not needed. | -| `adapters` | multiple of 4 | IOL port granularity. Ports are shown as `Ethernet0/0`-style (one 4-port unit per adapter range), matching the IOS CLI. | +| `adapters` | multiple of 4 | IOL port granularity (one 4-port unit per range). | ### Verify -1. Drop a node into a project and start it — the console shows the +1. The node's port list shows `Ethernet0/0`… (from the template's + `custom_adapters`). +2. Drop a node into a project and start it — the console shows the `Linux Unix (i686)` banner within seconds. -2. `$XDG_RUNTIME_DIR/gns3/unixio//` contains `s00.sock`… (one +3. `$XDG_RUNTIME_DIR/gns3/unixio//` contains `s00.sock`… (one pair per adapter). -3. The startup-config lives at +4. The startup-config lives at `project-files/docker//tmp/run/config` (interface names `Ethernet0/0`, not `GigabitEthernet0/0`). diff --git a/gns3server/compute/docker/iol_docker_vm.py b/gns3server/compute/docker/iol_docker_vm.py index b5cd588c7..6243f8a94 100644 --- a/gns3server/compute/docker/iol_docker_vm.py +++ b/gns3server/compute/docker/iol_docker_vm.py @@ -105,15 +105,6 @@ 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() diff --git a/tests/compute/docker/test_iol_docker_vm.py b/tests/compute/docker/test_iol_docker_vm.py index 006eb5a77..672325012 100644 --- a/tests/compute/docker/test_iol_docker_vm.py +++ b/tests/compute/docker/test_iol_docker_vm.py @@ -177,20 +177,6 @@ def test_iol_memory_knob(compute_project, manager): assert vm._iol_memory == 2048 -# --------------------------------------------------------------------------- -# Port naming -# --------------------------------------------------------------------------- - -def test_ports_are_named_after_iol_interfaces(compute_project, manager): - - vm = _make_vm(compute_project, manager, adapters=8) - assert vm._get_container_ifname(0) == "Ethernet0/0" - assert vm._get_container_ifname(3) == "Ethernet0/3" - # the second 4-port unit starts its own slot numbering - assert vm._get_container_ifname(4) == "Ethernet1/0" - assert vm._get_container_ifname(7) == "Ethernet1/3" - - # --------------------------------------------------------------------------- # create() # ---------------------------------------------------------------------------