Saturday, March 19, 2011

How to Block Ping/ICMP request on Linux box

We can make Linux box to ignore ping requests by edit the /etc/sysctl.conf file and add the below line,

net.ipv4.icmp_echo_ignore_all = 1

else use the below command to append the entry

# echo "net.ipv4.icmp_echo_ignore_all = 1" >> /etc/sysctl.conf

To activate the kernel parameters added in /etc/sysctl.conf file immediately at runtime, use below commands

# sysctl –p

Now the box which you have added the above parameter will not be pingable, it ignores the icmp requests.