Unable to use Ping command inside OpenShift containers

Solution Verified - Updated -

Issue

  • Error presented when attempting to use ping inside of a container:
$ oc rsh <my-container-with-ping> /bin/sh
# ping <upstream-address>
/bin/sh: 9: ./ping: Operation not permitted
  • Running container as privileged may allow ping to work periodically or not at all, running as nonroot/unprivileged constantly returns this not permitted error above.

Environment

  • OpenShift Container Platform (OCP) 3.11
  • OpenShift Container Platform (OCP) 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content