Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/bin/ping does not work without --cap-add=NET_RAW (podman on RPi) #580

Closed
jghaines opened this issue Dec 20, 2024 · 4 comments
Closed
Labels

Comments

@jghaines
Copy link

Describe The Bug

Environment is:

pi@raspberrypi $ podman --version
podman version 4.3.1
pi@raspberrypi $ uname -a 
Linux raspberrypi 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux

Compare the following commands:

pi@raspberrypi $ podman run --rm --network=host  --entrypoint "/bin/sh" docker.io/homebridge/homebridge:2024-12-19 -c "ping -c 1 8.8.8.8"
/bin/sh: 1: ping: Operation not permitted
pi@raspberrypi $ podman run --rm --cap-add=NET_RAW --network=host  --entrypoint "/bin/sh" docker.io/homebridge/homebridge:2024-12-19 -c "ping -c 1 8.8.8.8"
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=58.3 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 58.320/58.320/58.320/0.000 ms

Some homebridge plugins such as kiwi-cam/homebridge-broadlink-rm-pro rely on the node-ping library which in turn relies on CLI ping.

I suggest updating the documented docker run command to include --cap-add=NET_RAW

Docker Config

podman run --rm --network=host  --entrypoint "/bin/sh" docker.io/homebridge/homebridge:2024-12-19 -c "ping -c 1 8.8.8.8"

Logs

No response

Host Operating System

Raspberry Pi OS - Latest

Host Architecture

aarch64 / arm64

@NorthernMan54
Copy link
Contributor

Humm... I can't recreate your original issue, also on my RPI 5 running a recent RPI Image

cat /etc/os-release 

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

sudo docker run --rm --network=host  --entrypoint "/bin/sh" docker.io/homebridge/homebridge:2024-12-19 -c "ping -c 1 8.8.8.8"
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=22.0 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.032/22.032/22.032/0.000 ms

@jghaines
Copy link
Author

Humm... I can't recreate your original issue, also on my RPI 5 running a recent RPI Image

I wonder if this a podman vs docker problem. I'll see if I can test

@jghaines
Copy link
Author

I used the same hardware setup and used docker instead of podman. It does appear to be a podman specific issue.

pi@raspberrypi:~ $ docker --version
Docker version 27.4.1, build b9d17ea
pi@raspberrypi:~ $ uname -a 
Linux raspberrypi 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux
pi@raspberrypi:~ $ docker run --rm --network=host  --entrypoint "/bin/sh" docker.io/homebridge/homebridge:2024-12-19 -c "ping -c 1 8.8.8.8"
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=58.2 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 58.160/58.160/58.160/0.000 ms

@NorthernMan54
Copy link
Contributor

Okay, will close this and the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants