ICMP/Ping works even after adding iptables drop rule
We have an application which will configure network interface as well as iptables rules based on user configuration. Please find the iptables rules after configuring with the application
Even after adding this rule we can able to ping 10.10.10.10 from test PC. Why iptables fails to drop ICMP?
Note: I have changed the eth0 IP address and switch back to 10.10.10.10 immediately using ifconfig command and observed that iptables started blocking ICMP.
Execute the bellow as root or with sudo:
iptables -A INPUT -s {PING_FROM_IP_YOU_WANT_TO_BLOCK} -p icmp -j DROP
will block all ping(icmp requests) from a the specified IP.
The following to block all ICMP:
iptables -A INPUT -p icmp -j DROP
Basically omitting the ip will bock ALL ping requests.
to remove the following active firewall rule:
iptables -A INPUT -p icmp -j DROP
change the -A (append) to -D (delete)
iptables -D INPUT -p icmp -j DROP