Blocking user login after 3 tries

Is there a way to block an IP address for say 30 min after 3 failed login attempts? I have watched a couple of hackers running scripts try to login to my router. I have it set up so that admin can only get in from the lan side, but this doesn’t stop the hacker from trying to login. The last attempted break-in lasted for 2000 login attempts. I would eventually like it so that I can login from the wan, but there are many ways to set that up. Oh yeah, I’m running 2.9.5.

thats a briliant idea man…!
im 100% supported you man..!