# ---------- НАСТРОЙКА UFW ----------
echo y | sudo ufw reset
sudo sed -i 's/^IPV6=.*/IPV6=no/' /etc/default/ufw
ufw limit 4162/tcp

ufw allow from 185.71.81.102 to any port 9100
ufw allow from 77.110.112.21 to any port 9873
ufw allow from 84.252.101.89 to any port 9873
ufw allow 80/tcp
ufw allow 443/tcp

ufw default deny incoming
ufw default allow outgoing
sudo sed -i '/^-A ufw-before-.* -p icmp --icmp-type \(destination-unreachable\|time-exceeded\|parameter-problem\|echo-request\) -j ACCEPT/s/^/# /' /etc/ufw/before.rules
sudo sed -i "/^# don't delete the 'COMMIT' line or these rules won't be processed/i \
# ok icmp codes\n\
-A ufw-before-input -p icmp --icmp-type destination-unreachable -j DROP\n\
-A ufw-before-input -p icmp --icmp-type source-quench -j DROP\n\
-A ufw-before-input -p icmp --icmp-type time-exceeded -j DROP\n\
-A ufw-before-input -p icmp --icmp-type parameter-problem -j DROP\n\
-A ufw-before-input -p icmp --icmp-type echo-request -j DROP\n" /etc/ufw/before.rules

ufw --force enable
ufw status verbose
