geoipgen is a country to IPs generator written in ruby.
It can generate IPs for entire countries, or the world in a random order.
Code:
Usage: ./geoipgen [OPTION]... [COUNTRYCODE]...
IPv4 network tool for generating geotargeted IP lists of countries.
Features: Random or sorted order, unique or repeating IPs, skips
broadcast addresses, uses MaxMind GeoLite Country database.
Target:
COUNTRYCODE One or more country codes, delimited by spaces
Use 'all' to target all country codes. Use -l to see a list.
-n NUM Exits after NUM IPs
Unique or repeating:
-u, --unique Return each IP in the countries once only (default)
--repeat IPs can repeat with random order
Order:
-s, --sorted Order is sorted, ascending
--random Order is random (default)
--less-random Order is random seeming, returns each IP only once
Provides significant performance gain when used with 'all'
countrycodes
Other:
-h, --help This message
-l, --list-countries List countries and their country codes
-c DIRECTORY Location of GeoIPCountryWhois.csv database
Default locations: ./, /home/dc/.geoipgen/, /usr/local/share/
-V, --version Print version information. This version is 0.4
Examples:
geoipgen nz All IPs in New Zealand in a random order
geoipgen nz au All IPs in New Zealand and Australia in a random order
geoipgen --repeat -n 100 cn hk mn tw mo jp kr kp
100 random IPv4 addresses in Far East Asia.
geoipgen all Random, allocated IPs. More efficient than entirely random IPs. Uses 'less-random' for low memory overhead.
Submit bug reports to Andrew Horton, (urbanadventurer) at hxxp://code.google.com/p/geoipgen
Homepage: hxxp://code.google.com/p/geoipgen