To unblock the ping requests, again run the same command by changing the parameter value to default '0'. Alternatively, you can block the ping requests by changing the kernel parameter value in the /proc/sys directory using the echo command.
However, to use this method, you will need to run the command as root.
To block ping requests on CentOS:
- Edit /etc/sysctl.conf. Add the following line to your /etc/sysctl.conf : net.ipv4.icmp_echo_ignore_all=1. Then: sysctl -p.
- Using iptables: iptables -I INPUT -p icmp --icmp-type echo-request -j DROP.
- With cron. Run crontab -e as root, then add the following line: @reboot echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all.
https://linuxapt.com/blog/31-block-unblock-ping-requests-to-ubuntu-server-20-04-lts