Linux.com

Home Linux Community Community Blogs Servers Disable/Enable ping response on a Linux machine

Disable/Enable ping response on a Linux machine

Few days ago I was dealing with SYSCTL (man sysctl) utility and I was looking for a certain kernel parameter, I wish to set it on the fly and I've found other useful information too.

sysctl is used to modify kernel parameters at runtime, one of these parameter could be ping daemon response, if you want to disable ping reply on your network you just simply need to issue something like:

~# sysctl -w net.ipv4.icmp_echo_ignore_all=1
net.ipv4.icmp_echo_ignore_all = 1
(root access required)

Now try to ping your machine, no replies at all, look nice isn't it ?
To  re-enable ping reply just issue:

~# sysctl -w net.ipv4.icmp_echo_ignore_all=0
net.ipv4.icmp_echo_ignore_all = 0
(root access required)

-w flag is used if you want to change some settings, take a look at kernel flags you can set at runtime (linux sources)

Ben 

 

Comments

Subscribe to Comments Feed

Upcoming Linux Foundation Courses

  1. LFS426 Linux Performance Tuning
    21 Apr » 24 Apr - Virtual
    Details
  2. LFS520 OpenStack Cloud Architecture and Deployment
    05 May » 09 May - Virtual
    Details
  3. LFD320 Linux Kernel Internals and Debugging
    12 May » 16 May - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board