Console logo

Introduction

Ping is really useful, when you want to diagnose a network, to be sure you are able to reach a given computer, the good thing about ping is that it lets you know that both ways uplink and downlink are working.

Ping works by sending a package from the originating computer to the receiving one, once it reach the receiving computer, that “computer” (better call it device), respond with a similar message.

That way you are sure the path is working and that there is an IP enabled device on the other side.

But, that is also a security issue, as if someone else knows there is a device on the other side, can start an attack to that device.

So, once everything is working it may be a good idea to disable ping response. If your device is a computer and it is powered by Linux Operating System you can do it easily.

Stop ping response in Linux

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

And it is disabled, I have tested on Slackware and on Arch Linux and it works, it should work on other distributions as well, if it is different in some distribution you are working on, please share in the comments.

Re-enable ping response

echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all

You may add this line to the /etc/rc.local to make it permanent.