How to disable ping response – Linux

Usually a ping is used to check if a machine is up and to check the network status.

It is a small network packet sent to the machine. If the machine is up, an answer will be sent. The time needed to get the answer is called ping time or round-trip time.

The ping response from an IP indicates the machine is up.

Unfortunately this can be used to quickly scan an IP-range for reachable hosts.

This can be used to find potential hackable machines. If your machine doesn’t answer to pings, your chance to be seen is reduced. (That doesn’t mean your machine is more secure, the machine is just not that easy to be seen from the internet. Nothing more.)

Add the following line to your init script for the network (the name depends on the distribution you use):

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

This disables ping responses.

To reenable, use the following command:

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

To make this permanent set the following into /etc/sysctl.conf (if you have such a file)

net.ipv4.conf.icmp_echo_ignore_all = 1


3 Responses to “How to disable ping response – Linux”

  • unlock says:

    I have iptables up but this what it says;
    [root@hostname ~]# echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all
    -bash: /proc/sys/net/ipv4/icmp_echo_ignore_all: Operation not permitted

  • Truly insightful bless you, I am sure your current visitors could quite possibly want even more posts of the character maintain the excellent get the job done.

  • What i do not understood is if truth be told how you are not really much more well-appreciated than you might be now. You are so intelligent. You know thus considerably in the case of this topic, produced me for my part consider it from a lot of varied angles. Its like men and women are not involved until it’s something to do with Girl gaga! Your personal stuffs nice. Always deal with it up!


Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>