How To Disable Ping Responses / Replies In Linux


Irrespective of your reason, if you are trying to disable ping responses / replies in Linux temporarily or permanently, then here are the ways. All you need to do is run a couple of commands and your done with the disabling process.

how-to-disable-ping-responses-in-linux

DISABLE PING RESPONSES / REPLIES IN LINUX PERMANENTLY

In order to disable ping responses / replies in Linux permanently, all you need to do is follow the below steps:

STEP 1: First, you need to edit the sysctl.conf file, and simply add the below line to it.

net.ipv4.icmp_echo_ignore_all = 1

STEP 2: Now, when you are done with the editing part, you need to run the command sysctl –p, which will actually activate the changes done by you in the sysctl.conf file.

DISABLE PING RESPONSES / REPLIES IN LINUX TEMPORARILY

In order to disable ping responses / replies in Linux temporarily, you need to run one simple command, which is

# echo “1” >  /proc/sys/net/ipv4/icmp_echo_ignore_all

That is all.

These were the ways to disable ping responses / replies in Linus permanently and temporarily. They are simple and quick, so regardless your reason to block the responses in Linux, you can simply follow these methods and find that when somebody tries to ping your machine they will end up waiting without getting a ping reply packet.

Filed under: Linux
Tags: , , ,
December 9, 2010 by: Prasanth Chandra

Leave a Reply