Is there a away to ban all signups from an ip?

We’re ahving problems with a specific IP spaming our site, they’ve gotten ahold of our signup code and we need to ban all users from their ip.

Anyway to do that?