Change a running kernel parameter

Lets say you have disabled a server’s response to pings in /etc/sysctl. You can verify this setting with this command:

$ sysctl net.ipv4.icmp_echo_ignore_all
net.ipv4.icmp_echo_ignore_all = 1

The presence of the “1” indicates that this setting is turned ON. To disable it, run the same command with the -w flag and set the boolean value to zero:

$ sysctl -w net.ipv4.icmp_echo_ignore_all=0

Now you should see the value has changed to 0 or “off.”

$ sysctl net.ipv4.icmp_echo_ignore_all
net.ipv4.icmp_echo_ignore_all = 0