How disable response to ping from RedHat

We will need to change following kernel parameter to configure our RedHat server so that it does not respond to any ping request :

net.ipv4.icmp_echo_ignore_all

We  can do it using sysctl command :

sysctl -w net.ipv4.icmp_echo_ignore_all=1

Let us see if it changed :

sysctl net.ipv4.icmp_echo_ignore_all

net.ipv4.icmp_echo_ignore_all = 1

We can also do it  in /proc folder :

cat /proc/sys/net/ipv4/icmp_echo_ignore_all

1

Because changes to the /proc filesystem are temporary we need to add following  entry at the end of /etc/sysctl.conf file if we want them persist across reboots:


net.ipv4.icmp_echo_ignore_all=1

and save the file.

Now our system will not respond to any ping request any more.

Leave a Response