Ping command broken in Nix repls

Problem description:
Whenever attempting to run the ping command on any target within a Nix-based repl, a permission denied exception will occur.

Expected behavior:
The ping command will go through and test the availability of the target machine.

Actual behavior:
I’ve tested this with any of the available Nix packages that implement ping:


In every case, a permission denied exception will occur. Below are some sample outputs:

  • Toybox

ping: socket SOCK_DGRAM 1: Permission denied
Kernel bug workaround:
echo 0 99999999 | sudo tee /proc/sys/net/ipv4/ping_group_range

  • IPUtils

ping: socket: Operation not permitted

  • Busybox

PING ( 56 data bytes
ping: permission denied (are you root?)

Steps to reproduce:
Create a new Nix-based repl, install one of the packages that implement ping, and execute ping on any target within the shell.

1 Like

Hi @akac

The Repl would not be able to ping an external site. Can you give more details about what you are trying to use ping for?

I’m sending this bug report on behalf of another person.

Their school does computer science assignments through Replit, and a specific assignment requires the usage of network tools, such as ping, nslookup and traceroute. The students are capable of using everything besides ping, which returns the above mentioned errors.

The school deducted that repl blocked ping to prevent possible DDoS attacks from replit (which is completely understandable).

Could you confirm if this is the reason why ping might be intentionally blocked on Replit?

No problem. Each repl is self contained. For security reasons it wouldn’t make sense to allow ping or other network tools.

If your school has Windows 10 they can install wsl which is Ubuntu. From here you can access all the network tools you wish!

Or they can install Oracle VirtualBox or similar and set up Virtual Machines.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.