I have a database in a dedicated server (CentOS 7) setup by an external provider. I see a disgusting amount of brute-force attempts in MySQL log file every day. I know the best option would be to not connect remotely (and close the port), but I need to.
My IP at home is dynamic but the first 2 bytes are the same. Can I block IPs that are outside of this range? Should this be done for the server in general, or is there a way to do it for MySQL only?
As a note, my provider has access to the server from a static IP, so I would whitelist it, in case my home IP changes and I get locked out.