How to disable ping… in Linux servers
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
Or add the line
net.ipv4.conf.icmp_echo_ignore_all = 1
in /etc/sysclt.conf
To re-enable ping
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
Or add the line
net.ipv4.conf.icmp_echo_ignore_all = 0
in /etc/sysclt.conf
Alternatively, we can use IPtables to disable ping
# iptables -A INPUT -p icmp -j DROP
Or add the line
net.ipv4.conf.icmp_echo_ignore_all = 1
in /etc/sysclt.conf
To re-enable ping
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
Or add the line
net.ipv4.conf.icmp_echo_ignore_all = 0
in /etc/sysclt.conf
Alternatively, we can use IPtables to disable ping
# iptables -A INPUT -p icmp -j DROP
0 Comment:
Post a Comment