I've seen various guides out there for how to nullroute a single IP address, and I've done that before. However, I'm not sure how to nullroute a group of IP addresses. Going through each one individually would be too tedious.
If I have a text file with an IP address on each line, how would I nullroute all addresses in that file? Is there a command for route
or iptables
that I can use? I'm running a Debian VPS.
Also, I read somewhere that this method may not be the best way to ban a group of IPs. If there's a better way to accomplish this, please let me know. I've been having spam attacks on my server.