Trouble SSHing From a Docker Container to My Local Network

0
15
Asked By TechieLlama7 On

I'm trying to execute a shell command in my Dockerized Home Assistant that SSHs into a remote Raspberry Pi, primarily to trigger Squeezelite from the HA server. However, even when I run the container in host network mode, I still can't reach any devices on my local network. Interestingly, I can SSH from the server outside of the container without any issues. Any ideas on what might be going wrong?

3 Answers

Answered By CleverPineapple42 On

Have you considered using Tailscale? It allows SSH over Tailscale, which might help you connect without direct LAN access.

Answered By CuriousOtter56 On

You might want to run a traceroute to see if the packets are being dropped somewhere. When using host networking, your container should essentially have the same IP as your host. It's worth checking if they coordinate correctly.

Answered By UserFriendlyBear91 On

That’s pretty odd, since host mode should let your container work as though it’s on the host network itself. Have you tried pinging the Raspberry Pi from inside the container? Sometimes SSH fails because of the 'known hosts' prompt or if you forgot to mount your SSH keys into the container.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.