
GeoIP,意为 IP geographic location,即 IP 地址所对应的地理位置信息,例如所属的国家、地区等。GeoIP 数据文件则存储着 IP 地址所对应的地理位置信息。
GeoIP, which stands for IP geographic location, refers to the geographic location information associated with an IP address, such as the country or region. And GeoIP data files store the geographic location information corresponding to IP addresses.
本项目每周四自动生成多种格式 GeoIP 数据文件,同时提供命令行界面(CLI)工具供用户自行定制 GeoIP 数据文件,包括但不限于 V2Ray dat 格式文件 geoip.dat、MaxMind mmdb 格式文件 Country.mmdb(GeoIP2-Country.mmdb、GeoLite2-Country.mmdb)、sing-box SRS 格式文件、mihomo MRS 格式文件、Clash ruleset 规则文件、Surge ruleset 规则文件、Nginx allow list(允许访问列表)和 Nginx deny list(拒绝访问列表)。
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(GeoIP2-Country.mmdb, GeoLite2-Country.mmdb), sing-box SRS format file, mihomo MRS format file, Clash ruleset file, Surge ruleset file, Nginx allow list and Nginx deny list.
本项目默认使用 MaxMind GeoLite2 Country CSV 数据生成各个国家和地区的 GeoIP 文件。类别有:
geoip:cn(GEOIP,CN):中国大陆(Mainland China)geoip:hk(GEOIP,HK):香港(Hong Kong)geoip:mo(GEOIP,MO):澳门(Macau)geoip:tw(GEOIP,TW):台湾(Taiwan)geoip:us(GEOIP,US):美国(America)geoip:jp(GEOIP,JP):日本(Japan)geoip:kr(GEOIP,KR):韩国(Korea)geoip:sg(GEOIP,SG):新加坡(Singapore)geoip:mm(GEOIP,MM):缅甸(Myanmar)geoip:ir(GEOIP,IR):伊朗(Iran)geoip:ru(GEOIP,RU):俄罗斯(Russia)geoip:by(GEOIP,BY):白俄罗斯(Belarus)geoip:tm(GEOIP,TM):土库曼斯坦(Turkmenistan)geoip:private(GEOIP,PRIVATE):内网 IP 地址、保留 IP 地址等特殊 IP 地址的集合本项目对 MaxMind 官方 GeoIP 数据做了如下修改和新增:
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)[!NOTE] 如果无法访问域名
raw.githubusercontent.com,可以使用第二个地址cdn.jsdelivr.net。 如果无法访问域名cdn.jsdelivr.net,可以将其替换为fastly.jsdelivr.net。*.sha256sum 为校验文件。
本项目发布的所有 GeoIP 文件,请查看 release 分支。以下是部分格式 GeoIP 文件的下载地址和使用方法:
点击查看在 V2Ray 和 Xray-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: true
geox-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"
}
点击查看在 dae 中的使用方法
点击前往查看:《吃鹅直通手册》
适用于 V2Ray、Xray-core、mihomo、hysteria、Trojan-Go、dae。
此 dat 格式文件不能用于 Nginx。
所有国家/地区、新增类别的 dat 格式文件,请查看本项目 release 分支下的 dat 目录。
geoip:cn 和 geoip:private):geoip:cn):geoip:private):部分国家/地区类别:
新增类别:
$ claude mcp add geoip \
-- python -m otcore.mcp_server <graph>