Many comments in http://blog.erben.sk/2014/02/06/country-cidr-ip-ranges/ was about IPv6 support.
I had old UPS with serial port which was connected using Profilic USB to serial adapter. Sometimes this USB dongle had frozen and need to be restated – re-attached. This can be done in linux using IOCTL.
There are many sites providing country blocklists, for example http://www.ip2location.com/free/visitor-blocker or https://www.countryipblocks.net/. When you want periodicaly update such list, you have problem. You need pay for that service for automated access, actual data or “hack” access to that service (abuse their free access conditions)…