Geoip
🌚 🌍 🌝 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.
Install / Use
/learn @Loyalsoldier/GeoipREADME
GeoIP 简介

本项目每周四自动生成多种格式 GeoIP 文件,同时提供命令行界面(CLI)工具供用户自行定制 GeoIP 文件,包括但不限于 V2Ray dat 格式文件 geoip.dat、MaxMind mmdb 格式文件 Country.mmdb、sing-box SRS 格式文件、mihomo MRS 格式文件、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 V2Ray dat format file geoip.dat, MaxMind mmdb format file Country.mmdb, sing-box SRS format files, mihomo MRS 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 地址数据使用 @gaoyifan/china-operator-ip
- 新增类别(方便有特殊需求的用户使用):
geoip:cloudflare(GEOIP,CLOUDFLARE)geoip:cloudfront(GEOIP,CLOUDFRONT)geoip:facebook(GEOIP,FACEBOOK)geoip:fastly(GEOIP,FASTLY)geoip:google(GEOIP,GOOGLE)geoip:netflix(GEOIP,NETFLIX)geoip:telegram(GEOIP,TELEGRAM)geoip:twitter(GEOIP,TWITTER)geoip:tor(GEOIP,TOR)
下载地址与使用方法
本项目发布的所有 GeoIP 文件,请查看 release 分支。以下是部分格式 GeoIP 文件的下载地址:
如果无法访问域名
raw.githubusercontent.com,可以使用第二个地址cdn.jsdelivr.net。 如果无法访问域名cdn.jsdelivr.net,可以将其替换为fastly.jsdelivr.net。*.sha256sum 为校验文件。
V2Ray dat 格式文件
此 dat 格式文件不能用于 Nginx。
- geoip.dat:
- geoip.dat.sha256sum:
- geoip-only-cn-private.dat(精简版 GeoIP,只包含
geoip:cn和geoip:private): - geoip-only-cn-private.dat.sha256sum:
- geoip-asn.dat(精简版 GeoIP,只包含上述新增类别):
- geoip-asn.dat.sha256sum:
- cn.dat(精简版 GeoIP,只包含
geoip:cn): - cn.dat.sha256sum:
- private.dat(精简版 GeoIP,只包含
geoip:private): - private.dat.sha256sum:
- 所有国家 / 地区 / 新增类别的 dat 格式文件,请查看本项目
release分支下的 dat 目录。
dat 格式文件使用方法
<details> <summary>点击查看在 <b>V2Ray</b> 和 <b>Xray-core</b> 中的使用方法</summary> <br/> <p>需要先下载 <code>.dat</code> 格式文件,并放置在程序目录内。</p>"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"
]
}
]
}
</details>
<details>
<summary>点击查看在 <b>mihomo</b> 中的使用方法</summary>
geodata-mode: true
geox-url:
geoip: "https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/geoip.dat"
</details>
<details>
<summary>点击查看在 <b>hysteria</b> 中的使用方法</summary>
<br/>
<p>需要先下载 <code>.dat</code> 格式文件,并放置在 hysteria 程序目录内。</p>
direct(geoip:cn)
proxy(geoip:telegram)
proxy(geoip:us)
</details>
<details>
<summary>点击查看在 <b>Trojan-Go</b> 中的使用方法</summary>
<br/>
<p>需要先下载 <code>.dat</code> 格式文件,并放置在 Trojan-Go 程序目录内。</p>
"router": {
"enabled": true,
"bypass": ["geoip:cn"],
"proxy": ["geoip:telegram", "geoip:us"],
"block": ["geoip:jp"],
"default_policy": "proxy",
"geoip": "./geoip.dat"
}
</details>
MaxMind mmdb 格式文件
MaxMind 官方版国家/地区类型 mmdb 文件:
适用于 Nginx,需要配合 ngx_http_geoip2_module 模块使用。
- GeoLite2-Country.mmdb:
- GeoLite2-Country.mmdb.sha256sum:
MaxMind 官方版 ASN 类型 mmdb 文件:
适用于 mihomo、Shadowrocket、Surge。
- GeoLite2-ASN.mmdb:
- GeoLite2-ASN.mmdb.sha256sum:
- https://raw.githubusercontent.com/Loyalsoldier/geoip/release/GeoLite2-ASN.mmdb.sha256sum
- [https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/GeoLite2-ASN.mmdb.sha256sum](https://cdn.jsdelivr
Related Skills
node-connect
337.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
