1
sudo su

Disable ping:

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

or

1
iptables  -I  INPUT  -i  ech0  -p   icmp  -s  0/0  -d  0/0   -j  DROP

To re-enable ping:

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

or

1
iptables  -I  INPUT  -i  ech0  -p   icmp  -s  0/0  -d  0/0   -j  ACCEPT

To make it permanently, edit the “etc/sysctl.conf” file so that the setting gets picked up at boot time.

1
net.ipv4.icmp_echo_ignore_all=1