已经很多次了在初装或更新 OpenClash 后因为 GeoIP.dat 启动失败,通过「内核日志」可以看到如下日志:
2025-07-05 17:16:03 level=fatal msg="Parse config error: rules[18] [GEOIP,CN,DIRECT] error: can't download GeoIP.dat: Get \"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat\": dial tcp: lookup github.com on [::1]:53: read udp [::1]:52334->[::1]:53: i/o timeout"
2025-07-05 17:16:03 level=error msg="can't initial GeoIP: can't download GeoIP.dat: Get \"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat\": dial tcp: lookup github.com on [::1]:53: read udp [::1]:52334->[::1]:53: i/o timeout"
2025-07-05 17:15:43 level=warning msg="GeoIP.dat invalid, remove and download: failed to decode geodata file: GeoIP.dat, base error: country code cn not found in GeoIP.dat"
2025-07-05 17:15:43 level=warning msg="Load GeoIP rule: cn"
2025-07-05 17:15:43 level=info msg="Load GeoIP rule: cn"
2025-07-05 17:15:43 level=info msg="Geosite Matcher implementation: succinct"
2025-07-05 17:15:43 level=info msg="Geodata Loader mode: memconservative"
2025-07-05 17:15:43 level=info msg="Start initial configuration in progress"
解决办法也很简单,手动下载 GeoIP.dat 到指定位置即可:
cd /etc/openclash
wget -O GeoIP.dat https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat
不是很清楚是哪里设置不对,在 /etc/openclash
通过命令 ls
是可以看到有个名为 geoip.dat
的文件,只是因为大小写敏感而没用上,通过在「配置文件」的预览可以看到,我们的自定义配置会自动修改加上一段:
geox-url:
mmdb: https://testingcf.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb
geoip: https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat
问题应该是出在这里,在 OpenClash 大致的找了下也没有找到能修改这段的地方,姑且就这样吧