Iptables: how to drop incoming pings from host but allow ping responses?
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
Allow single ip using
iptables -A INPUT -s x.x.x.x -p ICMP --icmp-type 8 -j ACCEPT
Now drop ICMP packets from rest
iptables -A INPUT -p ICMP --icmp-type 8 -j DROP
Reference http://www.trickylinux.net/ping-single-ip-linux/