I'm trying to set up a shell command in my dockerized Home Assistant to SSH into a remote Raspberry Pi. The goal is to trigger squeezelite from the Home Assistant server. However, despite using the host network mode, I can't seem to access any devices on my local network from within the container, although I can access them without issue from the server outside the container. Any ideas on what might be going wrong?
3 Answers
That's really strange! When you're in host mode, the container should have the same network access as the host machine. Have you tried pinging the Raspberry Pi from inside the container? Sometimes, it might just be an SSH issue like the 'known hosts' prompt, or you may have forgotten to mount your SSH keys into the container.
Have you considered using Tailscale? It can be a great way to manage SSH connections, especially over local networks. Just a thought!
You might want to run a traceroute just to diagnose where the connection is breaking down. If you’re on host mode, the container should appear as another device on your LAN, so check if the IPs are the same and if you can reach them from the host.

I attempted to ping, but it just stalls out. I get 100% packet loss. It seems odd because I can SSH from outside the container, so I doubt it's a network issue.