Arun’s Weblog

Feel power of linux Ubuntu

Disable or drop all ping packats all together

Posted by arun161087 on September 4, 2008

Generally you can use iptables to block or allow ping requests.

You can setup kernel variable to drop all ping packets. Type the following command at shell prompt:
# echo “1″ > /proc/sys/net/ipv4/icmp_echo_ignore_all

This instructs the kernel to simply ignore all ping requests (ICMP type 0 messages). To enable ping request type the command:
#echo “0″ > /proc/sys/net/ipv4/icmp_echo_ignore_all

You can add following line to /etc/sysctl.conf file:
# vi /etc/sysctl.conf
Append following line:
net.ipv4.icmp_echo_ignore_all = 1

Save and close the file.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>