Hi guys, I have a question, maybe some of you can help me out. Hassio is running on docker on Ubuntu 18.04 on a nuc. Now I want to run a container (outside of the Hassio environment) which also needs bonjour support, and thus needs UDP port 5353. HA already uses that port, so docker cannot bind the port to the new container. What I’ve tried to do so far to work around this is use multiple ip’s on my host system: i have an original ip (ip1) and have added a virtual ip (ip2) to the system and assigned it to the bridge interface. So the new container goes on the standard bridge network and gets a portmap based on that ip explicitly and i can do a port map of ip2:5353, but that still fails to bind. Then i recreated the hassio docker network, with explicit assignment of ip1. So now, all hassio containers have port mappings of ip2:portx, so far so good! But still port 5353 is not free because docker still maps to HA as 0.0.0.0:5353
netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 213376 0 0.0.0.0:5353 0.0.0.0:* 23286/python3
I am probably making some wrong assumptions. Is it possible to make HA only listen on a certain interface instead of 0.0.0.0?
Does anyone have some ideas? Thanks!
Did you manage to fix your problem? I don’t have another container that needs port 5353 udp, but if I run home assistant in net=host mode, then I end up with your same issue: hass is binding to multiple 0.0.0.0 interfaces and this leads to UDP4 socket memory issue.
I had to remove the host mode, but this way I lose a lot of discovery functionalities, including ps4 and being able to turn on my lg tv.
Hi, I fixed my problem by creating a seperate macvlan on my host, then assigning a docker network to that interface. My other container (logitech media server) now has a seperate ip stack and a ip address from my lan, and it can do port forwarding now on it’s own. I haven’t touched my hassio install, so this might not make any difference for you.
Just for follow up, in case someone might find it usefull:
this is my entry in /etc/network/interfaces:
auto macvlan0
iface macvlan0 inet static
pre-up ip link add macvlan0 link eno1 type macvlan mode bridge
address 192.168.6.46/32
up route add -net 192.168.6.40/29 dev macvlan0