Issue: Configure CentOS server to ignore pings. Ping is useful to would-be attackers, who use it to identify systems. Configuring systems to ignore pings, may help them maintain a more hidden disposition, it is not a certain tool to eliminate attacks. In fact, it can disrupt someone trying to troubleshoot network connectivity.
Solution: Use sysctl to change the default value (for kernel parameters) that control how the system responds to ping. In this case, turn it off with the following command (logged in as root):
sysctl -w net.ipv4.icmp_echo_ignore_all=1
The above command will result in an immediate no response to ping command. This will not survive a reboot.
To turn “ping responses” back on:
sysctl -w net.ipv4.icmp_echo_ignore_all=0