Centos7永久禁ping

永久禁用ping

设置禁ping

vim /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all = 1

刷新配置

sysctl -p

永久启用ping设置

vim /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all = 0

刷新配置

sysctl -p