Tcpdump installation

Folks,

pardon me if this is a stupid question, but how do I install tcpdump on my Pi running HA (I installed it using the prebuilt hassios image). I can ssh into HA and the host (using port 22222), but cannot find any means to install packages, there is no apk or apt command that I can find (extensive Google searches have shown others using these but they are not on my installation). I’m trying to debug some connectivity issues and tcpdump is what I need, but cannot get it. Thanks in advance, Colin.

Well, turns out it was a bit of a stupid question. I was trying to use apk when I was ssh’d into the developer port (22222) which gives root access to the host system - apk is not available there. When I did a regular ssh on port 22 into HA I was able to get tcpdump installed via apk. Has done me no good though, as all I can see from there is 172 network, and not the host 192 that I need to be able to debug my connectivity issues…

Hi Colin, have you managed to figure this one out as I’m looking at the same issue right now…

docker ps

find the container ID that is running homeassistant like “ghcr.io/home-assistant/raspberrypi4-64-homeassistant:2023.1.2

#then connect to the given docker using:
docker exec -it <container_id> sh

install tcpdump

apk update
apk add tcpdump

run tcpdump for example:

tcpdump -w dump.pcap host 192.168.0.22

you can scp the file somewhere and use for example wireshark to analyze it

1 Like

Victor, you deserve a gold star! Thanks for writing that up - exactly what I needed. I just discovered that you actually even had a linux shell in hassos. Running generic-x86-64 on an old HP think client T520 (I did bring up memory to 12G and drive to 120G). Amazed at how little CPU and memory is required with all those docker images running (I added mariadb, esphome, and node-red).