Jump to content

[SOLVED] Is it possible to run a Docker as Host in a VLAN?


DZMM

Recommended Posts

I have setup VLANs in unraid, so I have dockers running across br0, br0.10 (MGMT), br0.20 (VPN) and br0.30 (CLRNET) with corresponding network ranges 172.30.12.0/24, 172.31.12.0/24, 172.32.12.0/24 and 172.33.12.0/24.

 

The problem I have is my Home-Assistant docker has to run as Host, so it's currently at 172.30.12.2:8123.  However, it can't communicate with my other dockers that have been given IP addresses on br0 -->br0.30. All of these dockers can communicate with each other, just not with the dockers on br0 or running as Host who haven't been assigned an IP address.

 

Is there a way around this e.g., get Home-Assistant running as Host but on br0.10 (172.31.12.x:8123) rather than br0 (not even sure if this makes sense) so it can communicate with the other dockers?  Or, is there another solution?

 

The big problem I have is with Letsencrypt which I've assigned an IP to so it can speak to dockers that are running in my VPN Vlan br0.20.  It means I can't control my Smart home from outside my LAN, unless I connect to my VPN-server.

 

Thanks in advance for any help

Link to comment

It is a design implementation of Docker that the host (containers) can not communicate with the custom (macvlan) networks.

 

You could set (all) your containers as custom (macvlan), which will give each of them a unique address, either fixed or dynamic and allows communication between them.

 

Link to comment

Thanks for replying.  I tried assigning a unique IP address to HA, but its connection to smartthings (I run another docker to run as a bridge between smartthings and Mqtt, and then mqtt talks to HA) didn't work properly - HA would get updates from ST, but changes in HA e.g. turning a light on wasn't flowing to ST.

 

I'll have another go later, as the problem might not have been HA and could actually be one of the other dockers, although it seemed weird that HA could 'receive' but not 'send'

Link to comment

I've just been trying to fix and ST-->ST-Bridge-->MQTT-->HA is working and in the logs I can see that messages from HA are making it to ST-Bridge (HA-->MQTT-->ST-Bridge), but not from ST-Bridge-->ST, so I don't think the problem is HA.

 

In setting up the ST-Bridge I had to enter the IP address and the Mac address of the bridge.  When a docker is assigned a new IP address, what mac address does it get?  I'm assuming it's a different one to the unraid IP address?  If so, where do I find the mac address of a docker?

Link to comment

My best friend google found me the answer:

 

docker inspect smartthings-mqtt-bridge

it spat out tonnes of information, but luckily the mac address was at the bottom so it was easy to find.  Popping the new mac address into the smarthings app solved the problem.

 

I guess my request now, is for the somewhere within unRAID for the new mac addresses to be found easily.

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...