I am practicing with iptables and... I need a rule that will block a certain host from pinging me but will let me to ping the host if needed (so I need to accept ping responses right?). Can you help me?

link|improve this question

44% accept rate
Some context, please. What is your current iptables ruleset (the output of iptables-save) ? – Steven Monday Dec 5 '10 at 0:00
feedback

2 Answers

You can block ping (icmp echo requests) from all hosts using this

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

If you want to block a particular host then

iptables -I INPUT -s 192.168.1.139 -j DROP -p icmp --icmp-type echo-request
link|improve this answer
feedback

Have a look at this page.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.