HA installation and Vlans

Hello,

A small question about network and HA installation.

I have a unify network with different Vlans.
CORE: my PCs, server (OMV with Docker), KNX gateway
IOT: all my IOT (Google assistant, Heos, roborock etc)
SEC: security camera etc.

I want to install HA on my server (vlan Core) with Docker/Portainer and Macvlan to assign an unique IP to each of my Docker containers.

Is it possible to mount HA with 2 IPs on two different Vlans (CORE and IOT) to “see” my KNX gateway and my IOTs elements without playing with firewall rules etc? If it is possible, is it safe?

ANother question regarding the Databases forr HA. Would you install these ones on the same Vlan as HA or on a dedicated Vlan ?

Thanks

BR

If you run HA Core it works fine.

You’ll need to run the container with host networking. Knx won’t work otherwise.

Hello Callifo

Thanks for your answer. I want to use HA core yes.

I’m not an Docker/portainer expert, so something like this could work?

version: "2"
services:
  homeassistant:
    container_name: "Home-Assistant"
    image: homeassistant/home-assistant:stable
    restart: always
    volumes:
      - /srv/dev-disk-by-label-Media/AppData/HomeAssistant:/config
    environment:
      - TZ=Europe/Paris   
    hostname: 'Home-Assistant'
    networks:
      macvlan_HA_CORE:
       mac_address: 02:42:ac:11:00:11
       ipv4_address: 10.10.70.103 
      macvlan_HA_IOT:
       mac_address: 02:42:ac:11:00:12
       ipv4_address: 10.10.55.103 
        
networks:
  macvlan_HA_CORE:
    external:
      name: MacVlan_CORE
  macvlan_HA_IOT:
    external:
      name: MacVlan_IOT

I’ve got to be honest, I’m not sure what you just posted?

HA Core does not use docker, its just a vanilla install of HA on python.

I not the best at LAN networking but I think you may potentially run into routing issue at some point.

How HA known WAN is eth0 vs eth1? Maybe it not matter if reachable at both.
Can 10.10.70.0 normally access 10.10.55.0? If so, how you prevent the loop by HA when it try use 10.10.70.103 to reach device at 10.10.70.30?

Is your database in same host server as HA?
If so maybe just use docker networking

Also they may be mostly dependant on services external to host connecting with DB. Use whatever is most convenient.

The docker container is a python base with HA core

Hello @tmjpugh

I’m quite sure we can create multiple Vlans using MacVlan and use them without any issue with Docker container. But I’m neebie with Linux and docker/Portainer, so difficult for me to implement.

see this link: Docker Networking: macvlans with VLANs – HiCube

For Database, I will install them on the same host server than Home Assistant (OMV with docker container) but I would like to access to them with other PC so I think I will also use a MacVlan network for them.

BR

That’s called Home Assistant Container.

Home Assistant Core is, as callifo described, simply python code. So if the discussion involves docker, it can’t be about Home Assistant Core but about Home Assistant Container or even Home Assistant Supervised or Home Assistant OS. Of the four, only Home Assistant Core doesn’t involve the use of docker.

If you want to use Home Assistant Core then it isn’t distributed as a docker container (just python code).

Given the docker-compose file you posted, what you want is Home Assistant Container.

I only specifically said HA Core as thats what I use and I can verify it works well. I have no experience with the other deployment options so I cannot confirm or deny that is works with those.

Hello all

I’m a newbie with HA so I probably don’t use the good denomination. In my docker compose I use the following image: homeassistant/home-assistant

But my main problem is not how to deploy HA but how to affect two virtual MacVlan to my HA installation…

And for this part, I don’t know how to do that.

BR