Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to write the same CIDR to different countries in customized Country.mmdb file? #44

Closed
Loyalsoldier opened this issue Aug 26, 2022 · 4 comments

Comments

@Loyalsoldier
Copy link

I want the same CIDR, eg 1.0.0.1/24 to be added to different countries US and CN in my customized Country.mmdb file.

How can I do that?

@oschwald
Copy link
Member

I am not quite sure what you are asking. Each leaf node has a single record. It isn't possible for a node to have two records. However, that record may contain whatever you want, including an array of country codes.

@Loyalsoldier
Copy link
Author

Loyalsoldier commented Aug 26, 2022

Sorry for the confusion.

I use GeoLite2-Country.mmdb file for web traffic routing. If the destination IP belongs to US, that traffic goes through the first proxy; if belongs to Google, it goes through the second proxy.

But the software I use can only read and parse GeoLite2-Country.mmdb file, not the GeoLite2-ASN.mmdb file. To achieve my use case, I need to extend the official GeoLite2-Country.mmdb file to include Google's CIDRs to a fake country called Google.

As we all know, the IP 8.8.8.8 belongs to Google and US. Is there any way to keep 8.8.8.8 both in US and the fake country Google?

@oschwald
Copy link
Member

I would recommend just adding a new field to the record with the extra information you want. The country code is a string, not an array, but there is nothing stopping you from adding a new key with different data. You could have an array of countries as I mentioned in my first message, although that would break compatibility with GeoLite2-Country.

@Loyalsoldier
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants