How to configure VLAN within Home Assistant

IoT devices not automatically discovered across VLANs.

HA 2024.5.3
Home Assistant OS 12.3
Raspberry Pi 4
TP-Link ER605 router

I have created two VLAN’s. VLAN 10 has my Raspberry Pi only. VLAN 20 has all of my IoT devices. VLAN10 has full access to VLAN20 but VLAN20 cannot talk to 10.

How do I create VLANs in HA so that HA can auto detect devices in the IoT VLAN?

What HA items do I need to configure? What do I need to do on my router?

I’ve seen posts talking about eth0 (older) and end0. I haven’t found out how to set up end0.2 to show up on my network settings page.

I enabled mDNS on my router and set port forwarding for ports 6666-6667 to go to my Home Assistant server. Neither solved my problem.

Any help is greatly appreciated as I am stuck.

1 Like

So, my opinion on this is that it is not an HA question.

It is a networking question. Yes, many people here have that kind of knowledge, but depending on who is asking the question, the person trying to help could go down a HUGE rabbit hole.

I think it is better to try to find the answers using Google or some networking specific message boards.

2 Likes

You will not be satisfied with the answer, but i think that the easiest way is to use proxmox where you can create vitrual network interfaces on same network card in which you can add vlan tags. Then in HA panel you have several network cards and HA communicates through them with networks as you want.

1 Like

Multicast traffic (like mDNS) isn’t going to cross subnets (VLANs) without a multicast reflector.

You can’t setup a VLAN interface (like you were asking) on the client side. You’d have to have something in between HA and the network stack (like a VM hypervisor) to virtualize a network bridge.

1 Like

Although I don’t use VLANs, I thought I would try to help out
Sorry, I’m not quite following your network setup. Is this correct:
VLAN20 connected to IOT devices and ER605 (call it IP subnet-2)
VLAN10 connect to RPi (HA) and ER605 (call it IP subnet-1)

Are you using ER605 for NATing between VLAN10 and VLAN20 to achieve this?

As for mDNS, HA will need to receive multicast from IOT devices and send multicast to IOT devices, and if it has to go through a router to do this, I think it becomes problematic to get the Router to forward these. As the previous poster said, you probably need something like a multicast reflector, but this may have limits to it as well (maybe one of the limits is dealing with IPv6 multicast discovery in addtion to IPv4).

I have seen others put the IOT VLAN on HA (in addition to other VLAN(s)), but then you have to somehow tell HA to use the IOT VLAN for multicast. This is suppose to work via the HA UI Network settings (as the “default” network adapter), but for VLANs, it may not work through the HA UI, so may have to resort to nmcli and route metrics to do this.

Correct, i believe autodiscovery uses UPnP

I eventually solved this by using a USB to RJ45 adapter and plugged that into the IoT VLAN. HA found the new network and it now discovers devices on the IoT VLAN while I can still block the IoT VLAN from accessing other devices using the router rules.

1 Like