Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🌚 🌍 🌝 GeoIP 规则文件加强版,支持自行定制 V2Ray dat 格式文件 geoip.dat、MaxMind mmdb 格式文件、sing-box SRS 格式文件、mihomo MRS 格式文件、Clash ruleset、Surge ruleset 等。Enhanced edition of GeoIP files for V2Ray, Xray-core, sing-box, Clash, mihomo, Shadowrocket, Quantumult X, Surge, hysteria, Trojan-Go, Leaf, Nginx, etc.

License

CC-BY-SA-4.0, GPL-3.0 licenses found

Licenses found

CC-BY-SA-4.0
LICENSE
GPL-3.0
LICENSE-GPL
NotificationsYou must be signed in to change notification settings

Loyalsoldier/geoip

本项目每周四自动生成多种格式 GeoIP 文件,同时提供命令行界面(CLI)工具供用户自行定制 GeoIP 文件,包括但不限于 V2Raydat 格式文件geoip.dat、MaxMindmmdb 格式文件Country.mmdb、sing-boxSRS 格式文件、mihomoMRS 格式文件、Clash ruleset 和 Surge ruleset。

This project releases various formats of GeoIP files automatically every Thursday, and provides a command line interface(CLI) tool for users to customize their own GeoIP files, including but not limited to V2Raydat format filegeoip.dat, MaxMindmmdb format fileCountry.mmdb, sing-boxSRS format files, mihomoMRS format files, Clash ruleset files and Surge ruleset files.

与 MaxMind 官方 GeoIP 数据的区别

本项目默认使用MaxMind GeoLite2 Country CSV 数据生成各个国家和地区的 GeoIP 文件。所有可供使用的国家和地区 geoip 类别(如geoip:cn,两位英文字母表示国家和地区),请查看:https://www.iban.com/country-codes

另外,本项目对 MaxMind 官方 GeoIP 数据做了修改和新增:

  • 中国大陆 IPv4 地址数据融合了IPIP.net@gaoyifan/china-operator-ip
  • 中国大陆 IPv6 地址数据融合了 MaxMind GeoLite2 和@gaoyifan/china-operator-ip
  • 新增类别(方便有特殊需求的用户使用):
    • geoip:cloudflareGEOIP,CLOUDFLARE
    • geoip:cloudfrontGEOIP,CLOUDFRONT
    • geoip:facebookGEOIP,FACEBOOK
    • geoip:fastlyGEOIP,FASTLY
    • geoip:googleGEOIP,GOOGLE
    • geoip:netflixGEOIP,NETFLIX
    • geoip:telegramGEOIP,TELEGRAM
    • geoip:twitterGEOIP,TWITTER
    • geoip:torGEOIP,TOR

下载地址与使用方法

本项目发布的所有 GeoIP 文件,请查看release 分支。以下是部分格式 GeoIP 文件的下载地址:

如果无法访问域名raw.githubusercontent.com,可以使用第二个地址cdn.jsdelivr.net。如果无法访问域名cdn.jsdelivr.net,可以将其替换为fastly.jsdelivr.net

*.sha256sum 为校验文件。

V2Ray dat 格式文件

适用于V2RayXray-coremihomohysteriaTrojan-Go

此 dat 格式文件不能用于 Nginx。

dat 格式文件使用方法

点击查看在V2RayXray-core 中的使用方法

需要先下载.dat 格式文件,并放置在程序目录内。

"routing": {"rules": [    {"type":"field","outboundTag":"Direct","ip": ["geoip:cn","geoip:private","ext:cn.dat:cn","ext:private.dat:private","ext:geoip-only-cn-private.dat:cn","ext:geoip-only-cn-private.dat:private"      ]    },    {"type":"field","outboundTag":"Proxy","ip": ["geoip:us","geoip:jp","geoip:facebook","geoip:telegram","ext:geoip-asn.dat:facebook","ext:geoip-asn.dat:telegram"      ]    }  ]}
点击查看在mihomo 中的使用方法
geodata-mode:truegeox-url:geoip:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/geoip.dat"
点击查看在hysteria 中的使用方法

需要先下载.dat 格式文件,并放置在 hysteria 程序目录内。

direct(geoip:cn)proxy(geoip:telegram)proxy(geoip:us)
点击查看在Trojan-Go 中的使用方法

需要先下载.dat 格式文件,并放置在 Trojan-Go 程序目录内。

"router": {"enabled":true,"bypass": ["geoip:cn"],"proxy": ["geoip:telegram","geoip:us"],"block": ["geoip:jp"],"default_policy":"proxy","geoip":"./geoip.dat"}

MaxMind mmdb 格式文件

MaxMind 官方版国家/地区类型 mmdb 文件:

适用于ClashmihomoShadowrocketQuantumult XSurgeLeaf

适用于Nginx,需要配合ngx_http_geoip2_module 模块使用。

MaxMind 官方版ASN 类型 mmdb 文件:

适用于mihomoShadowrocketSurge

本项目生成的国家/地区类型 mmdb 文件:

适用于ClashmihomoShadowrocketQuantumult XSurgeLeaf

适用于Nginx,需要配合ngx_http_geoip2_module 模块使用。

国家/地区类别保留了ContinentCountry 里的所有字段。新增类别geoip:private 类别只保留了Country 里的iso_code(两位英文字母表示的国家/地区代号)字段。关于 Maxmind 官方 country MMDB 格式文件完整字段,请查看代码

mmdb 格式文件使用方法

点击查看在Clash 中的使用方法

需要先下载.mmdb 格式文件,命名为Country.mmdb,并放置在 Clash 程序目录内。

rules:  -GEOIP,PRIVATE,policy,no-resolve  -GEOIP,FACEBOOK,policy  -GEOIP,CN,policy,no-resolve
点击查看在mihomo 中的使用方法
geodata-mode:truegeox-url:mmdb:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/Country.mmdb"asn:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/GeoLite2-ASN.mmdb"
点击查看在Shadowrocket 中的使用方法

需要将下载地址填入到 Shadowrocket 的设置中。

[Rule]GEOIP,PRIVATE,DIRECTGEOIP,FACEBOOK,PROXYGEOIP,CN,DIRECT
点击查看在Quantumult X 中的使用方法

需要将下载地址填入到 Quantumult X 的设置中。

[filter_local]GEOIP,PRIVATE,DIRECTGEOIP,FACEBOOK,PROXYGEOIP,CN,DIRECT
点击查看在Surge 中的使用方法

需要将下载地址填入到 Surge 的设置中。

[Rule]GEOIP,PRIVATE,policy,no-resolveGEOIP,FACEBOOK,policyGEOIP,CN,policy,no-resolve

sing-box SRS 格式文件

适用于sing-box

请查看本项目release 分支下的srs 目录

SRS 格式文件使用方法

点击查看在sing-box 中的使用方法
"route": {"rules": [    {"rule_set":"geoip-cn","outbound":"direct"    },    {"rule_set":"geoip-us","outbound":"block"    }  ],"rule_set": [    {"tag":"geoip-cn","type":"remote","format":"binary","url":"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/srs/cn.srs"    },    {"tag":"geoip-us","type":"remote","format":"binary","url":"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/srs/us.srs"    }  ]}

mihomo MRS 格式文件

适用于mihomo

请查看本项目release 分支下的mrs 目录

MRS 格式文件使用方法

点击查看在mihomo 中的使用方法
rule-providers:cn-cidr:type:httpbehavior:ipcidrformat:mrsurl:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/mrs/cn.mrs"path:./mrs/geoip/cn.mrsinterval:86400google-cidr:type:httpbehavior:ipcidrformat:mrsurl:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/mrs/google.mrs"path:./mrs/geoip/google.mrsinterval:86400rules:  -RULE-SET,cn-cidr,DIRECT  -RULE-SET,google-cidr,PROXY,no-resolve

Clash ruleset 文件

适用于Clash Premiummihomo

请查看本项目release 分支下的clash 目录

Clash ruleset 使用方法

点击查看在Clash Premiummihomo 中的使用方法
rule-providers:cn-cidr:type:httpbehavior:ipcidrformat:yamlurl:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/clash/ipcidr/cn.txt"path:./ruleset/ipcidr/cn.yamlinterval:86400telegram-cidr:type:httpbehavior:ipcidrformat:yamlurl:"https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/clash/ipcidr/telegram.txt"path:./ruleset/ipcidr/telegram.yamlinterval:86400rules:  -RULE-SET,cn-cidr,DIRECT  -RULE-SET,telegram-cidr,PROXY,no-resolve

Surge ruleset 文件

适用于Surge

请查看本项目release 分支下的surge 目录

Surge ruleset 使用方法

点击查看在Surge 中的使用方法
[Rule]RULE-SET,https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/surge/us.txt,REJECTRULE-SET,https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/surge/cn.txt,DIRECTRULE-SET,https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/surge/telegram.txt,PROXY,no-resolve

纯文本 txt 格式文件

请查看本项目release 分支下的text 目录


Nginxallowdeny 文件

请查看本项目release 分支下的nginx 目录


自行定制 GeoIP 文件

可通过以下几种方式自行定制 GeoIP 文件:

  • 在线生成Fork 本仓库后,修改自己仓库内的配置文件config.json 和 GitHub Workflow.github/workflows/build.yml
  • 本地生成
    • 安装GolangGit
    • 拉取项目代码:git clone https://github.com/Loyalsoldier/geoip.git
    • 进入项目根目录:cd geoip
    • 修改配置文件config.json
    • 运行代码:go run ./ convert -c ./config.json

特别说明:

  • 在线生成Fork 本项目后,如果需要使用 MaxMind GeoLite2 官方数据文件,需要在自己仓库的[Settings] 页面的左侧边栏[Secrets and variables] 下的[Actions] 选项卡页面中添加一个名为MAXMIND_GEOLITE2_LICENSE 的 secret,否则 GitHub Actions 会运行失败。这个 secret 的值为 MaxMind 账号的 LICENSE KEY,需要注册 MaxMind 账号后,在个人账号管理页面左侧边栏的 [Manage License Keys] 里生成。
  • 本地生成:如果需要使用 MaxMind 官方 GeoLite2 数据文件,需要提前从 MaxMind 下载,或者从本项目release 分支下载(文件名以GeoLite2 为前缀的文件),并解压缩到名为geolite2 的目录。

概念解析

本项目有两个概念:inputoutputinput 指数据源(data source)及其输入格式,output 指数据的去向(data destination)及其输出格式。CLI 的作用就是通过读取配置文件中的选项,聚合用户提供的所有数据源,去重,将其转换为目标格式,并输出到文件。

These two concepts are notable:input andoutput. Theinput is the data source and its input format, whereas theoutput is the destination of the converted data and its output format. What the CLI does is to aggregate all input format data, then convert them to output format and write them to GeoIP files by using the options in the config file.

支持的格式

关于每种格式所支持的配置选项,查看本项目configuration.md 文件。

支持的input 输入格式:

  • text:纯文本 IP 和 CIDR(例如:1.1.1.11.0.0.0/24
  • stdin:从 standard input 获取纯文本 IP 和 CIDR(例如:1.1.1.11.0.0.0/24
  • private:局域网和私有网络 CIDR(例如:192.168.0.0/16127.0.0.0/8
  • cutter:用于裁剪前置步骤中的数据
  • json:JSON 数据格式
  • v2rayGeoIPDat:V2Ray GeoIP dat 数据格式(geoip.dat
  • maxmindMMDB:MaxMind GeoLite2 country mmdb 数据格式(GeoLite2-Country.mmdb
  • maxmindGeoLite2ASNCSV:MaxMind GeoLite2 ASN CSV 数据格式(GeoLite2-ASN-CSV.zip
  • maxmindGeoLite2CountryCSV:MaxMind GeoLite2 country CSV 数据格式(GeoLite2-Country-CSV.zip
  • dbipCountryMMDB:DB-IP country mmdb 数据格式(dbip-country-lite.mmdb
  • ipinfoCountryMMDB:IPInfo country mmdb 数据格式(country.mmdb
  • mihomoMRS:mihomo MRS 数据格式(geoip-cn.mrs
  • singboxSRS:sing-box SRS 数据格式(geoip-cn.srs
  • clashRuleSetClassicalclassical 类型的 Clash RuleSet
  • clashRuleSetipcidr 类型的 Clash RuleSet
  • surgeRuleSetSurge RuleSet

支持的output 输出格式:

  • text:纯文本 CIDR(例如:1.0.0.0/24
  • stdout:将纯文本 CIDR 输出到 standard output(例如:1.0.0.0/24
  • lookup:从指定的列表中查找指定的 IP 或 CIDR
  • v2rayGeoIPDat:V2Ray GeoIP dat 数据格式(geoip.dat
  • maxmindMMDB:MaxMind GeoLite2 country mmdb 数据格式(GeoLite2-Country.mmdb
  • dbipCountryMMDB:DB-IP country mmdb 数据格式(dbip-country-lite.mmdb
  • ipinfoCountryMMDB:IPInfo country mmdb 数据格式(country.mmdb
  • mihomoMRS:mihomo MRS 数据格式(geoip-cn.mrs
  • singboxSRS:sing-box SRS 数据格式(geoip-cn.srs
  • clashRuleSetClassicalclassical 类型的 Clash RuleSet
  • clashRuleSetipcidr 类型的 Clash RuleSet
  • surgeRuleSetSurge RuleSet

注意事项

由于 MaxMind、DB-IP、IPInfo 的 mmdb 文件格式的限制,当不同列表的 IP 或 CIDR 数据有交集或重复项时,后写入的列表的 IP 或 CIDR 数据会覆盖(overwrite)之前已写入的列表的数据。譬如,IP1.1.1.1 同属于列表AU 和列表Cloudflare。如果CloudflareAU 之后写入,则 IP1.1.1.1 归属于列表Cloudflare

为了确保某些指定的列表、被修改的列表一定囊括属于它的所有 IP 或 CIDR 数据,可在output 相应输出格式的配置中增加选项overwriteList,该选项中指定的列表会在最后逐一写入,列表中最后一项优先级最高。若已设置选项wantedList,则无需设置overwriteListwantedList 中指定的列表会在最后逐一写入,列表中最后一项优先级最高。

CLI 功能展示

可通过go install -v github.com/Loyalsoldier/geoip@latest 直接安装 CLI 工具。

CLI 提供的功能如下:

  • 列出支持的inputoutput 格式(list
  • GeoIP 数据格式转换(convert
  • 查找 IP 或 CIDR 所在类别(lookup
  • 去重和合并 IP 与 CIDR(merge

总览

$ ./geoipgeoip is a convenient tool to merge, convert and lookup IP& CIDR from various formats of geoip data.Usage:  geoip [command]Available Commands:  convert     Convert geoip data from one format to another by using config filehelp        Help about anycommand  list        List all available input and output formats  lookup      Lookup specified IP or CIDRin specified lists  merge       Merge plaintext IP& CIDR from standard input,then print to standard outputFlags:  -h, --helphelpfor geoipUse"geoip [command] --help"for more information about a command.

列出支持的inputoutput 格式(list

$ ./geoip listAll available input formats:  - clashRuleSet (Convert ipcidrtype of Clash RuleSet to other formats)  - clashRuleSetClassical (Convert classicaltype of Clash RuleSet to other formats (just processing IP& CIDR lines))  - cutter (Remove data from previous steps)  - dbipCountryMMDB (Convert DB-IP country mmdb database to other formats)  - ipinfoCountryMMDB (Convert IPInfo country mmdb database to other formats)  - json (Convert JSON data to other formats)  - maxmindGeoLite2ASNCSV (Convert MaxMind GeoLite2 ASN CSV data to other formats)  - maxmindGeoLite2CountryCSV (Convert MaxMind GeoLite2 country CSV data to other formats)  - maxmindMMDB (Convert MaxMind mmdb database to other formats)  - mihomoMRS (Convert mihomo MRS data to other formats)  - private (Convert LAN and private network CIDR to other formats)  - singboxSRS (Convert sing-box SRS data to other formats)  - stdin (Accept plaintext IP& CIDR from standard input, separated by newline)  - surgeRuleSet (Convert Surge RuleSet to other formats (just processing IP& CIDR lines))  -test (Convert specific CIDR to other formats (fortest only))  - text (Convert plaintext IP& CIDR to other formats)  - v2rayGeoIPDat (Convert V2Ray GeoIP dat to other formats)All available output formats:  - clashRuleSet (Convert data to ipcidrtype of Clash RuleSet)  - clashRuleSetClassical (Convert data to classicaltype of Clash RuleSet)  - dbipCountryMMDB (Convert data to DB-IP country mmdb database format)  - ipinfoCountryMMDB (Convert data to IPInfo country mmdb database format)  - lookup (Lookup specified IP or CIDR from various formats of data)  - maxmindMMDB (Convert data to MaxMind mmdb database format)  - mihomoMRS (Convert data to mihomo MRS format)  - singboxSRS (Convert data to sing-box SRS format)  - stdout (Convert data to plaintext CIDR format and output to standard output)  - surgeRuleSet (Convert data to Surge RuleSet)  - text (Convert data to plaintext CIDR format)  - v2rayGeoIPDat (Convert data to V2Ray GeoIP dat format)

去重和合并 IP 与 CIDR(merge

$ curl -s https://core.telegram.org/resources/cidr.txt| ./geoip merge -t ipv491.105.192.0/2391.108.4.0/2291.108.8.0/2191.108.16.0/2191.108.56.0/22149.154.160.0/20185.76.151.0/24

GeoIP 数据格式转换(convert

$ ./geoip convert -c config.json2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] geoip.dat --> output/dat2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] geoip-only-cn-private.dat --> output/dat2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] geoip-asn.dat --> output/dat2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] cn.dat --> output/dat2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] private.dat --> output/dat2021/08/29 12:11:39 ✅ [maxmindMMDB] Country.mmdb --> output/maxmind2021/08/29 12:11:39 ✅ [maxmindMMDB] Country-only-cn-private.mmdb --> output/maxmind2021/08/29 12:11:39 ✅ [text] netflix.txt --> output/text2021/08/29 12:11:39 ✅ [text] telegram.txt --> output/text2021/08/29 12:11:39 ✅ [text] cn.txt --> output/text2021/08/29 12:11:39 ✅ [text] cloudflare.txt --> output/text2021/08/29 12:11:39 ✅ [text] cloudfront.txt --> output/text2021/08/29 12:11:39 ✅ [text] facebook.txt --> output/text2021/08/29 12:11:39 ✅ [text] fastly.txt --> output/text2021/08/29 12:11:45 ✅ [singboxSRS] netflix.txt --> output/srs2021/08/29 12:11:45 ✅ [singboxSRS] telegram.txt --> output/srs2021/08/29 12:11:45 ✅ [singboxSRS] cn.txt --> output/srs2021/08/29 12:11:45 ✅ [singboxSRS] cloudflare.txt --> output/srs2021/08/29 12:11:45 ✅ [singboxSRS] cloudfront.txt --> output/srs2021/08/29 12:11:45 ✅ [singboxSRS] facebook.txt --> output/srs2021/08/29 12:11:45 ✅ [singboxSRS] fastly.txt --> output/srs2021/08/29 12:11:50 ✅ [mihomoMRS] netflix.txt --> output/mrs2021/08/29 12:11:50 ✅ [mihomoMRS] telegram.txt --> output/mrs2021/08/29 12:11:50 ✅ [mihomoMRS] cn.txt --> output/mrs2021/08/29 12:11:50 ✅ [mihomoMRS] cloudflare.txt --> output/mrs2021/08/29 12:11:50 ✅ [mihomoMRS] cloudfront.txt --> output/mrs2021/08/29 12:11:50 ✅ [mihomoMRS] facebook.txt --> output/mrs2021/08/29 12:11:50 ✅ [mihomoMRS] fastly.txt --> output/mrs

查找 IP 或 CIDR 所在类别(lookup

可能的返回结果:

  • 查询的字符串不是有效的 IP 或 CIDR,返回false
  • 查询的 IP 或 CIDR 不存在于任何一个类别中,返回false
  • 查询的 IP 或 CIDR 存在于某种格式文件的单个类别中:
    • 若该格式文件只包含一个类别,返回true
    • 若该格式文件包含多个类别,返回匹配的类别名称
  • 查询的 IP 或 CIDR 存在于多个类别中,返回以英文逗号分隔的类别名称,如au,cloudflare
# ================= One-time Mode ================= ## 从 text 格式的本地文件(只包含一个类别)中查找某个 IP 地址# lookup IP from local file (with only one list) in text format$ ./geoip lookup -f text -u ./cn.txt 1.0.1.1true# 从 text 格式的本地文件(只包含一个类别)中查找某个 IP 地址# lookup IP from local file (with only one list) in text format$ ./geoip lookup -f text -u ./cn.txt 2.2.2.2false# 从 text 格式的本地文件(只包含一个类别)中查找某个 CIDR# lookup CIDR from local file (with only one list) in text format$ ./geoip lookup -f text -u ./cn.txt 1.0.1.1/24true# 从 text 格式的本地文件(只包含一个类别)中查找某个 CIDR# lookup CIDR from local file (with only one list) in text format$ ./geoip lookup -f text -u ./cn.txt 1.0.1.1/23false# 从 text 格式的远程 URL(只包含一个类别)中查找某个 IP 地址# lookup IP from remote URL (with only one list) in text format$ ./geoip lookup -f text -u https://example.com/cn.txt 1.0.1.1true# 从 v2rayGeoIPDat 格式的本地文件(只包含一个类别)中查找某个 IP 地址# lookup IP from local file (with only one list) in v2rayGeoIPDat format$ ./geoip lookup -f v2rayGeoIPDat -u ./cn.dat 1.0.1.1true# 从 v2rayGeoIPDat 格式的本地文件(包含多个类别)中查找某个 IP 地址# lookup IP from local file (with multiple lists) in v2rayGeoIPDat format$ ./geoip lookup -f v2rayGeoIPDat -u ./geoip.dat 1.0.1.1cn# 从 v2rayGeoIPDat 格式的本地文件(包含多个类别)中查找某个 IP 地址# lookup IP from local file (with multiple lists) in v2rayGeoIPDat format$ ./geoip lookup -f v2rayGeoIPDat -u ./geoip.dat 1.0.0.1au,cloudflare# 从 v2rayGeoIPDat 格式的远程 URL(包含多个类别)中查找某个 CIDR# lookup CIDR from remote URL (with multiple lists) in v2rayGeoIPDat format$ ./geoip lookup -f v2rayGeoIPDat -u https://example.com/geoip.dat 1.0.0.1/24au,cloudflare# ================= REPL Mode ================= ## 从 text 格式的本地文件(只包含一个类别)中查找某个 IP 地址或 CIDR# lookup IP or CIDR from local file (with only one list) in text format$ ./geoip lookup -f text -u ./cn.txtEnter IP or CIDR (type"exit" to quit):>> 1.0.1.1true>> 1.0.1.1/24true>> 1.0.1.1/23false>> 2.2.2.2false>> 2.2.2.2/24false>> 300.300.300.300false>> 300.300.300.300/24false>>exit# 从 text 格式的远程 URL(只包含一个类别)中查找某个 IP 地址或 CIDR# lookup IP or CIDR from remote URL (with only one list) in text format$ ./geoip lookup -f text -u https://example.com/cn.txtEnter IP or CIDR (type"exit" to quit):>> 1.0.1.1true>> 1.0.1.1/24true>> 1.0.1.1/23false>> 2.2.2.2false>> 2.2.2.2/24false>> 300.300.300.300false>> 300.300.300.300/24false>>exit# 从 v2rayGeoIPDat 格式的本地文件(只包含一个类别)中查找某个 IP 地址或 CIDR# lookup IP or CIDR from local file (with only one list) in v2rayGeoIPDat format$ ./geoip lookup -f v2rayGeoIPDat -u ./cn.datEnter IP or CIDR (type"exit" to quit):>> 1.0.1.1true>> 1.0.1.1/24true>> 1.0.1.1/23false>> 2.2.2.2false>> 2.2.2.2/24false>> 300.300.300.300false>> 300.300.300.300/24false>>exit# 从 v2rayGeoIPDat 格式的远程 URL(包含多个类别)中查找某个 IP 地址或 CIDR# lookup IP or CIDR from remote URL (with multiple list) in v2rayGeoIPDat format$ ./geoip lookup -f v2rayGeoIPDat -u https://example.com/geoip.datEnter IP or CIDR (type"exit" to quit):>> 1.0.1.1cn>> 1.0.1.1/24cn>> 1.0.1.1/23false>> 1.0.0.1au,cloudflare>> 1.0.0.1/24au,cloudflare>> 300.300.300.300false>> 300.300.300.300/24false>>exit

使用本项目的项目

License

CC-BY-SA-4.0 andGPL-3.0

This product includes GeoLite2 data created by MaxMind, available fromMaxMind.

项目 Star 数增长趋势

Stargazers over time

About

🌚 🌍 🌝 GeoIP 规则文件加强版,支持自行定制 V2Ray dat 格式文件 geoip.dat、MaxMind mmdb 格式文件、sing-box SRS 格式文件、mihomo MRS 格式文件、Clash ruleset、Surge ruleset 等。Enhanced edition of GeoIP files for V2Ray, Xray-core, sing-box, Clash, mihomo, Shadowrocket, Quantumult X, Surge, hysteria, Trojan-Go, Leaf, Nginx, etc.

Topics

Resources

License

CC-BY-SA-4.0, GPL-3.0 licenses found

Licenses found

CC-BY-SA-4.0
LICENSE
GPL-3.0
LICENSE-GPL

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp