0

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.

Gilson PJ
  • 101
  • 6

1 Answers1

1

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
Keftef
  • 96
  • 1
  • 8
  • 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. – Gilson PJ Sep 20 '21 at 12:19