pvxe / nftables-geoip

Python script that generates nft maps of ip address blocks and corresponding geolocation. This data is taken from db-ip.com, so yo don't have to worry about accepting any EULA.
GNU General Public License v2.0
115 stars 17 forks source link

Interesting countries #7

Closed rdmcguire closed 7 months ago

rdmcguire commented 3 years ago

The full map is pretty large and not always required in your nftables config. I added an option to create an "interesting" countries map by providing a list of countries by either name or abbreviation. I also added an option to dump a list of countries and abbreviations. Adding -c us,ca for example will cause separate ip4 and ip6 maps to be created that contain only entries for United States and Canada.

pvxe commented 3 years ago

Hi @redbeardmcg, it's come to mind to offer some kind of filtering and more features in the script but to be honest I've always ended up preferring the script to be as minimal as possible.

In this case I've always ended up grepping continents or countries like and just crafting different .csv files to use later on.

grep -w -e [country] [...] location.csv

Thank you nonetheless for using the script. adjusting it to your needs and letting me know! 😊

pvxe commented 7 months ago

Hi @rdmcguire, I have not been able to take the time I wished for this project in the past but I just found some time and realized it's ok to add this feature! If any user want to grep locations.csv they still can and if not this is the way to let the script do it for you.

I took the freedom to grab the changes from your branch and make some changes to the commit message and the .gitignore change (seemed a bit arbitrary to ignore the data/ folder when this scripts does not create it). I have already applied them to the main branch so you can consider this PR merged.