One question that often comes up in forums is how you can cleanly block complete IP-areas already in the webserver. Since the solutions are often not quite perfect, I put together a small tool which will take care of this.
When you look through your webserver-logfiles and you want to block the access from the IP 18.104.22.168 for example, you should first figure out the start- and end-IP for the whole network. So you put in the IP 22.214.171.124 into Whois and will find out that this IP belongs to the serverhoster Hetzner which has the addresses 126.96.36.199 to 188.8.131.52 allocated to them (inetnum: 184.108.40.206 – 220.127.116.11). Seeing how servers are not usually welcome visitors you can decide on blocking the whole area.
Now you input the start- and end-IP into the tool and it will automatically calculate the correct CIDR-notation. Repeat this process until you have covered all unwanted areas and then copy the content into the .htaccess file on your own webspace.