Посмотреть с каких IP сколько соединений
sudo netstat -ntu | awk '{print $5}' | grep -vE "(Address|servers|127.0.0.1)" | cut -d: -f1 | sort | uniq -c | sort -n| sed 's/^[ \t]*//'
Добавить IP в бан
sudo iptables -A INPUT -s IPADDRESS -j DROP
Сохранить
sudo /etc/init.d/iptables-persistent save
sudo sh -c 'sudo iptables-save > /etc/iptables/rules.v4'