Thursday 23 July 2020

How to Enable/Disable Ping using iptables on Debian 10

Disabling Ping with iptables


ping 127.0.0.1

$ sudo iptables -A INPUT -p icmp --icmp-type echo-request -j REJECT

$ iptables -L

ping 127.0.0.1

Enabling Ping in iptables

$ sudo iptables -D  INPUT -p icmp --icmp-type echo-request -j REJECT

ping 127.0.0.1