I need to block about 10 000 IP addresses in my firewall, I have all IP addresses in file, so I run this command from command line:
while read line; do sudo ufw insert 1 deny from $line; done < IP_addresses
And it works, it inserts rules, but it is very slow, it inserts about 1 rule per second, is possible to make it faster?
It is running on Debian 9 with 1 CPU core of Xeon (VPS).