gns3-web-ui icon indicating copy to clipboard operation
gns3-web-ui copied to clipboard

Webui missing custom network adapter option for node

Open spikefishjohn opened this issue 3 years ago • 3 comments

image

I don't see a way to do this via the webui.

Screen shot is from a deployed QEMU node in this case.

spikefishjohn avatar Jun 23 '22 16:06 spikefishjohn

Qemu

Custom adapters seems to be almost implemented for Qemu templates/nodes however the Web-Ui seems to not send the correct custom adapters list:

Screenshot from 2022-09-29 16-16-31

Error {"message":"HTTP error 422 received from compute 'vps1 (controller)' for request POST /projects/0f354949-996d-46e7-ac13-9c615ca48acd/qemu/nodes: {\"detail\":[{\"loc\":[\"body\",\"custom_adapters\",0,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"},{\"loc\":[\"body\",\"custom_adapters\",1,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"},{\"loc\":[\"body\",\"custom_adapters\",2,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"},{\"loc\":[\"body\",\"custom_adapters\",3,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"},{\"loc\":[\"body\",\"custom_adapters\",4,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"},{\"loc\":[\"body\",\"custom_adapters\",5,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"},{\"loc\":[\"body\",\"custom_adapters\",6,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"},{\"loc\":[\"body\",\"custom_adapters\",7,\"port_name\"],\"msg\":\"field required\",\"type\":\"value_error.missing\"}]}"} 

The custom_adapters entry is an array, for example:

  "custom_adapters": [
    {
      "adapter_number": 0,
      "port_name": "Ethernet 0",
      "adapter_type": "e1000",
      "mac_address": "10:0A:8D:7F:cf:5d"
    },
    {
      "adapter_number": 1,
      "port_name": "Ethernet 1",
      "adapter_type": "e1000",
      "mac_address": "10:0A:8D:7F:cf:5e"
    }
  ]

Also, the possibility to configure custom MAC addresses is not available:

Screenshot from 2022-09-29 16-34-50

Docker

Custom adapters for Docker templates and nodes is not implemented in the web-ui, here is what we have in the desktop interface:

Screenshot from 2022-09-29 16-40-15

Screenshot from 2022-09-29 16-40-41

For Docker, we can only configure port names, for example:

  "custom_adapters": [
    {
      "adapter_number": 0,
      "port_name": "Ethernet 0"
    },
    {
      "adapter_number": 1,
      "port_name": "Ethernet 1"
    }
  ]

VMware and VirtualBox

Custom adapters seems to be almost implemented for VirtualBox and VMware templates/nodes however seems to be the same error as with Qemu + the adapter types are not filled out.

Screenshot from 2022-09-29 16-49-23

Screenshot from 2022-09-29 16-49-10

Screenshot from 2022-09-29 16-44-39

Screenshot from 2022-09-29 16-44-50

For VirtualBox/VMware, we can only configure port names and adapter types, for example:

  "custom_adapters": [
    {
      "adapter_number": 0,
      "port_name": "Ethernet 0",
      "adapter_type": "e1000"
    },
    {
      "adapter_number": 1,
      "port_name": "Ethernet 1",
      "adapter_type": "e1000"
    }
  ]

grossmj avatar Sep 29 '22 14:09 grossmj

Let's focus on Qemu templates first. Here is the data we receive from the server for the FRR template using the /v3/templates API endpoint.

  {
    "template_id": "59c55a13-5556-4fe2-9d8a-161c66f7576d",
    "name": "FRR",
    "version": "7.3.1",
    "category": "router",
    "default_name_format": "{name}-{0}",
    "symbol": ":/symbols/classic/router.svg",
    "builtin": false,
    "template_type": "qemu",
    "compute_id": "local",
    "usage": "Credentials: root / root\nIf you exit from the router CLI, you can get back by typing 'vtysh' to the console.",
    "created_at": "2022-04-08T04:53:16",
    "updated_at": "2022-04-08T04:53:16",
    "kernel_image": "",
    "options": "",
    "platform": "i386",
    "port_name_format": "eth{0}",
    "cpus": 1,
    "first_port_name": "test-0",
    "cpu_throttling": 0,
    "bios_image": "",
    "maxcpus": 1,
    "hdd_disk_image": "",
    "hdd_disk_interface": "none",
    "initrd": "",
    "create_config_disk": false,
    "console_type": "telnet",
    "hda_disk_interface": "ide",
    "mac_address": "",
    "on_close": "power_off",
    "process_priority": "normal",
    "hdb_disk_interface": "none",
    "hda_disk_image": "frr-7.3.1.qcow2",
    "ram": 256,
    "aux_type": "none",
    "hdb_disk_image": "",
    "cdrom_image": "",
    "boot_priority": "c",
    "linked_clone": true,
    "hdc_disk_interface": "none",
    "qemu_path": "qemu-system-x86_64",
    "hdc_disk_image": "",
    "replicate_network_connection_state": true,
    "port_segment_size": 0,
    "console_auto_start": false,
    "kernel_command_line": "",
    "custom_adapters": [
      {
        "adapter_number": 0,
        "port_name": "eth{0}",
        "adapter_type": "e1000",
        "mac_address": null
      },
      {
        "adapter_number": 1,
        "port_name": "eth{1}",
        "adapter_type": "e1000",
        "mac_address": null
      },
      {
        "adapter_number": 2,
        "port_name": "eth{2}",
        "adapter_type": "e1000",
        "mac_address": null
      },
      {
        "adapter_number": 3,
        "port_name": "eth{3}",
        "adapter_type": "e1000",
        "mac_address": null
      },
      {
        "adapter_number": 4,
        "port_name": "eth{4}",
        "adapter_type": "e1000",
        "mac_address": null
      },
      {
        "adapter_number": 5,
        "port_name": "eth{5}",
        "adapter_type": "e1000",
        "mac_address": null
      },
      {
        "adapter_number": 6,
        "port_name": "eth{6}",
        "adapter_type": "e1000",
        "mac_address": null
      },
      {
        "adapter_number": 7,
        "port_name": "eth{7}",
        "adapter_type": "e1000",
        "mac_address": null
      }
    ],
    "adapter_type": "rtl8139",
    "adapters": 8
  },

Now we have to use the content of custom_adapters to fill the custom adapters section in the template preferences:

Screenshot from 2022-11-03 00-25-23

  • The port_name column should use eth{0} etc. not Ethernet 0 etc.
  • The adapter_type should work similarly with the type defined in the network section, meaning for instance selecting "e1000" in the desktop interface for a custom adapter will show "Intel Ethernet Gigabit (e1000)" in the web-ui. The reverse should work too, selecting another type should show the same type in the desktop interface.

Screenshot from 2022-11-03 00-32-21

grossmj avatar Nov 02 '22 16:11 grossmj

Next is Docker, it is not possible to configure custom network adapters for Docker templates in the web-ui:

Screenshot from 2022-11-04 00-13-04

Also, there is an issue in the web-ui when configuring custom adpaters for a Docker node:

Screenshot from 2022-11-04 00-08-41

Screenshot from 2022-11-04 00-08-58

![ScreensScreenshot from 2022-11-04 00-10-32

grossmj avatar Nov 03 '22 16:11 grossmj