Linux系统-禁ping

1) Add the following line to your /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_all=1

Then :

sysctl -p

2) Using iptables:

iptables -I INPUT -p icmp --icmp-type echo-request -j DROP

3) The cron job way , run crontab -e , then add the following line:

@reboot echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all

Start and enable the service:

systemctl start cron.service
systemctl enable cron.service
上一篇:spring的annotation-driven配置事务管理器详解


下一篇:Android 开发第四天