Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Thanks. The capability flag fixes the error. But after doing some reading, I still don't understand why it's needed for Ubuntu image, but not Alpine/Fedora. As far as I understand, CAP_NET_RAW is required to use ping via SOCK_RAW, but if net.ipv4.ping_group_range is configured correctly you can still use ping via SOCK_DGRAM. I also verified this on an Ubuntu host by removing the NET_RAW capability, I was still able to use ping. Only after removing my user from ping group range, ping stopped working. For some reason, only on an Ubuntu container, you must have NET_RAW capability.
    – epokhe
    Commented Oct 11, 2022 at 16:12
  • By some way described in superuser.com/a/1702188/1737591 you always have to grant the ping executable the required permissions. This is just mostly taken care of by the package or image maintainers.
    – Sascha S.
    Commented Oct 14, 2022 at 20:08