Block ping using iptables in Ubuntu

nano /etc/sysctl.conf
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


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.