sortout vyos ova interface order


I deploy VyOS OVA with x numbers of interfaces and trying to determine the order correlate with the interface name.
for example a deploy can result a scenario with eth7 linked to network adapter 10 or some other miss-correlated order of interface names (eth-x) to adapter (y). (ideally that should go as ethX = adapter(X-1), but its not)

to put some context…
my initial goal is to dynamically deploy vyos image with x numbers of interfaces on separate vlans and configure each interface according to vlans im assigning to it. currently i can’t determine which OS-interface correlate to virtual interface.
manually, i can view mac from virtual-network-adapter and locate the interface name on the os level.
my current thoughts are to run a script which i can (potentially list v-adapters and MAC) and script will scan the interfaces name and mac and link them all.
sounds dirty, and Im open to new strategies

any suggestions are welcome,

Usually it’s ordered sequentially
You prepare default configuration and remove hw-id from interfaces
later you deploy it with vnics assigned as per your needs

Or if misunderstood your requirements please elaborate
You want to have vlans processing on VyOS side(e.g. VIFs) and not on vSwitch side?

thx Syncer,

in my case the interfaces are not sequentially.
the only reliable interface is eth0. by default eth0 is always linked to n.adapter-1.
as for other interfaces, i have no consistent way to know how they linked.
eth1 - n.adapter-3
eth2 - n.adapter-5
eth3 - n.adapter-4
eth4 - n.adapter-6
eth5 - n.adapter-2

the deployment script is doing the follow:

  • deploying vyos vm (off)
  • adding X number of interfaces
  • powering on

from here i assumed the adapters are correlated to os interfaces, like [eth1 - n.adapter-2] [eth2 - n.adapter-3]…
if that was correct, i would be able to assign IP on the OS level and vlan on the hypervisor layer.

hopefully that makes more sense

The problem appeared to come from adding vmxnet3 interfaces. When using E1000 NIC’s for the additional interfaces, the is no mismatch between interface names and adapter’s on the hypervisor and os level.