CentOS禁止ping


禁止ping

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo "echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all" >> /etc/rc.d/rc.local  # 添加开机自启动


允许ping  

echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all


CentOS7开机自启动脚本


文章最后更新时间: 2021-12-06 21:47:31