HP Thin client with HAOS on different vlan. What's the concept? Firewall rules?

Hi!
I’m (very) new to home automation and I’m taking step after step to make things work.

I’m using the unifi UDMPro and have an enterprise switch and several Unifi APs. Setting up vlans and firewalls is therefore easily to make.

I installed HA OS on a HP T640 and put it and (1 :slight_smile: )Shelly on an IOT network. I blocked all traffic from and to this vlan.

I found brilliant tutorials like https://community.home-assistant.io/t/setup-vlan-and-ha-tutorial/87705/70
but I don’t have a concept how to set up the ha network:

  1. Does the HA server stay in the IoT vlan and I only connect via VPN to reach it.
  2. Or do I punch a hole in the firewall to reach it from my main vlan?
  3. Or do I set the server to be in two vlans?
  4. Do I put the HA server in the main vlan and let it only talk to the devices in the iot vlan?
  5. Forget all above…

You see I’m lost on the concept. If I have a concept I hope to be able to follow the individual tutorials to set it up.
If possible I would prefer a configuration without cloud access. A remote access to the network should be possible via a VPN setup in the UDM Pro? Or a seperate DNS server on the iot vlan?

For any heads up I’d be more than grateful and we could all together impress my wife with more than one shelly controled via smartphone :smiley:

Cheers! Marc

Hello Villanelle,
Welcome to the HA Forums.
Maybe I can offer some advice.

Segmented networks are not officially supported within HA.

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) and if you are asking for support in the future, you should disclose to the volunteer helping you that this is in use as it often changes the correct answers.

Please keep this in mind when you are trying to do this kind of thing.

1 Like

I would recommend going for the container installation instead of HAOS. I’m using the Linuxserver image because it recommends running as non-root (I heard you can also set up the official image this way but the official guide recommends priviliged mode, which is a big no-no). https://hub.docker.com/r/linuxserver/homeassistant

As for the networking problem, prefer using stuff that can’t connect to LAN/internet, like Zigbee devices. Obviously there might be some stuff that’s only available with WiFi, I don’t know what’s the best way for managing those.

1 Like

Thanks for the input. I’ll keep that in mind.

Nonetheless I hope for more insights concerning my problem.

Might this be a possibility?

@cr0muald0 , @BoneyAz could you point me in the right direction?

Hi, @Villanelle, sure thing. Do you have a more concrete question? :slight_smile:
That thread is huge, but contains many different perspectives and solutions to inspire you. I suggest a good read :slight_smile:
Multiple networks/VLANs configuration is already supported natively if you are presenting multiple interfaces (virtual ones count too) to HA. From what you’ve written before, it does not look like you are virtualizing HA (proxmox or something similar), so you will have to create your extra vlanned interfaces in the HA terminal, like this:

  1. Install the SSH & Web Terminal add-on, configure it according to instructions.
  2. Enter the terminal and run:
ha network -h

to have a list of commands and examples shown to you.

  1. Create your virtual vlanned interfaces, one per each network you want to separate, and have HA talk to it and its members.

If static IP:

ha network vlan REAL_INTERFACE_NAME VLAN_ID --ipv4-method static --ipv6-method disabled --ipv4-address IP/NETMASK --ipv4-gateway IP_GATEWAY --ipv4-nameserver IP_DNS

if DHCP:

ha network vlan REAL_INTERFACE_NAME VLAN_ID --ipv4-method auto --ipv6-method disabled 

Use only once the --ipv4-gateway IP_GATEWAY variable in the interface that you want HA to go to the internet (usually main LAN interface). Many/per interface defined gateways WILL bring you routing problems.

  1. Go to Settings / System / Network in HA and check if the interfaces/networks added are properly configured and setup. Choose the main adapter in this same page.

Your questions:

  1. Yes, it needs to stay in every VLAN you have devices. A normal “problematic” situation arises if you want to control media (Chromecasts, etc.) and you need to have it both in your LAN and IOT VLAN,
  2. Discovery will not work with a lot of extra config (mDNS comes to mind)
  3. Yes, all and any, wherever you will use HA
  4. Can’t see how…
  5. Remember all above! :slight_smile:
1 Like

Thanks a lot for your reply. I appreciate it.
Yes i installed ha os directly on the thin client. I did not use proxmox.
The 206 pages of the setup thread are a bit intimidating even more so I sometimes can’t figure out if all the answers apply to one concept of setting it up.

I’m still not clear if i leave my main vlan and the iot vlan with ha server completely separate and only access ha via app/ cloud/vpn. Or if i try to connect the vlans via firewall/…

I found also a promising german website describing two solutions: Home Assistant OS mit mehreren VLANs verbinden - nerdig.es

Marc

No worries :slight_smile: my german is really rusty, but I can tell you that the first question is just as simple as “Are you going to connect any equipment to HA in your main VLAN?” If so you’ll definitely have an easier time configuring stuff by just having two interfaces, one per VLAN. If not, just install it in your IOT VLAN and use firewall rules to controll traffic in and out of the IOT VLAN.

1 Like

Oh, and I just updated the VLAN configuration tutorial to better reflect the current HA status and procedures, so thanks for the push :slight_smile:

1 Like

This forum is great because of people like you who put so much effort in.

That’s what people in need are looking for :slight_smile: I too struggled with stuff (and still struggle to be fair) and I always got/get help from generous people. You just have to give back however you can, right? :slight_smile: and thanks for the props! Keep digging! :slight_smile: