Many malicious attacks begin with a ping scan. Disabling ICMP echo requests prevents your system’s discovery with a ping.
Disable ICMP echo responses temporarily
You can temporarily disable the ICMP using the following method but this setting will be erased after the reboot.
root@lifelinux:~# echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
Also, to enable the ICMP echo responses back, type the following command:
root@lifelinux:~# echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
Disable ICMP echo responses permanently
You can permanently disable the ICMP echo reponses using the following method:
Edit the sysctl.conf file:
root@lifelinux:~# vi /etc/sysctl.conf
And add the following line:
net.ipv4.icmp_echo_ignore_all = 1
After that, execute sysctl -p to enforce this setting immediately:
root@lifelinux:~# sysctl -p
The above command loads the sysctl settings from the sysctl.conf.
Related Posts:
- How Do I Disable The Ping Response On Linux?
- How To Enable IP Forwarding On CentOS / RedHat
- How To Install Lighttpd And PHP (PHP-FPM) On CentOS 6
- How To Install Nginx And PHP-FPM On CentOS 6 Via Yum
- How To Install Nginx And PHP (PHP-FPM) On CentOS 6
- How To Increase The Number Of PTY (Pseudo-Terminal Driver)
- How To Increase PHP Memory Limit
- MySQL Slow Query Log File
- How To Install Rootkit Hunter
- How To Install ionCube Loader