Block ping using iptables in Ubuntu

nano /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all=1
sysctl -p
sudo iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
sudo iptables -A OUTPUT -p icmp --icmp-type echo-reply -j DROP

then Make iptables rules persistent after reboot on Ubuntu 18.04

References
https://vitux.com/how-to-block-allow-ping-using-iptables-in-ubuntu/
http://ubuntuhandbook.org/index.php/2013/07/disable-ping-response-ubuntu-server/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.