Rootless docker: ping from within container is way faster than host's ping
retained text
Hey, I'm trying to monitor my ping to external servers using BlackBox and I'm running into an issue that seems to be a general docker issue:
I'm running rootless docker and did this simple test:
$ docker network create ping-test
e4b47f5a00d890828f84b688d5490b6addfc465b892762381ba9a149d5095e81
$ docker run --rm --network ping-test alpine ping -c 10 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=63 time=0.997 ms
64 bytes from 1.1.1.1: seq=1 ttl=63 time=0.716 ms
64 bytes from 1.1.1.1: seq=2 ttl=63 time=0.642 ms
64 bytes from 1.1.1.1: seq=3 ttl=63 time=2.441 ms
64 bytes from 1.1.1.1: seq=4 ttl=63 time=0.800 ms
64 bytes from 1.1.1.1: seq=5 ttl=63 time=0.691 ms
64 bytes from 1.1.1.1: seq=6 ttl=63 time=3.087 ms
^C
--- 1.1.1.1 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 0.642/1.339/3.087 ms
These ping times are wayyyy to low. When doing a ping directly on the host, I get around 10ms.
On another host that runs rootful docker this issue doesn't occur (ping inside of the container and host's ping are roughly the same).
Only similar issue I found was [this issue](https://forums.docker.com/t/ping-from-within-a-container-does-not-actually-ping/11787) from 2016 but that bug must have been fixed by now 😅
Is there any way to fix this without returning to rootful docker? Or is this just a limitation with rootless docker?document fetched 2026-11-02 00:32 · canonical https://reddit.com/r/docker/comments/1xkrtjn/rootless_docker_ping_from_within_container_is_way