I have set up two wake on LAN and one ping device presence sensor in my configuration, but they do not seem to ever turn on, even if the devices are online.
Is there a setting I need to enable to allow pings from the container?
I’m using Portainer, Host networking and HA 2021.11.5.
Wake-on-LAN magic packets are mutlicast packets, which require special rules set up for it to be routed between the internal docker network and the host network.
Sorry, I have avoided containers and VMs for that reason.
I tried first with a docker solution, but multicast WOL and multicast Discovery was an issue and having to make it being routed from first the docker network to the host network and then to a second VLAN was too much for me, so jumped the low fence.
Well, ping packets are actually using a icmp protocol and not the standard tcp or udp protocol, that are used most often for network communication, so maybe you are missing a routing configuration for those kind of packets.
Pings work on Home Assistant OS, and Home Assistant Supervised. Both run all the parts of Home Assistant in multiple Docker containers, so I can confidently state that pings absolutely work in docker containers.
Update!
Running chmod u+s /bin/ping inside of the container fixes this issue.
Not sure if if persists between image updates, though. I have a feeling it doesn’t.
Yup. That’s the fix - I re pulled the image, it stopped working, ran the command, it started working. How odd. I’ll have to see if I can make an issue.
Update,
After a chat on Discord, It seems that Portainer mangles containers and that was part of the root cause for this issue.
I’m now moving to Compose files.