This won't give you all the IPs of a country but it will tell you the country of the current browser, with which you can decide to do or not do some code.
In this example I send all United States visitors to
www.example.com (which actually exists,) and away from my site.
You could send them to a forbidden.php page on your site, set a cookie and check for that cookie on all your pages to decide if you are going to allow access or even show different content.
I currently send all traffic from two countries to a CAPTCHA page because 99% of the visits from those countries are bots. The bots can't solve the CAPTCHA so they time out and go some place else.
Regards,
Rod