It is possible, but with many drawbacks.
First of all, you'd need to find a IP address range database mapping ranges to locations and then determine, if the location is correct -> not easy.
You could also pay a web service that will provide you with an API to check the same information (you don't have to manage a hundred megabyte database of IP ranges).
There will be many false calls each way -> some local users will not be able to connect and people from elsewhere could still reach your board, it's a minority of users if you set up the first step correctly, but still.
Personally, I'd discourage you from doing this. Geolocation by IP is really useful for non-critical things like advertisment targeting, but blocking access is a bit off.