Score:0

ICMP/Ping works even after adding iptables drop rule

ca flag

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

enter image description here

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.

Score:1
us flag

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
ca flag
I am sorry the actual question is not about how to block ICMP. The rules are added properly with commands but ICMP is not blocked. User still able to ping with the IP.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.