[VM] VLANs: Multiple network adapter vs one adapter

I’m using Home Assistant OS in a VM. In my setup there are multiple VLANs, two relevant for Home Assistant: “User” and “IoT”. I see two possibilities to give HA access to both networks:

a) Add 2 network cards to the VM all tagged with the right VLAN Tag
b) Use 1 network card an configure the VLAN Tags and virtual adapters in HA

Does anybody know, if there is a preferable way to set my machine up?

Thanks!

Does HaOS support multiplle Ethernet adapters? Perhaps put 1 VLAN on Wi-Fi?

From my tests I thought it would support it. Following is the output of “ha network info” of a VM with 3 network adapters. But I’m not sure if I should continue that route.

~ $ ha network info
docker:
  address: 172.30.32.0/23
  dns: 172.30.32.3
  gateway: 172.30.32.1
  interface: hassio
host_internet: true
interfaces:
- connected: true
  enabled: true
  interface: enp0s3
  ipv4:
    address:
    - 10.0.20.120/24
    gateway: 10.0.20.1
    method: auto
    nameservers:
    - 10.0.20.1
  ipv6:
    address:
    - 2003:c1:c742:7900:b526:46e7:5def:b3d8/64
    - 2003:c1:c742:7900::6bc/128
    - fe80::2d26:216e:ec66:76ad/64
    gateway: fe80::e063:daff:fe89:1b9e
    method: auto
    nameservers:
    - 2003:c1:c742:7900::1
  primary: true
  type: ethernet
  vlan: null
  wifi: null
- connected: true
  enabled: true
  interface: enp0s4
  ipv4:
    address:
    - 10.0.30.30/24
    gateway: 10.0.30.1
    method: auto
    nameservers:
    - 10.0.30.1
  ipv6:
    address:
    - 2003:c1:c742:7901:d94d:47f4:85df:3e8e/64
    - 2003:c1:c742:7901::507/128
    - fe80::7606:388:3e76:14ce/64
    gateway: fe80::a8db:8dff:fea8:c29c
    method: auto
    nameservers:
    - 2003:c1:c742:7901::1
  primary: false
  type: ethernet
  vlan: null
  wifi: null
- connected: true
  enabled: true
  interface: enp0s5
  ipv4:
    address:
    - 10.0.40.163/24
    gateway: 10.0.40.1
    method: auto
    nameservers:
    - 10.0.40.1
  ipv6:
    address:
    - 2003:c1:c742:7902:1f49:54f6:e30:3007/64
    - 2003:c1:c742:7902::53c/128
    - fe80::92ce:792b:efe1:9028/64
    gateway: fe80::7076:d1ff:fee6:10a2
    method: auto
    nameservers:
    - 2003:c1:c742:7902::1
  primary: false
  type: ethernet
  vlan: null
  wifi: null
supervisor_internet: true

As a general practice, I would think it would be more efficient to configure all your VLANs on one Ethernet Link (Port). However it may depend on how you map traffic from your virtual Network Interface Cards (NICs) on your VM to your Physical Ethernet Links (Ports). Do you already have 3 physical Ethernet Links on your VM’s Host?