podman-default

When you run the ping command inside a container it returns Operation not permitted.

root@debian:/# ping example.com
bash: /usr/bin/ping: Operation not permitted

You “must verify that the UID of the user is part of the range in the /proc/sys/net/ipv4/ping_group_range file.”

“To change its value the administrator can use a call similar to: sysctl -w "net.ipv4.ping_group_range=0 1000".”

Then, if ping its not yet available, you need to add NET_RAW capability to the container:

podman run -it --cap-add=NET_RAW custom-debian /bin/bash

Finally you must be able to use ping command.

root@debian:/# ping -c1 example.com
PING example.com (93.184.216.34) 56(84) bytes of data.
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=1 ttl=255 time=105 ms

--- example.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 104.969/104.969/104.969/0.000 ms

Reference