HAOS, VLAN and Unifi

Folks,

I’ve been a long time consumer of this great forum. Including the long VLAN thread originating from 4y back :D.

But I cannot get my setup working. Here are some details:

  • HA running on HAOS within a VM on a QNAP NAS
  • The NAS is connected via 2 different NICs. One in my private network, the 2nd one to my IoT VLAN 30 (specific port on the switch with default VLAN 30)
  • Both NICs get IPs and the NAS is reachable from both networks
  • The VM on the NAS is supposed to get IPs from virtual switches (a QNAP-specific thing, where both virtual switches - 1 per network - do get an IP from my router)
  • BUT the VM and therefore HA do only get an IP from the “private” network

Below is the output of ha net info. I also created a VLAN inteface within HA, just for testing. But esp0s4 doesn’t get an IP and esp0s4.30 only shows up when I assign a static IP to esp0s4 (without getting an actual IP from my router). After tinkering around for 1w+, I need a fresh perspective on it. Thanks for your guidance!

ha net info output

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: enp0s4
  ipv4:
    address: []
    gateway: null
    method: auto
    nameservers:
    - 192.168.66.1
    ready: false
  ipv6:
    address:
    - fe80::6713:19ea:1cda:31ff/64
    gateway: null
    method: disabled
    nameservers: []
    ready: true
  mac: 52:...
  primary: false
  type: ethernet
  vlan: null
  wifi: null
- connected: true
  enabled: true
  interface: enp0s3
  ipv4:
    address:
    - 192.168.178.72/24
    gateway: 192.168.178.1
    method: auto
    nameservers:
    - 192.168.178.1
    ready: true
  ipv6:
    address:
    - fe80::36c7:806b:57bf:5a0b/64
    gateway: null
    method: disabled
    nameservers: []
    ready: true
  mac: 52:...
  primary: true
  type: ethernet
  vlan: null
  wifi: null
supervisor_internet: true

host log output for enp0s4

2025-05-07 19:32:51.557 homeassistant NetworkManager[391]: <info>  [1746646371.5573] device (enp0s4): state change: activated -> deactivating (reason 'new-activation', sys-iface-state: 'managed')
2025-05-07 19:32:51.558 homeassistant NetworkManager[391]: <info>  [1746646371.5585] device (enp0s4): disconnecting for new activation request.
2025-05-07 19:32:51.662 homeassistant NetworkManager[391]: <info>  [1746646371.6626] device (enp0s4): state change: deactivating -> disconnected (reason 'new-activation', sys-iface-state: 'managed')
2025-05-07 19:32:51.685 homeassistant NetworkManager[391]: <info>  [1746646371.6846] device (enp0s4): Activation: starting connection 'Supervisor enp0s4' (d5f3310a-9804-4a79-8c5b-1b47c93702bb)
2025-05-07 19:32:51.686 homeassistant NetworkManager[391]: <info>  [1746646371.6866] device (enp0s4): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
2025-05-07 19:32:51.687 homeassistant NetworkManager[391]: <info>  [1746646371.6872] device (enp0s4): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
2025-05-07 19:32:51.690 homeassistant NetworkManager[391]: <info>  [1746646371.6906] device (enp0s4): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
2025-05-07 19:32:51.698 homeassistant NetworkManager[391]: <info>  [1746646371.6983] dhcp4 (enp0s4): activation: beginning transaction (timeout in 45 seconds)
2025-05-07 19:32:53.208 homeassistant NetworkManager[391]: <info>  [1746646373.2081] device (enp0s4): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
2025-05-07 19:32:53.213 homeassistant NetworkManager[391]: <info>  [1746646373.2129] device (enp0s4): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
2025-05-07 19:32:53.213 homeassistant NetworkManager[391]: <info>  [1746646373.2132] device (enp0s4): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
2025-05-07 19:32:53.216 homeassistant NetworkManager[391]: <info>  [1746646373.2159] device (enp0s4): Activation: successful, device activated.

Adding the QNAP virtual switch config for clarity.

Hello wolfsbein,

HA is designed and expects a flat subnet to work as intended.

This is because every segmented network is different for IP’s and number of segments and firewalls and sharing rules and about 650495849085 other things.
This does not mean you can’t use them or that they can’t be made to work, it means that to get them working you are the support structure on your own subnet(s). Consider it Advanced mode…

For another opinion, there is this: The enterprise smart home syndrome

Thanks, but this is not really answering my question or providing any pointers.

I’m not familiar with your hard/soft config, but I have HA on proxmox as a VM and a Unifi network. I gave it two NICs in proxmox, and set a static IP in the HA network settings, one for each Vlan I can’t remember if I tagged one NIC for the IOT Vlan in proxmox.

It works, although things were working prior with HA on my private side with firewall rules to allow the private Vlan to see into the IOT vlan. I think I created the second interface when I was trying to get Sonos to work , but ended up moving them to their own Vlan which is pretty much open to the private network.

I did run into issues with mdns messages from HA getting relayed from one HA interface to the other which kept HA changing mdns names and wasting CPU to the point of crashing it. More info on that here.

Sounds like you have no DHCP service on one of your networks.
You might get it up and running, but you will have a fight with discovery, because those services are not multihomed and you will probably need to learn a lot about IPv6, if you intend to use Matter or Thread.
Even if you avoid those pitfalls, then HA is not meant to be used as a router and you will get issue from time to time, like the discovery services suddenly shifting adapter after a restart.
If you want to run with VLANs, then put HA and your devices into one VLAN and let the router handle the routing (see the similarity between the function and the device! :wink: ) between the VLANs. That means only one interface on the HA server and you might even handle the firewall opening with just port 8123 to HA.

OK, then as they said in the HA release party Stream Wednesday,

it’s always DNS.

As the NAS literally does get an IP from DHCP running on the router - and all of the other 100+ devices do, I feel it’s a little more complicated than DHCP or DNS…

If QNAP has IPs for both network and only HA cannot reach both network, the issue likely exists at the VM. I dont use VM so can help there but

The “HA net info output” is kinda meaningless.
HAOS uses docker networks and that is what your looking at there I expect. This has nothing to do with external network to host or connections HA to LAN. I say this to keep you out of that rabbit hole if you were thinking to chase this

Curious. what do you see at HAui >> settings >> system >> network >> network adapter?
does it event detect the second adapter? if it does, try deselecting “auto configure” and check all adapters.

You are most likely wrong in your assumption.
You DHCP on the router is not leasing an IP to both your VMs.
One of them or maybe both of them are getting an IP leased from the router on the virtual hypervisor network.

Your router are probably leasing out 192.168.0.0/24 or 192.168.1.0/24.
Your VMs are getting 192.168.66.32 and 192.168.178.43 and my guess is that they both use subnet /24

My router is leasing out 2 different ranges for the 2 NAS NICs, which are 192.168.178.0/24 and 192.168.66.0/24.

Correct, the issue already sits on the the VM, as it doesn’t get an IP via NIC2. It does, though via NIC1 as it is the same VM.

The HA UI does show both ENP0S3 and ENP0S4 (in captions, btw. compared to lower caps in the config). The DNS server is also shown (correctly), but no gateway and no IP assigned. Might not have mentioned it before, but if I do assign a static IP within HA to the 66.0/24 network, it doesn’t show up on the router either.

After firing up a simple Alpine linux in a new VM on the QNAP which is bound to NIC2, I know more: the Alpine does get an IP and has network access out of the box [1]. Therefore the problem is most likely within HA. Any further ideas, now that we basically can rule out a networking issue [2]?

[1]

[2]