linux disables implementation instances of ping

  • 2020-06-07 05:55:07
  • OfStack

linux disables implementation instances of ping

1. The command to temporarily forbid PING operation is: #echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

2. Permanently disable the PING configuration method


  /etc/sysctl.conf  add 1 line 

   net.ipv4.icmp_echo_ignore_all=1

    perform sysctl -p To take effect 

Firewall mode:

1. PING setting is allowed


     iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT

    iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT

Or you can temporarily stop the operation of the firewall.


  service iptables stop

2. Disable PING Settings


  iptables -A INPUT -p icmp --icmp-type 8 -s 0/0 -j DROP

Thank you for reading, I hope to help you, thank you for your support to this site!


Related articles: