X86 VM: Order of ethernet ports

Lately I've been messing around with an x86 Virtual Machine running on a VMWare ESXI host.
It all runs fine. I have quite a lot experience in running OpenWRT on KVM and Virtualbox. But this time I faced some things that are rather unclear to me.
What makes the sort order of the ethernetports (eth0, eth1, eth2 etc..) when I add them to the VM? And especially when I add some more, later on?
I noticed that this order is different from the order that I see in ESXI's GUI and that I find in is .vmx config file.

Maybe at initial installation it does keep that order but after adding and removing some virtual NICs I do not recognise any logic.
Is there a way to manipulate or rescan the ports?

Any help appreciated.

  • Erik -

Few ideas - Is the order being sorted based on the MAC address?
I haven’t tried but does udev exist for x86 images ? If so, would need to add rules.
What order does the kernel see the devices with ? lspci -vv

1 Like

You can "manipulate" the ports in the config or with a [virtual]cable.

The port ordering is defined by the underlying virtual hardware. In the old days you'd change the network card slot. See the virtualisation man pages re: similar feature sets.

Without ethool blink... just enable the vnics one at a time to identify.

3 Likes

Yes, searching deeply using lspci (had to install the package pciutils) made it more clear to me.
I have to invest it further but for now it seems to me that vmware firstly puts the virtual pci ethernetinterfaces in a logical order. Eth0, 1 and 2 on the physical (simulated) pci address 160, 224 and 256. And increment the mac-addresses 10 each respectively.

But when adding 2 more NICs it just puts them somewhere on a free Phy address (161 and 193 in the case I just tested). The previous NICs kept their mac-addresses. I think OpenWRT takes the (new) pci-slot order while I see a different order in vmware's GUI.

The .vmx file is well hackable. I'm gonna try to swap some of these PCI Phy-address now.

Thanks for now!

2 Likes

Hi Zanzani,

I have been trying to accomplish exactly this, getting OpenWRT to run on ESXI 6.5. (am on a HW not supporting 6.7 or 7).

I only get v15.02 to run though. Have not managed to get a newer built on it.

Could you point me to some kind of tutorial on how to manage to get a newer release on it? Have also tried an update through the GUI, no success. And tried to convert the image to VMDK with QEMU, also no success....

Thanks.

I will try to find some time to test and write some of my notes. It is not very difficult but you might have to do some tricks.

And indeed, upgrade from within OpenWRT still hasn't worked ever since.