Disable PING (ICMP) Response On Linux System

Posted: August 7, 2013 in Uncategorized

You can setup kernel variable to drop all ping packets. Type the following command at shell prompt:

[root@afzalkhan ~]#echo “1” > /proc/sys/net/ipv4/icmp_echo_ignore_all

This instructs the kernel to simply ignore all ping requests (ICMP type 0 messages).

[root@afzalkhan ~]#echo “0” > /proc/sys/net/ipv4/icmp_echo_ignore_all

This instructs the kernel to allow all ping requests from remote.

You can add following line to /etc/sysctl.conf file to make this changes permanently.

[root@afzalkhan ~]#vi /etc/sysctl.conf 
net.ipv4.icmp_echo_ignore_all = 1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s