GNS3 / gns3-gui

GNS3 Graphical Network Simulator
http://www.gns3.com
GNU General Public License v3.0
2.17k stars 436 forks source link

Possibility to customize interface naming for all devices #2361

Closed AJNOURI closed 6 years ago

AJNOURI commented 6 years ago

This is available only for qemu devices. Because it is merely cosmetic and doesn't affect the appliance working, is it possible to make this functionality available for all devices (VIRL images, vmware/vbox and containers)? It will then be up to the user to leave the default interface naming of adjust according to the device specific naming

selection_001_17_12

grossmj commented 6 years ago

Do you mean for more than Qemu devices?

tombakita commented 6 years ago

My request for Docker container interface mapping is to cover a case where a simple template partially solves it.

Consider my virutal router that takes 20 interfaces, and the docker template configures 20 interfaces. These interfaces from within the router have a mapping:

eth0 --> Gi 0/1 eth1 --> Gi 0/2 ... eth 10 -> Gi 0/11 eth 11 -> Gi 0/12 eth 12 -> Slot 1/1 eth 13 -> Slot 1/2 eth 14 -> Slot 2/1 eth 15 -> Slot 2/2 eth 16 -> Slot 3/1 eth 17 -> Slot 3/2 eth 18 -> Slot 4/1 eth 19 -> Slot 4/2

It would be nice to have an "edit" option where a user can define any mapping for the interfaces.

One nagging issue with this template approach is my first interface is eth0 and maps to Gi 0/1. The template would allow mapping eth0 to Gi 0/0, but not eth0 to Gi 0/1. Then eth13 would be Gi x/x and not Slot x/x.

This is why I think a template with an edit option would be more manual but would allow flexibility.

Would this kind of enhancement be useful if I have a developer who can help contribute?

grossmj commented 6 years ago

For reference: https://gns3.com/qa/customize-the-display-name-for-i

immybo commented 6 years ago

So I had a brief play around with this and (crudely!) added the option to manually specify each interface name for Docker containers over the REST API (although I didn't add it to the GUI). My patch is attached if you want to have a look at it - is this the right area to put the code in? It probably wouldn't be too hard to generalise this so that the same option works on all types of nodes.

0001-add-adapter_names.txt

grossmj commented 6 years ago

Implemented. Hope everyone is going to like it.