Keep in mind that geoblocking is NOT precise, you will have both false positives and false negatives. If that is acceptable for your use case have a look here:
This might do what you want, but keep in mind that geoip is an approximation not veridical information where an end host is truely physically located.