mirror of
https://github.com/tommytran732/Pterodactyl-Script
synced 2024-11-09 05:01:33 -05:00
Blocking ICMP the better way
This commit is contained in:
parent
4ee2dc607d
commit
e2f5fbb115
@ -895,8 +895,13 @@ block_icmp(){
|
|||||||
output "[2] No."
|
output "[2] No."
|
||||||
read icmp
|
read icmp
|
||||||
case $icmp in
|
case $icmp in
|
||||||
1 ) /sbin/iptables -t mangle -A PREROUTING -p icmp -j DROP
|
1 ) if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
|
||||||
(crontab -l ; echo "@reboot /sbin/iptables -t mangle -A PREROUTING -p icmp -j DROP >> /dev/null 2>&1")| crontab -
|
sed -i '/ufw-before-input.*icmp/s/ACCEPT/DROP/g' /etc/ufw/before.rules
|
||||||
|
sudo ufw reload
|
||||||
|
elif [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "rhel" ]; then
|
||||||
|
firewall-cmd --permanent --add-icmp-block-inversion
|
||||||
|
firewall-cmd --reload
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
2 ) output "Skipping rule..."
|
2 ) output "Skipping rule..."
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user