So as you can see, we have two “types of brute force attacks” those which use dictionary and those that does not. With this technique we will be protected from both of them. More here
This technique, uses iptables to block a particular IP, that has passed the threshold of a certain number of connections in a given period of time.
I will show here, some basic IPtables rules to protect a web server from brute force attacks, but this example can be adapted to other scenarios.